seimin преди 2 години
родител
ревизия
174cbc2eea
променени са 1 файла, в които са добавени 21 реда и са изтрити 6 реда
  1. 21 6
      src/views/repair.vue

+ 21 - 6
src/views/repair.vue

@@ -203,11 +203,11 @@ const PCA = {
203 203
           let arr = [];
204 204
           result.data.list = result.data.list || [];
205 205
           result.data.list.forEach(item => {
206
-            arr.push({ value: item.room, text: item.room });
206
+            arr.push({ value: item.id, text: item.room });
207 207
           });
208 208
           this.$parent.$parent.$parent.$parent.$parent.fields.forEach(item => {
209 209
             // 初始化房间号下拉框列表
210
-            if (item.modelKey == "room") {
210
+            if (item.modelKey == "roomId") {
211 211
               item.props.options = arr;
212 212
             }
213 213
           });
@@ -229,9 +229,19 @@ const delay = (function() {
229 229
 })();
230 230
 export default {
231 231
   watch: {
232
-    "model.room": {
232
+    "model.roomId": {
233 233
       handler(newV) {
234
-        this.model.address = newV || "";
234
+        if (newV) {
235
+          this.fields.forEach(item => {
236
+            if (item.modelKey == "roomId") {
237
+              this.model.address = item.props.options.find(
238
+                v => v.value == newV
239
+              ).text;
240
+            }
241
+          });
242
+        } else {
243
+          this.model.address = "";
244
+        }
235 245
       }
236 246
     }
237 247
   },
@@ -282,7 +292,7 @@ export default {
282 292
         deptId: "",
283 293
         contacts: "",
284 294
         assetId: "",
285
-        room: ""
295
+        roomId: ""
286 296
       },
287 297
       // showPrompting:false,
288 298
       promptingConent: "",
@@ -384,7 +394,7 @@ export default {
384 394
         },
385 395
         {
386 396
           type: "select",
387
-          modelKey: "room",
397
+          modelKey: "roomId",
388 398
           label: "房间号",
389 399
           props: {
390 400
             placeholder: "请选择房间号",
@@ -487,6 +497,11 @@ export default {
487 497
       } else {
488 498
         delete reqData.incident.deptId;
489 499
       }
500
+      if (this.ifRoom == 1) {
501
+        reqData.incident.roomId = this.model.roomId;
502
+      } else {
503
+        delete reqData.incident.roomId;
504
+      }
490 505
       this.$http
491 506
         .post("service/apply/bpm/addWxIncident", reqData)
492 507
         .then(function(res) {