seimin 2 年之前
父节点
当前提交
3ca6ba1939
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/views/repair.vue

+ 7 - 2
src/views/repair.vue

@@ -115,7 +115,9 @@ const PCA = {
115
     },
115
     },
116
     selectHandler(selectedVal, selectedIndex, selectedTxt) {
116
     selectHandler(selectedVal, selectedIndex, selectedTxt) {
117
       console.log(selectedVal, selectedIndex, selectedTxt, "baba", this);
117
       console.log(selectedVal, selectedIndex, selectedTxt, "baba", this);
118
-      this.getRoomData(selectedVal[1]);
118
+      if (this.$parent.$parent.$parent.$parent.$parent.ifRoom == 1) {
119
+        this.getRoomData(selectedVal[1]);
120
+      }
119
       this.selected = selectedTxt;
121
       this.selected = selectedTxt;
120
       this.selectIndex = selectedIndex;
122
       this.selectIndex = selectedIndex;
121
       this.$emit("input", selectedVal);
123
       this.$emit("input", selectedVal);
@@ -186,7 +188,9 @@ const PCA = {
186
       var data = JSON.parse(localStorage.getItem("loginUser"));
188
       var data = JSON.parse(localStorage.getItem("loginUser"));
187
       this.selected[0] = data.place.area.area;
189
       this.selected[0] = data.place.area.area;
188
       this.selected[1] = data.place.place;
190
       this.selected[1] = data.place.place;
189
-      this.getRoomData(data.place.id);
191
+      if (this.$parent.$parent.$parent.$parent.$parent.ifRoom == 1) {
192
+        this.getRoomData(data.place.id);
193
+      }
190
     },
194
     },
191
     getRoomData(placeId) {
195
     getRoomData(placeId) {
192
       this.$http
196
       this.$http
@@ -197,6 +201,7 @@ const PCA = {
197
         })
201
         })
198
         .then(result => {
202
         .then(result => {
199
           let arr = [];
203
           let arr = [];
204
+          result.data.list = result.data.list || [];
200
           result.data.list.forEach(item => {
205
           result.data.list.forEach(item => {
201
             arr.push({ value: item.room, text: item.room });
206
             arr.push({ value: item.room, text: item.room });
202
           });
207
           });