瀏覽代碼

资产新增与展示

seimin 3 年之前
父節點
當前提交
d0092b9392
共有 7 個文件被更改,包括 761 次插入439 次删除
  1. 96 75
      src/views/againAssign.vue
  2. 71 54
      src/views/closed.vue
  3. 202 117
      src/views/grabSheet.vue
  4. 50 2
      src/views/newIncident.vue
  5. 246 120
      src/views/order.vue
  6. 14 7
      src/views/processing.vue
  7. 82 64
      src/views/solved.vue

+ 96 - 75
src/views/againAssign.vue

@@ -117,7 +117,12 @@
117 117
             <p>
118 118
               <span class="fl">处理人电话</span>
119 119
               <span class="fr" v-if="!model.incident.handlerUser"></span>
120
-              <span class="fr" v-if="model.incident.handlerUser"><a :href="'tel:' + model.incident.handlerUser.phone"><i class="iconfont icon-shouji"></i>{{model.incident.handlerUser.phone}}</a></span>
120
+              <span class="fr" v-if="model.incident.handlerUser"
121
+                ><a :href="'tel:' + model.incident.handlerUser.phone"
122
+                  ><i class="iconfont icon-shouji"></i
123
+                  >{{ model.incident.handlerUser.phone }}</a
124
+                ></span
125
+              >
121 126
             </p>
122 127
             <p>
123 128
               <span class="fl">优先级</span>
@@ -134,30 +139,38 @@
134 139
               <span class="fr">{{ model.incident.overdueTime }}</span>
135 140
             </p>
136 141
             <p>
137
-                <span class="fl">区域</span>
138
-                <span class="fr">{{model.incident.place?model.incident.place.area.area:'--'}}</span>
139
-              </p>
140
-              <p class="boeder_B">
141
-                <span class="fl">地点</span>
142
-                <span class="fr">{{model.incident.place?model.incident.place.place:'--'}}</span>
143
-              </p>
144
-              <div v-if="hcsjList.length">
145
-                <p>耗材</p>
146
-                <div class="hcTable">
147
-                  <table>
148
-                    <tr>
149
-                      <td>耗材名称</td>
150
-                      <td>价格</td>
151
-                      <td>数量</td>
152
-                    </tr>
153
-                    <tr v-for="(item,i) in hcsjList" :key="i">
154
-                      <td>{{item.consumable.name}}</td>
155
-                      <td>{{item.extra1}}</td>
156
-                      <td>{{item.consumablesSum}}</td>
157
-                    </tr>
158
-                  </table>
159
-                </div>
142
+              <span class="fl">区域</span>
143
+              <span class="fr">{{
144
+                model.incident.place ? model.incident.place.area.area : "--"
145
+              }}</span>
146
+            </p>
147
+            <p class="boeder_B">
148
+              <span class="fl">地点</span>
149
+              <span class="fr">{{
150
+                model.incident.place ? model.incident.place.place : "--"
151
+              }}</span>
152
+            </p>
153
+            <div v-if="hcsjList.length">
154
+              <p>耗材</p>
155
+              <div class="hcTable">
156
+                <table>
157
+                  <tr>
158
+                    <td>耗材名称</td>
159
+                    <td>价格</td>
160
+                    <td>数量</td>
161
+                  </tr>
162
+                  <tr v-for="(item, i) in hcsjList" :key="i">
163
+                    <td>{{ item.consumable.name }}</td>
164
+                    <td>{{ item.extra1 }}</td>
165
+                    <td>{{ item.consumablesSum }}</td>
166
+                  </tr>
167
+                </table>
160 168
               </div>
169
+            </div>
170
+            <p v-if="wxIncidentWithCmdb == 1">
171
+              <span class="fl">资产</span>
172
+              <span class="fr">{{ model.incident.assetId || "无" }}</span>
173
+            </p>
161 174
           </div>
162 175
           <p class="info_hide">
163 176
             <span class="fl hide" @click="hides()" v-if="!item_hides"
@@ -172,11 +185,11 @@
172 185
               <img
173 186
                 v-if="
174 187
                   img.suffix == 'jpeg' ||
175
-                    img.suffix == 'jpg' ||
176
-                    img.suffix == 'gif' ||
177
-                    img.suffix == 'png' ||
178
-                    img.suffix == 'svg' ||
179
-                    img.suffix == 'pdf'
188
+                  img.suffix == 'jpg' ||
189
+                  img.suffix == 'gif' ||
190
+                  img.suffix == 'png' ||
191
+                  img.suffix == 'svg' ||
192
+                  img.suffix == 'pdf'
180 193
                 "
181 194
                 :src="img.previewUrl"
182 195
                 v-for="(img, index) in imgs"
@@ -208,15 +221,15 @@
208 221
                     :class="{
209 222
                       iconfont: true,
210 223
                       'icon-icon_weizuo': item.endTime != '',
211
-                      'icon-icon_zhengzaijinx': item.endTime == ''
224
+                      'icon-icon_zhengzaijinx': item.endTime == '',
212 225
                     }"
213 226
                   ></i>
214 227
                   <span class="text1">
