Browse Source

自动带入房屋

Shannon_mu 3 years ago
parent
commit
d3d51b8d59

+ 3 - 2
operationSupport/src/views/ownerManagement/index.vue

@@ -220,7 +220,8 @@ export default {
             ],
             activeData: {},
             isAdd: true,
-            selectRow: []
+            selectRow: [],
+            thisLeftData:{},
         };
     },
     methods: {
@@ -366,7 +367,7 @@ export default {
                     this.mixins_query.roomNumber = newValueIds[newValueIds.length - 1];
                 }
             }
-
+            this.thisLeftData = newValue;;
             this.mixins_search();
         }
     },

+ 20 - 7
operationSupport/src/views/ownerManagement/stepPage/add.vue

@@ -140,9 +140,9 @@
                     <div class="block-title">
                         <div class="floor list-title">
                             {{
-                                `${item.buildingName} ${item.unitName.indexOf('单元') !== -1 ? item.unitName : !!item.unitName?item.unitName + '单元':''}${
-                                    item.roomNumber
-                                }`
+                                `${item.buildingName} ${
+                                    item.unitName.indexOf('单元') !== -1 ? item.unitName : !!item.unitName ? item.unitName + '单元' : ''
+                                }${item.roomNumber}`
                             }}
                         </div>
                         <span class="remove list-title" v-if="!islooks" @click="removeHouse(index, 'houseList')">移除</span>
@@ -213,7 +213,7 @@
 <script>
 import envConfig from '@/config';
 export default {
-    name:"ownerManagementAdd",
+    name: 'ownerManagementAdd',
     props: {
         params: {
             type: Object
@@ -438,10 +438,25 @@ export default {
     },
     created() {
         this.$store.dispatch('collapse', true);
+
         if (!!this.params.id) {
             this.getDetails(this.params.id);
+        } else {
+            if (this.$parent.thisLeftData.type == 'room') {
+                this.formData.houseList = [
+                    {
+                        checkInDate: '',
+                        householdType: 1,
+                        buildingName: this.$parent.thisLeftData.buildingName,
+                        unitName: this.$parent.thisLeftData.unitName,
+                        roomNumber: this.$parent.thisLeftData.houseName,
+                        houseId: this.$parent.thisLeftData.houseId
+                    }
+                ];
+            }
+            console.log(this.$parent.thisLeftData);
         }
-        console.log(this.$parent)
+
         this.getTenantsTree();
     },
     beforeDestroy() {
@@ -540,12 +555,10 @@ export default {
                     notip: true
                 });
             }).then((res) => {
-                debugger;
                 if (res.length > 0) {
                     res.forEach((item, index) => {
                         let newObj = {};
                         if (num === 1) {
-                            debugger;
                             newObj = {
                                 checkInDate: '',
                                 householdType: 1,