Browse Source

修复bug

Shannon_mu 3 years ago
parent
commit
ab328bb941

+ 1 - 1
operationSupport/src/views/assetManagement/housingManagement/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="content">
-        <building-tree @buildingInformation="buildingInformation" v-if="!showaddDialog"></building-tree>
+        <building-tree @buildingInformation="buildingInformation" :buildingType="1" v-if="!showaddDialog"></building-tree>
         <div class="content-right" v-if="!showaddDialog">
             <div class="search">
                 <el-input clearable placeholder="房屋号" class="search-input" v-trim v-model="mixins_query.roomNumber"></el-input>

+ 1 - 1
operationSupport/src/views/buildingManagement/pageJump/addoredit.vue

@@ -61,7 +61,7 @@
                     </span>
                 </div>
                 <div class="right_content_info">
-                    <div class="head_fr">
+                    <div class="head_fr" v-if="isAdd">
                         <div class="head_content head_add">
                             <div class="checkbox_style">
                                 <el-checkbox :disabled="!isAdd" @change="checkedUnit" v-model="initialUnitList.checkedUnit"></el-checkbox>

+ 1 - 1
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -37,7 +37,7 @@
                     />
                 </el-form-item> -->
                 <el-form-item label="详细地址" prop="address">
-                    <el-input disabled v-model="ruleForm.address">
+                    <el-input v-model="ruleForm.address">
                         <i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="addressQueryClick"></i>
                     </el-input>
                 </el-form-item>

+ 32 - 17
operationSupport/src/views/deviceManagement/popups/addDeviceManagement.vue

@@ -2,12 +2,12 @@
     <div class="alert-body__main_content">
         <zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="120" ref="form">
             <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-select>
             </template>
             <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>
                 </el-input>
             </template>
@@ -68,6 +68,7 @@ export default {
                     }
                 ]
             ],
