|
@@ -2,12 +2,12 @@
|
|
<div class="alert-body__main_content">
|
|
<div class="alert-body__main_content">
|
|
<zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="120" ref="form">
|
|
<zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="120" ref="form">
|
|
<template slot="communityId">
|
|
<template slot="communityId">
|
|
- <el-select v-model="formData.communityId" @change="productChange($event)">
|
|
|
|
|
|
+ <el-select v-model="formData.communityId" @change="productChange($event)">
|
|
<el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
|
|
<el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
<template slot="address">
|
|
<template slot="address">
|
|
- <el-input disabled v-model="formData.address">
|
|
|
|
|
|
+ <el-input v-model="formData.address" clearable>
|
|
<i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="addressQueryClick"></i>
|
|
<i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="addressQueryClick"></i>
|
|
</el-input>
|
|
</el-input>
|
|
</template>
|
|
</template>
|
|
@@ -68,6 +68,7 @@ export default {
|
|
}
|
|
}
|
|
]
|
|
]
|
|
],
|
|
],
|
|
|
|
+ addressTree: [],
|
|
formRules: {
|
|
formRules: {
|
|
communityId: [this.$valid.selectRequired('选择社区')],
|
|
communityId: [this.$valid.selectRequired('选择社区')],
|
|
productId: [this.$valid.selectRequired('设备类型')],
|
|
productId: [this.$valid.selectRequired('设备类型')],
|
|
@@ -90,27 +91,41 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
productChange(va) {
|
|
productChange(va) {
|
|
- console.log(va)
|
|
|
|
|
|
+ if (this.formData.communityId) {
|
|
|
|
+ this.getTenantsTree(va);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- getTenantsTree() {
|
|
|
|
|
|
+ getTenantsTree(va) {
|
|
this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
|
|
this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
|
|
if (status === 0 && data) {
|
|
if (status === 0 && data) {
|
|
- console.log(data);
|
|
|
|
|
|
+ data.forEach((element) => {
|
|
|
|
+ if (element.value == va) {
|
|
|
|
+ this.addressTree = element.children;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- addressQueryClick() {
|
|
|
|
- this.$store.dispatch('addPopup', {
|
|
|
|
- url: '/ownerManagement/stepPage/poptreeSelect.vue',
|
|
|
|
|
|
|
|
- width: '500px',
|
|
|
|
- height: '400px',
|
|
|
|
- props: {
|
|
|
|
- list,
|
|
|
|
- tenantsTree,
|
|
|
|
- callback: resolve
|
|
|
|
- },
|
|
|
|
- title: title
|
|
|
|
|
|
+ addressQueryClick() {
|
|
|
|
+ if (!this.formData.communityId) {
|
|
|
|
+ this.$message.error('请先选择社区');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ new Promise((resolve) => {
|
|
|
|
+ this.$store.dispatch('addPopup', {
|
|
|
|
+ url: '/deviceManagement/popups/poptreeSelect.vue',
|
|
|
|
+ width: '300px',
|
|
|
|
+ height: '400px',
|
|
|
|
+ props: {
|
|
|
|
+ tenantsTree: this.addressTree,
|
|
|
|
+ callback: resolve
|
|
|
|
+ },
|
|
|
|
+ hideStar: true,
|
|
|
|
+ title: '楼栋信息'
|
|
|
|
+ });
|
|
|
|
+ }).then((e) => {
|
|
|
|
+ this.formData.address = ` ${e.buildingName} - ${e.unitName} - ${e.houseName}`;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
@@ -141,7 +156,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getTenantsTree()
|
|
|
|
|
|
+ this.getTenantsTree();
|
|
this.productOptions = this.params.productOptions;
|
|
this.productOptions = this.params.productOptions;
|
|
if (this.params.todo == 'edit') {
|
|
if (this.params.todo == 'edit') {
|
|
this.formData = JSON.parse(JSON.stringify(this.params.data));
|
|
this.formData = JSON.parse(JSON.stringify(this.params.data));
|