|
@@ -17,7 +17,7 @@
|
|
|
区域
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('区域')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.area">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.region">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -36,20 +36,20 @@
|
|
|
<span style="color: red;margin-right: 5rpx">*</span>
|
|
|
出租单元名称
|
|
|
</span>
|
|
|
- <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx">
|
|
|
+ <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx" v-model="postData.roomNo">
|
|
|
</li>
|
|
|
<li class="detailLi">
|
|
|
<span class="liName">
|
|
|
平面图号
|
|
|
</span>
|
|
|
- <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx">
|
|
|
+ <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx" v-model="postData.imgNo">
|
|
|
</li>
|
|
|
<li class="detailLi">
|
|
|
<span class="liName">
|
|
|
<span style="color: red;margin-right: 5rpx">*</span>
|
|
|
面积(㎡)
|
|
|
</span>
|
|
|
- <input placeholder="请填写" class="myIpt" value="256" style="padding-right: 30rpx">
|
|
|
+ <input placeholder="请填写" class="myIpt" v-model="postData.size" style="padding-right: 30rpx">
|
|
|
</li>
|
|
|
<li class="detailLi">
|
|
|
<span class="liName">
|
|
@@ -57,7 +57,7 @@
|
|
|
用途
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('用途')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.usege">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.roomUseLabel">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -66,7 +66,7 @@
|
|
|
物业性质
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('物业性质')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.nature">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.propertyNatureLabel">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -76,7 +76,7 @@
|
|
|
朝向
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('朝向')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.cx">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.direction">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -86,7 +86,7 @@
|
|
|
装修情况
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('装修情况')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.situation">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.decorationSituation">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -94,7 +94,7 @@
|
|
|
<span class="liName">
|
|
|
层高
|
|
|
</span>
|
|
|
- <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx">
|
|
|
+ <input placeholder="请填写" class="myIpt" style="padding-right: 30rpx" v-model="postData.floorHeight">
|
|
|
</li>
|
|
|
<li class="detailLi2" >
|
|
|
<div class="titleBox" >
|
|
@@ -102,11 +102,13 @@
|
|
|
</div>
|
|
|
<van-field
|
|
|
autosize
|
|
|
+ :value="postData.bearing"
|
|
|
type="textarea"
|
|
|
placeholder="请输入"
|
|
|
class="myField"
|
|
|
maxlength="1000"
|
|
|
show-word-limit
|
|
|
+ @change="changeBearing"
|
|
|
/>
|
|
|
</li>
|
|
|
<li class="detailLi2" >
|
|
@@ -114,12 +116,14 @@
|
|
|
<span class="liName">用电说明</span>
|
|
|
</div>
|
|
|
<van-field
|
|
|
+ :value="postData.electricity"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
placeholder="请输入"
|
|
|
class="myField"
|
|
|
maxlength="1000"
|
|
|
show-word-limit
|
|
|
+ @change="changeElectricity"
|
|
|
/>
|
|
|
</li>
|
|
|
<li class="detailLi2" >
|
|
@@ -128,10 +132,12 @@
|
|
|
<span class="liName">出租指导价(元/㎡/月)</span>
|
|
|
</div>
|
|
|
<van-field
|
|
|
+ :value="postData.guidePrice"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
placeholder="请输入"
|
|
|
class="myField"
|
|
|
+ @change="changeGuidePrice"
|
|
|
/>
|
|
|
</li>
|
|
|
<li class="detailLi2" >
|
|
@@ -139,6 +145,8 @@
|
|
|
<span class="liName">备注</span>
|
|
|
</div>
|
|
|
<van-field
|
|
|
+ :value="postData.remark"
|
|
|
+ @change="changeRemark"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
placeholder="请输入"
|
|
@@ -182,13 +190,15 @@
|
|
|
<span class="liName">出租位置</span>
|
|
|
</div>
|
|
|
<van-field
|
|
|
+ :value="postData.address"
|
|
|
+ @change="changeAddress"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
placeholder="请选择地址"
|
|
|
class="myField"
|
|
|
style="padding-right: 120rpx;box-sizing: border-box"
|
|
|
/>
|
|
|
- <div class="locationBox">
|
|
|
+ <div class="locationBox" @tap="showMap">
|
|
|
<van-icon name="location" />
|
|
|
地图
|
|
|
</div>
|
|
@@ -198,7 +208,7 @@
|
|
|
当前可用状态
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('可用状态')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.enable">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.enableLabel">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
@@ -207,12 +217,12 @@
|
|
|
租赁状态
|
|
|
</span>
|
|
|
<div class="inputBox" @tap="showArea('租赁状态')">
|
|
|
- <input placeholder="请选择" disabled class="myIpt" v-model="postData.status">
|
|
|
+ <input placeholder="请选择" disabled class="myIpt" v-model="postData.stateLabel">
|
|
|
<van-icon name="arrow-down" />
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <button class="commitBtn">保存</button>
|
|
|
+ <button class="commitBtn" @tap="commit">保存</button>
|
|
|
<van-popup
|
|
|
:show="showTree"
|
|
|
round position="bottom"
|
|
@@ -247,8 +257,9 @@
|
|
|
<script>
|
|
|
import {
|
|
|
getTreeData2,
|
|
|
- saleControllerGetById,
|
|
|
+ parkRoomGetById,
|
|
|
getByCodes,
|
|
|
+ parkRoomEdit
|
|
|
} from "@/js_sdk/http";
|
|
|
export default {
|
|
|
name: "propertyEditor",
|
|
@@ -288,34 +299,138 @@ export default {
|
|
|
statusList:[],
|
|
|
popType:'',
|
|
|
postData:{
|
|
|
- area:'',
|
|
|
+ groupName:'',
|
|
|
+ floorDiscName: '',
|
|
|
+ buildName: '',
|
|
|
+ roomNo: '',
|
|
|
+ region: '',
|
|
|
+ size: '',
|
|
|
+ imgNo: '',
|
|
|
floor:'',
|
|
|
- usege:'',
|
|
|
- nature:'',
|
|
|
- cx:'',
|
|
|
- situation:'',
|
|
|
+ roomUse:'',
|
|
|
+ roomUseLabel:'',
|
|
|
+ propertyNature:'',
|
|
|
+ direction:'',
|
|
|
+ decorationSituation:'',
|
|
|
+ floorHeight:'',
|
|
|
+ bearing:'',
|
|
|
+ electricity:'',
|
|
|
+ guidePrice:'',
|
|
|
+ remark:'',
|
|
|
+ environmentPicture:'',
|
|
|
+ planPicture:'',
|
|
|
+ address:'',
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onLoad(options){
|
|
|
console.log('id',options.id)
|
|
|
+ this.getTree()
|
|
|
if (options.id){
|
|
|
- saleControllerGetById(options.id).then(res=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
+ this.getByCodes(options.id)
|
|
|
}
|
|
|
- this.getByCodes()
|
|
|
- this.getTree()
|
|
|
},
|
|
|
methods:{
|
|
|
+ changeBearing(e){
|
|
|
+ this.postData.bearing = e.detail
|
|
|
+ },
|
|
|
+ changeElectricity(e){
|
|
|
+ this.postData.electricity = e.detail
|
|
|
+ },
|
|
|
+ changeGuidePrice(e){
|
|
|
+ this.postData.guidePrice = e.detail
|
|
|
+ },
|
|
|
+ changeRemark(e){
|
|
|
+ this.postData.remark = e.detail
|
|
|
+ },
|
|
|
+ changeAddress(e){
|
|
|
+ this.postData.address = e.detail
|
|
|
+ },
|
|
|
+ showMap(){
|
|
|
+ const _this = this
|
|
|
+ uni.chooseLocation({
|
|
|
+ success: function (res) {
|
|
|
+ console.log('选择的位置:', res.name);
|
|
|
+ _this.postData.address = res.name
|
|
|
+ console.log('纬度:' + res.latitude + ',经度:' + res.longitude);
|
|
|
+ _this.postData.latitude = res.latitude
|
|
|
+ _this.postData.longitude = res.longitude
|
|
|
+ _this.$forceUpdate();
|
|
|
+ // 其他业务逻辑
|
|
|
+ },
|
|
|
+ fail: function (error) {
|
|
|
+ console.error('Choose location failed: ' + JSON.stringify(error));
|
|
|
+ },
|
|
|
+ complete: function () {
|
|
|
+ console.log('chooseLocation operation is complete');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getTree(){
|
|
|
getTreeData2().then(res=>{
|
|
|
console.log(res.data)
|
|
|
this.options = res.data
|
|
|
})
|
|
|
},
|
|
|
+ commit(){
|
|
|
+ if (this.fileList.length > 0){
|
|
|
+ let pictureArr = []
|
|
|
+ this.fileList.forEach(e=>{
|
|
|
+ pictureArr.push(e.id)
|
|
|
+ })
|
|
|
+ this.postData.planPicture = pictureArr.toString()
|
|
|
+ }
|
|
|
|
|
|
- async getByCodes() {
|
|
|
+ if (this.fileList2.length > 0){
|
|
|
+ let pictureArr2 = []
|
|
|
+ this.fileList2.forEach(e=>{
|
|
|
+ pictureArr2.push(e.id)
|
|
|
+ })
|
|
|
+ this.postData.environmentPicture = pictureArr2.toString()
|
|
|
+ }
|
|
|
+ if (!this.buildFa){
|
|
|
+ this.$showToast('请选择父级')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.region){
|
|
|
+ this.$showToast('请选择区域')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.floor){
|
|
|
+ this.$showToast('请选择楼层')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.roomNo){
|
|
|
+ this.$showToast('请输入出租单元名称')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.size){
|
|
|
+ this.$showToast('请输入面积')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.roomUseLabel){
|
|
|
+ this.$showToast('请选择用途')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.direction){
|
|
|
+ this.$showToast('请选择朝向')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.decorationSituation){
|
|
|
+ this.$showToast('请选择装修情况')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.postData.guidePrice){
|
|
|
+ this.$showToast('请填写出租指导价')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ parkRoomEdit(this.postData).then(res=>{
|
|
|
+ if (res.code == 200){
|
|
|
+ this.$showToast('保存成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getByCodes(id) {
|
|
|
let data = await getByCodes(JSON.stringify(this.dic_key));
|
|
|
this.dic_SelectList = this.$common.handleDicList(data);
|
|
|
this.areaList = this.dic_SelectList.MNP_BUILDING_LCQY
|
|
@@ -326,6 +441,11 @@ export default {
|
|
|
this.situationList = this.dic_SelectList.DECORATION_SITUATION
|
|
|
this.enableList = this.dic_SelectList.HOUSE_ENABLE
|
|
|
this.statusList = this.dic_SelectList.HOUSE_STATUS
|
|
|
+ parkRoomGetById(id).then(res=>{
|
|
|
+ this.postData = res
|
|
|
+ this.buildFa = res.groupName + '/' + res.floorDiscName+'/' + res.buildName
|
|
|
+ this.dataCheck(res)
|
|
|
+ })
|
|
|
},
|
|
|
showPop(e){
|
|
|
this.showTree = true
|
|
@@ -335,6 +455,9 @@ export default {
|
|
|
this.show = true
|
|
|
},
|
|
|
onFinish(e){
|
|
|
+ this.postData.groupName = e.detail.selectedOptions[0].label
|
|
|
+ this.postData.floorDiscName = e.detail.selectedOptions[1].label
|
|
|
+ this.postData.buildName = e.detail.selectedOptions[2].label
|
|
|
console.log(e)
|
|
|
const fieldValue = e.detail.selectedOptions
|
|
|
.map((option) => option.label)
|
|
@@ -346,28 +469,32 @@ export default {
|
|
|
console.log(e)
|
|
|
switch (this.popType) {
|
|
|
case "区域":
|
|
|
- this.postData.area = e.detail.value.label
|
|
|
+ this.postData.region = e.detail.value.label
|
|
|
break;
|
|
|
case "楼层":
|
|
|
this.postData.floor = e.detail.value.label
|
|
|
break;
|
|
|
case "用途":
|
|
|
- this.postData.usege = e.detail.value.label
|
|
|
+ this.postData.roomUse = e.detail.value.value
|
|
|
+ this.postData.roomUseLabel = e.detail.value.label
|
|
|
break;
|
|
|
case "物业性质":
|
|
|
- this.postData.nature = e.detail.value.label
|
|
|
+ this.postData.propertyNature = e.detail.value.value
|
|
|
+ this.postData.propertyNatureLabel = e.detail.value.label
|
|
|
break;
|
|
|
case "朝向":
|
|
|
- this.postData.cx = e.detail.value.label
|
|
|
+ this.postData.direction = e.detail.value.label
|
|
|
break;
|
|
|
case "装修情况":
|
|
|
- this.postData.situation = e.detail.value.label
|
|
|
+ this.postData.decorationSituation = e.detail.value.label
|
|
|
break;
|
|
|
case "可用状态":
|
|
|
- this.postData.enable = e.detail.value.label
|
|
|
+ this.postData.isEnable = e.detail.value.value
|
|
|
+ this.postData.enableLabel = e.detail.value.label
|
|
|
break;
|
|
|
case "租赁状态":
|
|
|
- this.postData.status = e.detail.value.label
|
|
|
+ this.postData.state = e.detail.value.value
|
|
|
+ this.postData.stateLabel = e.detail.value.label
|
|
|
break;
|
|
|
}
|
|
|
this.show = false
|
|
@@ -377,7 +504,7 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
deleteRYXXZP2(event) {
|
|
|
- this.fileList.splice(event.detail.index, 1);
|
|
|
+ this.fileList2.splice(event.detail.index, 1);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
uploadRYXXZP(event) {
|
|
@@ -417,7 +544,7 @@ export default {
|
|
|
success(res) {
|
|
|
// 上传完成需要更新 fileList
|
|
|
let data = JSON.parse(res.data);
|
|
|
- that.fileList.push({
|
|
|
+ that.fileList2.push({
|
|
|
imgUrl: "/FileController/download/" + data.data[0],
|
|
|
id: data.data[0],
|
|
|
url:
|
|
@@ -430,6 +557,50 @@ export default {
|
|
|
fail(res) {},
|
|
|
});
|
|
|
},
|
|
|
+ dataCheck(res){
|
|
|
+ this.postData.roomUseLabel = this.usegeList.find(e=>{
|
|
|
+ return e.value === res.roomUse
|
|
|
+
|
|
|
+ }).label
|
|
|
+ this.postData.propertyNatureLabel = this.natureList.find(e=>{
|
|
|
+ return e.value === res.propertyNature
|
|
|
+
|
|
|
+ }).label
|
|
|
+ this.postData.enableLabel = this.enableList.find(e=>{
|
|
|
+ return e.value === res.isEnable
|
|
|
+
|
|
|
+ }).label
|
|
|
+ this.postData.stateLabel = this.statusList.find(e=>{
|
|
|
+ return e.value === res.state
|
|
|
+
|
|
|
+ }).label
|
|
|
+ const trimmedString = res.environmentPicture.replace(/,$/, '');
|
|
|
+ const trimmedString2 = res.planPicture.replace(/,$/, '');
|
|
|
+ let environmentList = trimmedString.split(',')
|
|
|
+ let planPictureList = trimmedString2.split(',')
|
|
|
+ environmentList.forEach(id=>{
|
|
|
+ this.fileList2.push({
|
|
|
+ imgUrl: "/FileController/download/" + id,
|
|
|
+ id: id,
|
|
|
+ url:
|
|
|
+ this.$constant.BASE_URI +
|
|
|
+ "/FileController/download/" +
|
|
|
+ id,
|
|
|
+ isImage: true,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ planPictureList.forEach(id=>{
|
|
|
+ this.fileList.push({
|
|
|
+ imgUrl: "/FileController/download/" + id,
|
|
|
+ id: id,
|
|
|
+ url:
|
|
|
+ this.$constant.BASE_URI +
|
|
|
+ "/FileController/download/" +
|
|
|
+ id,
|
|
|
+ isImage: true,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|