浏览代码

优化指派

seimin 1 年之前
父节点
当前提交
9cfd228728
共有 5 个文件被更改,包括 85 次插入14 次删除
  1. 8 0
      config/index.js
  2. 4 0
      src/App.vue
  3. 20 2
      src/components/showModel/showModel.vue
  4. 27 6
      src/views/IncidentNewList.vue
  5. 26 6
      src/views/incidentList.vue

+ 8 - 0
config/index.js

@@ -14,6 +14,14 @@ module.exports = {
14
     proxyTable: {
14
     proxyTable: {
15
       '/service': {//自定义名字,代表的是以下target中的内容
15
       '/service': {//自定义名字,代表的是以下target中的内容
16
         // target: host.host+'/service/',//微信
16
         // target: host.host+'/service/',//微信
17
+        target: 'http://192.168.4.240',//微信
18
+        changeOrigin: true,//是否允许跨域
19
+        // pathRewrite: {
20
+        //   '^/service': ''
21
+        // }
22
+      },
23
+      '/file': {//自定义名字,代表的是以下target中的内容
24
+        // target: host.host+'/service/',//微信
17
         target: 'http://192.168.3.111',//微信
25
         target: 'http://192.168.3.111',//微信
18
         changeOrigin: true,//是否允许跨域
26
         changeOrigin: true,//是否允许跨域
19
         // pathRewrite: {
27
         // pathRewrite: {

+ 4 - 0
src/App.vue

@@ -13,6 +13,10 @@ export default {
13
 </script>
13
 </script>
14
 
14
 
15
 <style lang='less'>
15
 <style lang='less'>
16
+.cube-switch .cube-switch-input:checked + .cube-switch-ui{
17
+  border-color: #005395!important;
18
+  background-color: #005395!important;
19
+}
16
 .cube-picker-wheel-item{
20
 .cube-picker-wheel-item{
17
   font-size: 12px!important;
21
   font-size: 12px!important;
18
 }
22
 }

+ 20 - 2
src/components/showModel/showModel.vue

@@ -39,11 +39,12 @@
39
             @change="changeGroup($event)"
39
             @change="changeGroup($event)"
40
             style="margin-top:0.2rem;"
40
             style="margin-top:0.2rem;"
41
           ></cube-select>
41
           ></cube-select>
42
+          <cube-switch v-model="isRadioUser" style="margin-top:0.2rem;" @input="changeRadioUser" v-if="isShowRadioUser">是否指派到人</cube-switch>
42
           <cube-select
43
           <cube-select
43
             v-model="selectUserId"
44
             v-model="selectUserId"
44
             :options="selectDataUser"
45
             :options="selectDataUser"
45
             placeholder="请选择指派对象"
46
             placeholder="请选择指派对象"
46
-            style="margin-top:0.2rem;"
47
+            style="margin-top:0.2rem;" v-if="isRadioUser"
47
           ></cube-select>
48
           ></cube-select>
48
         </div>
49
         </div>
49
         <div v-if="textName === 'textarea'">
50
         <div v-if="textName === 'textarea'">
@@ -124,6 +125,8 @@
124
 export default {
125
 export default {
125
   data() {
126
   data() {
126
     return {
127
     return {
128
+      isShowRadioUser: false,
129
+      isRadioUser: false,
127
       consumablesNum: this.data ? (this.data.consumablesNum ? this.data.consumablesNum : 1) : 1,
130
       consumablesNum: this.data ? (this.data.consumablesNum ? this.data.consumablesNum : 1) : 1,
128
       workHourNum2: this.data ? (this.data.workHourNum2 ? this.data.workHourNum2 : 1) : 1,
131
       workHourNum2: this.data ? (this.data.workHourNum2 ? this.data.workHourNum2 : 1) : 1,
129
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
132
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
@@ -218,6 +221,11 @@ export default {
218
       type: String,
221
       type: String,
219
       default: ""
222
       default: ""
220
     },
223
     },
224
+    // 下拉框(user)
225
+    dataObj: {
226
+      type: Object,
227
+      default: () => {}
228
+    },
221
     // 文本块(维修记录)
229
     // 文本块(维修记录)
222
     textName: {
230
     textName: {
223
       type: String,
231
       type: String,
@@ -234,6 +242,9 @@ export default {
234
     }
242
     }
235
   },
243
   },
236
   methods: {
244
   methods: {
245
+    changeRadioUser(){
246
+      this.selectUserId = undefined;
247
+    },
237
     copyTo(value){
248
     copyTo(value){
238
       this.textareaData += value;
249
       this.textareaData += value;
239
     },
250
     },
@@ -389,7 +400,7 @@ export default {
389
     // 确定
400
     // 确定
390
     ok() {
401
     ok() {
391
       if (this.selectName === "user") {
402
       if (this.selectName === "user") {
392
-        this.$emit("ok", this.selectUserId);
403
+        this.$emit("ok", {selectUserId: this.selectUserId, isRadioUser: this.isRadioUser, selectGroupId: this.selectGroupId});
393
       } else if (this.selectName === "hc_add" || this.selectName === "hc_edit") {
404
       } else if (this.selectName === "hc_add" || this.selectName === "hc_edit") {
394
         this.$emit("ok", {hc: this.data.hc, consumablesNum:this.consumablesNum});
405
         this.$emit("ok", {hc: this.data.hc, consumablesNum:this.consumablesNum});
395
       } else if (this.selectName === "gs_edit") {
406
       } else if (this.selectName === "gs_edit") {
@@ -429,6 +440,13 @@ export default {
429
       this.getZpBranch();
440
       this.getZpBranch();
430
       // this.getZpGroup();
441
       // this.getZpGroup();
431
       // this.getZpUser();
442
       // this.getZpUser();
443
+      if(this.dataObj.state.id == 1544){
444
+        this.isShowRadioUser = false;
445
+        this.isRadioUser = true;
446
+      }else{
447
+        this.isShowRadioUser = true;
448
+        this.isRadioUser = false;
449
+      }
432
     }
450
     }
433
     if (this.textName === "textarea") {
451
     if (this.textName === "textarea") {
434
       this.getLogs();
452
       this.getLogs();

+ 27 - 6
src/views/IncidentNewList.vue

@@ -180,6 +180,7 @@
180
       @cancel="cancel"
180
       @cancel="cancel"
181
       :operate="models.operate"
181
       :operate="models.operate"
182
       selectName="user"
182
       selectName="user"
183
+      :dataObj="modelsData"
183
     ></showModel>
184
     ></showModel>
184
     <!-- 新增维修记录弹窗 -->
185
     <!-- 新增维修记录弹窗 -->
185
     <showModel
186
     <showModel
@@ -418,9 +419,10 @@ export default {
418
       this.audioMask=false;
419
       this.audioMask=false;
419
     },
420
     },
420
     //确定
421
     //确定
421
-    ok(selectUserId) {
422
-      console.log(selectUserId);
423
-      if (!selectUserId) {
422
+    ok(data) {
423
+      let {selectUserId, isRadioUser, selectGroupId} = data;
424
+      console.log(data);
425
+      if (isRadioUser && !selectUserId) {
424
         this.$createDialog({
426
         this.$createDialog({
425
           type: "alert",
427
           type: "alert",
426
           title: "请选择指派对象",
428
           title: "请选择指派对象",
@@ -428,19 +430,37 @@ export default {
428
         }).show();
430
         }).show();
429
         return;
431
         return;
430
       }
432
       }
433
+      if (!isRadioUser && !selectGroupId) {
434
+        this.$createDialog({
435
+          type: "alert",
436
+          title: "请选择工作组",
437
+          icon: "cubeic-warn"
438
+        }).show();
439
+        return;
440
+      }
431
       const toast = this.$createToast({
441
       const toast = this.$createToast({
432
         txt: "Loading...",
442
         txt: "Loading...",
433
         mask: true
443
         mask: true
434
       });
444
       });
435
       toast.show();
445
       toast.show();
436
-      this.$http
437
-        .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, {
446
+      let postData = {};
447
+      if(isRadioUser){
448
+        postData = {
438
           assginee: selectUserId,
449
           assginee: selectUserId,
439
           incId: this.modelsData.assignee ? this.modelsData.id : undefined,
450
           incId: this.modelsData.assignee ? this.modelsData.id : undefined,
440
           handlerIncidentId: this.modelsData.state.value === 'handler' ? this.modelsData.id : undefined,
451
           handlerIncidentId: this.modelsData.state.value === 'handler' ? this.modelsData.id : undefined,
441
           incidentId: this.modelsData.assignee ? undefined : this.modelsData.id,
452
           incidentId: this.modelsData.assignee ? undefined : this.modelsData.id,
442
           taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
453
           taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
443
-        })
454
+        };
455
+      }else{
456
+        postData = {
457
+          group: selectGroupId,
458
+          taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
459
+        };
460
+        console.log(postData)
461
+      }
462
+      this.$http
463
+        .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, postData)
444
         .then(res => {
464
         .then(res => {
445
           toast.hide();
465
           toast.hide();
446
           this.models.disjunctor = false;
466
           this.models.disjunctor = false;
@@ -477,6 +497,7 @@ export default {
477
     },
497
     },
478
     // 指派
498
     // 指派
479
     assign(item) {
499
     assign(item) {
500
+      console.log(item)
480
       this.modelsData = item;
501
       this.modelsData = item;
481
       this.models = {
502
       this.models = {
482
         disjunctor: true,
503
         disjunctor: true,

+ 26 - 6
src/views/incidentList.vue

@@ -191,6 +191,7 @@
191
       @cancel="cancel"
191
       @cancel="cancel"
192
       :operate="models.operate"
192
       :operate="models.operate"
193
       selectName="user"
193
       selectName="user"
194
+      :dataObj="modelsData"
194
     ></showModel>
195
     ></showModel>
195
     <!-- 新增维修记录弹窗 -->
196
     <!-- 新增维修记录弹窗 -->
196
     <showModel
197
     <showModel
@@ -392,9 +393,10 @@ export default {
392
       this.audioMask=false;
393
       this.audioMask=false;
393
     },
394
     },
394
     //确定
395
     //确定
395
-    ok(selectUserId) {
396
-      console.log(selectUserId);
397
-      if (!selectUserId) {
396
+    ok(data) {
397
+      let {selectUserId, isRadioUser, selectGroupId} = data;
398
+      console.log(data);
399
+      if (isRadioUser && !selectUserId) {
398
         this.$createDialog({
400
         this.$createDialog({
399
           type: "alert",
401
           type: "alert",
400
           title: "请选择指派对象",
402
           title: "请选择指派对象",
@@ -402,19 +404,37 @@ export default {
402
         }).show();
404
         }).show();
403
         return;
405
         return;
404
       }
406
       }
407
+      if (!isRadioUser && !selectGroupId) {
408
+        this.$createDialog({
409
+          type: "alert",
410
+          title: "请选择工作组",
411
+          icon: "cubeic-warn"
412
+        }).show();
413
+        return;
414
+      }
405
       const toast = this.$createToast({
415
       const toast = this.$createToast({
406
         txt: "Loading...",
416
         txt: "Loading...",
407
         mask: true
417
         mask: true
408
       });
418
       });
409
       toast.show();
419
       toast.show();
410
-      this.$http
411
-        .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, {
420
+      let postData = {};
421
+      if(isRadioUser){
422
+        postData = {
412
           assginee: selectUserId,
423
           assginee: selectUserId,
413
           incId: this.modelsData.assignee ? this.modelsData.id : undefined,
424
           incId: this.modelsData.assignee ? this.modelsData.id : undefined,
414
           handlerIncidentId: this.modelsData.state.value === 'handler' ? this.modelsData.id : undefined,
425
           handlerIncidentId: this.modelsData.state.value === 'handler' ? this.modelsData.id : undefined,
415
           incidentId: this.modelsData.assignee ? undefined : this.modelsData.id,
426
           incidentId: this.modelsData.assignee ? undefined : this.modelsData.id,
416
           taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
427
           taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
417
-        })
428
+        };
429
+      }else{
430
+        postData = {
431
+          group: selectGroupId,
432
+          taskType: this.modelsData.state.value == 'handler' ? 'handlerform' : (this.modelsData.state.value == 'pending' ? 'receiveform' : undefined)
433
+        };
434
+        console.log(postData)
435
+      }
436
+      this.$http
437
+        .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, postData)
418
         .then(res => {
438
         .then(res => {
419
           toast.hide();
439
           toast.hide();
420
           this.models.disjunctor = false;
440
           this.models.disjunctor = false;