215
-                      {{item.startTime | timeFormat("MM-dd HH:mm:ss")}}
216
-                      <template v-if="item.userName">
217
-                        ,{{item.userName}}
218
-                      </template>
219
-                      </span>
228
+                    {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
229
+                    <template v-if="item.userName">
230
+                      ,{{ item.userName }}
231
+                    </template>
232
+                  </span>
220 233
                 </div>
221 234
                 <div :class="{ cont: true, blue: item.endTime != '' }">
222 235
                   <p class="text2" v-if="item.desc" v-html="item.desc"></p>
@@ -234,13 +247,13 @@
234 247
             <div class="form">
235 248
               <div class="txtLabel">
236 249
                 <div class="txt fl handler">
237
-                  <span style="color:red;">*</span>是否选择处理人:
250
+                  <span style="color: red">*</span>是否选择处理人:
238 251
                 </div>
239 252
                 <cube-switch v-model="handleUserOrGroup"></cube-switch>
240 253
               </div>
241 254
               <div class="txtLabel" v-if="handleUserOrGroup">
242 255
                 <div class="txt fl">
243
-                  <span style="color:red;">*</span> 处理人:
256
+                  <span style="color: red">*</span> 处理人:
244 257
                 </div>
245 258
                 <cube-select
246 259
                   class="selectGroup fl"
@@ -252,7 +265,7 @@
252 265
               </div>
253 266
               <div class="txtLabel" v-if="!handleUserOrGroup">
254 267
                 <div class="txt fl">
255
-                  <span style="color:red;">*</span> 处理组:
268
+                  <span style="color: red">*</span> 处理组:
256 269
                 </div>
257 270
                 <cube-select
258 271
                   class="selectGroup fl"
@@ -288,7 +301,7 @@ export default {
288 301
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
289 302
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
290 303
       wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
291
-      hcsjList:[],//绑定的耗材列表,展示
304
+      hcsjList: [], //绑定的耗材列表,展示
292 305
       promptingConent: "",
293 306
       promptingStatus: "",
294 307
       item_hides: false,
@@ -302,12 +315,12 @@ export default {
302 315
       candidateGroupsArr: [], //处理组
303 316
       handlerUser: "", //处理人
304 317
       handlerGroup: "", //处理组
305
-      pro_hides: false //展开/收起处理进度
318
+      pro_hides: false, //展开/收起处理进度
306 319
     };
307 320
   },
308 321
   components: {
309 322
     LoadIng,
310
-    PrompTing
323
+    PrompTing,
311 324
   },
312 325
   methods: {
313 326
     // 获取事件上绑定的耗材
@@ -317,7 +330,7 @@ export default {
317 330
           data: { type: 2, source: "1627", sourceId: this.id },
318 331
         })
319 332
         .then((result) => {
320
-          if(result.data.status == 200){
333
+          if (result.data.status == 200) {
321 334
             this.hcsjList = result.data.data;
322 335
           }
323 336
         });
@@ -335,9 +348,12 @@ export default {
335 348
             that.id,
336 349
           {}
337 350
         )
338
-        .then(function(res) {
351
+        .then(function (res) {
339 352
           console.log(res.data);
340 353
           that.model = res.data.model;
354
+          if (that.$route.params.data) {
355
+            that.model.incident.assetId = that.$route.params.data.assetId;
356
+          }
341 357
           that.getProgressInfo();
342 358
         });
343 359
     },
@@ -350,7 +366,7 @@ export default {
350 366
             that.processInstanceId,
351 367
           {}
352 368
         )
353
-        .then(function(res) {
369
+        .then(function (res) {
354 370
           console.log(res.data);
355 371
           that.imgs = res.data.data.splice(0, 3);
356 372
           console.log(that.imgs);
@@ -364,34 +380,39 @@ export default {
364 380
           "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
365 381
           {}
366 382
         )
367
-        .then(function(res) {
383
+        .then(function (res) {
368 384
           console.log(res.data);
369 385
           that.progressInfo = res.data.data;
370 386
           //处理日志startcaca
371
-          if(that.model.incident.handlerLogs){
387
+          if (that.model.incident.handlerLogs) {
372 388
             //添加日志
373
-            that.model.incident.handlerLogs.forEach(v=>{
374
-              that.progressInfo.push({startTime:v.opTime,endTime:1,desc:v.opValue,userName:v.userName,activityName:'事件处理'});
375
-            })
376
-
389
+            that.model.incident.handlerLogs.forEach((v) => {
390
+              that.progressInfo.push({
391
+                startTime: v.opTime,
392
+                endTime: 1,
393
+                desc: v.opValue,
394
+                userName: v.userName,
395
+                activityName: "事件处理",
396
+              });
397
+            });
377 398
           }
378 399
           //处理数据
379
-          that.progressInfo.forEach((v)=>{
380
-            if(!v.endTime){
400
+          that.progressInfo.forEach((v) => {
401
+            if (!v.endTime) {
381 402
               v.endTime = 1;
382 403
             }
383 404
             v.startTime = new Date(v.startTime).getTime();
384
-          })
405
+          });
385 406
           var kaishi = that.progressInfo.shift();
386 407
           var jiedan = that.progressInfo.shift();
387
-          that.progressInfo.sort(function(o,c){
408
+          that.progressInfo.sort(function (o, c) {
388 409
             return c.startTime - o.startTime;
389 410
           });
390
-          that.progressInfo.length && (that.progressInfo[0].endTime = '');
411
+          that.progressInfo.length && (that.progressInfo[0].endTime = "");
391 412
           that.progressInfo.push(jiedan);
392 413
           that.progressInfo.push(kaishi);
393
-          console.log(that.progressInfo)
394
-        //处理日志end
414
+          console.log(that.progressInfo);
415
+          //处理日志end
395 416
         });
396 417
     },
397 418
     //隐藏显示详情
@@ -403,7 +424,7 @@ export default {
403 424
     proHides() {
404 425
       if (!this.pro_hides) {
405 426
         $("#progressBox").animate({
406
-          height: $("#progressBox")[0].scrollHeight
427
+          height: $("#progressBox")[0].scrollHeight,
407 428
         });
408 429
       } else {
409 430
         $("#progressBox").animate({ height: "1.7rem" });
@@ -418,7 +439,7 @@ export default {
418 439
           scrollTop:
419 440
             $("#" + id).offset().top -
420 441
             $(".header")[0].offsetHeight -
421
-            $(".navBar")[0].offsetHeight
442
+            $(".navBar")[0].offsetHeight,
422 443
         },
423 444
         260
424 445
       );
@@ -432,14 +453,14 @@ export default {
432 453
           sum: 1000,
433 454
           user: {
434 455
             roledata: { rolecode: "first-line support" },
435
-            selectType: "1"
436
-          }
456
+            selectType: "1",
457
+          },
437 458
         })
438
-        .then(function(res) {
439
-          res.data.list.forEach(function(v, i) {
459
+        .then(function (res) {
460
+          res.data.list.forEach(function (v, i) {
440 461
             that.handlerUserArr.push({
441 462
               text: v.name,
442
-              value: v.id
463
+              value: v.id,
443 464
             });
444 465
           });
445 466
         });
@@ -451,13 +472,13 @@ export default {
451 472
         .post("service/user/data/fetchDataList/group", {
452 473
           idx: 0,
453 474
           sum: 1000,
454
-          group: { selectType: "nouser" }
475
+          group: { selectType: "nouser" },
455 476
         })
456
-        .then(function(res) {
457
-          res.data.list.forEach(function(v, i) {
477
+        .then(function (res) {
478
+          res.data.list.forEach(function (v, i) {
458 479
             that.candidateGroupsArr.push({
459 480
               text: v.groupName,
460
-              value: v.id
481
+              value: v.id,
461 482
             });
462 483
           });
463 484
           console.log(that.candidateGroupsArr);
@@ -473,7 +494,7 @@ export default {
473 494
         $("#fade").fadeIn();
474 495
         that.promptingConent = "提交失败,请填写必填信息!";
475 496
         that.promptingStatus = false;
476
-        setTimeout(function() {
497
+        setTimeout(function () {
477 498
           $("#fade").fadeOut();
478 499
         }, 2000);
479 500
       }
@@ -496,7 +517,7 @@ export default {
496 517
             that.loginUser.id,
497 518
           that.model
498 519
         )
499
-        .then(function(res) {
520
+        .then(function (res) {
500 521
           if (res.data.status == 200) {
501 522
             $("#fade").fadeIn();
502 523
             that.promptingConent = "恭喜您,提交成功!";
@@ -509,27 +530,27 @@ export default {
509 530
                 icon: "cubeic-right",
510 531
                 onConfirm: (e, promptValue) => {
511 532
                   that.$router.push({ path: "/main" });
512
-                }
533
+                },
513 534
               })
514 535
               .show();
515
-            setTimeout(function() {
536
+            setTimeout(function () {
516 537
               $("#fade").fadeOut();
517 538
             }, 2000);
518 539
           }
519 540
         });
520
-    }
541
+    },
521 542
   },
522 543
   created() {
523 544
     this.processInstanceId = this.$route.params.data.processInstanceId;
524 545
     this.id = this.$route.params.data.id;
525 546
     this.getParamsData();
526 547
     this.getImgs();
527
-    if(this.incidentWithConsumable == 1){
548
+    if (this.incidentWithConsumable == 1) {
528 549
       this.getHcBySj();
529 550
     }
530 551
     this.getHandlerUser();
531 552
     this.getCandidateGroups();
532
-  }
553
+  },
533 554
 };
534 555
 </script>
535 556
 <style lang="less" scoped>

+ 71 - 54
src/views/closed.vue

@@ -125,7 +125,12 @@
125 125
             <p>
126 126
               <span class="fl">处理人电话</span>
127 127
               <span class="fr" v-if="!model.incident.handlerUser"></span>
128
-              <span class="fr" v-if="model.incident.handlerUser"><a :href="'tel:' + model.incident.handlerUser.phone"><i class="iconfont icon-shouji"></i>{{model.incident.handlerUser.phone}}</a></span>
128
+              <span class="fr" v-if="model.incident.handlerUser"
129
+                ><a :href="'tel:' + model.incident.handlerUser.phone"
130
+                  ><i class="iconfont icon-shouji"></i
131
+                  >{{ model.incident.handlerUser.phone }}</a
132
+                ></span
133
+              >
129 134
             </p>
130 135
             <p>
131 136
               <span class="fl">优先级</span>
@@ -154,22 +159,26 @@
154 159
               }}</span>
155 160
             </p>
156 161
             <div v-if="hcsjList.length">
157
-                <p>耗材</p>
158
-                <div class="hcTable">
159
-                  <table>
160
-                    <tr>
161
-                      <td>耗材名称</td>
162
-                      <td>价格</td>
163
-                      <td>数量</td>
164
-                    </tr>
165
-                    <tr v-for="(item,i) in hcsjList" :key="i">
166
-                      <td>{{item.consumable.name}}</td>
167
-                      <td>{{item.extra1}}</td>
168
-                      <td>{{item.consumablesSum}}</td>
169
-                    </tr>
170
-                  </table>
171
-                </div>
162
+              <p>耗材</p>
163
+              <div class="hcTable">
164
+                <table>
165
+                  <tr>
166
+                    <td>耗材名称</td>
167
+                    <td>价格</td>
168
+                    <td>数量</td>
169
+                  </tr>
170
+                  <tr v-for="(item, i) in hcsjList" :key="i">
171
+                    <td>{{ item.consumable.name }}</td>
172
+                    <td>{{ item.extra1 }}</td>
173
+                    <td>{{ item.consumablesSum }}</td>
174
+                  </tr>
175
+                </table>
172 176
               </div>
177
+            </div>
178
+            <p v-if="wxIncidentWithCmdb == 1">
179
+              <span class="fl">资产</span>
180
+              <span class="fr">{{ model.incident.assetId || "无" }}</span>
181
+            </p>
173 182
           </div>
174 183
           <p class="info_hide">
175 184
             <span class="fl hide" @click="hides()" v-if="!item_hides"
@@ -184,11 +193,11 @@
184 193
               <img
185 194
                 v-if="
186 195
                   img.suffix == 'jpeg' ||
187
-                    img.suffix == 'jpg' ||
188
-                    img.suffix == 'gif' ||
189
-                    img.suffix == 'png' ||
190
-                    img.suffix == 'svg' ||
191
-                    img.suffix == 'pdf'
196
+                  img.suffix == 'jpg' ||
197
+                  img.suffix == 'gif' ||
198
+                  img.suffix == 'png' ||
199
+                  img.suffix == 'svg' ||
200
+                  img.suffix == 'pdf'
192 201
                 "
193 202
                 :src="img.previewUrl"
194 203
                 v-for="(img, index) in imgs"
@@ -284,15 +293,15 @@
284 293
                     :class="{
285 294
                       iconfont: true,
286 295
                       'icon-icon_weizuo': item.endTime != '',
287
-                      'icon-icon_zhengzaijinx': item.endTime == ''
296
+                      'icon-icon_zhengzaijinx': item.endTime == '',
288 297
                     }"
289 298
                   ></i>
290 299
                   <span class="text1">
291
-                      {{item.startTime | timeFormat("MM-dd HH:mm:ss")}}
292
-                      <template v-if="item.userName">
293
-                        ,{{item.userName}}
294
-                      </template>
295
-                      </span>
300
+                    {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
301
+                    <template v-if="item.userName">
302
+                      ,{{ item.userName }}
303
+                    </template>
304
+                  </span>
296 305
                 </div>
297 306
                 <div :class="{ cont: true, blue: item.endTime != '' }">
298 307
                   <p class="text2" v-if="item.desc" v-html="item.desc"></p>
@@ -321,17 +330,17 @@ export default {
321 330
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
322 331
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
323 332
       wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
324
-      hcsjList:[],//绑定的耗材列表,展示
333
+      hcsjList: [], //绑定的耗材列表,展示
325 334
       selected: 1,
326 335
       options: [
327 336
         {
328 337
           label: "接单",
329
-          value: 1
338
+          value: 1,
330 339
         },
331 340
         {
332 341
           label: "关单信息",
333
-          value: 2
334
-        }
342
+          value: 2,
343
+        },
335 344
       ],
336 345
       resignComment: "", //重新指派原因
337 346
       item_hides: false,
@@ -341,11 +350,11 @@ export default {
341 350
       progressInfo: [], //处理进度
342 351
       imgs: [], //图片
343 352
       model: {}, //提交数据
344
-      pro_hides: false //展开/收起处理进度
353
+      pro_hides: false, //展开/收起处理进度
345 354
     };
346 355
   },
347 356
   components: {
348
-    LoadIng
357
+    LoadIng,
349 358
   },
350 359
   methods: {
351 360
     // 获取事件上绑定的耗材
@@ -355,7 +364,7 @@ export default {
355 364
           data: { type: 2, source: "1627", sourceId: this.id },
356 365
         })
357 366
         .then((result) => {
358
-          if(result.data.status == 200){
367
+          if (result.data.status == 200) {
359 368
             this.hcsjList = result.data.data;
360 369
           }
361 370
         });
@@ -373,9 +382,12 @@ export default {
373 382
             that.id,
374 383
           {}
375 384
         )
376
-        .then(function(res) {
385
+        .then(function (res) {
377 386
           console.log(res.data);
378 387
           that.model = res.data.model;
388
+          if (that.$route.params.data) {
389
+            that.model.incident.assetId = that.$route.params.data.assetId;
390
+          }
379 391
           //seimin
380 392
           localStorage.setItem("modelData", JSON.stringify(that.model));
381 393
           that.getProgressInfo();
@@ -390,7 +402,7 @@ export default {
390 402
             that.processInstanceId,
391 403
           {}
392 404
         )
393
-        .then(function(res) {
405
+        .then(function (res) {
394 406
           console.log(res.data);
395 407
           that.imgs = res.data.data.splice(0, 3);
396 408
           console.log(that.imgs);
@@ -404,34 +416,39 @@ export default {
404 416
           "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
405 417
           {}
406 418
         )
407
-        .then(function(res) {
419
+        .then(function (res) {
408 420
           console.log(res.data);
409 421
           that.progressInfo = res.data.data;
410 422
           //处理日志startcaca
411
-          if(that.model.incident.handlerLogs){
423
+          if (that.model.incident.handlerLogs) {
412 424
             //添加日志
413
-            that.model.incident.handlerLogs.forEach(v=>{
414
-              that.progressInfo.push({startTime:v.opTime,endTime:1,desc:v.opValue,userName:v.userName,activityName:'事件处理'});
415
-            })
416
-
425
+            that.model.incident.handlerLogs.forEach((v) => {
426
+              that.progressInfo.push({
427
+                startTime: v.opTime,
428
+                endTime: 1,
429
+                desc: v.opValue,
430
+                userName: v.userName,
431
+                activityName: "事件处理",
432
+              });
433
+            });
417 434
           }
418 435
           //处理数据
419
-          that.progressInfo.forEach((v)=>{
420
-            if(!v.endTime){
436
+          that.progressInfo.forEach((v) => {
437
+            if (!v.endTime) {
421 438
               v.endTime = 1;
422 439
             }
423 440
             v.startTime = new Date(v.startTime).getTime();
424
-          })
441
+          });
425 442
           var kaishi = that.progressInfo.shift();
426 443
           var jiedan = that.progressInfo.shift();
427
-          that.progressInfo.sort(function(o,c){
444
+          that.progressInfo.sort(function (o, c) {
428 445
             return c.startTime - o.startTime;
429 446
           });
430
-          that.progressInfo.length && (that.progressInfo[0].endTime = '');;
447
+          that.progressInfo.length && (that.progressInfo[0].endTime = "");
431 448
           that.progressInfo.push(jiedan);
432 449
           that.progressInfo.push(kaishi);
433
-          console.log(that.progressInfo)
434
-        //处理日志end
450
+          console.log(that.progressInfo);
451
+          //处理日志end
435 452
         });
436 453
     },
437 454
     //隐藏显示详情
@@ -444,7 +461,7 @@ export default {
444 461
     proHides() {
445 462
       if (!this.pro_hides) {
446 463
         $("#progressBox").animate({
447
-          height: $("#progressBox")[0].scrollHeight
464
+          height: $("#progressBox")[0].scrollHeight,
448 465
         });
449 466
       } else {
450 467
         $("#progressBox").animate({ height: "1.7rem" });
@@ -464,11 +481,11 @@ export default {
464 481
           scrollTop:
465 482
             $("#" + id).offset().top -
466 483
             $(".header")[0].offsetHeight -
467
-            $(".navBar")[0].offsetHeight
484
+            $(".navBar")[0].offsetHeight,
468 485
         },
469 486
         260
470 487
       );
471
-    }
488
+    },
472 489
   },
473 490
   created() {
474 491
     // seimin
@@ -481,10 +498,10 @@ export default {
481 498
       : JSON.parse(localStorage.getItem("modelData")).incident.id;
482 499
     this.getParamsData();
483 500
     this.getImgs();
484
-    if(this.incidentWithConsumable == 1){
501
+    if (this.incidentWithConsumable == 1) {
485 502
       this.getHcBySj();
486 503
     }
487
-  }
504
+  },
488 505
 };
489 506
 </script>
490 507
 <style lang="less" scoped>

+ 202 - 117
src/views/grabSheet.vue

@@ -1,19 +1,25 @@
1 1
 <template>
2 2
   <div class="grabSheet">
3 3
     <div class="conentBox">
4
-      <div class="conent" >
4
+      <div class="conent">
5 5
         <div class="header">处理方案</div>
6 6
         <div class="box" v-if="model.incident">
7 7
           <div class="navBar">
8 8
             <div class="fl">
9
-              <a :class="{active:actives=='info'}" href="javascript:;" @click="toInfo('info')">事件信息</a>
9
+              <a
10
+                :class="{ active: actives == 'info' }"
11
+                href="javascript:;"
12
+                @click="toInfo('info')"
13
+                >事件信息</a
14
+              >
10 15
             </div>
11 16
             <div class="fl">
12 17
               <a
13
-                :class="{active:actives=='progress'}"
18
+                :class="{ active: actives == 'progress' }"
14 19
                 href="javascript:;"
15 20
                 @click="toInfo('progress')"
16
-              >处理进度</a>
21
+                >处理进度</a
22
+              >
17 23
             </div>
18 24
           </div>
19 25
           <div class="label headtop" id="info">事件信息</div>
@@ -22,15 +28,17 @@
22 28
             <div class="head">
23 29
               <p>
24 30
                 <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
25
-                事件编号:{{model.incident?model.incident.incidentsign:''}}
26
-                <span
27
-                  class="fr btn daiqiangdan"
28
-                >待抢单</span>
31
+                事件编号:{{
32
+                  model.incident ? model.incident.incidentsign : ""
33
+                }}
34
+                <span class="fr btn daiqiangdan">待抢单</span>
29 35
               </p>
30 36
             </div>
31 37
             <p>
32 38
               <span class="fl">事件分类</span>
33
-              <span class="fr">{{model.incident.category.category||''}}</span>
39
+              <span class="fr">{{
40
+                model.incident.category.category || ""
41
+              }}</span>
34 42
             </p>
35 43
             <!-- <p>
36 44
               <span class="fl">事件主题</span>
@@ -38,33 +46,50 @@
38 46
             </p> -->
39 47
             <p class="desc">
40 48
               <span class="fl">事件描述</span>
41
-              <span class="fr grayFont" v-html="model.incident.description"></span>
49
+              <span
50
+                class="fr grayFont"
51
+                v-html="model.incident.description"
52
+              ></span>
42 53
             </p>
43 54
             <div class="shows" id="shows">
44
-               <p v-if="valConfig==2">
55
+              <p v-if="valConfig == 2">
45 56
                 <span class="fl">报修科室</span>
46
-                <span class="fr">{{model.incident.department?model.incident.department.dept:''}}</span>
57
+                <span class="fr">{{
58
+                  model.incident.department
59
+                    ? model.incident.department.dept
60
+                    : ""
61
+                }}</span>
62
+              </p>
63
+              <p v-if="valConfig == 1">
64
+                <span class="fl">报修人</span>
65
+                <span class="fr">{{ model.incident.requester.name }}</span>
66
+              </p>
67
+              <p v-if="valConfig == 2">
68
+                <span class="fl">联系人</span>
69
+                <span class="fr">{{ model.incident.contacts }}</span>
47 70
               </p>
48
-            <p v-if="valConfig==1">
49
-              <span class="fl">报修人</span>
50
-              <span class="fr">{{model.incident.requester.name}}</span>
51
-            </p>
52
-            <p v-if="valConfig==2">
53
-              <span class="fl">联系人</span>
54
-              <span class="fr">{{model.incident.contacts}}</span>
55
-            </p>
56 71
               <p>
57 72
                 <span class="fl">联系电话</span>
58
-                <span class="fr" v-if="!model.incident.contactsInformation"></span>
59
-                <span class="fr" v-if="model.incident.contactsInformation"><a :href="'tel:' + model.incident.contactsInformation"><i class="iconfont icon-shouji"></i>{{ model.incident.contactsInformation }}</a></span>
73
+                <span
74
+                  class="fr"
75
+                  v-if="!model.incident.contactsInformation"
76
+                ></span>
77
+                <span class="fr" v-if="model.incident.contactsInformation"
78
+                  ><a :href="'tel:' + model.incident.contactsInformation"
79
+                    ><i class="iconfont icon-shouji"></i
80
+                    >{{ model.incident.contactsInformation }}</a
81
+                  ></span
82
+                >
60 83
               </p>
61 84
               <p>
62 85
                 <span class="fl">联系地址</span>
63
-                <span class="fr">{{model.incident.houseNumber||''||''}}</span>
86
+                <span class="fr">{{
87
+                  model.incident.houseNumber || "" || ""
88
+                }}</span>
64 89
               </p>
65 90
               <p class="boeder_B">
66 91
                 <span class="fl">事件来源</span>
67
-                <span class="fr">{{model.incident.source.name||''}}</span>
92
+                <span class="fr">{{ model.incident.source.name || "" }}</span>
68 93
               </p>
69 94
               <!-- <p>
70 95
                 <span class="fl">影响度</span>
@@ -76,36 +101,57 @@
76 101
               </p> -->
77 102
               <p>
78 103
                 <span class="fl">受理人</span>
79
-                <span class="fr">{{model.incident.acceptUser?model.incident.acceptUser.name:''}}</span>
104
+                <span class="fr">{{
105
+                  model.incident.acceptUser
106
+                    ? model.incident.acceptUser.name
107
+                    : ""
108
+                }}</span>
80 109
               </p>
81 110
               <p>
82 111
                 <span class="fl">处理人</span>
83
-                <span class="fr">{{model.incident.handlerUser?model.incident.handlerUser.name:''}}</span>
112
+                <span class="fr">{{
113
+                  model.incident.handlerUser
114
+                    ? model.incident.handlerUser.name
115
+                    : ""
116
+                }}</span>
84 117
               </p>
85 118
               <p>
86 119
                 <span class="fl">处理人电话</span>
87 120
                 <span class="fr" v-if="!model.incident.handlerUser"></span>
88
-                <span class="fr" v-if="model.incident.handlerUser"><a :href="'tel:' + model.incident.handlerUser.phone"><i class="iconfont icon-shouji"></i>{{model.incident.handlerUser.phone}}</a></span>
121
+                <span class="fr" v-if="model.incident.handlerUser"
122
+                  ><a :href="'tel:' + model.incident.handlerUser.phone"
123
+                    ><i class="iconfont icon-shouji"></i
124
+                    >{{ model.incident.handlerUser.phone }}</a
125
+                  ></span
126
+                >
89 127
               </p>
90 128
               <p>
91 129
                 <span class="fl">优先级</span>
92
-                <span class="fr">{{model.incident.priority?model.incident.priority.name:''}}</span>
130
+                <span class="fr">{{
131
+                  model.incident.priority ? model.incident.priority.name : ""
132
+                }}</span>
93 133
               </p>
94 134
               <p>
95 135
                 <span class="fl">逾期响应时间</span>
96
-                <span class="fr">{{model.incident.overdueResponseDate||''}}</span>
136
+                <span class="fr">{{
137
+                  model.incident.overdueResponseDate || ""
138
+                }}</span>
97 139
               </p>
98 140
               <p>
99 141
                 <span class="fl">逾期解决时间</span>
100
-                <span class="fr">{{model.incident.overdueTime||''}}</span>
142
+                <span class="fr">{{ model.incident.overdueTime || "" }}</span>
101 143
               </p>
102 144
               <p>
103 145
                 <span class="fl">区域</span>
104
-                <span class="fr">{{model.incident.place?model.incident.place.area.area:'--'}}</span>
146
+                <span class="fr">{{
147
+                  model.incident.place ? model.incident.place.area.area : "--"
148
+                }}</span>
105 149
               </p>
106 150
               <p class="boeder_B">
107 151
                 <span class="fl">地点</span>
108
-                <span class="fr">{{model.incident.place?model.incident.place.place:'--'}}</span>
152
+                <span class="fr">{{
153
+                  model.incident.place ? model.incident.place.place : "--"
154
+                }}</span>
109 155
               </p>
110 156
               <div v-if="hcsjList.length">
111 157
                 <p>耗材</p>
@@ -116,54 +162,81 @@
116 162
                       <td>价格</td>
117 163
                       <td>数量</td>
118 164
                     </tr>
119
-                    <tr v-for="(item,i) in hcsjList" :key="i">
120
-                      <td>{{item.consumable.name}}</td>
121
-                      <td>{{item.extra1}}</td>
122
-                      <td>{{item.consumablesSum}}</td>
165
+                    <tr v-for="(item, i) in hcsjList" :key="i">
166
+                      <td>{{ item.consumable.name }}</td>
167
+                      <td>{{ item.extra1 }}</td>
168
+                      <td>{{ item.consumablesSum }}</td>
123 169
                     </tr>
124 170
                   </table>
125 171
                 </div>
126 172
               </div>
173
+              <p v-if="wxIncidentWithCmdb == 1">
174
+                <span class="fl">资产</span>
175
+                <span class="fr">{{ model.incident.assetId || "无" }}</span>
176
+              </p>
127 177
             </div>
128 178
             <p class="info_hide">
129
-              <span class="fl hide" @click="hides()" v-if="!item_hides">展开详情 >></span>
130
-              <span class="fl hide" @click="hides()" v-if="item_hides">隐藏详情<<</span>
179
+              <span class="fl hide" @click="hides()" v-if="!item_hides"
180
+                >展开详情 >></span
181
+              >
182
+              <span class="fl hide" @click="hides()" v-if="item_hides"
183
+                >隐藏详情<<</span
184
+              >
131 185
             </p>
132 186
             <div class="imgs-container" v-if="imgs.length">
133 187
               <div class="imgs-cont">
134
-                <img v-if='img.suffix=="jpeg"||img.suffix=="jpg"||img.suffix=="gif"||img.suffix=="png"||img.suffix=="svg"||img.suffix=="pdf"' :src="img.previewUrl" v-for="(img, index) in imgs" class="imgs">
188
+                <img
189
+                  v-if="
190
+                    img.suffix == 'jpeg' ||
191
+                    img.suffix == 'jpg' ||
192
+                    img.suffix == 'gif' ||
193
+                    img.suffix == 'png' ||
194
+                    img.suffix == 'svg' ||
195
+                    img.suffix == 'pdf'
196
+                  "
197
+                  :src="img.previewUrl"
198
+                  v-for="(img, index) in imgs"
199
+                  class="imgs"
200
+                />
135 201
                 <p v-else>
136
-                  <a :href='[img.previewUrl]'>{{img.name}}</a>
202
+                  <a :href="[img.previewUrl]">{{ img.name }}</a>
137 203
                 </p>
138 204
               </div>
139 205
             </div>
140 206
 
141 207
             <div class="label" id="progress">处理进度</div>
142
-            <div :class="{'progress':true,'progressHide':!pro_hides}" id="progressBox">
208
+            <div
209
+              :class="{ progress: true, progressHide: !pro_hides }"
210
+              id="progressBox"
211
+            >
143 212
               <div class="progress_info" v-for="item in progressInfo">
144
-                <div class="progress_info_L">{{item.activityName}}</div>
213
+                <div class="progress_info_L">{{ item.activityName }}</div>
145 214
                 <div class="progress_info_R">
146 215
                   <div class="time">
147 216
                     <i
148
-                      :class="{'iconfont':true, 'icon-icon_weizuo':item.endTime!='','icon-icon_zhengzaijinx':item.endTime=='' }"
217
+                      :class="{
218
+                        iconfont: true,
219
+                        'icon-icon_weizuo': item.endTime != '',
220
+                        'icon-icon_zhengzaijinx': item.endTime == '',
221
+                      }"
149 222
                     ></i>
150 223
                     <span class="text1">
151
-                      {{item.startTime | timeFormat("MM-dd HH:mm:ss")}}
224
+                      {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
152 225
                       <template v-if="item.userName">
153
-                        ,{{item.userName}}
226
+                        ,{{ item.userName }}
154 227
                       </template>
155
-                      </span>
228
+                    </span>
156 229
                   </div>
157
-                  <div
158
-                    :class="{'cont':true,'blue':item.endTime!='' }"
159
-                  >
230
+                  <div :class="{ cont: true, blue: item.endTime != '' }">
160 231
                     <p class="text2" v-if="item.desc" v-html="item.desc"></p>
161 232
                   </div>
162 233
                 </div>
163 234
               </div>
164 235
             </div>
165 236
             <p class="info_hide">
166
-              <span class="fl hide" @click="proHides()">{{pro_hides?'隐藏详情 <<':'展开详情 >>'}}</span>
237
+              <span class="fl hide" @click="proHides()">{{
238
+                pro_hides ? "隐藏详情 <<" : "展开详情 >>"
239
+              }}</span>
167 240
             </p>
168 241
           </div>
169 242
           <cube-form-group class="sub">
@@ -172,7 +245,7 @@
172 245
         </div>
173 246
       </div>
174 247
 
175
-        <load-ing v-if="!model.incident"></load-ing>
248
+      <load-ing v-if="!model.incident"></load-ing>
176 249
     </div>
177 250
   </div>
178 251
 </template>
@@ -181,22 +254,22 @@ import LoadIng from "./../views/loading.vue";
181 254
 export default {
182 255
   data() {
183 256
     return {
184
-      id:'',
257
+      id: "",
185 258
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
186 259
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
187 260
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
188 261
       wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
189
-      hcsjList:[],//绑定的耗材列表,展示
262
+      hcsjList: [], //绑定的耗材列表,展示
190 263
       selected: 1,
191 264
       options: [
192 265
         {
193 266
           label: "接单",
194
-          value: 1
267
+          value: 1,
195 268
         },
196 269
         {
197 270
           label: "重新指派",
198
-          value: 2
199
-        }
271
+          value: 2,
272
+        },
200 273
       ],
201 274
       resignComment: "", //重新指派原因
202 275
       item_hides: false,
@@ -205,8 +278,8 @@ export default {
205 278
       progressInfo: [], //处理进度
206 279
       imgs: [], //图片
207 280
       model: {}, //提交数据
208
-      jurisdiction:false,//是否有抢单权限
209
-      pro_hides:false,//展开/收起处理进度
281
+      jurisdiction: false, //是否有抢单权限
282
+      pro_hides: false, //展开/收起处理进度
210 283
     };
211 284
   },
212 285
   methods: {
@@ -217,7 +290,7 @@ export default {
217 290
           data: { type: 2, source: "1627", sourceId: this.id },
218 291
         })
219 292
         .then((result) => {
220
-          if(result.data.status == 200){
293
+          if (result.data.status == 200) {
221 294
             this.hcsjList = result.data.data;
222 295
           }
223 296
         });
@@ -225,29 +298,34 @@ export default {
225 298
     //   获取事件数据
226 299
     getParamsData() {
227 300
       var that = this;
228
-      var groups=[];
229
-      that.loginUser.group.forEach(element => {
301
+      var groups = [];
302
+      that.loginUser.group.forEach((element) => {
230 303
         groups.push(element.id);
231 304
       });
232
-      console.log(groups)
305
+      console.log(groups);
233 306
       that.$http
234 307
         .get(
235 308
           "/service/form/renderForm/receiveform/" +
236 309
             that.processInstanceId +
237 310
             "/" +
238
-            that.loginUser.id+'/'+that.id,
311
+            that.loginUser.id +
312
+            "/" +
313
+            that.id,
239 314
           {}
240 315
         )
241
-        .then(function(res) {
316
+        .then(function (res) {
242 317
           console.log(res.data);
243 318
           that.model = res.data.model;
244
-          for(var i =0;i<groups.length;i++){
245
-            if(groups[i]==that.model.incident.candidateGroups){
246
-              that.jurisdiction=true;
319
+          if (that.$route.params.data) {
320
+            that.model.incident.assetId = that.$route.params.data.assetId;
321
+          }
322
+          for (var i = 0; i < groups.length; i++) {
323
+            if (groups[i] == that.model.incident.candidateGroups) {
324
+              that.jurisdiction = true;
247 325
             }
248 326
           }
249 327
           //seimin
250
-          localStorage.setItem('modelData',JSON.stringify(that.model))
328
+          localStorage.setItem("modelData", JSON.stringify(that.model));
251 329
           that.getProgressInfo();
252 330
         });
253 331
     },
@@ -260,7 +338,7 @@ export default {
260 338
             that.processInstanceId,
261 339
           {}
262 340
         )
263
-        .then(function(res) {
341
+        .then(function (res) {
264 342
           console.log(res.data);
265 343
           that.imgs = res.data.data.splice(0, 3);
266 344
           console.log(that.imgs);
@@ -274,34 +352,39 @@ export default {
274 352
           "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
275 353
           {}
276 354
         )
277
-        .then(function(res) {
355
+        .then(function (res) {
278 356
           console.log(res.data);
279 357
           that.progressInfo = res.data.data;
280 358
           //处理日志startcaca
281
-          if(that.model.incident.handlerLogs){
359
+          if (that.model.incident.handlerLogs) {
282 360
             //添加日志
283
-            that.model.incident.handlerLogs.forEach(v=>{
284
-              that.progressInfo.push({startTime:v.opTime,endTime:1,desc:v.opValue,userName:v.userName,activityName:'事件处理'});
285
-            })
286
-
361
+            that.model.incident.handlerLogs.forEach((v) => {
362
+              that.progressInfo.push({
363
+                startTime: v.opTime,
364
+                endTime: 1,
365
+                desc: v.opValue,
366
+                userName: v.userName,
367
+                activityName: "事件处理",
368
+              });
369
+            });
287 370
           }
288 371
           //处理数据
289
-          that.progressInfo.forEach((v)=>{
290
-            if(!v.endTime){
372
+          that.progressInfo.forEach((v) => {
373
+            if (!v.endTime) {
291 374
               v.endTime = 1;
292 375
             }
293 376
             v.startTime = new Date(v.startTime).getTime();
294
-          })
377
+          });
295 378
           var kaishi = that.progressInfo.shift();
296 379
           var jiedan = that.progressInfo.shift();
297
-          that.progressInfo.sort(function(o,c){
380
+          that.progressInfo.sort(function (o, c) {
298 381
             return c.startTime - o.startTime;
299 382
           });
300
-          that.progressInfo.length && (that.progressInfo[0].endTime = '');;
383
+          that.progressInfo.length && (that.progressInfo[0].endTime = "");
301 384
           that.progressInfo.push(jiedan);
302 385
           that.progressInfo.push(kaishi);
303
-          console.log(that.progressInfo)
304
-        //处理日志end
386
+          console.log(that.progressInfo);
387
+          //处理日志end
305 388
         });
306 389
     },
307 390
     //隐藏显示详情
@@ -310,13 +393,15 @@ export default {
310 393
       $("#shows").slideToggle();
311 394
     },
312 395
     // 处理进度隐藏/展开
313
-    proHides(){
314
-      if(!this.pro_hides){
315
-        $('#progressBox').animate({'height':$('#progressBox')[0].scrollHeight})
316
-      }else{
317
-        $('#progressBox').animate({'height':'1.7rem'})
396
+    proHides() {
397
+      if (!this.pro_hides) {
398
+        $("#progressBox").animate({
399
+          height: $("#progressBox")[0].scrollHeight,
400
+        });
401
+      } else {
402
+        $("#progressBox").animate({ height: "1.7rem" });
318 403
       }
319
-      this.pro_hides=!this.pro_hides;
404
+      this.pro_hides = !this.pro_hides;
320 405
     },
321 406
     subVali() {
322 407
       //数据提交
@@ -326,7 +411,7 @@ export default {
326 411
           "service/bpm/bpm/claimAndCompletedTask/" + that.model.incident.taskId,
327 412
           { receive_code: "handler", userId: that.loginUser.id }
328 413
         )
329
-        .then(function(res) {
414
+        .then(function (res) {
330 415
           console.log(res.data);
331 416
           if (res.data.status == 200) {
332 417
             $("#fade").fadeIn();
@@ -340,10 +425,10 @@ export default {
340 425
                 icon: "cubeic-right",
341 426
                 onConfirm: (e, promptValue) => {
342 427
                   that.$router.push({ path: "/main" });
343
-                }
428
+                },
344 429
               })
345 430
               .show();
346
-            setTimeout(function() {
431
+            setTimeout(function () {
347 432
               $("#fade").fadeOut();
348 433
             }, 2000);
349 434
           }
@@ -357,15 +442,14 @@ export default {
357 442
           scrollTop:
358 443
             $("#" + id).offset().top -
359 444
             $(".header")[0].offsetHeight -
360
-            $(".navBar")[0].offsetHeight
445
+            $(".navBar")[0].offsetHeight,
361 446
         },
362 447
         260
363 448
       );
364
-    }
449
+    },
365 450
   },
366 451
   components: {
367 452
     LoadIng,
368
-
369 453
   },
370 454
   created() {
371 455
     // seimin
@@ -373,13 +457,15 @@ export default {
373 457
       ? this.$route.params.data.processInstanceId
374 458
       : JSON.parse(localStorage.getItem("modelData")).incident
375 459
           .processInstanceId;
376
-          this.id=this.$route.params.data?this.$route.params.data.id:JSON.parse(localStorage.getItem("modelData")).incident.id;
460
+    this.id = this.$route.params.data
461
+      ? this.$route.params.data.id
462
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
377 463
     this.getParamsData();
378 464
     this.getImgs();
379
-    if(this.incidentWithConsumable == 1){
465
+    if (this.incidentWithConsumable == 1) {
380 466
       this.getHcBySj();
381 467
     }
382
-  }
468
+  },
383 469
 };
384 470
 </script>
385 471
 <style lang="less" scoped>
@@ -408,10 +494,9 @@ export default {
408 494
     top: 0;
409 495
     z-index: 6;
410 496
   }
411
-  .box{
497
+  .box {
412 498
     min-height: 9.7rem;
413 499
     position: relative;
414
-
415 500
   }
416 501
   .navBar {
417 502
     width: 100%;
@@ -472,14 +557,14 @@ export default {
472 557
         border-bottom: 0.01rem solid #ccc;
473 558
       }
474 559
       p {
475
-          &.desc{
476
-            overflow: hidden;
477
-          }
478
-          .grayFont {
479
-            width: 75%;
480
-            text-align: right;
481
-            overflow-x: scroll;
482
-          }
560
+        &.desc {
561
+          overflow: hidden;
562
+        }
563
+        .grayFont {
564
+          width: 75%;
565
+          text-align: right;
566
+          overflow-x: scroll;
567
+        }
483 568
       }
484 569
       .bottom {
485 570
         overflow: hidden;
@@ -518,14 +603,14 @@ export default {
518 603
             color: #00559d;
519 604
           }
520 605
         }
521
-        .imgs-container{
522
-          a{
523
-            color:#03c !important;
524
-            &:visited{
606
+        .imgs-container {
607
+          a {
608
+            color: #03c !important;
609
+            &:visited {
525 610
               color: #551a8b !important;
526 611
             }
527 612
           }
528
-           img {
613
+          img {
529 614
             width: 1.5rem;
530 615
             height: 1.5rem;
531 616
             margin-right: 0.7rem;
@@ -537,17 +622,17 @@ export default {
537 622
         .progress {
538 623
           padding: 0.2rem 0.2rem;
539 624
           overflow: hidden;
540
-          transition-duration: .2s;
625
+          transition-duration: 0.2s;
541 626
           transition-timing-function: linear;
542
-          &.progressHide{
627
+          &.progressHide {
543 628
             height: 1.7rem;
544 629
           }
545 630
           .progress_info {
546 631
             overflow: hidden;
547 632
             margin-bottom: 0.1rem;
548
-            &:nth-last-child(1){
549
-              .cont{
550
-                border:none !important;
633
+            &:nth-last-child(1) {
634
+              .cont {
635
+                border: none !important;
551 636
               }
552 637
             }
553 638
             .progress_info_L {

+ 50 - 2
src/views/newIncident.vue

@@ -109,6 +109,13 @@
109 109
           :field="fields[10]"
110 110
           class="btn_plcaeholde"
111 111
         ></cube-form-item>
112
+        <div class="zc" v-if="wxIncidentWithCmdb == 1">
113
+          <cube-form-item
114
+            :field="fields[22]"
115
+            class="btn_plcaeholde zc-item"
116
+          ></cube-form-item>
117
+          <span class="icon dash dash-saoyisao zc-sao" @click="scan()"></span>
118
+        </div>
112 119
         <div class="label" id="handlerInfo">处理信息</div>
113 120
         <div class="handleRadio">
114 121
           <cube-radio-group
@@ -188,6 +195,7 @@ import DatePicker from "./../components/date-picker.vue";
188 195
 import CubeExtendPopup from "./../components/extend-popup.vue";
189 196
 import LoadIng from "./../views/loading.vue";
190 197
 import PrompTing from "./../views/prompting.vue";
198
+import { SM } from "./../http/http";
191 199
 // import host from "../request/host";
192 200
 // 知识库类型
193 201
 const solution = {
@@ -320,6 +328,8 @@ export default {
320 328
       },
321 329
       isUploading: false,
322 330
       loadShow: false,
331
+      incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
332
+      wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
323 333
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
324 334
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
325 335
       name: "",
@@ -345,6 +355,7 @@ export default {
345 355
         houseNumber: "", //详细地址
346 356
         description: "", //事件描述
347 357
         // bxcode: "",
358
+        assetId: "", //资产
348 359
         category: [],
349 360
         source: "", //事件来源
350 361
         title: "", //事件主题
@@ -692,7 +703,19 @@ export default {
692 703
           rules: {
693 704
             required: false
694 705
           }
695
-        }
706
+        },
707
+        {
708
+          type: "input",
709
+          modelKey: "assetId",
710
+          label: "资产:",
711
+          rules: {
712
+            required: false,
713
+          },
714
+          props: {
715
+            placeholder: "请选择资产",
716
+            disabled: true,
717
+          },
718
+        },
696 719
       ]
697 720
     };
698 721
   },
@@ -706,6 +729,12 @@ export default {
706 729
     // }
707 730
   },
708 731
   methods: {
732
+    //扫资产
733
+    scan(){
734
+      SM(this).then((ress1) => {
735
+        this.model.assetId = ress1;
736
+      })
737
+    },
709 738
     // 输入事件描述
710 739
     inpTitle() {
711 740
       this.model.title = this.incidentTitle;
@@ -922,7 +951,9 @@ export default {
922 951
       } else if (that.valConfig == 2) {
923 952
         that.modelData.incident.department = that.model.requester;
924 953
       }
925
-
954
+      if (that.wxIncidentWithCmdb == 1) {
955
+        that.modelData.incident.assetId = that.model.assetId;
956
+      }
926 957
       that.modelData.incident.area = { id: that.model.areaId };
927 958
       that.modelData.incident.place = { id: that.model.placeId };
928 959
       that.modelData.incident.category = {
@@ -1025,6 +1056,9 @@ export default {
1025 1056
       if (that.$route.params.data) {
1026 1057
         var inspecInfo = that.$route.params.data;
1027 1058
         // 巡检生成事件
1059
+        if (that.wxIncidentWithCmdb == 1) {
1060
+          that.model.assetId = inspecInfo.assetId;
1061
+        }
1028 1062
         console.log(that.$route.params.abnormal);
1029 1063
         that.model.contacts = inspecInfo.processUser.name;
1030 1064
         that.model.contactsInformation = inspecInfo.processUser.phone
@@ -1639,6 +1673,20 @@ export default {
1639 1673
 }
1640 1674
 </style>
1641 1675
 <style lang="less" scoped>
1676
+.zc{
1677
+  display:flex;
1678
+  position:relative;
1679
+  .zc-item{
1680
+    flex:7;
1681
+  }
1682
+  .zc-sao{
1683
+    flex:3;
1684
+    display:flex;
1685
+    justify-content:center;
1686
+    align-items:center;
1687
+    font-size:0.6rem;
1688
+  }
1689
+}
1642 1690
 .header {
1643 1691
   width: 100%;
1644 1692
   height: 0.88rem;

+ 246 - 120
src/views/order.vue

@@ -5,15 +5,27 @@
5 5
         <div class="header">处理方案</div>
6 6
         <div v-if="model.incident">
7 7
           <div class="navBar">
8
-            <div class="fl" :class="{'p50':model.incident.handlerUser.id!=loginUser.id}">
9
-              <a :class="{active:actives=='info'}" href="javascript:;" @click="toInfo('info')">事件信息</a>
8
+            <div
9
+              class="fl"
10
+              :class="{ p50: model.incident.handlerUser.id != loginUser.id }"
11
+            >
12
+              <a
13
+                :class="{ active: actives == 'info' }"
14
+                href="javascript:;"
15
+                @click="toInfo('info')"
16
+                >事件信息</a
17
+              >
10 18
             </div>
11
-            <div class="fl" :class="{'p50':model.incident.handlerUser.id!=loginUser.id}">
19
+            <div
20
+              class="fl"
21
+              :class="{ p50: model.incident.handlerUser.id != loginUser.id }"
22
+            >
12 23
               <a
13
-                :class="{active:actives=='progress'}"
24
+                :class="{ active: actives == 'progress' }"
14 25
                 href="javascript:;"
15 26
                 @click="toInfo('progress')"
16
-              >处理进度</a>
27
+                >处理进度</a
28
+              >
17 29
             </div>
18 30
             <!-- <div class="fl" :class="{'p50':model.incident.handlerUser.id!=loginUser.id}">
19 31
               <a
@@ -22,8 +34,16 @@
22 34
                 @click="toInfo('handlerLog')"
23 35
               >处理日志</a>
24 36
             </div> -->
25
-            <div class="fl" v-if="model.incident.handlerUser.id==loginUser.id">
26
-              <a :class="{active:actives=='jd'}" href="javascript:;" @click="toInfo('jd')">接单</a>
37
+            <div
38
+              class="fl"
39
+              v-if="model.incident.handlerUser.id == loginUser.id"
40
+            >
41
+              <a
42
+                :class="{ active: actives == 'jd' }"
43
+                href="javascript:;"
44
+                @click="toInfo('jd')"
45
+                >接单</a
46
+              >
27 47
             </div>
28 48
           </div>
29 49
           <div class="label headtop" id="info">事件信息</div>
@@ -32,15 +52,34 @@
32 52
             <div class="head">
33 53
               <p>
34 54
                 <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
35
-                事件单号:{{model.incident.incidentsign}}
55
+                事件单号:{{ model.incident.incidentsign }}
36 56
                 <span
37
-                  :class="{ 'fr':true,'btn':true, 'daijiedan':(model.incident.state.value=='pending'&&model.incident.handlerUser&&!model.incident.candidateGroups), 'daiqiangdan':(model.incident.state.value=='pending'&&!model.incident.handlerUser&&model.incident.candidateGroups)}"
38
-                >{{model.incident.state.value=='pending'?(model.incident.handlerUser&&!model.incident.candidateGroups?'待接单':'待抢单'):model.incident.state.name}}</span>
57
+                  :class="{
58
+                    fr: true,
59
+                    btn: true,
60
+                    daijiedan:
61
+                      model.incident.state.value == 'pending' &&
62
+                      model.incident.handlerUser &&
63
+                      !model.incident.candidateGroups,
64
+                    daiqiangdan:
65
+                      model.incident.state.value == 'pending' &&
66
+                      !model.incident.handlerUser &&
67
+                      model.incident.candidateGroups,
68
+                  }"
69
+                  >{{
70
+                    model.incident.state.value == "pending"
71
+                      ? model.incident.handlerUser &&
72
+                        !model.incident.candidateGroups
73
+                        ? "待接单"
74
+                        : "待抢单"
75
+                      : model.incident.state.name
76
+                  }}</span
77
+                >
39 78
               </p>
40 79
             </div>
41 80
             <p>
42 81
               <span class="fl">事件分类</span>
43
-              <span class="fr">{{model.incident.category.category}}</span>
82
+              <span class="fr">{{ model.incident.category.category }}</span>
44 83
             </p>
45 84
             <!-- <p>
46 85
               <span class="fl">事件主题</span>
@@ -48,33 +87,48 @@
48 87
             </p> -->
49 88
             <p class="desc">
50 89
               <span class="fl">事件描述</span>
51
-              <span class="grayFont fr" v-html="model.incident.description"></span>
90
+              <span
91
+                class="grayFont fr"
92
+                v-html="model.incident.description"
93
+              ></span>
52 94
             </p>
53 95
             <div class="shows" id="shows">
54
-              <p v-if="valConfig==2">
96
+              <p v-if="valConfig == 2">
55 97
                 <span class="fl">报修科室</span>
56
-                <span class="fr">{{model.incident.department?model.incident.department.dept:''}}</span>
98
+                <span class="fr">{{
99
+                  model.incident.department
100
+                    ? model.incident.department.dept
101
+                    : ""
102
+                }}</span>
103
+              </p>
104
+              <p v-if="valConfig == 1">
105
+                <span class="fl">报修人</span>
106
+                <span class="fr">{{ model.incident.requester.name }}</span>
107
+              </p>
108
+              <p v-if="valConfig == 2">
109
+                <span class="fl">联系人</span>
110
+                <span class="fr">{{ model.incident.contacts }}</span>
57 111
               </p>
58
-            <p v-if="valConfig==1">
59
-              <span class="fl">报修人</span>
60
-              <span class="fr">{{model.incident.requester.name}}</span>
61
-            </p>
62
-            <p v-if="valConfig==2">
63
-              <span class="fl">联系人</span>
64
-              <span class="fr">{{model.incident.contacts}}</span>
65
-            </p>
66 112
               <p>
67 113
                 <span class="fl">联系电话</span>
68
-                <span class="fr" v-if="!model.incident.contactsInformation"></span>
69
-                <span class="fr" v-if="model.incident.contactsInformation"><a :href="'tel:' + model.incident.contactsInformation"><i class="iconfont icon-shouji"></i>{{model.incident.contactsInformation}}</a></span>
114
+                <span
115
+                  class="fr"
116
+                  v-if="!model.incident.contactsInformation"
117
+                ></span>
118
+                <span class="fr" v-if="model.incident.contactsInformation"
119
+                  ><a :href="'tel:' + model.incident.contactsInformation"
120
+                    ><i class="iconfont icon-shouji"></i
121
+                    >{{ model.incident.contactsInformation }}</a
122
+                  ></span
123
+                >
70 124
               </p>
71 125
               <p>
72 126
                 <span class="fl">联系地址</span>
73
-                <span class="fr">{{model.incident.houseNumber||''}}</span>
127
+                <span class="fr">{{ model.incident.houseNumber || "" }}</span>
74 128
               </p>
75 129
               <p class="boeder_B">
76 130
                 <span class="fl">事件来源</span>
77
-                <span class="fr">{{model.incident.source.name}}</span>
131
+                <span class="fr">{{ model.incident.source.name }}</span>
78 132
               </p>
79 133
               <!-- <p>
80 134
                 <span class="fl">影响度</span>
@@ -86,36 +140,55 @@
86 140
               </p> -->
87 141
               <p>
88 142
                 <span class="fl">受理人</span>
89
-                <span class="fr">{{model.incident.acceptUser?model.incident.acceptUser.name:''}}</span>
143
+                <span class="fr">{{
144
+                  model.incident.acceptUser
145
+                    ? model.incident.acceptUser.name
146
+                    : ""
147
+                }}</span>
90 148
               </p>
91 149
               <p>
92 150
                 <span class="fl">处理人</span>
93
-                <span class="fr">{{model.incident.handlerUser?model.incident.handlerUser.name:''}}</span>
151
+                <span class="fr">{{
152
+                  model.incident.handlerUser
153
+                    ? model.incident.handlerUser.name
154
+                    : ""
155
+                }}</span>
94 156
               </p>
95 157
               <p>
96 158
                 <span class="fl">处理人电话</span>
97 159
                 <span class="fr" v-if="!model.incident.handlerUser"></span>
98
-                <span class="fr" v-if="model.incident.handlerUser"><a :href="'tel:' + model.incident.handlerUser.phone"><i class="iconfont icon-shouji"></i>{{model.incident.handlerUser.phone}}</a></span>
160
+                <span class="fr" v-if="model.incident.handlerUser"
161
+                  ><a :href="'tel:' + model.incident.handlerUser.phone"
162
+                    ><i class="iconfont icon-shouji"></i
163
+                    >{{ model.incident.handlerUser.phone }}</a
164
+                  ></span
165
+                >
99 166
               </p>
100 167
               <p>
101 168
                 <span class="fl">优先级</span>
102
-                <span class="fr">{{model.incident.priority?model.incident.priority.name:''}}</span>
169
+                <span class="fr">{{
170
+                  model.incident.priority ? model.incident.priority.name : ""
171
+                }}</span>
103 172
               </p>
104 173
               <p>
105 174
                 <span class="fl">逾期响应时间</span>
106
-                <span class="fr">{{model.incident.overdueResponseDate}}</span>
175
+                <span class="fr">{{ model.incident.overdueResponseDate }}</span>
107 176
               </p>
108 177
               <p>
109 178
                 <span class="fl">逾期解决时间</span>
110
-                <span class="fr">{{model.incident.overdueTime}}</span>
179
+                <span class="fr">{{ model.incident.overdueTime }}</span>
111 180
               </p>
112 181
               <p>
113 182
                 <span class="fl">区域</span>
114
-                <span class="fr">{{model.incident.place?model.incident.place.area.area:'--'}}</span>
183
+                <span class="fr">{{
184
+                  model.incident.place ? model.incident.place.area.area : "--"
185
+                }}</span>
115 186
               </p>
116 187
               <p class="boeder_B">
117 188
                 <span class="fl">地点</span>
118
-                <span class="fr">{{model.incident.place?model.incident.place.place:'--'}}</span>
189
+                <span class="fr">{{
190
+                  model.incident.place ? model.incident.place.place : "--"
191
+                }}</span>
119 192
               </p>
120 193
               <div v-if="hcsjList.length">
121 194
                 <p>耗材</p>
@@ -126,14 +199,18 @@
126 199
                       <td>价格</td>
127 200
                       <td>数量</td>
128 201
                     </tr>
129
-                    <tr v-for="(item,i) in hcsjList" :key="i">
130
-                      <td>{{item.consumable.name}}</td>
131
-                      <td>{{item.extra1}}</td>
132
-                      <td>{{item.consumablesSum}}</td>
202
+                    <tr v-for="(item, i) in hcsjList" :key="i">
203
+                      <td>{{ item.consumable.name }}</td>
204
+                      <td>{{ item.extra1 }}</td>
205
+                      <td>{{ item.consumablesSum }}</td>
133 206
                     </tr>
134 207
                   </table>
135 208
                 </div>
136 209
               </div>
210
+              <p v-if="wxIncidentWithCmdb == 1">
211
+                <span class="fl">资产</span>
212
+                <span class="fr">{{ model.incident.assetId || "无" }}</span>
213
+              </p>
137 214
               <!-- <p v-if="model.incident.synergeticReason">
138 215
                 <span class="fl" >协同原因</span>
139 216
                 <span class="fr">{{model.incident.synergeticReason}}</span>
@@ -148,44 +225,69 @@
148 225
               </p> -->
149 226
             </div>
150 227
             <p class="info_hide">
151
-              <span class="fl hide" @click="hides()" v-if="!item_hides">展开详情 >></span>
152
-              <span class="fl hide" @click="hides()" v-if="item_hides">隐藏详情 <<</span>
228
+              <span class="fl hide" @click="hides()" v-if="!item_hides"
229
+                >展开详情 >></span
230
+              >
231
+              <span class="fl hide" @click="hides()" v-if="item_hides"
232
+                >隐藏详情 <<</span
233
+              >
153 234
             </p>
154 235
             <div class="imgs-container" v-if="imgs.length">
155 236
               <div class="imgs-cont">
156
-                <img v-if='img.suffix=="jpeg"||img.suffix=="jpg"||img.suffix=="gif"||img.suffix=="png"||img.suffix=="svg"||img.suffix=="pdf"' :src="img.previewUrl" v-for="(img, index) in imgs" class="imgs">
237
+                <img
238
+                  v-if="
239
+                    img.suffix == 'jpeg' ||
240
+                    img.suffix == 'jpg' ||
241
+                    img.suffix == 'gif' ||
242
+                    img.suffix == 'png' ||
243
+                    img.suffix == 'svg' ||
244
+                    img.suffix == 'pdf'
245
+                  "
246
+                  :src="img.previewUrl"
247
+                  v-for="(img, index) in imgs"
248
+                  class="imgs"
249
+                />
157 250
                 <p v-else>
158
-                  <a :href='[img.previewUrl]'>{{img.name}}</a>
251
+                  <a :href="[img.previewUrl]">{{ img.name }}</a>
159 252
                 </p>
160 253
               </div>
161 254
             </div>
162 255
             <!-- <HandlerLog :data="model.incident.handlerLogs" id="handlerLog"></HandlerLog> -->
163 256
             <div class="label" id="progress">处理进度</div>
164
-            <div :class="{'progress':true,'progressHide':!pro_hides}" id="progressBox">
257
+            <div
258
+              :class="{ progress: true, progressHide: !pro_hides }"
259
+              id="progressBox"
260
+            >
165 261
               <div class="progress_info" v-for="item in progressInfo">
166
-                <div class="progress_info_L">{{item.activityName}}</div>
262
+                <div class="progress_info_L">{{ item.activityName }}</div>
167 263
                 <div class="progress_info_R">
168 264
                   <div class="time">
169 265
                     <i
170
-                      :class="{'iconfont':true, 'icon-icon_weizuo':item.endTime!='','icon-icon_zhengzaijinx':item.endTime=='' }"
266
+                      :class="{
267
+                        iconfont: true,
268
+                        'icon-icon_weizuo': item.endTime != '',
269
+                        'icon-icon_zhengzaijinx': item.endTime == '',
270
+                      }"
171 271
                     ></i>
172 272
                     <span class="text1">
173
-                      {{item.startTime | timeFormat("MM-dd HH:mm:ss")}}
273
+                      {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
174 274
                       <template v-if="item.userName">
175
-                        ,{{item.userName}}
275
+                        ,{{ item.userName }}
176 276
                       </template>
177
-                      </span>
277
+                    </span>
178 278
                   </div>
179
-                  <div :class="{'cont':true,'blue':item.endTime!='' }">
279
+                  <div :class="{ cont: true, blue: item.endTime != '' }">
180 280
                     <p class="text2" v-if="item.desc" v-html="item.desc"></p>
181 281
                   </div>
182 282
                 </div>
183 283
               </div>
184 284
             </div>
185 285
             <p class="info_hide">
186
-              <span class="fl hide" @click="proHides()">{{pro_hides?'隐藏详情 <<':'展开详情 >>'}}</span>
286
+              <span class="fl hide" @click="proHides()">{{
287
+                pro_hides ? "隐藏详情 <<" : "展开详情 >>"
288
+              }}</span>
187 289
             </p>
188
-            <div v-if="model.incident.handlerUser.id==loginUser.id">
290
+            <div v-if="model.incident.handlerUser.id == loginUser.id">
189 291
               <div class="label" id="jd">接单</div>
190 292
               <cube-radio-group
191 293
                 v-model="selected"
@@ -194,20 +296,29 @@
194 296
                 :hollow-style="true"
195 297
               />
196 298
 
197
-              <div class="txtLabel" v-if="selected==2">
299
+              <div class="txtLabel" v-if="selected == 2">
198 300
                 <div class="txt fl">
199
-                  <span style="color:red;">*</span> 重新指派理由:
301
+                  <span style="color: red">*</span> 重新指派理由:
200 302
                 </div>
201
-                <cube-textarea class="fl" v-model="resignComment" placeholder="重新指派理由"></cube-textarea>
303
+                <cube-textarea
304
+                  class="fl"
305
+                  v-model="resignComment"
306
+                  placeholder="重新指派理由"
307
+                ></cube-textarea>
202 308
               </div>
203 309
               <cube-form-group class="sub">
204
-                <cube-button type="submit" @click="subVali()">{{selected==1?'接单':'重新指派'}}</cube-button>
310
+                <cube-button type="submit" @click="subVali()">{{
311
+                  selected == 1 ? "接单" : "重新指派"
312
+                }}</cube-button>
205 313
               </cube-form-group>
206 314
             </div>
207 315
           </div>
208 316
         </div>
209 317
         <load-ing v-if="!model.incident"></load-ing>
210
-        <promp-ting :conents="promptingConent" :status="promptingStatus"></promp-ting>
318
+        <promp-ting
319
+          :conents="promptingConent"
320
+          :status="promptingStatus"
321
+        ></promp-ting>
211 322
       </div>
212 323
     </div>
213 324
   </div>
@@ -223,16 +334,16 @@ export default {
223 334
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
224 335
       wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
225 336
       selected: 1,
226
-      id:'',
337
+      id: "",
227 338
       options: [
228 339
         {
229 340
           label: "接单",
230
-          value: 1
341
+          value: 1,
231 342
         },
232 343
         {
233 344
           label: "重新指派",
234
-          value: 2
235
-        }
345
+          value: 2,
346
+        },
236 347
       ],
237 348
       promptingConent: "",
238 349
       promptingStatus: "",
@@ -243,8 +354,8 @@ export default {
243 354
       progressInfo: [], //处理进度
244 355
       imgs: [], //图片
245 356
       model: {}, //提交数据
246
-      pro_hides:false,//展开/收起处理进度
247
-      hcsjList:[],//绑定的耗材列表,展示
357
+      pro_hides: false, //展开/收起处理进度
358
+      hcsjList: [], //绑定的耗材列表,展示
248 359
     };
249 360
   },
250 361
   components: {
@@ -259,7 +370,7 @@ export default {
259 370
           data: { type: 2, source: "1627", sourceId: this.id },
260 371
         })
261 372
         .then((result) => {
262
-          if(result.data.status == 200){
373
+          if (result.data.status == 200) {
263 374
             this.hcsjList = result.data.data;
264 375
           }
265 376
         });
@@ -272,14 +383,19 @@ export default {
272 383
           "/service/form/renderForm/receiveform/" +
273 384
             that.processInstanceId +
274 385
             "/" +
275
-            that.loginUser.id+'/'+that.id,
386
+            that.loginUser.id +
387
+            "/" +
388
+            that.id,
276 389
           {}
277 390
         )
278
-        .then(function(res) {
391
+        .then(function (res) {
279 392
           console.log(res.data);
280 393
           that.model = res.data.model;
394
+          if (that.$route.params.data) {
395
+            that.model.incident.assetId = that.$route.params.data.assetId;
396
+          }
281 397
           //seimin
282
-          localStorage.setItem('modelData',JSON.stringify(that.model))
398
+          localStorage.setItem("modelData", JSON.stringify(that.model));
283 399
           that.getProgressInfo();
284 400
         });
285 401
     },
@@ -292,7 +408,7 @@ export default {
292 408
             that.processInstanceId,
293 409
           {}
294 410
         )
295
-        .then(function(res) {
411
+        .then(function (res) {
296 412
           console.log(res.data);
297 413
           that.imgs = res.data.data.splice(0, 3);
298 414
           console.log(that.imgs);
@@ -306,34 +422,39 @@ export default {
306 422
           "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
307 423
           {}
308 424
         )
309
-        .then(function(res) {
425
+        .then(function (res) {
310 426
           console.log(res.data);
311 427
           that.progressInfo = res.data.data;
312 428
           //处理日志startcaca
313
-          if(that.model.incident.handlerLogs){
429
+          if (that.model.incident.handlerLogs) {
314 430
             //添加日志
315
-            that.model.incident.handlerLogs.forEach(v=>{
316
-              that.progressInfo.push({startTime:v.opTime,endTime:1,desc:v.opValue,userName:v.userName,activityName:'事件处理'});
317
-            })
318
-
431
+            that.model.incident.handlerLogs.forEach((v) => {
432
+              that.progressInfo.push({
433
+                startTime: v.opTime,
434
+                endTime: 1,
435
+                desc: v.opValue,
436
+                userName: v.userName,
437
+                activityName: "事件处理",
438
+              });
439
+            });
319 440
           }
320 441
           //处理数据
321
-          that.progressInfo.forEach((v)=>{
322
-            if(!v.endTime){
442
+          that.progressInfo.forEach((v) => {
443
+            if (!v.endTime) {
323 444
               v.endTime = 1;
324 445
             }
325 446
             v.startTime = new Date(v.startTime).getTime();
326
-          })
447
+          });
327 448
           var kaishi = that.progressInfo.shift();
328 449
           var jiedan = that.progressInfo.shift();
329
-          that.progressInfo.sort(function(o,c){
450
+          that.progressInfo.sort(function (o, c) {
330 451
             return c.startTime - o.startTime;
331 452
           });
332
-          that.progressInfo.length && (that.progressInfo[0].endTime = '');
453
+          that.progressInfo.length && (that.progressInfo[0].endTime = "");
333 454
           that.progressInfo.push(jiedan);
334 455
           that.progressInfo.push(kaishi);
335
-          console.log(that.progressInfo)
336
-        //处理日志end
456
+          console.log(that.progressInfo);
457
+          //处理日志end
337 458
         });
338 459
     },
339 460
     //隐藏显示详情
@@ -342,13 +463,15 @@ export default {
342 463
       $("#shows").slideToggle();
343 464
     },
344 465
     // 处理进度隐藏/展开
345
-    proHides(){
346
-      if(!this.pro_hides){
347
-        $('#progressBox').animate({'height':$('#progressBox')[0].scrollHeight})
348
-      }else{
349
-        $('#progressBox').animate({'height':'1.7rem'})
466
+    proHides() {
467
+      if (!this.pro_hides) {
468
+        $("#progressBox").animate({
469
+          height: $("#progressBox")[0].scrollHeight,
470
+        });
471
+      } else {
472
+        $("#progressBox").animate({ height: "1.7rem" });
350 473
       }
351
-      this.pro_hides=!this.pro_hides;
474
+      this.pro_hides = !this.pro_hides;
352 475
     },
353 476
     //数据提交baba
354 477
     subVali() {
@@ -359,18 +482,18 @@ export default {
359 482
       if (that.selected == 1) {
360 483
         that.model.receive_code = "handler";
361 484
         that.model.loginUser = that.loginUser;
362
-        that.model.msgflag = '接单';
363
-        that.model.submit = '接单';
485
+        that.model.msgflag = "接单";
486
+        that.model.submit = "接单";
364 487
       } else if (that.selected == 2) {
365
-        that.model.msgflag = '重新指派';
366
-        that.model.submit = '重新指派';
488
+        that.model.msgflag = "重新指派";
489
+        that.model.submit = "重新指派";
367 490
         that.model.receive_code = "transferment";
368 491
         that.model.resignComment = that.resignComment;
369 492
         if (!that.resignComment) {
370 493
           $("#fade").fadeIn();
371 494
           that.promptingConent = "提交失败,请填写必填信息!";
372 495
           that.promptingStatus = false;
373
-          setTimeout(function() {
496
+          setTimeout(function () {
374 497
             $("#fade").fadeOut();
375 498
           }, 2000);
376 499
           return;
@@ -385,24 +508,25 @@ export default {
385 508
             that.loginUser.id,
386 509
           that.model
387 510
         )
388
-        .then(function(res) {
511
+        .then(function (res) {
389 512
           console.log(res.data);
390 513
           if (res.data) {
391 514
             $("#fade").fadeIn();
392
-            that.promptingConent = that.selected==1?"恭喜您,接单成功!":"恭喜您,重新指派成功!";
515
+            that.promptingConent =
516
+              that.selected == 1 ? "恭喜您,接单成功!" : "恭喜您,重新指派成功!";
393 517
             that.promptingStatus = true;
394 518
             that.dialog = that
395 519
               .$createDialog({
396 520
                 type: "alert",
397
-                title: that.selected==1?"接单成功":"重新指派成功",
521
+                title: that.selected == 1 ? "接单成功" : "重新指派成功",
398 522
                 content: "点击返回首页",
399 523
                 icon: "cubeic-right",
400 524
                 onConfirm: (e, promptValue) => {
401 525
                   that.$router.push({ path: "/main" });
402
-                }
526
+                },
403 527
               })
404 528
               .show();
405
-            setTimeout(function() {
529
+            setTimeout(function () {
406 530
               $("#fade").fadeOut();
407 531
             }, 2000);
408 532
           }
@@ -416,11 +540,11 @@ export default {
416 540
           scrollTop:
417 541
             $("#" + id).offset().top -
418 542
             $(".header")[0].offsetHeight -
419
-            $(".navBar")[0].offsetHeight
543
+            $(".navBar")[0].offsetHeight,
420 544
         },
421 545
         260
422 546
       );
423
-    }
547
+    },
424 548
   },
425 549
   created() {
426 550
     // seimin
@@ -428,13 +552,15 @@ export default {
428 552
       ? this.$route.params.data.processInstanceId
429 553
       : JSON.parse(localStorage.getItem("modelData")).incident
430 554
           .processInstanceId;
431
-          this.id=this.$route.params.data?this.$route.params.data.id:JSON.parse(localStorage.getItem("modelData")).incident.id;
555
+    this.id = this.$route.params.data
556
+      ? this.$route.params.data.id
557
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
432 558
     this.getParamsData();
433 559
     this.getImgs();
434
-    if(this.incidentWithConsumable == 1){
560
+    if (this.incidentWithConsumable == 1) {
435 561
       this.getHcBySj();
436 562
     }
437
-  }
563
+  },
438 564
 };
439 565
 </script>
440 566
 <style lang="less" scoped>
@@ -475,9 +601,9 @@ i.iconfont.blue {
475 601
     div {
476 602
       width: 33.33%;
477 603
       text-align: center;
478
-      &.p50{
479
-        width: 49.99% ;
480
-    }
604
+      &.p50 {
605
+        width: 49.99%;
606
+      }
481 607
       a {
482 608
         display: inline-block;
483 609
         height: 0.9rem;
@@ -525,15 +651,15 @@ i.iconfont.blue {
525 651
       .boeder_B {
526 652
         border-bottom: 0.01rem solid #ccc;
527 653
       }
528
-        p {
529
-          &.desc{
530
-            overflow: hidden;
531
-          }
532
-          .grayFont {
533
-            width: 75%;
534
-            text-align: right;
535
-            overflow-x: scroll;
536
-          }
654
+      p {
655
+        &.desc {
656
+          overflow: hidden;
657
+        }
658
+        .grayFont {
659
+          width: 75%;
660
+          text-align: right;
661
+          overflow-x: scroll;
662
+        }
537 663
       }
538 664
       .bottom {
539 665
         overflow: hidden;
@@ -571,14 +697,14 @@ i.iconfont.blue {
571 697
             color: #00559d;
572 698
           }
573 699
         }
574
-        .imgs-container{
575
-          a{
576
-            color:#03c !important;
577
-            &:visited{
700
+        .imgs-container {
701
+          a {
702
+            color: #03c !important;
703
+            &:visited {
578 704
               color: #551a8b !important;
579 705
             }
580 706
           }
581
-           img {
707
+          img {
582 708
             width: 1.5rem;
583 709
             height: 1.5rem;
584 710
             margin-right: 0.7rem;
@@ -590,9 +716,9 @@ i.iconfont.blue {
590 716
         .progress {
591 717
           padding: 0.2rem 0.2rem;
592 718
           overflow: hidden;
593
-          transition-duration: .2s;
719
+          transition-duration: 0.2s;
594 720
           transition-timing-function: linear;
595
-          &.progressHide{
721
+          &.progressHide {
596 722
             height: 1.7rem;
597 723
           }
598 724
           .progress_info {

+ 14 - 7
src/views/processing.vue

@@ -189,14 +189,18 @@
189 189
                     <td>价格</td>
190 190
                     <td>数量</td>
191 191
                   </tr>
192
-                  <tr v-for="(item,i) in hcsjList" :key="i">
193
-                    <td>{{item.consumable.name}}</td>
194
-                    <td>{{item.extra1}}</td>
195
-                    <td>{{item.consumablesSum}}</td>
192
+                  <tr v-for="(item, i) in hcsjList" :key="i">
193
+                    <td>{{ item.consumable.name }}</td>
194
+                    <td>{{ item.extra1 }}</td>
195
+                    <td>{{ item.consumablesSum }}</td>
196 196
                   </tr>
197 197
                 </table>
198 198
               </div>
199 199
             </div>
200
+            <p v-if="wxIncidentWithCmdb == 1">
201
+              <span class="fl">资产</span>
202
+              <span class="fr">{{ modelData.incident.assetId || "无" }}</span>
203
+            </p>
200 204
 
201 205
             <!-- <p v-if="modelData.incident.synergeticReason">
202 206
                 <span class="fl" >协同原因</span>
@@ -904,7 +908,7 @@ export default {
904 908
       hcList: [], //绑定的耗材列表
905 909
       idMock: 0, //自增id,mock
906 910
       hcs: [], //耗材列表
907
-      hcsjList:[],//绑定的耗材列表,展示
911
+      hcsjList: [], //绑定的耗材列表,展示
908 912
     };
909 913
   },
910 914
   watch: {
@@ -1021,6 +1025,9 @@ export default {
1021 1025
         .then(function (res) {
1022 1026
           console.log(res.data, 666);
1023 1027
           that.modelData = res.data.model;
1028
+          if (that.$route.params.data) {
1029
+            that.modelData.incident.assetId = that.$route.params.data.assetId;
1030
+          }
1024 1031
           //seimin
1025 1032
           localStorage.setItem("modelData", JSON.stringify(that.modelData));
1026 1033
         });
@@ -1832,7 +1839,7 @@ export default {
1832 1839
           data: { type: 2, source: "1627", sourceId: this.id },
1833 1840
         })
1834 1841
         .then((result) => {
1835
-          if(result.data.status == 200){
1842
+          if (result.data.status == 200) {
1836 1843
             this.hcsjList = result.data.data;
1837 1844
           }
1838 1845
         });
@@ -1850,7 +1857,7 @@ export default {
1850 1857
     this.action.target += this.processInstanceId;
1851 1858
     this.getParamsData();
1852 1859
     this.getHcs();
1853
-    if(this.incidentWithConsumable == 1){
1860
+    if (this.incidentWithConsumable == 1) {
1854 1861
       this.getHcBySj();
1855 1862
     }
1856 1863
     this.getImgs();

+ 82 - 64
src/views/solved.vue

@@ -60,7 +60,7 @@
60 60
           <p class="desc">
61 61
             <span class="fl">事件描述</span>
62 62
             <span
63
-              class="grayFont fr "
63
+              class="grayFont fr"
64 64
               v-html="model.incident.description"
65 65
             ></span>
66 66
           </p>
@@ -125,7 +125,12 @@
125 125
             <p>
126 126
               <span class="fl">处理人电话</span>
127 127
               <span class="fr" v-if="!model.incident.handlerUser"></span>
128
-              <span class="fr" v-if="model.incident.handlerUser"><a :href="'tel:' + model.incident.handlerUser.phone"><i class="iconfont icon-shouji"></i>{{model.incident.handlerUser.phone}}</a></span>
128
+              <span class="fr" v-if="model.incident.handlerUser"
129
+                ><a :href="'tel:' + model.incident.handlerUser.phone"
130
+                  ><i class="iconfont icon-shouji"></i
131
+                  >{{ model.incident.handlerUser.phone }}</a
132
+                ></span
133
+              >
129 134
             </p>
130 135
             <p>
131 136
               <span class="fl">优先级</span>
@@ -154,22 +159,26 @@
154 159
               }}</span>
155 160
             </p>
156 161
             <div v-if="hcsjList.length">
157
-                <p>耗材</p>
158
-                <div class="hcTable">
159
-                  <table>
160
-                    <tr>
161
-                      <td>耗材名称</td>
162
-                      <td>价格</td>
163
-                      <td>数量</td>
164
-                    </tr>
165
-                    <tr v-for="(item,i) in hcsjList" :key="i">
166
-                      <td>{{item.consumable.name}}</td>
167
-                      <td>{{item.extra1}}</td>
168
-                      <td>{{item.consumablesSum}}</td>
169
-                    </tr>
170
-                  </table>
171
-                </div>
162
+              <p>耗材</p>
163
+              <div class="hcTable">
164
+                <table>
165
+                  <tr>
166
+                    <td>耗材名称</td>
167
+                    <td>价格</td>
168
+                    <td>数量</td>
169
+                  </tr>
170
+                  <tr v-for="(item, i) in hcsjList" :key="i">
171
+                    <td>{{ item.consumable.name }}</td>
172
+                    <td>{{ item.extra1 }}</td>
173
+                    <td>{{ item.consumablesSum }}</td>
174
+                  </tr>
175
+                </table>
172 176
               </div>
177
+            </div>
178
+            <p v-if="wxIncidentWithCmdb == 1">
179
+              <span class="fl">资产</span>
180
+              <span class="fr">{{ model.incident.assetId || "无" }}</span>
181
+            </p>
173 182
           </div>
174 183
           <p class="info_hide">
175 184
             <span class="fl hide" @click="hides()" v-if="!item_hides"
@@ -184,11 +193,11 @@
184 193
               <img
185 194
                 v-if="
186 195
                   img.suffix == 'jpeg' ||
187
-                    img.suffix == 'jpg' ||
188
-                    img.suffix == 'gif' ||
189
-                    img.suffix == 'png' ||
190
-                    img.suffix == 'svg' ||
191
-                    img.suffix == 'pdf'
196
+                  img.suffix == 'jpg' ||
197
+                  img.suffix == 'gif' ||
198
+                  img.suffix == 'png' ||
199
+                  img.suffix == 'svg' ||
200
+                  img.suffix == 'pdf'
192 201
                 "
193 202
                 :src="img.previewUrl"
194 203
                 v-for="(img, index) in imgs"
@@ -270,13 +279,13 @@
270 279
                     :class="{
271 280
                       iconfont: true,
272 281
                       'icon-icon_weizuo': item.endTime != '',
273
-                      'icon-icon_zhengzaijinx': item.endTime == ''
282
+                      'icon-icon_zhengzaijinx': item.endTime == '',
274 283
                     }"
275 284
                   ></i>
276 285
                   <span class="text1">
277 286
                     {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
278 287
                     <template v-if="item.userName">
279
-                      ,{{item.userName}}
288
+                      ,{{ item.userName }}
280 289
                     </template>
281 290
                   </span>
282 291
                 </div>
@@ -298,7 +307,7 @@
298 307
           >
299 308
             <div class="txtLabel">
300 309
               <div class="txt fl handler">
301
-                <span style="color:red;">*</span>是否已解决:
310
+                <span style="color: red">*</span>是否已解决:
302 311
               </div>
303 312
               <cube-select
304 313
                 class="selectGroup fl"
@@ -308,7 +317,7 @@
308 317
             </div>
309 318
             <div class="txtLabel">
310 319
               <div class="txt fl">
311
-                <span style="color:red;">*</span> 结果类型:
320
+                <span style="color: red">*</span> 结果类型:
312 321
               </div>
313 322
               <cube-select
314 323
                 class="selectGroup fl"
@@ -349,18 +358,18 @@ export default {
349 358
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
350 359
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
351 360
       wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
352
-      hcsjList:[],//绑定的耗材列表,展示
361
+      hcsjList: [], //绑定的耗材列表,展示
353 362
       selected: 1,
354 363
       isclose: "close", //是否已解决
355 364
       iscloseArr: [
356 365
         {
357 366
           text: "已解决",
358
-          value: "close"
367
+          value: "close",
359 368
         },
360 369
         {
361 370
           text: "未解决",
362
-          value: "notsolved"
363
-        }
371
+          value: "notsolved",
372
+        },
364 373
       ],
365 374
       handleResult: "", //结果类型
366 375
       handleResultArr: [], //结果类型
@@ -374,7 +383,7 @@ export default {
374 383
       processInstanceId: "",
375 384
       progressInfo: [], //处理进度
376 385
       imgs: [], //图片
377
-      model: {} //提交数据
386
+      model: {}, //提交数据
378 387
     };
379 388
   },
380 389
   components: {
@@ -389,7 +398,7 @@ export default {
389 398
           data: { type: 2, source: "1627", sourceId: this.id },
390 399
         })
391 400
         .then((result) => {
392
-          if(result.data.status == 200){
401
+          if (result.data.status == 200) {
393 402
             this.hcsjList = result.data.data;
394 403
           }
395 404
         });
@@ -407,10 +416,13 @@ export default {
407 416
             that.id,
408 417
           {}
409 418
         )
410
-        .then(function(res) {
419
+        .then(function (res) {
411 420
           console.log(res.data);
412 421
           that.model = res.data.model;
413 422
           that.model.msgflag = "已解决";
423
+          if (that.$route.params.data) {
424
+            that.model.incident.assetId = that.$route.params.data.assetId;
425
+          }
414 426
           //seimin
415 427
           localStorage.setItem("modelData", JSON.stringify(that.model));
416 428
           that.getProgressInfo();
@@ -425,7 +437,7 @@ export default {
425 437
             that.processInstanceId,
426 438
           {}
427 439
         )
428
-        .then(function(res) {
440
+        .then(function (res) {
429 441
           console.log(res.data);
430 442
           that.imgs = res.data.data.splice(0, 3);
431 443
           console.log(that.imgs);
@@ -439,33 +451,39 @@ export default {
439 451
           "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
440 452
           {}
441 453
         )
442
-        .then(function(res) {
454
+        .then(function (res) {
443 455
           console.log(res.data);
444 456
           that.progressInfo = res.data.data;
445 457
           //处理日志startcaca
446
-          if(that.model.incident.handlerLogs){
458
+          if (that.model.incident.handlerLogs) {
447 459
             //添加日志
448
-            that.model.incident.handlerLogs.forEach(v=>{
449
-              that.progressInfo.push({startTime:v.opTime,endTime:1,desc:v.opValue,userName:v.userName,activityName:'事件处理'});
450
-            })
460
+            that.model.incident.handlerLogs.forEach((v) => {
461
+              that.progressInfo.push({
462
+                startTime: v.opTime,
463
+                endTime: 1,
464
+                desc: v.opValue,
465
+                userName: v.userName,
466
+                activityName: "事件处理",
467
+              });
468
+            });
451 469
           }
452 470
           //处理数据
453
-          that.progressInfo.forEach((v)=>{
454
-            if(!v.endTime){
471
+          that.progressInfo.forEach((v) => {
472
+            if (!v.endTime) {
455 473
               v.endTime = 1;
456 474
             }
457 475
             v.startTime = new Date(v.startTime).getTime();
458
-          })
476
+          });
459 477
           var kaishi = that.progressInfo.shift();
460 478
           var jiedan = that.progressInfo.shift();
461
-          that.progressInfo.sort(function(o,c){
479
+          that.progressInfo.sort(function (o, c) {
462 480
             return c.startTime - o.startTime;
463 481
           });
464
-          that.progressInfo.length && (that.progressInfo[0].endTime = '');;
482
+          that.progressInfo.length && (that.progressInfo[0].endTime = "");
465 483
           that.progressInfo.push(jiedan);
466 484
           that.progressInfo.push(kaishi);
467
-          console.log(that.progressInfo)
468
-        //处理日志end
485
+          console.log(that.progressInfo);
486
+          //处理日志end
469 487
         });
470 488
     },
471 489
     // 获取结果类型
@@ -474,18 +492,18 @@ export default {
474 492
       that.$http
475 493
         .post("/service/common/common/getDictionary", {
476 494
           type: "list",
477
-          key: "incident_handleresult"
495
+          key: "incident_handleresult",
478 496
         })
479
-        .then(function(res) {
497
+        .then(function (res) {
480 498
           console.log(res.data);
481 499
           // that.handleResultArr = res.data;
482
-          res.data.forEach(function(v, i) {
500
+          res.data.forEach(function (v, i) {
483 501
             that.handleResultArr.push({
484 502
               text: v.name,
485
-              value: v.id
503
+              value: v.id,
486 504
             });
487 505
           });
488
-          if(that.handleResultArr.length){
506
+          if (that.handleResultArr.length) {
489 507
             that.handleResult = that.handleResultArr[0].value;
490 508
           }
491 509
         });
@@ -496,15 +514,15 @@ export default {
496 514
       that.$http
497 515
         .post("/service/common/common/getDictionary", {
498 516
           type: "list",
499
-          key: "incident_degree"
517
+          key: "incident_degree",
500 518
         })
501
-        .then(function(res) {
519
+        .then(function (res) {
502 520
           console.log(res.data);
503 521
           // that.degreeArr = res.data;
504
-          res.data.forEach(function(v, i) {
522
+          res.data.forEach(function (v, i) {
505 523
             that.degreeArr.push({
506 524
               text: v.name,
507
-              value: v.id
525
+              value: v.id,
508 526
             });
509 527
           });
510 528
         });
@@ -523,7 +541,7 @@ export default {
523 541
     proHides() {
524 542
       if (!this.pro_hides) {
525 543
         $("#progressBox").animate({
526
-          height: $("#progressBox")[0].scrollHeight
544
+          height: $("#progressBox")[0].scrollHeight,
527 545
         });
528 546
       } else {
529 547
         $("#progressBox").animate({ height: "1.7rem" });
@@ -538,7 +556,7 @@ export default {
538 556
           scrollTop:
539 557
             $("#" + id).offset().top -
540 558
             $(".header")[0].offsetHeight -
541
-            $(".navBar")[0].offsetHeight
559
+            $(".navBar")[0].offsetHeight,
542 560
         },
543 561
         260
544 562
       );
@@ -563,7 +581,7 @@ export default {
563 581
         $("#fade").fadeIn();
564 582
         that.promptingConent = "提交失败,请填写必填信息!";
565 583
         that.promptingStatus = false;
566
-        setTimeout(function() {
584
+        setTimeout(function () {
567 585
           $("#fade").fadeOut();
568 586
         }, 2000);
569 587
       }
@@ -576,7 +594,7 @@ export default {
576 594
             that.loginUser.id,
577 595
           that.model
578 596
         )
579
-        .then(function(res) {
597
+        .then(function (res) {
580 598
           if (res.data.status == 200) {
581 599
             $("#fade").fadeIn();
582 600
             that.promptingConent = "恭喜您,提交成功!";
@@ -589,15 +607,15 @@ export default {
589 607
                 icon: "cubeic-right",
590 608
                 onConfirm: (e, promptValue) => {
591 609
                   that.$router.push({ path: "/main" });
592
-                }
610
+                },
593 611
               })
594 612
               .show();
595
-            setTimeout(function() {
613
+            setTimeout(function () {
596 614
               $("#fade").fadeOut();
597 615
             }, 2000);
598 616
           }
599 617
         });
600
-    }
618
+    },
601 619
   },
602 620
   created() {
603 621
     // seimin
@@ -611,12 +629,12 @@ export default {
611 629
     this.getParamsData();
612 630
 
613 631
     this.getImgs();
614
-    if(this.incidentWithConsumable == 1){
632
+    if (this.incidentWithConsumable == 1) {
615 633
       this.getHcBySj();
616 634
     }
617 635
     this.getHandlerRes();
618 636
     this.getDegree();
619
-  }
637
+  },
620 638
 };
621 639
 </script>
622 640
 <style lang="less" scoped>