+            addressTree: [],
             formRules: {
                 communityId: [this.$valid.selectRequired('选择社区')],
                 productId: [this.$valid.selectRequired('设备类型')],
@@ -90,27 +91,41 @@ export default {
     },
     methods: {
         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 }) => {
                 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() {
@@ -141,7 +156,7 @@ export default {
         }
     },
     created() {
-        this.getTenantsTree()
+        this.getTenantsTree();
         this.productOptions = this.params.productOptions;
         if (this.params.todo == 'edit') {
             this.formData = JSON.parse(JSON.stringify(this.params.data));

+ 48 - 4
operationSupport/src/views/deviceManagement/popups/addFacilities.vue

@@ -6,8 +6,13 @@
                     <el-option v-for="item in TypeOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
                 </el-select>
             </template>
+            <template slot="address">
+                <el-input v-model="formData.address" clearable>
+                    <i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="addressQueryClick"></i>
+                </el-input>
+            </template>
             <template slot="communityId">
-                <el-select v-model="formData.communityId">
+                <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-select>
             </template>
@@ -54,8 +59,7 @@ export default {
                     {
                         label: '地址',
                         prop: 'address',
-                        slot: 'address',
-                        input: true
+                        slot: 'address'
                     }
                 ]
             ],
@@ -65,6 +69,7 @@ export default {
                 facilityNo: [this.$valid.selectRequired('设施编号')],
                 name: [this.$valid.selectRequired('设施名称')]
             },
+            addressTree: [],
             formErrors: {},
             TypeOptions: []
         };
@@ -75,7 +80,46 @@ export default {
         }
     },
     methods: {
-        productChange(va) {},
+        productChange(va) {
+            if (this.formData.communityId) {
+                this.getTenantsTree(va);
+            }
+        },
+        getTenantsTree(va) {
+            this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
+                if (status === 0 && data) {
+                    data.forEach((element) => {
+                        if (element.value == va) {
+                            this.addressTree = element.children;
+                        }
+                    });
+                }
+            });
+        },
+        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.buildingId = e.buildingId;
+                this.formData.unitName = e.unitName;
+                this.formData.houseId = e.houseId;
+                this.formData.address = ` ${e.buildingName} - ${e.unitName} - ${e.houseName}`;
+            });
+        },
         submit() {
             new Promise((resolve) => {
                 this.$refs.form.validate(resolve);

+ 35 - 48
operationSupport/src/views/deviceManagement/popups/poptreeSelect.vue

@@ -1,13 +1,6 @@
 <template>
-    <el-scrollbar class="el-scrollbar-byself" style="width: 100%">
-        <el-tree
-            :data="tenantsTree"
-            show-checkbox
-            node-key="value"
-            :props="treedefaultProps"
-            :default-checked-keys="defaultcheckedkeys"
-            ref="tenantstree"
-        >
+    <el-scrollbar class="el-scrollbar-byself thisColor" style="width: 100%">
+        <el-tree class="" :data="tenantsTree" @node-click="treeClick" node-key="value" :props="treedefaultProps" ref="tenantstree">
         </el-tree>
     </el-scrollbar>
 </template>
@@ -21,54 +14,48 @@ export default {
                 children: 'children',
                 label: 'name'
             },
-            defaultcheckedkeys: []
+            unitPa: {
+                buildingId: '',
+                buildingName: '',
+                unitId: '',
+                unitName: '',
+                houseId: '',
+                houseName: '',
+                type: ''
+            }
         };
     },
     computed: {},
     mounted() {},
     methods: {
         submit() {
-            let arrs = this.$refs.tenantstree.getCheckedNodes();
-            let combination = [];
-            arrs.forEach((item, index) => {
-                let thisValue = this.$refs.tenantstree.getNode(item);
-                let objArray = {};
-                if (
-                    (item.children == null || item.children == undefined) &&
-                    !this.defaultcheckedkeys.includes(parseInt(thisValue.data.value))
-                ) {
-                    if (thisValue.data.type === 'room') {
-                        objArray = {
-                            houseId: thisValue.data.value,
-                            buildingName: thisValue.parent.parent.data.name,
-                            unitName: thisValue.parent.data.name,
-                            roomNumber: thisValue.data.name
-                        };
-                    } else if (thisValue.data.type === 'parking') {
-                        objArray = {
-                            parkingId: thisValue.data.value,
-                            parkingNumber: thisValue.data.name
-                        };
-                    }
-                    combination.push(objArray);
-                }
-            });
-
-            this.params.callback && this.params.callback(combination);
-            this.$emit('close');
+            if (this.unitPa.type === 'room') {
+                this.params.callback && this.params.callback(this.unitPa);
+                this.$emit('close');
+            } else {
+                this.$message.error('请先选择到房间');
+                return;
+            }
+        },
+        treeClick(e) {
+            this.unitPa.type = e.type;
+            if (e.type == 'room') {
+                this.unitPa.buildingId = this.$refs.tenantstree.getNode(e).parent.parent.data.value;
+                this.unitPa.buildingName = this.$refs.tenantstree.getNode(e).parent.parent.data.name;
+                this.unitPa.unitId = this.$refs.tenantstree.getNode(e).parent.data.value;
+                this.unitPa.unitName = this.$refs.tenantstree.getNode(e).parent.data.name;
+                this.unitPa.houseId = e.value;
+                this.unitPa.houseName = e.name;
+            }
         }
     },
     created() {
-        if (this.params.list.length !== 0) {
-            this.params.list.forEach((item, index) => {
-                if (this.params.num === 1) {
-                    this.defaultcheckedkeys.push(item.houseId);
-                } else {
-                    this.defaultcheckedkeys.push(item.parkingId);
-                }
-            });
-        }
         this.tenantsTree = this.params.tenantsTree;
     }
 };
-</script>
+</script>
+<style lang="scss" scoped>
+.thisColor /deep/ .el-tree .is-current {
+    color: #56c6ff;
+}
+</style>

+ 1 - 1
operationSupport/src/views/payService/billingRules/stepPage/add.vue

@@ -341,7 +341,7 @@ export default {
     created() {
         if (this.params.todo == 'edit') {
             Object.assign(this.formData, this.params.data);
-            this.formData.ladderList = JSON.parse(this.formData.chargePriceLadder);
+            this.formData.ladderList = JSON.parse(this.formData.chargePriceLadder) ||  this.formData.ladderList;
         }
     }
 };

+ 3 - 3
operationSupport/src/views/payService/propertyFee/stepPage/temporary.vue

@@ -1,7 +1,7 @@
 <template>
     <el-form ref="form" :model="formData" :rules="formRules" label-width="120px">
         <el-form-item label="选择收费项目" prop="chargeType">
-            <el-select placeholder="选择收费项目" v-model="formData.chargeType" clearable>
+            <el-select placeholder="选择收费项目" v-model="formData.strategyId" clearable>
                 <el-option label="物业管理费" :value="item.id" v-for="(item, index) in selectData" :key="index">{{
                     item.chargeName
                 }}</el-option>
@@ -28,9 +28,9 @@ export default {
         return {
             formData: {
                 assetsId: '',
-                strategyId: '14',
+                strategyId: '',
                 assetsType: 1,
-                chargeType: '',
+                chargeType: 1,
                 chargeStartTime: '2021-09',
                 chargeEndTime: '2021-09'
             },