Parcourir la source

考核流程更新

lamphua il y a 1 an
Parent
révision
891a1bceee

+ 1
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcAssessController.java Voir le fichier

@@ -110,6 +110,7 @@ public class CmcAssessController extends BaseController
110 110
         formData.put("assessId", assessId);
111 111
         if (cmcAssess != null) {
112 112
             formData.put("assessTime", cmcAssess.getAssessTime());
113
+            formData.put("projectId", cmcAssess.getProjectId());
113 114
             if (cmcAssess.getProjectId() != null && !cmcAssess.getProjectId().equals("")){
114 115
                 formData.put("projectNumber", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectNumber());
115 116
                 formData.put("projectName", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectName());

+ 12
- 12
oa-back/sql/sql.sql
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 85
- 28
oa-ui/src/views/flowable/form/cwTable.vue Voir le fichier

@@ -107,7 +107,7 @@
107 107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
108 108
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
109 109
               <el-radio :key="dict.value" :label="dict.value"
110
-                @click.native.prevent="cancelSelect(dict.value, 'workload01',isStaff)">
110
+                @click.native.prevent="cancelSelect(dict.value, 'workload01', isStaff)">
111 111
                 {{ dict.label }}
112 112
               </el-radio>
113 113
             </div>
@@ -117,7 +117,7 @@
117 117
           <el-radio-group v-model="tableForm.assessment01" :disabled="!isPiLeader">
118 118
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
119 119
               <el-radio :key="dict.value" :label="dict.value"
120
-                @click.native.prevent="cancelSelect(dict.value, 'assessment01',isStaff)">
120
+                @click.native.prevent="cancelSelect(dict.value, 'assessment01', isStaff)">
121 121
                 {{ dict.label }}
122 122
               </el-radio>
123 123
             </div>
@@ -211,7 +211,7 @@
211 211
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
212 212
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
213 213
               <el-radio :key="dict.value" :label="dict.value"
214
-                @click.native.prevent="cancelSelect(dict.value, 'workload02',isStaff)">
214
+                @click.native.prevent="cancelSelect(dict.value, 'workload02', isStaff)">
215 215
                 {{ dict.label }}
216 216
               </el-radio>
217 217
             </div>
@@ -221,7 +221,7 @@
221 221
           <el-radio-group v-model="tableForm.assessment02" :disabled="!isPiLeader">
222 222
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
223 223
               <el-radio :key="dict.value" :label="dict.value"
224
-                @click.native.prevent="cancelSelect(dict.value, 'assessment02',isStaff)">
224
+                @click.native.prevent="cancelSelect(dict.value, 'assessment02', isStaff)">
225 225
                 {{ dict.label }}
226 226
               </el-radio>
227 227
             </div>
@@ -274,7 +274,7 @@
274 274
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
275 275
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
276 276
               <el-radio :key="dict.value" :label="dict.value"
277
-                @click.native.prevent="cancelSelect(dict.value, 'workload03',isStaff)">
277
+                @click.native.prevent="cancelSelect(dict.value, 'workload03', isStaff)">
278 278
                 {{ dict.label }}
279 279
               </el-radio>
280 280
             </div>
@@ -284,7 +284,7 @@
284 284
           <el-radio-group v-model="tableForm.assessment03" :disabled="!isPiLeader">
285 285
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
286 286
               <el-radio :key="dict.value" :label="dict.value"
287
-                @click.native.prevent="cancelSelect(dict.value, 'assessment03',isStaff)">
287
+                @click.native.prevent="cancelSelect(dict.value, 'assessment03', isStaff)">
288 288
                 {{ dict.label }}
289 289
               </el-radio>
290 290
             </div>
@@ -367,7 +367,7 @@
367 367
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
368 368
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
369 369
               <el-radio :key="dict.value" :label="dict.value"
370
-                @click.native.prevent="cancelSelect(dict.value, 'workload04',isStaff)">
370
+                @click.native.prevent="cancelSelect(dict.value, 'workload04', isStaff)">
371 371
                 {{ dict.label }}
372 372
               </el-radio>
373 373
             </div>
@@ -377,7 +377,7 @@
377 377
           <el-radio-group v-model="tableForm.assessment04" :disabled="!isPiLeader">
378 378
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
379 379
               <el-radio :key="dict.value" :label="dict.value"
380
-                @click.native.prevent="cancelSelect(dict.value, 'assessment04',isStaff)">
380
+                @click.native.prevent="cancelSelect(dict.value, 'assessment04', isStaff)">
381 381
                 {{ dict.label }}
382 382
               </el-radio>
383 383
             </div>
@@ -468,7 +468,7 @@
468 468
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
469 469
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
470 470
               <el-radio :key="dict.value" :label="dict.value"
471
-                @click.native.prevent="cancelSelect(dict.value, 'workload05',isStaff)">
471
+                @click.native.prevent="cancelSelect(dict.value, 'workload05', isStaff)">
472 472
                 {{ dict.label }}
473 473
               </el-radio>
474 474
             </div>
@@ -478,7 +478,7 @@
478 478
           <el-radio-group v-model="tableForm.assessment05" :disabled="!isPiLeader">
479 479
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
480 480
               <el-radio :key="dict.value" :label="dict.value"
481
-                @click.native.prevent="cancelSelect(dict.value, 'assessment05',isStaff)">
481
+                @click.native.prevent="cancelSelect(dict.value, 'assessment05', isStaff)">
482 482
                 {{ dict.label }}
483 483
               </el-radio>
484 484
             </div>
@@ -521,10 +521,9 @@
521 521
         </td>
522 522
       </tr>
523 523
     </table>
524
-    <el-row justify="center" type="flex" style="margin-top:20px;"
525
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
526
-      <el-button type="primary" @click="submit">提交</el-button>
527
-      <el-button @click="$emit('close')">取消</el-button>
524
+    <el-row justify="center" type="flex" style="margin-top:20px;">
525
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
526
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
528 527
     </el-row>
529 528
   </div>
530 529
 </template>
@@ -532,15 +531,17 @@
532 531
 <script>
533 532
 import { XMContent } from '@/assets/datas/XMContent'
534 533
 import { getDicts as getDicts } from '@/api/system/dict/data'
534
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
535
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
536
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
535 537
 export default {
536 538
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
537 539
   props: {
538
-    tableForm: {
539
-      type: Object,
540
-      required: true
541
-    },
542 540
     taskName: {
543 541
       type: String
542
+    },
543
+    taskForm: {
544
+      type: Object
544 545
     }
545 546
   },
546 547
   watch: {
@@ -550,6 +551,7 @@ export default {
550 551
   },
551 552
   data() {
552 553
     return {
554
+      tableForm: {},
553 555
       form: {},
554 556
       radio1: "",
555 557
       radio2: "",
@@ -567,13 +569,26 @@ export default {
567 569
   mounted() {
568 570
     this.formatForm();
569 571
   },
570
-  methods: {
572
+  methods: {// 获取需要处理的表单表格信息
571 573
     initForm() {
572
-
574
+      getAssess(this.taskForm.formId).then(res => {
575
+        let data = res.data;
576
+        for (let d in data) {
577
+          if (d.includes('role')) {
578
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
579
+              data[d] = data[d].split(',')
580
+          }
581
+          if (d.includes('familiar')) {
582
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
583
+              data[d] = parseInt(data[d])
584
+          }
585
+        }
586
+        this.tableForm = data;
587
+      })
573 588
     },
574 589
     formatForm() {
575 590
 
576
-      if (this.taskName == '负责人审核') {
591
+      if (this.taskName == '项目负责人审核') {
577 592
         this.isPiLeader = true;
578 593
         this.isDeptLeader = false;
579 594
         this.isManager = false;
@@ -597,8 +612,48 @@ export default {
597 612
     },
598 613
     submit() {
599 614
       let flag = this.formValidate(this.tableForm)
600
-      if (flag)
601
-        this.$emit('submit', this.tableForm);
615
+      if (flag) {
616
+        // this.$emit('submit', this.tableForm);
617
+        let formData = new FormData();
618
+        this.tableForm.formId = this.taskForm.formId;
619
+        let form = JSON.stringify(this.tableForm);
620
+        formData.append("form", form);
621
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
622
+          let list = result;
623
+          if (list.total != 0) {
624
+            modifyAssess(formData);
625
+          } else {
626
+            submitAssess(formData);
627
+          }
628
+        })
629
+        const params = { taskId: this.taskForm.taskId }
630
+        getNextFlowNode(params).then(res => {
631
+          if (this.taskName == '员工填报') {
632
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
633
+              if (res.data)
634
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
635
+              complete(this.taskForm).then(response => {
636
+                this.$modal.msgSuccess(response.msg);
637
+                this.$emit("goBack");
638
+              });
639
+            })
640
+          } else if (this.taskName == '部门审核') {
641
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
642
+              let userId = res.data.userId;
643
+              this.$set(this.taskForm.variables, "approval", userId);
644
+              complete(this.taskForm).then(response => {
645
+                this.$modal.msgSuccess(response.msg);
646
+                this.$emit("goBack");
647
+              });
648
+            })
649
+          } else if (this.taskName == '分管审核') {
650
+            complete(this.taskForm).then(response => {
651
+              this.$modal.msgSuccess(response.msg);
652
+              this.$emit("goBack");
653
+            });
654
+          }
655
+        })
656
+      }
602 657
     },
603 658
     formValidate(form) {
604 659
       let flag = [];
@@ -614,13 +669,13 @@ export default {
614 669
       let isF = false;
615 670
       if (flag.length == 0) {
616 671
         this.$modal.msgError("表格未填写,请填写表格");
617
-      }else{
672
+      } else {
618 673
         isF = true
619 674
       }
620 675
       return isF
621 676
     },
622 677
     cancelSelect(value, name, disabled) {
623
-      if(disabled){
678
+      if (disabled) {
624 679
         return
625 680
       }
626 681
       if (this.isStaff) {
@@ -642,7 +697,7 @@ export default {
642 697
             this.tableForm[name] = value
643 698
         }
644 699
       }
645
-    }
700
+    },    
646 701
   },
647 702
 }
648 703
 </script>
@@ -657,11 +712,13 @@ export default {
657 712
   background-color: #90d6f1;
658 713
   font-weight: bold;
659 714
 }
660
-.table-fillin{
715
+
716
+.table-fillin {
661 717
   background-color: #bfee93;
662 718
   font-weight: bold;
663 719
 }
664
-.table-fzr{
720
+
721
+.table-fzr {
665 722
   background-color: #eead93;
666 723
   font-weight: bold;
667 724
 }

+ 87
- 23
oa-ui/src/views/flowable/form/jsTable.vue Voir le fichier

@@ -123,7 +123,8 @@
123 123
         <td rowspan="6">
124 124
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
125 125
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
126
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill01', isStaff)">
126
+              <el-radio :key="dict.value" :label="dict.value"
127
+                @click.native.prevent="cancelSelect(dict.value, 'skill01', isStaff)">
127 128
                 {{ dict.label }}
128 129
               </el-radio>
129 130
             </div>
@@ -220,7 +221,8 @@
220 221
         <td rowspan="4">
221 222
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
222 223
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
223
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill02', isStaff)">
224
+              <el-radio :key="dict.value" :label="dict.value"
225
+                @click.native.prevent="cancelSelect(dict.value, 'skill02', isStaff)">
224 226
                 {{ dict.label }}
225 227
               </el-radio>
226 228
             </div>
@@ -300,7 +302,8 @@
300 302
         <td rowspan="13">
301 303
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
302 304
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
303
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill03', isStaff)">
305
+              <el-radio :key="dict.value" :label="dict.value"
306
+                @click.native.prevent="cancelSelect(dict.value, 'skill03', isStaff)">
304 307
                 {{ dict.label }}
305 308
               </el-radio>
306 309
             </div>
@@ -453,7 +456,8 @@
453 456
         <td rowspan="5">
454 457
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
455 458
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
456
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill04', isStaff)">
459
+              <el-radio :key="dict.value" :label="dict.value"
460
+                @click.native.prevent="cancelSelect(dict.value, 'skill04', isStaff)">
457 461
                 {{ dict.label }}
458 462
               </el-radio>
459 463
             </div>
@@ -542,7 +546,8 @@
542 546
         <td rowspan="3">
543 547
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
544 548
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
545
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill05', isStaff)">
549
+              <el-radio :key="dict.value" :label="dict.value"
550
+                @click.native.prevent="cancelSelect(dict.value, 'skill05', isStaff)">
546 551
                 {{ dict.label }}
547 552
               </el-radio>
548 553
             </div>
@@ -597,10 +602,9 @@
597 602
         </td>
598 603
       </tr>
599 604
     </table>
600
-    <el-row justify="center" type="flex" style="margin-top:20px;"
601
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
602
-      <el-button type="primary" @click="submit">提交</el-button>
603
-      <el-button @click="$emit('close')">取消</el-button>
605
+    <el-row justify="center" type="flex" style="margin-top:20px;">
606
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
607
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
604 608
     </el-row>
605 609
   </div>
606 610
 </template>
@@ -608,13 +612,18 @@
608 612
 <script>
609 613
 import { JYContent } from '@/assets/datas/JYContent'
610 614
 import { getDicts as getDicts } from '@/api/system/dict/data'
615
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
616
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
617
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
611 618
 export default {
612 619
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
613 620
   props: {
614
-    tableForm: {
615
-      type: Object,
616
-      required: true
621
+    taskName: {
622
+      type: String
617 623
     },
624
+    taskForm: {
625
+      type: Object
626
+    }
618 627
   },
619 628
   watch: {
620 629
     tableForm: function (newval, oldval) {
@@ -623,6 +632,7 @@ export default {
623 632
   },
624 633
   data() {
625 634
     return {
635
+      tableForm: {},
626 636
       form: {},
627 637
       radio1: "",
628 638
       radio2: "",
@@ -642,25 +652,38 @@ export default {
642 652
   },
643 653
   methods: {
644 654
     initForm() {
645
-
655
+      getAssess(this.taskForm.formId).then(res => {
656
+        let data = res.data;
657
+        for (let d in data) {
658
+          if (d.includes('role')) {
659
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
660
+              data[d] = data[d].split(',')
661
+          }
662
+          if (d.includes('familiar')) {
663
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
664
+              data[d] = parseInt(data[d])
665
+          }
666
+        }
667
+        this.tableForm = data;
668
+      })
646 669
     },
647 670
     formatForm() {
648
-      if (this.tableForm.taskName == '负责人审核') {
671
+      if (this.taskName == '项目负责人审核') {
649 672
         this.isPiLeader = true;
650 673
         this.isDeptLeader = false;
651 674
         this.isManager = false;
652 675
         this.isStaff = false;
653
-      } else if (this.tableForm.taskName == '部门审核') {
676
+      } else if (this.taskName == '部门审核') {
654 677
         this.isPiLeader = false;
655 678
         this.isDeptLeader = true;
656 679
         this.isManager = false;
657 680
         this.isStaff = false;
658
-      } else if (this.tableForm.taskName == '分管审核') {
681
+      } else if (this.taskName == '分管审核') {
659 682
         this.isPiLeader = false;
660 683
         this.isDeptLeader = false;
661 684
         this.isManager = true;
662 685
         this.isStaff = false;
663
-      } else if (this.tableForm.taskName == '员工填报') {
686
+      } else if (this.taskName == '员工填报') {
664 687
         this.isPiLeader = false;
665 688
         this.isDeptLeader = false;
666 689
         this.isManager = false;
@@ -669,8 +692,48 @@ export default {
669 692
     },
670 693
     submit() {
671 694
       let flag = this.formValidate(this.tableForm)
672
-      if (flag)
673
-        this.$emit('submit', this.tableForm);
695
+      if (flag) {
696
+        // this.$emit('submit', this.tableForm);
697
+        let formData = new FormData();
698
+        this.tableForm.formId = this.taskForm.formId;
699
+        let form = JSON.stringify(this.tableForm);
700
+        formData.append("form", form);
701
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
702
+          let list = result;
703
+          if (list.total != 0) {
704
+            modifyAssess(formData);
705
+          } else {
706
+            submitAssess(formData);
707
+          }
708
+        })
709
+        const params = { taskId: this.taskForm.taskId }
710
+        getNextFlowNode(params).then(res => {
711
+          if (this.taskName == '员工填报') {
712
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
713
+              if (res.data)
714
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
715
+              complete(this.taskForm).then(response => {
716
+                this.$modal.msgSuccess(response.msg);
717
+                this.$emit("goBack");
718
+              });
719
+            })
720
+          } else if (this.taskName == '部门审核') {
721
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
722
+              let userId = res.data.userId;
723
+              this.$set(this.taskForm.variables, "approval", userId);
724
+              complete(this.taskForm).then(response => {
725
+                this.$modal.msgSuccess(response.msg);
726
+                this.$emit("goBack");
727
+              });
728
+            })
729
+          } else if (this.taskName == '分管审核') {
730
+            complete(this.taskForm).then(response => {
731
+              this.$modal.msgSuccess(response.msg);
732
+              this.$emit("goBack");
733
+            });
734
+          }
735
+        })
736
+      }
674 737
     },
675 738
     formValidate(form) {
676 739
       let flag = [];
@@ -686,13 +749,13 @@ export default {
686 749
       let isF = false;
687 750
       if (flag.length == 0) {
688 751
         this.$modal.msgError("表格未填写,请填写表格");
689
-      }else{
752
+      } else {
690 753
         isF = true
691 754
       }
692 755
       return isF
693 756
     },
694 757
     cancelSelect(value, name, disabled) {
695
-      if(disabled){
758
+      if (disabled) {
696 759
         return
697 760
       }
698 761
       if (this.isStaff) {
@@ -714,7 +777,7 @@ export default {
714 777
             this.tableForm[name] = value
715 778
         }
716 779
       }
717
-    }
780
+    },
718 781
   },
719 782
 }
720 783
 </script>
@@ -800,4 +863,5 @@ td {
800 863
   transform: rotate(-45deg);
801 864
   border-radius: 0px;
802 865
   background: none;
803
-}</style>
866
+}
867
+</style>

+ 77
- 18
oa-ui/src/views/flowable/form/jyTable.vue Voir le fichier

@@ -305,10 +305,9 @@
305 305
         </td>
306 306
       </tr>
307 307
     </table>
308
-    <el-row justify="center" type="flex" style="margin-top:20px;"
309
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
310
-      <el-button type="primary" @click="submit">提交</el-button>
311
-      <el-button @click="$emit('close')">取消</el-button>
308
+    <el-row justify="center" type="flex" style="margin-top:20px;">
309
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
310
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
312 311
     </el-row>
313 312
   </div>
314 313
 </template>
@@ -316,13 +315,18 @@
316 315
 <script>
317 316
 import { JYContent } from '@/assets/datas/JYContent'
318 317
 import { getDicts as getDicts } from '@/api/system/dict/data'
318
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
319
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
320
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
319 321
 export default {
320 322
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
321 323
   props: {
322
-    tableForm: {
323
-      type: Object,
324
-      required: true
324
+    taskName: {
325
+      type: String
325 326
     },
327
+    taskForm: {
328
+      type: Object
329
+    }
326 330
   },
327 331
   watch: {
328 332
     tableForm: function (newval, oldval) {
@@ -331,6 +335,7 @@ export default {
331 335
   },
332 336
   data() {
333 337
     return {
338
+      tableForm: {},
334 339
       form: {},
335 340
       radio1: "",
336 341
       radio2: "",
@@ -350,25 +355,38 @@ export default {
350 355
   },
351 356
   methods: {
352 357
     initForm() {
353
-      console.log(this.tableForm);
358
+      getAssess(this.taskForm.formId).then(res => {
359
+        let data = res.data;
360
+        for (let d in data) {
361
+          if (d.includes('role')) {
362
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
363
+              data[d] = data[d].split(',')
364
+          }
365
+          if (d.includes('familiar')) {
366
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
367
+              data[d] = parseInt(data[d])
368
+          }
369
+        }
370
+        this.tableForm = data;
371
+      })
354 372
     },
355 373
     formatForm() {
356
-      if (this.tableForm.taskName == '负责人审核') {
374
+      if (this.taskName == '项目负责人审核') {
357 375
         this.isPiLeader = true;
358 376
         this.isDeptLeader = false;
359 377
         this.isManager = false;
360 378
         this.isStaff = false;
361
-      } else if (this.tableForm.taskName == '部门审核') {
379
+      } else if (this.taskName == '部门审核') {
362 380
         this.isPiLeader = false;
363 381
         this.isDeptLeader = true;
364 382
         this.isManager = false;
365 383
         this.isStaff = false;
366
-      } else if (this.tableForm.taskName == '分管审核') {
384
+      } else if (this.taskName == '分管审核') {
367 385
         this.isPiLeader = false;
368 386
         this.isDeptLeader = false;
369 387
         this.isManager = true;
370 388
         this.isStaff = false;
371
-      } else if (this.tableForm.taskName == '员工填报') {
389
+      } else if (this.taskName == '员工填报') {
372 390
         this.isPiLeader = false;
373 391
         this.isDeptLeader = false;
374 392
         this.isManager = false;
@@ -377,8 +395,48 @@ export default {
377 395
     },
378 396
     submit() {
379 397
       let flag = this.formValidate(this.tableForm)
380
-      if (flag)
381
-        this.$emit('submit', this.tableForm);
398
+      if (flag) {
399
+        // this.$emit('submit', this.tableForm);
400
+        let formData = new FormData();
401
+        this.tableForm.formId = this.taskForm.formId;
402
+        let form = JSON.stringify(this.tableForm);
403
+        formData.append("form", form);
404
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
405
+          let list = result;
406
+          if (list.total != 0) {
407
+            modifyAssess(formData);
408
+          } else {
409
+            submitAssess(formData);
410
+          }
411
+        })
412
+        const params = { taskId: this.taskForm.taskId }
413
+        getNextFlowNode(params).then(res => {
414
+          if (this.taskName == '员工填报') {
415
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
416
+              if (res.data)
417
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
418
+              complete(this.taskForm).then(response => {
419
+                this.$modal.msgSuccess(response.msg);
420
+                this.$emit("goBack");
421
+              });
422
+            })
423
+          } else if (this.taskName == '部门审核') {
424
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
425
+              let userId = res.data.userId;
426
+              this.$set(this.taskForm.variables, "approval", userId);
427
+              complete(this.taskForm).then(response => {
428
+                this.$modal.msgSuccess(response.msg);
429
+                this.$emit("goBack");
430
+              });
431
+            })
432
+          } else if (this.taskName == '分管审核') {
433
+            complete(this.taskForm).then(response => {
434
+              this.$modal.msgSuccess(response.msg);
435
+              this.$emit("goBack");
436
+            });
437
+          }
438
+        })
439
+      }
382 440
     },
383 441
     formValidate(form) {
384 442
       let flag = [];
@@ -394,13 +452,13 @@ export default {
394 452
       let isF = false;
395 453
       if (flag.length == 0) {
396 454
         this.$modal.msgError("表格未填写,请填写表格");
397
-      }else{
455
+      } else {
398 456
         isF = true
399 457
       }
400 458
       return isF
401 459
     },
402 460
     cancelSelect(value, name, disabled) {
403
-      if(disabled){
461
+      if (disabled) {
404 462
         return
405 463
       }
406 464
       if (this.isStaff) {
@@ -422,7 +480,7 @@ export default {
422 480
             this.tableForm[name] = value
423 481
         }
424 482
       }
425
-    }
483
+    },
426 484
   },
427 485
 }
428 486
 </script>
@@ -509,4 +567,5 @@ td {
509 567
   transform: rotate(-45deg);
510 568
   border-radius: 0px;
511 569
   background: none;
512
-}</style>
570
+}
571
+</style>

+ 117
- 35
oa-ui/src/views/flowable/form/scTable.vue Voir le fichier

@@ -150,7 +150,8 @@
150 150
         <td rowspan="5">
151 151
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
152 152
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
153
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill01', isStaff)">
153
+              <el-radio :key="dict.value" :label="dict.value"
154
+                @click.native.prevent="cancelSelect(dict.value, 'skill01', isStaff)">
154 155
                 {{ dict.label }}
155 156
               </el-radio>
156 157
             </div>
@@ -237,7 +238,8 @@
237 238
         <td rowspan="10">
238 239
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
239 240
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
240
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill02', isStaff)">
241
+              <el-radio :key="dict.value" :label="dict.value"
242
+                @click.native.prevent="cancelSelect(dict.value, 'skill02', isStaff)">
241 243
                 {{ dict.label }}
242 244
               </el-radio>
243 245
             </div>
@@ -361,7 +363,8 @@
361 363
         <td rowspan="5">
362 364
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
363 365
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
364
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill03', isStaff)">
366
+              <el-radio :key="dict.value" :label="dict.value"
367
+                @click.native.prevent="cancelSelect(dict.value, 'skill03', isStaff)">
365 368
                 {{ dict.label }}
366 369
               </el-radio>
367 370
             </div>
@@ -445,7 +448,8 @@
445 448
         <td rowspan="4">
446 449
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
447 450
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
448
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill04', isStaff)">
451
+              <el-radio :key="dict.value" :label="dict.value"
452
+                @click.native.prevent="cancelSelect(dict.value, 'skill04', isStaff)">
449 453
                 {{ dict.label }}
450 454
               </el-radio>
451 455
             </div>
@@ -518,7 +522,8 @@
518 522
         <td rowspan="6">
519 523
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
520 524
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
521
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill05', isStaff)">
525
+              <el-radio :key="dict.value" :label="dict.value"
526
+                @click.native.prevent="cancelSelect(dict.value, 'skill05', isStaff)">
522 527
                 {{ dict.label }}
523 528
               </el-radio>
524 529
             </div>
@@ -606,7 +611,8 @@
606 611
         <td rowspan="6">
607 612
           <el-radio-group v-model="tableForm.skill06" :disabled="!isPiLeader">
608 613
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
609
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill06', isStaff)">
614
+              <el-radio :key="dict.value" :label="dict.value"
615
+                @click.native.prevent="cancelSelect(dict.value, 'skill06', isStaff)">
610 616
                 {{ dict.label }}
611 617
               </el-radio>
612 618
             </div>
@@ -694,7 +700,8 @@
694 700
         <td rowspan="4">
695 701
           <el-radio-group v-model="tableForm.skill07" :disabled="!isPiLeader">
696 702
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
697
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill07', isStaff)">
703
+              <el-radio :key="dict.value" :label="dict.value"
704
+                @click.native.prevent="cancelSelect(dict.value, 'skill07', isStaff)">
698 705
                 {{ dict.label }}
699 706
               </el-radio>
700 707
             </div>
@@ -767,7 +774,8 @@
767 774
         <td rowspan="3">
768 775
           <el-radio-group v-model="tableForm.skill08" :disabled="!isPiLeader">
769 776
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
770
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill08', isStaff)">
777
+              <el-radio :key="dict.value" :label="dict.value"
778
+                @click.native.prevent="cancelSelect(dict.value, 'skill08', isStaff)">
771 779
                 {{ dict.label }}
772 780
               </el-radio>
773 781
             </div>
@@ -833,7 +841,8 @@
833 841
         <td rowspan="6">
834 842
           <el-radio-group v-model="tableForm.skill09" :disabled="!isPiLeader">
835 843
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
836
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill09', isStaff)">
844
+              <el-radio :key="dict.value" :label="dict.value"
845
+                @click.native.prevent="cancelSelect(dict.value, 'skill09', isStaff)">
837 846
                 {{ dict.label }}
838 847
               </el-radio>
839 848
             </div>
@@ -922,7 +931,8 @@
922 931
         <td rowspan="5">
923 932
           <el-radio-group v-model="tableForm.skill10" :disabled="!isPiLeader">
924 933
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
925
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill10', isStaff)">
934
+              <el-radio :key="dict.value" :label="dict.value"
935
+                @click.native.prevent="cancelSelect(dict.value, 'skill10', isStaff)">
926 936
                 {{ dict.label }}
927 937
               </el-radio>
928 938
             </div>
@@ -1003,7 +1013,8 @@
1003 1013
         <td rowspan="6">
1004 1014
           <el-radio-group v-model="tableForm.skill11" :disabled="!isPiLeader">
1005 1015
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1006
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill11', isStaff)">
1016
+              <el-radio :key="dict.value" :label="dict.value"
1017
+                @click.native.prevent="cancelSelect(dict.value, 'skill11', isStaff)">
1007 1018
                 {{ dict.label }}
1008 1019
               </el-radio>
1009 1020
             </div>
@@ -1092,7 +1103,8 @@
1092 1103
         <td rowspan="5">
1093 1104
           <el-radio-group v-model="tableForm.skill12" :disabled="!isPiLeader">
1094 1105
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1095
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill12', isStaff)">
1106
+              <el-radio :key="dict.value" :label="dict.value"
1107
+                @click.native.prevent="cancelSelect(dict.value, 'skill12', isStaff)">
1096 1108
                 {{ dict.label }}
1097 1109
               </el-radio>
1098 1110
             </div>
@@ -1173,7 +1185,8 @@
1173 1185
         <td rowspan="6">
1174 1186
           <el-radio-group v-model="tableForm.skill13" :disabled="!isPiLeader">
1175 1187
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1176
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill13', isStaff)">
1188
+              <el-radio :key="dict.value" :label="dict.value"
1189
+                @click.native.prevent="cancelSelect(dict.value, 'skill13', isStaff)">
1177 1190
                 {{ dict.label }}
1178 1191
               </el-radio>
1179 1192
             </div>
@@ -1262,7 +1275,8 @@
1262 1275
         <td rowspan="6">
1263 1276
           <el-radio-group v-model="tableForm.skill14" :disabled="!isPiLeader">
1264 1277
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1265
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill14', isStaff)">
1278
+              <el-radio :key="dict.value" :label="dict.value"
1279
+                @click.native.prevent="cancelSelect(dict.value, 'skill14', isStaff)">
1266 1280
                 {{ dict.label }}
1267 1281
               </el-radio>
1268 1282
             </div>
@@ -1351,7 +1365,8 @@
1351 1365
         <td rowspan="6">
1352 1366
           <el-radio-group v-model="tableForm.skill15" :disabled="!isPiLeader">
1353 1367
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1354
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill15', isStaff)">
1368
+              <el-radio :key="dict.value" :label="dict.value"
1369
+                @click.native.prevent="cancelSelect(dict.value, 'skill15', isStaff)">
1355 1370
                 {{ dict.label }}
1356 1371
               </el-radio>
1357 1372
             </div>
@@ -1440,7 +1455,8 @@
1440 1455
         <td rowspan="4">
1441 1456
           <el-radio-group v-model="tableForm.skill16" :disabled="!isPiLeader">
1442 1457
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1443
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill16', isStaff)">
1458
+              <el-radio :key="dict.value" :label="dict.value"
1459
+                @click.native.prevent="cancelSelect(dict.value, 'skill16', isStaff)">
1444 1460
                 {{ dict.label }}
1445 1461
               </el-radio>
1446 1462
             </div>
@@ -1512,7 +1528,8 @@
1512 1528
         <td rowspan="5">
1513 1529
           <el-radio-group v-model="tableForm.skill17" :disabled="!isPiLeader">
1514 1530
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
1515
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'skill17', isStaff)">
1531
+              <el-radio :key="dict.value" :label="dict.value"
1532
+                @click.native.prevent="cancelSelect(dict.value, 'skill17', isStaff)">
1516 1533
                 {{ dict.label }}
1517 1534
               </el-radio>
1518 1535
             </div>
@@ -1570,10 +1587,9 @@
1570 1587
         </td>
1571 1588
       </tr>
1572 1589
     </table>
1573
-    <el-row justify="center" type="flex" style="margin-top:20px;"
1574
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
1575
-      <el-button type="primary" @click="submit">提交</el-button>
1576
-      <el-button @click="$emit('close')">取消</el-button>
1590
+    <el-row justify="center" type="flex" style="margin-top:20px;">
1591
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
1592
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
1577 1593
     </el-row>
1578 1594
   </div>
1579 1595
 </template>
@@ -1583,14 +1599,19 @@ import { SCContent } from '@/assets/datas/SCContent'
1583 1599
 import { getDicts as getDicts } from '@/api/system/dict/data'
1584 1600
 import { listProject } from '@/api/oa/project/project.js'
1585 1601
 import { getProject } from '@/api/oa/project/project'
1602
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
1603
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
1604
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
1586 1605
 
1587 1606
 export default {
1588 1607
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment'],
1589 1608
   props: {
1590
-    tableForm: {
1591
-      type: Object,
1592
-      required: true
1609
+    taskName: {
1610
+      type: String
1593 1611
     },
1612
+    taskForm: {
1613
+      type: Object
1614
+    }
1594 1615
   },
1595 1616
   watch: {
1596 1617
     tableForm: function (newval, oldval) {
@@ -1599,6 +1620,7 @@ export default {
1599 1620
   },
1600 1621
   data() {
1601 1622
     return {
1623
+      tableForm: {},
1602 1624
       form: {},
1603 1625
       radio1: "",
1604 1626
       radio2: "",
@@ -1619,6 +1641,20 @@ export default {
1619 1641
   },
1620 1642
   methods: {
1621 1643
     initForm() {
1644
+      getAssess(this.taskForm.formId).then(res => {
1645
+        let data = res.data;
1646
+        for (let d in data) {
1647
+          if (d.includes('role')) {
1648
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
1649
+              data[d] = data[d].split(',')
1650
+          }
1651
+          if (d.includes('familiar')) {
1652
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
1653
+              data[d] = parseInt(data[d])
1654
+          }
1655
+        }
1656
+        this.tableForm = data;
1657
+      })
1622 1658
       listProject({ pageSize: 200 }).then(res => {
1623 1659
         this.projectList = res.rows;
1624 1660
       })
@@ -1642,22 +1678,22 @@ export default {
1642 1678
             this.form['role' + i] = this.tableForm['role' + i]
1643 1679
         }
1644 1680
       }
1645
-      if (this.tableForm.taskName == '负责人审核') {
1681
+      if (this.taskName == '项目负责人审核') {
1646 1682
         this.isPiLeader = true;
1647 1683
         this.isDeptLeader = false;
1648 1684
         this.isManager = false;
1649 1685
         this.isStaff = false;
1650
-      } else if (this.tableForm.taskName == '部门审核') {
1686
+      } else if (this.taskName == '部门审核') {
1651 1687
         this.isPiLeader = false;
1652 1688
         this.isDeptLeader = true;
1653 1689
         this.isManager = false;
1654 1690
         this.isStaff = false;
1655
-      } else if (this.tableForm.taskName == '分管审核') {
1691
+      } else if (this.taskName == '分管审核') {
1656 1692
         this.isPiLeader = false;
1657 1693
         this.isDeptLeader = false;
1658 1694
         this.isManager = true;
1659 1695
         this.isStaff = false;
1660
-      } else if (this.tableForm.taskName == '员工填报') {
1696
+      } else if (this.taskName == '员工填报') {
1661 1697
         this.isPiLeader = false;
1662 1698
         this.isDeptLeader = false;
1663 1699
         this.isManager = false;
@@ -1694,10 +1730,57 @@ export default {
1694 1730
       if (flag) {
1695 1731
         this.assignmentToTableForm();
1696 1732
         this.initTableFormFromForm();
1697
-        console.log(this.tableForm);
1698
-        this.$emit('submit', this.tableForm);
1733
+        // this.$emit('submit', this.tableForm);
1734
+        let formData = new FormData();
1735
+        this.tableForm.formId = this.taskForm.formId;
1736
+        let form = JSON.stringify(this.tableForm);
1737
+        formData.append("form", form);
1738
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
1739
+          let list = result;
1740
+          if (list.total != 0) {
1741
+            modifyAssess(formData);
1742
+          } else {
1743
+            submitAssess(formData);
1744
+          }
1745
+        })
1746
+        const params = { taskId: this.taskForm.taskId }
1747
+        getNextFlowNode(params).then(res => {
1748
+          if (this.taskName == '员工填报') {
1749
+            console.log(this.tableForm);
1750
+            getProject(this.tableForm.projectId).then(res => {
1751
+              if (res.data)
1752
+                this.$set(this.taskForm.variables, "approval", res.data.projectLeader);
1753
+              complete(this.taskForm).then(response => {
1754
+                this.$modal.msgSuccess(response.msg);
1755
+                this.$emit("goBack");
1756
+              });
1757
+            })
1758
+          } else if (this.taskName == '项目负责人审核') {
1759
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
1760
+              if (res.data)
1761
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
1762
+              complete(this.taskForm).then(response => {
1763
+                this.$modal.msgSuccess(response.msg);
1764
+                this.$emit("goBack");
1765
+              });
1766
+            })
1767
+          } else if (this.taskName == '部门审核') {
1768
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
1769
+              let userId = res.data.userId;
1770
+              this.$set(this.taskForm.variables, "approval", userId);
1771
+              complete(this.taskForm).then(response => {
1772
+                this.$modal.msgSuccess(response.msg);
1773
+                this.$emit("goBack");
1774
+              });
1775
+            })
1776
+          } else if (this.taskName == '分管审核') {
1777
+            complete(this.taskForm).then(response => {
1778
+              this.$modal.msgSuccess(response.msg);
1779
+              this.$emit("goBack");
1780
+            });
1781
+          }
1782
+        })
1699 1783
       }
1700
-
1701 1784
     },
1702 1785
     formValidate(form) {
1703 1786
       let flag = [];
@@ -1718,7 +1801,7 @@ export default {
1718 1801
       return isF
1719 1802
     },
1720 1803
     cancelSelect(value, name, disabled) {
1721
-      if(disabled){
1804
+      if (disabled) {
1722 1805
         return
1723 1806
       }
1724 1807
       if (this.isStaff) {
@@ -1740,7 +1823,7 @@ export default {
1740 1823
             this.tableForm[name] = value
1741 1824
         }
1742 1825
       }
1743
-    }
1826
+    },
1744 1827
   },
1745 1828
 }
1746 1829
 </script>
@@ -1826,5 +1909,4 @@ td {
1826 1909
   transform: rotate(-45deg);
1827 1910
   border-radius: 0px;
1828 1911
   background: none;
1829
-}
1830
-</style>
1912
+}</style>

+ 76
- 17
oa-ui/src/views/flowable/form/xmTable.vue Voir le fichier

@@ -335,10 +335,9 @@
335 335
         </td>
336 336
       </tr>
337 337
     </table>
338
-    <el-row justify="center" type="flex" style="margin-top:20px;"
339
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
340
-      <el-button type="primary" @click="submit">提交</el-button>
341
-      <el-button @click="$emit('close')">取消</el-button>
338
+    <el-row justify="center" type="flex" style="margin-top:20px;">
339
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
340
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
342 341
     </el-row>
343 342
   </div>
344 343
 </template>
@@ -346,13 +345,18 @@
346 345
 <script>
347 346
 import { XMContent } from '@/assets/datas/XMContent'
348 347
 import { getDicts as getDicts } from '@/api/system/dict/data'
348
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
349
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
350
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
349 351
 export default {
350 352
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
351 353
   props: {
352
-    tableForm: {
353
-      type: Object,
354
-      required: true
354
+    taskName: {
355
+      type: String
355 356
     },
357
+    taskForm: {
358
+      type: Object
359
+    }
356 360
   },
357 361
   watch: {
358 362
     tableForm: function (newval, oldval) {
@@ -361,6 +365,7 @@ export default {
361 365
   },
362 366
   data() {
363 367
     return {
368
+      tableForm: {},      
364 369
       form: {},
365 370
       radio1: "",
366 371
       radio2: "",
@@ -380,25 +385,38 @@ export default {
380 385
   },
381 386
   methods: {
382 387
     initForm() {
383
-
388
+      getAssess(this.taskForm.formId).then(res => {
389
+        let data = res.data;
390
+        for (let d in data) {
391
+          if (d.includes('role')) {
392
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
393
+              data[d] = data[d].split(',')
394
+          }
395
+          if (d.includes('familiar')) {
396
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
397
+              data[d] = parseInt(data[d])
398
+          }
399
+        }
400
+        this.tableForm = data;
401
+      })
384 402
     },
385 403
     formatForm() {
386
-      if (this.tableForm.taskName == '负责人审核') {
404
+      if (this.taskName == '项目负责人审核') {
387 405
         this.isPiLeader = true;
388 406
         this.isDeptLeader = false;
389 407
         this.isManager = false;
390 408
         this.isStaff = false;
391
-      } else if (this.tableForm.taskName == '部门审核') {
409
+      } else if (this.taskName == '部门审核') {
392 410
         this.isPiLeader = false;
393 411
         this.isDeptLeader = true;
394 412
         this.isManager = false;
395 413
         this.isStaff = false;
396
-      } else if (this.tableForm.taskName == '分管审核') {
414
+      } else if (this.taskName == '分管审核') {
397 415
         this.isPiLeader = false;
398 416
         this.isDeptLeader = false;
399 417
         this.isManager = true;
400 418
         this.isStaff = false;
401
-      } else if (this.tableForm.taskName == '员工填报') {
419
+      } else if (this.taskName == '员工填报') {
402 420
         this.isPiLeader = false;
403 421
         this.isDeptLeader = false;
404 422
         this.isManager = false;
@@ -407,8 +425,48 @@ export default {
407 425
     },
408 426
     submit() {
409 427
       let flag = this.formValidate(this.tableForm)
410
-      if (flag)
411
-        this.$emit('submit', this.tableForm);
428
+      if (flag) {
429
+        // this.$emit('submit', this.tableForm);
430
+        let formData = new FormData();
431
+        this.tableForm.formId = this.taskForm.formId;
432
+        let form = JSON.stringify(this.tableForm);
433
+        formData.append("form", form);
434
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
435
+          let list = result;
436
+          if (list.total != 0) {
437
+            modifyAssess(formData);
438
+          } else {
439
+            submitAssess(formData);
440
+          }
441
+        })
442
+        const params = { taskId: this.taskForm.taskId }
443
+        getNextFlowNode(params).then(res => {
444
+          if (this.taskName == '员工填报') {
445
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
446
+              if (res.data)
447
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
448
+              complete(this.taskForm).then(response => {
449
+                this.$modal.msgSuccess(response.msg);
450
+                this.$emit("goBack");
451
+              });
452
+            })
453
+          } else if (this.taskName == '部门审核') {
454
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
455
+              let userId = res.data.userId;
456
+              this.$set(this.taskForm.variables, "approval", userId);
457
+              complete(this.taskForm).then(response => {
458
+                this.$modal.msgSuccess(response.msg);
459
+                this.$emit("goBack");
460
+              });
461
+            })
462
+          } else if (this.taskName == '分管审核') {
463
+            complete(this.taskForm).then(response => {
464
+              this.$modal.msgSuccess(response.msg);
465
+              this.$emit("goBack");
466
+            });
467
+          }
468
+        })
469
+      }
412 470
     },
413 471
     formValidate(form) {
414 472
       let flag = [];
@@ -430,7 +488,7 @@ export default {
430 488
       return isF
431 489
     },
432 490
     cancelSelect(value, name, disabled) {
433
-      if(disabled){
491
+      if (disabled) {
434 492
         return
435 493
       }
436 494
       if (this.isStaff) {
@@ -452,7 +510,7 @@ export default {
452 510
             this.tableForm[name] = value
453 511
         }
454 512
       }
455
-    }
513
+    },
456 514
   },
457 515
 }
458 516
 </script>
@@ -539,4 +597,5 @@ td {
539 597
   transform: rotate(-45deg);
540 598
   border-radius: 0px;
541 599
   background: none;
542
-}</style>
600
+}
601
+</style>

+ 104
- 34
oa-ui/src/views/flowable/form/zhTable.vue Voir le fichier

@@ -101,12 +101,13 @@
101 101
 
102 102
         <td rowspan="9">
103 103
           <div>{{ tableForm.remark01 }}</div>
104
-          <el-input v-if="isStaff" v-model="tableForm.remark01"  type="textarea" :rows="4"></el-input>
104
+          <el-input v-if="isStaff" v-model="tableForm.remark01" type="textarea" :rows="4"></el-input>
105 105
         </td>
106 106
         <td rowspan="9">
107 107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
108 108
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
109
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload01', isStaff)">
109
+              <el-radio :key="dict.value" :label="dict.value"
110
+                @click.native.prevent="cancelSelect(dict.value, 'workload01', isStaff)">
110 111
                 {{ dict.label }}
111 112
               </el-radio>
112 113
             </div>
@@ -215,12 +216,13 @@
215 216
         </td>
216 217
         <td rowspan="8">
217 218
           <div>{{ tableForm.remark02 }}</div>
218
-          <el-input v-if="isStaff" v-model="tableForm.remark02"  type="textarea" :rows="4"></el-input>
219
+          <el-input v-if="isStaff" v-model="tableForm.remark02" type="textarea" :rows="4"></el-input>
219 220
         </td>
220 221
         <td rowspan="8">
221 222
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
222 223
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
223
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload02', isStaff)">
224
+              <el-radio :key="dict.value" :label="dict.value"
225
+                @click.native.prevent="cancelSelect(dict.value, 'workload02', isStaff)">
224 226
                 {{ dict.label }}
225 227
               </el-radio>
226 228
             </div>
@@ -317,12 +319,13 @@
317 319
         </td>
318 320
         <td rowspan="5">
319 321
           <div>{{ tableForm.remark03 }}</div>
320
-          <el-input v-if="isStaff" v-model="tableForm.remark03"  type="textarea" :rows="4"></el-input>
322
+          <el-input v-if="isStaff" v-model="tableForm.remark03" type="textarea" :rows="4"></el-input>
321 323
         </td>
322 324
         <td rowspan="5">
323 325
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
324 326
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
325
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload03', isStaff)">
327
+              <el-radio :key="dict.value" :label="dict.value"
328
+                @click.native.prevent="cancelSelect(dict.value, 'workload03', isStaff)">
326 329
                 {{ dict.label }}
327 330
               </el-radio>
328 331
             </div>
@@ -394,12 +397,13 @@
394 397
         </td>
395 398
         <td rowspan="7">
396 399
           <div>{{ tableForm.remark04 }}</div>
397
-          <el-input v-if="isStaff" v-model="tableForm.remark04"  type="textarea" :rows="4"></el-input>
400
+          <el-input v-if="isStaff" v-model="tableForm.remark04" type="textarea" :rows="4"></el-input>
398 401
         </td>
399 402
         <td rowspan="7">
400 403
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
401 404
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
402
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload04', isStaff)">
405
+              <el-radio :key="dict.value" :label="dict.value"
406
+                @click.native.prevent="cancelSelect(dict.value, 'workload04', isStaff)">
403 407
                 {{ dict.label }}
404 408
               </el-radio>
405 409
             </div>
@@ -487,12 +491,13 @@
487 491
         </td>
488 492
         <td rowspan="10">
489 493
           <div>{{ tableForm.remark05 }}</div>
490
-          <el-input v-if="isStaff" v-model="tableForm.remark05"  type="textarea" :rows="4"></el-input>
494
+          <el-input v-if="isStaff" v-model="tableForm.remark05" type="textarea" :rows="4"></el-input>
491 495
         </td>
492 496
         <td rowspan="10">
493 497
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
494 498
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
495
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload05', isStaff)">
499
+              <el-radio :key="dict.value" :label="dict.value"
500
+                @click.native.prevent="cancelSelect(dict.value, 'workload05', isStaff)">
496 501
                 {{ dict.label }}
497 502
               </el-radio>
498 503
             </div>
@@ -603,12 +608,13 @@
603 608
         </td>
604 609
         <td rowspan="7">
605 610
           <div>{{ tableForm.remark06 }}</div>
606
-          <el-input v-if="isStaff" v-model="tableForm.remark06"  type="textarea" :rows="4"></el-input>
611
+          <el-input v-if="isStaff" v-model="tableForm.remark06" type="textarea" :rows="4"></el-input>
607 612
         </td>
608 613
         <td rowspan="7">
609 614
           <el-radio-group v-model="tableForm.workload06" :disabled="!isPiLeader">
610 615
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
611
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload06', isStaff)">
616
+              <el-radio :key="dict.value" :label="dict.value"
617
+                @click.native.prevent="cancelSelect(dict.value, 'workload06', isStaff)">
612 618
                 {{ dict.label }}
613 619
               </el-radio>
614 620
             </div>
@@ -695,12 +701,13 @@
695 701
         </td>
696 702
         <td rowspan="2">
697 703
           <div>{{ tableForm.remark07 }}</div>
698
-          <el-input v-if="isStaff" v-model="tableForm.remark07"  type="textarea" :rows="4"></el-input>
704
+          <el-input v-if="isStaff" v-model="tableForm.remark07" type="textarea" :rows="4"></el-input>
699 705
         </td>
700 706
         <td rowspan="2">
701 707
           <el-radio-group v-model="tableForm.workload07" :disabled="!isPiLeader">
702 708
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
703
-              <el-radio :key="dict.value" :label="dict.value" @click.native.prevent="cancelSelect(dict.value, 'workload07', isStaff)">
709
+              <el-radio :key="dict.value" :label="dict.value"
710
+                @click.native.prevent="cancelSelect(dict.value, 'workload07', isStaff)">
704 711
                 {{ dict.label }}
705 712
               </el-radio>
706 713
             </div>
@@ -746,10 +753,9 @@
746 753
         </td>
747 754
       </tr>
748 755
     </table>
749
-    <el-row justify="center" type="flex" style="margin-top:20px;"
750
-      v-if="tableForm.taskName == undefined || tableForm.taskName == '员工填报'">
751
-      <el-button type="primary" @click="submit">提交</el-button>
752
-      <el-button @click="$emit('close')">取消</el-button>
756
+    <el-row justify="center" type="flex" style="margin-top:20px;">
757
+      <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过'  }}</el-button>
758
+      <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
753 759
     </el-row>
754 760
   </div>
755 761
 </template>
@@ -757,13 +763,22 @@
757 763
 <script>
758 764
 import { JYContent } from '@/assets/datas/JYContent'
759 765
 import { getDicts as getDicts } from '@/api/system/dict/data'
766
+import { complete, getNextFlowNode } from "@/api/flowable/todo";
767
+import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
768
+import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
760 769
 export default {
761
-  dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment','cmc_workload'],
770
+  dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
762 771
   props: {
763 772
     tableForm: {
764 773
       type: Object,
765 774
       required: true
766 775
     },
776
+    taskName: {
777
+      type: String
778
+    },
779
+    taskForm: {
780
+      type: Object
781
+    }
767 782
   },
768 783
   watch: {
769 784
     tableForm: function (newval, oldval) {
@@ -772,6 +787,7 @@ export default {
772 787
   },
773 788
   data() {
774 789
     return {
790
+      tableForm: {},
775 791
       form: {},
776 792
       radio1: "",
777 793
       radio2: "",
@@ -790,26 +806,39 @@ export default {
790 806
     this.formatForm();
791 807
   },
792 808
   methods: {
793
-    initForm() {
794
-
809
+initForm() {
810
+      getAssess(this.taskForm.formId).then(res => {
811
+        let data = res.data;
812
+        for (let d in data) {
813
+          if (d.includes('role')) {
814
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
815
+              data[d] = data[d].split(',')
816
+          }
817
+          if (d.includes('familiar')) {
818
+            if (data[d] != "" && data[d] != undefined && data[d] != null)
819
+              data[d] = parseInt(data[d])
820
+          }
821
+        }
822
+        this.tableForm = data;
823
+      })
795 824
     },
796 825
     formatForm() {
797
-      if (this.tableForm.taskName == '负责人审核') {
826
+      if (this.taskName == '项目负责人审核') {
798 827
         this.isPiLeader = true;
799 828
         this.isDeptLeader = false;
800 829
         this.isManager = false;
801 830
         this.isStaff = false;
802
-      } else if (this.tableForm.taskName == '部门审核') {
831
+      } else if (this.taskName == '部门审核') {
803 832
         this.isPiLeader = false;
804 833
         this.isDeptLeader = true;
805 834
         this.isManager = false;
806 835
         this.isStaff = false;
807
-      } else if (this.tableForm.taskName == '分管审核') {
836
+      } else if (this.taskName == '分管审核') {
808 837
         this.isPiLeader = false;
809 838
         this.isDeptLeader = false;
810 839
         this.isManager = true;
811 840
         this.isStaff = false;
812
-      } else if (this.tableForm.taskName == '员工填报') {
841
+      } else if (this.taskName == '员工填报') {
813 842
         this.isPiLeader = false;
814 843
         this.isDeptLeader = false;
815 844
         this.isManager = false;
@@ -818,8 +847,48 @@ export default {
818 847
     },
819 848
     submit() {
820 849
       let flag = this.formValidate(this.tableForm)
821
-      if (flag)
822
-        this.$emit('submit', this.tableForm);
850
+      if (flag) {
851
+        // this.$emit('submit', this.tableForm);
852
+        let formData = new FormData();
853
+        this.tableForm.formId = this.taskForm.formId;
854
+        let form = JSON.stringify(this.tableForm);
855
+        formData.append("form", form);
856
+        listAssess({ assessId: this.tableForm.formId }).then(result => {
857
+          let list = result;
858
+          if (list.total != 0) {
859
+            modifyAssess(formData);
860
+          } else {
861
+            submitAssess(formData);
862
+          }
863
+        })
864
+        const params = { taskId: this.taskForm.taskId }
865
+        getNextFlowNode(params).then(res => {
866
+          if (this.taskName == '员工填报') {
867
+            getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
868
+              if (res.data)
869
+                this.$set(this.taskForm.variables, "approval", res.data.userId);
870
+              complete(this.taskForm).then(response => {
871
+                this.$modal.msgSuccess(response.msg);
872
+                this.$emit("goBack");
873
+              });
874
+            })
875
+          } else if (this.taskName == '部门审核') {
876
+            getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
877
+              let userId = res.data.userId;
878
+              this.$set(this.taskForm.variables, "approval", userId);
879
+              complete(this.taskForm).then(response => {
880
+                this.$modal.msgSuccess(response.msg);
881
+                this.$emit("goBack");
882
+              });
883
+            })
884
+          } else if (this.taskName == '分管审核') {
885
+            complete(this.taskForm).then(response => {
886
+              this.$modal.msgSuccess(response.msg);
887
+              this.$emit("goBack");
888
+            });
889
+          }
890
+        })
891
+      }
823 892
     },
824 893
     formValidate(form) {
825 894
       let flag = [];
@@ -835,13 +904,13 @@ export default {
835 904
       let isF = false;
836 905
       if (flag.length == 0) {
837 906
         this.$modal.msgError("表格未填写,请填写表格");
838
-      }else{
907
+      } else {
839 908
         isF = true
840 909
       }
841 910
       return isF
842 911
     },
843 912
     cancelSelect(value, name, disabled) {
844
-      if(disabled){
913
+      if (disabled) {
845 914
         return
846 915
       }
847 916
       if (this.isStaff) {
@@ -863,7 +932,7 @@ export default {
863 932
             this.tableForm[name] = value
864 933
         }
865 934
       }
866
-    }
935
+    },
867 936
   },
868 937
 }
869 938
 </script>
@@ -878,11 +947,13 @@ export default {
878 947
   background-color: #90d6f1;
879 948
   font-weight: bold;
880 949
 }
881
-.table-fillin{
950
+
951
+.table-fillin {
882 952
   background-color: #bfee93;
883 953
   font-weight: bold;
884 954
 }
885
-.table-fzr{
955
+
956
+.table-fzr {
886 957
   background-color: #eead93;
887 958
   font-weight: bold;
888 959
 }
@@ -948,5 +1019,4 @@ td {
948 1019
   transform: rotate(-45deg);
949 1020
   border-radius: 0px;
950 1021
   background: none;
951
-}
952
-</style>
1022
+}</style>

+ 6
- 6
oa-ui/src/views/flowable/task/finished/detail/index.vue Voir le fichier

@@ -15,12 +15,12 @@
15 15
           </el-col>
16 16
         </el-tab-pane> -->
17 17
         <el-tab-pane label="表单信息" name="1">
18
-          <sc-table :tableForm="tableForm" v-if="taskForm.procDefName == '生产部门考核'"></sc-table>
19
-          <jy-table :tableForm="tableForm" v-else-if="taskForm.procDefName == '经营发展部考核'"></jy-table>
20
-          <js-table :tableForm="tableForm" v-else-if="taskForm.procDefName == '技术质量部考核'"></js-table>
21
-          <xm-table :tableForm="tableForm" v-else-if="taskForm.procDefName == '项目管理部考核'"></xm-table>
22
-          <cw-table :tableForm="tableForm" v-else-if="taskForm.procDefName == '财务部考核'"></cw-table>
23
-          <zh-table :tableForm="tableForm" v-else-if="taskForm.procDefName == '综合事务部考核'"></zh-table>
18
+          <sc-table :taskForm="taskForm" :tableForm="tableForm" v-if="taskForm.procDefName == '生产部门考核'"></sc-table>
19
+          <jy-table :taskForm="taskForm" :tableForm="tableForm" v-else-if="taskForm.procDefName == '经营发展部考核'"></jy-table>
20
+          <js-table :taskForm="taskForm" :tableForm="tableForm" v-else-if="taskForm.procDefName == '技术质量部考核'"></js-table>
21
+          <xm-table :taskForm="taskForm" :tableForm="tableForm" v-else-if="taskForm.procDefName == '项目管理部考核'"></xm-table>
22
+          <cw-table :taskForm="taskForm" :tableForm="tableForm" v-else-if="taskForm.procDefName == '财务部考核'"></cw-table>
23
+          <zh-table :taskForm="taskForm" :tableForm="tableForm" v-else-if="taskForm.procDefName == '综合事务部考核'"></zh-table>
24 24
           <el-col :span="16" :offset="4" v-else>
25 25
             <div class="test-form">
26 26
               <parser :key="new Date().getTime()" :form-conf="variablesData" />

+ 23
- 65
oa-ui/src/views/flowable/task/todo/detail/index.vue Voir le fichier

@@ -10,18 +10,18 @@
10 10
       <el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
11 11
         <!--表单信息-->
12 12
         <el-tab-pane label="表单信息" name="1">
13
-          <sc-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
14
-            v-if="taskForm.procDefName == '生产部门考核'"></sc-table>
15
-          <jy-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
16
-            v-else-if="taskForm.procDefName == '经营发展部考核'"></jy-table>
17
-          <js-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
18
-            v-else-if="taskForm.procDefName == '技术质量部考核'"></js-table>
19
-          <xm-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
20
-            v-else-if="taskForm.procDefName == '项目管理部考核'"></xm-table>
21
-          <cw-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
22
-            v-else-if="taskForm.procDefName == '财务部考核'"></cw-table>
23
-          <zh-table :tableForm="tableForm" :taskName="taskName" @submit="handleComplete"
24
-            v-else-if="taskForm.procDefName == '综合事务部考核'"></zh-table>
13
+          <sc-table :taskForm="taskForm" :taskName="taskName" v-if="taskForm.procDefName == '生产部门考核'"
14
+            @goBack="goBack"></sc-table>
15
+          <jy-table :taskForm="taskForm" :taskName="taskName" v-else-if="taskForm.procDefName == '经营发展部考核'"
16
+            @goBack="goBack"></jy-table>
17
+          <js-table :taskForm="taskForm" :taskName="taskName" v-else-if="taskForm.procDefName == '技术质量部考核'"
18
+            @goBack="goBack"></js-table>
19
+          <xm-table :taskForm="taskForm" :taskName="taskName" v-else-if="taskForm.procDefName == '项目管理部考核'"
20
+            @goBack="goBack"></xm-table>
21
+          <cw-table :taskForm="taskForm" :taskName="taskName" v-else-if="taskForm.procDefName == '财务部考核'"
22
+            @goBack="goBack"></cw-table>
23
+          <zh-table :taskForm="taskForm" :taskName="taskName" v-else-if="taskForm.procDefName == '综合事务部考核'"
24
+            @goBack="goBack"></zh-table>
25 25
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批'"
26 26
             @goBack="goBack"></car-form>
27 27
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批(工会)'"
@@ -38,11 +38,12 @@
38 38
             @goBack="goBack"></safe-form>
39 39
           <technical-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '技术交底'"
40 40
             @goBack="goBack"></technical-form>
41
-          <el-row type="flex" justify="center" v-show="isShowApprove()">
42
-            <el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
43
-              @click="handleComplete">审核通过
44
-            </el-button>
45
-            <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>
41
+          <el-row type="flex" justify="center">
42
+            <!-- <el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
43
+              @click="handleComplete">审批
44
+            </el-button> -->
45
+            <el-button v-show="isShowApprove()" icon="el-icon-refresh-left" type="warning" size="mini"
46
+              @click="handleReturn">退回</el-button>
46 47
             <!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button> -->
47 48
           </el-row>
48 49
         </el-tab-pane>
@@ -175,7 +176,6 @@ import {
175 176
 import flow from '@/views/flowable/task/todo/detail/flow'
176 177
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
177 178
 import { listUser } from "@/api/system/user";
178
-import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
179 179
 import ScTable from "@/views/flowable/form/scTable.vue";
180 180
 import JyTable from "@/views/flowable/form/jyTable.vue";
181 181
 import ZhTable from "@/views/flowable/form/zhTable.vue";
@@ -276,8 +276,6 @@ export default {
276 276
       startUser: null, // 发起人信息,
277 277
       multiInstanceVars: '', // 会签节点
278 278
       formKeyExist: false, // 当前节点是否存在表单
279
-      // 表单信息
280
-      tableForm: {}
281 279
     };
282 280
   },
283 281
   created() {
@@ -295,7 +293,6 @@ export default {
295 293
       if (this.taskForm.taskId) {
296 294
         this.processVariables(this.taskForm.taskId)
297 295
         this.getFlowTaskForm(this.taskForm.taskId)
298
-        this.getAssessByAssessId(this.taskForm.formId)
299 296
       }
300 297
       this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
301 298
     }
@@ -386,38 +383,11 @@ export default {
386 383
         });
387 384
       }
388 385
     },
389
-    // 获取需要处理的表单表格信息
390
-    getAssessByAssessId(formId) {
391
-
392
-      getAssess(formId).then(res => {
393
-        let data = res.data;
394
-
395
-        for (let d in data) {
396
-          if (d.includes('role')) {
397
-            if (data[d] != "" && data[d] != undefined && data[d] != null)
398
-              data[d] = data[d].split(',')
399
-          }
400
-          if (d.includes('familiar')) {
401
-            if (data[d] != "" && data[d] != undefined && data[d] != null)
402
-              data[d] = parseInt(data[d])
403
-          }
404
-        }
405
-        this.tableForm = data;
406
-        this.tableForm.taskId = this.$route.query.taskId;
407
-        this.tableForm.taskName = this.$route.query.taskName;
408
-      })
409
-    },
410 386
     /** 加载审批任务弹框 */
411 387
     handleComplete() {
412 388
       // this.completeOpen = true;
413 389
       // this.completeTitle = "流程审批";
414
-      // this.submitForm(null);
415
-
416
-      let formData = new FormData();
417
-      this.tableForm.formId = this.tableForm.assessId;
418
-      let form = JSON.stringify(this.tableForm);
419
-      formData.append("form", form);
420
-      this.submitForm(formData, this.tableForm.assessId);
390
+      this.submitForm(null);
421 391
     },
422 392
     /** 用户审批任务 */
423 393
     taskComplete() {
@@ -526,20 +496,7 @@ export default {
526 496
       this.returnTaskList = [];
527 497
     },
528 498
     /** 申请流程表单数据提交 */
529
-    submitForm(formData, assessId) {
530
-      listAssess({ assessId }).then(result => {
531
-        let list = result;
532
-        if (list.total != 0) {
533
-          modifyAssess(formData).then(res => {
534
-          });
535
-        } else {
536
-          submitAssess(formData)
537
-        }
538
-      })
539
-
540
-      if (this.taskForm.variables === null) {
541
-        this.taskForm.variables = {};
542
-      }
499
+    submitForm(formData) {
543 500
       // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
544 501
       const params = { taskId: this.taskForm.taskId }
545 502
       getNextFlowNode(params).then(res => {
@@ -564,7 +521,7 @@ export default {
564 521
           }
565 522
         }
566 523
         this.completeOpen = true;
567
-        this.completeTitle = "选择下一节点审核人";
524
+        this.completeTitle = "流程审批";
568 525
       })
569 526
     },
570 527
     // 是否显示审批通过
@@ -608,4 +565,5 @@ export default {
608 565
 
609 566
 .my-label {
610 567
   background: #E1F3D8;
611
-}</style>
568
+}
569
+</style>

Loading…
Annuler
Enregistrer