Procházet zdrojové kódy

考核流程更新

lamphua před 1 rokem
rodič
revize
891a1bceee

+ 1
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcAssessController.java Zobrazit soubor

110
         formData.put("assessId", assessId);
110
         formData.put("assessId", assessId);
111
         if (cmcAssess != null) {
111
         if (cmcAssess != null) {
112
             formData.put("assessTime", cmcAssess.getAssessTime());
112
             formData.put("assessTime", cmcAssess.getAssessTime());
113
+            formData.put("projectId", cmcAssess.getProjectId());
113
             if (cmcAssess.getProjectId() != null && !cmcAssess.getProjectId().equals("")){
114
             if (cmcAssess.getProjectId() != null && !cmcAssess.getProjectId().equals("")){
114
                 formData.put("projectNumber", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectNumber());
115
                 formData.put("projectNumber", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectNumber());
115
                 formData.put("projectName", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectName());
116
                 formData.put("projectName", cmcProjectService.selectCmcProjectByProjectId(cmcAssess.getProjectId()).getProjectName());

+ 12
- 12
oa-back/sql/sql.sql
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 85
- 28
oa-ui/src/views/flowable/form/cwTable.vue Zobrazit soubor

107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
108
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
108
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
109
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
111
                 {{ dict.label }}
112
               </el-radio>
112
               </el-radio>
113
             </div>
113
             </div>
117
           <el-radio-group v-model="tableForm.assessment01" :disabled="!isPiLeader">
117
           <el-radio-group v-model="tableForm.assessment01" :disabled="!isPiLeader">
118
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
118
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
119
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
121
                 {{ dict.label }}
122
               </el-radio>
122
               </el-radio>
123
             </div>
123
             </div>
211
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
211
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
212
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
212
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
213
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
215
                 {{ dict.label }}
216
               </el-radio>
216
               </el-radio>
217
             </div>
217
             </div>
221
           <el-radio-group v-model="tableForm.assessment02" :disabled="!isPiLeader">
221
           <el-radio-group v-model="tableForm.assessment02" :disabled="!isPiLeader">
222
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
222
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
223
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
225
                 {{ dict.label }}
226
               </el-radio>
226
               </el-radio>
227
             </div>
227
             </div>
274
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
274
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
275
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
275
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
276
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
278
                 {{ dict.label }}
279
               </el-radio>
279
               </el-radio>
280
             </div>
280
             </div>
284
           <el-radio-group v-model="tableForm.assessment03" :disabled="!isPiLeader">
284
           <el-radio-group v-model="tableForm.assessment03" :disabled="!isPiLeader">
285
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
285
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
286
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
288
                 {{ dict.label }}
289
               </el-radio>
289
               </el-radio>
290
             </div>
290
             </div>
367
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
367
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
368
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
368
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
369
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
371
                 {{ dict.label }}
372
               </el-radio>
372
               </el-radio>
373
             </div>
373
             </div>
377
           <el-radio-group v-model="tableForm.assessment04" :disabled="!isPiLeader">
377
           <el-radio-group v-model="tableForm.assessment04" :disabled="!isPiLeader">
378
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
378
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
379
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
381
                 {{ dict.label }}
382
               </el-radio>
382
               </el-radio>
383
             </div>
383
             </div>
468
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
468
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
469
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
469
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
470
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
472
                 {{ dict.label }}
473
               </el-radio>
473
               </el-radio>
474
             </div>
474
             </div>
478
           <el-radio-group v-model="tableForm.assessment05" :disabled="!isPiLeader">
478
           <el-radio-group v-model="tableForm.assessment05" :disabled="!isPiLeader">
479
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
479
             <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
480
               <el-radio :key="dict.value" :label="dict.value"
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
                 {{ dict.label }}
482
                 {{ dict.label }}
483
               </el-radio>
483
               </el-radio>
484
             </div>
484
             </div>
521
         </td>
521
         </td>
522
       </tr>
522
       </tr>
523
     </table>
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
     </el-row>
527
     </el-row>
529
   </div>
528
   </div>
530
 </template>
529
 </template>
532
 <script>
531
 <script>
533
 import { XMContent } from '@/assets/datas/XMContent'
532
 import { XMContent } from '@/assets/datas/XMContent'
534
 import { getDicts as getDicts } from '@/api/system/dict/data'
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
 export default {
537
 export default {
536
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
538
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
537
   props: {
539
   props: {
538
-    tableForm: {
539
-      type: Object,
540
-      required: true
541
-    },
542
     taskName: {
540
     taskName: {
543
       type: String
541
       type: String
542
+    },
543
+    taskForm: {
544
+      type: Object
544
     }
545
     }
545
   },
546
   },
546
   watch: {
547
   watch: {
550
   },
551
   },
551
   data() {
552
   data() {
552
     return {
553
     return {
554
+      tableForm: {},
553
       form: {},
555
       form: {},
554
       radio1: "",
556
       radio1: "",
555
       radio2: "",
557
       radio2: "",
567
   mounted() {
569
   mounted() {
568
     this.formatForm();
570
     this.formatForm();
569
   },
571
   },
570
-  methods: {
572
+  methods: {// 获取需要处理的表单表格信息
571
     initForm() {
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
     formatForm() {
589
     formatForm() {
575
 
590
 
576
-      if (this.taskName == '负责人审核') {
591
+      if (this.taskName == '项目负责人审核') {
577
         this.isPiLeader = true;
592
         this.isPiLeader = true;
578
         this.isDeptLeader = false;
593
         this.isDeptLeader = false;
579
         this.isManager = false;
594
         this.isManager = false;
597
     },
612
     },
598
     submit() {
613
     submit() {
599
       let flag = this.formValidate(this.tableForm)
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
     formValidate(form) {
658
     formValidate(form) {
604
       let flag = [];
659
       let flag = [];
614
       let isF = false;
669
       let isF = false;
615
       if (flag.length == 0) {
670
       if (flag.length == 0) {
616
         this.$modal.msgError("表格未填写,请填写表格");
671
         this.$modal.msgError("表格未填写,请填写表格");
617
-      }else{
672
+      } else {
618
         isF = true
673
         isF = true
619
       }
674
       }
620
       return isF
675
       return isF
621
     },
676
     },
622
     cancelSelect(value, name, disabled) {
677
     cancelSelect(value, name, disabled) {
623
-      if(disabled){
678
+      if (disabled) {
624
         return
679
         return
625
       }
680
       }
626
       if (this.isStaff) {
681
       if (this.isStaff) {
642
             this.tableForm[name] = value
697
             this.tableForm[name] = value
643
         }
698
         }
644
       }
699
       }
645
-    }
700
+    },    
646
   },
701
   },
647
 }
702
 }
648
 </script>
703
 </script>
657
   background-color: #90d6f1;
712
   background-color: #90d6f1;
658
   font-weight: bold;
713
   font-weight: bold;
659
 }
714
 }
660
-.table-fillin{
715
+
716
+.table-fillin {
661
   background-color: #bfee93;
717
   background-color: #bfee93;
662
   font-weight: bold;
718
   font-weight: bold;
663
 }
719
 }
664
-.table-fzr{
720
+
721
+.table-fzr {
665
   background-color: #eead93;
722
   background-color: #eead93;
666
   font-weight: bold;
723
   font-weight: bold;
667
 }
724
 }

+ 87
- 23
oa-ui/src/views/flowable/form/jsTable.vue Zobrazit soubor

123
         <td rowspan="6">
123
         <td rowspan="6">
124
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
124
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
125
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
128
                 {{ dict.label }}
128
               </el-radio>
129
               </el-radio>
129
             </div>
130
             </div>
220
         <td rowspan="4">
221
         <td rowspan="4">
221
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
222
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
222
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
226
                 {{ dict.label }}
225
               </el-radio>
227
               </el-radio>
226
             </div>
228
             </div>
300
         <td rowspan="13">
302
         <td rowspan="13">
301
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
303
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
302
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
307
                 {{ dict.label }}
305
               </el-radio>
308
               </el-radio>
306
             </div>
309
             </div>
453
         <td rowspan="5">
456
         <td rowspan="5">
454
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
457
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
455
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
461
                 {{ dict.label }}
458
               </el-radio>
462
               </el-radio>
459
             </div>
463
             </div>
542
         <td rowspan="3">
546
         <td rowspan="3">
543
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
547
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
544
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
551
                 {{ dict.label }}
547
               </el-radio>
552
               </el-radio>
548
             </div>
553
             </div>
597
         </td>
602
         </td>
598
       </tr>
603
       </tr>
599
     </table>
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
     </el-row>
608
     </el-row>
605
   </div>
609
   </div>
606
 </template>
610
 </template>
608
 <script>
612
 <script>
609
 import { JYContent } from '@/assets/datas/JYContent'
613
 import { JYContent } from '@/assets/datas/JYContent'
610
 import { getDicts as getDicts } from '@/api/system/dict/data'
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
 export default {
618
 export default {
612
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
619
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
613
   props: {
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
   watch: {
628
   watch: {
620
     tableForm: function (newval, oldval) {
629
     tableForm: function (newval, oldval) {
623
   },
632
   },
624
   data() {
633
   data() {
625
     return {
634
     return {
635
+      tableForm: {},
626
       form: {},
636
       form: {},
627
       radio1: "",
637
       radio1: "",
628
       radio2: "",
638
       radio2: "",
642
   },
652
   },
643
   methods: {
653
   methods: {
644
     initForm() {
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
     formatForm() {
670
     formatForm() {
648
-      if (this.tableForm.taskName == '负责人审核') {
671
+      if (this.taskName == '项目负责人审核') {
649
         this.isPiLeader = true;
672
         this.isPiLeader = true;
650
         this.isDeptLeader = false;
673
         this.isDeptLeader = false;
651
         this.isManager = false;
674
         this.isManager = false;
652
         this.isStaff = false;
675
         this.isStaff = false;
653
-      } else if (this.tableForm.taskName == '部门审核') {
676
+      } else if (this.taskName == '部门审核') {
654
         this.isPiLeader = false;
677
         this.isPiLeader = false;
655
         this.isDeptLeader = true;
678
         this.isDeptLeader = true;
656
         this.isManager = false;
679
         this.isManager = false;
657
         this.isStaff = false;
680
         this.isStaff = false;
658
-      } else if (this.tableForm.taskName == '分管审核') {
681
+      } else if (this.taskName == '分管审核') {
659
         this.isPiLeader = false;
682
         this.isPiLeader = false;
660
         this.isDeptLeader = false;
683
         this.isDeptLeader = false;
661
         this.isManager = true;
684
         this.isManager = true;
662
         this.isStaff = false;
685
         this.isStaff = false;
663
-      } else if (this.tableForm.taskName == '员工填报') {
686
+      } else if (this.taskName == '员工填报') {
664
         this.isPiLeader = false;
687
         this.isPiLeader = false;
665
         this.isDeptLeader = false;
688
         this.isDeptLeader = false;
666
         this.isManager = false;
689
         this.isManager = false;
669
     },
692
     },
670
     submit() {
693
     submit() {
671
       let flag = this.formValidate(this.tableForm)
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
     formValidate(form) {
738
     formValidate(form) {
676
       let flag = [];
739
       let flag = [];
686
       let isF = false;
749
       let isF = false;
687
       if (flag.length == 0) {
750
       if (flag.length == 0) {
688
         this.$modal.msgError("表格未填写,请填写表格");
751
         this.$modal.msgError("表格未填写,请填写表格");
689
-      }else{
752
+      } else {
690
         isF = true
753
         isF = true
691
       }
754
       }
692
       return isF
755
       return isF
693
     },
756
     },
694
     cancelSelect(value, name, disabled) {
757
     cancelSelect(value, name, disabled) {
695
-      if(disabled){
758
+      if (disabled) {
696
         return
759
         return
697
       }
760
       }
698
       if (this.isStaff) {
761
       if (this.isStaff) {
714
             this.tableForm[name] = value
777
             this.tableForm[name] = value
715
         }
778
         }
716
       }
779
       }
717
-    }
780
+    },
718
   },
781
   },
719
 }
782
 }
720
 </script>
783
 </script>
800
   transform: rotate(-45deg);
863
   transform: rotate(-45deg);
801
   border-radius: 0px;
864
   border-radius: 0px;
802
   background: none;
865
   background: none;
803
-}</style>
866
+}
867
+</style>

+ 77
- 18
oa-ui/src/views/flowable/form/jyTable.vue Zobrazit soubor

305
         </td>
305
         </td>
306
       </tr>
306
       </tr>
307
     </table>
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
     </el-row>
311
     </el-row>
313
   </div>
312
   </div>
314
 </template>
313
 </template>
316
 <script>
315
 <script>
317
 import { JYContent } from '@/assets/datas/JYContent'
316
 import { JYContent } from '@/assets/datas/JYContent'
318
 import { getDicts as getDicts } from '@/api/system/dict/data'
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
 export default {
321
 export default {
320
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
322
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
321
   props: {
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
   watch: {
331
   watch: {
328
     tableForm: function (newval, oldval) {
332
     tableForm: function (newval, oldval) {
331
   },
335
   },
332
   data() {
336
   data() {
333
     return {
337
     return {
338
+      tableForm: {},
334
       form: {},
339
       form: {},
335
       radio1: "",
340
       radio1: "",
336
       radio2: "",
341
       radio2: "",
350
   },
355
   },
351
   methods: {
356
   methods: {
352
     initForm() {
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
     formatForm() {
373
     formatForm() {
356
-      if (this.tableForm.taskName == '负责人审核') {
374
+      if (this.taskName == '项目负责人审核') {
357
         this.isPiLeader = true;
375
         this.isPiLeader = true;
358
         this.isDeptLeader = false;
376
         this.isDeptLeader = false;
359
         this.isManager = false;
377
         this.isManager = false;
360
         this.isStaff = false;
378
         this.isStaff = false;
361
-      } else if (this.tableForm.taskName == '部门审核') {
379
+      } else if (this.taskName == '部门审核') {
362
         this.isPiLeader = false;
380
         this.isPiLeader = false;
363
         this.isDeptLeader = true;
381
         this.isDeptLeader = true;
364
         this.isManager = false;
382
         this.isManager = false;
365
         this.isStaff = false;
383
         this.isStaff = false;
366
-      } else if (this.tableForm.taskName == '分管审核') {
384
+      } else if (this.taskName == '分管审核') {
367
         this.isPiLeader = false;
385
         this.isPiLeader = false;
368
         this.isDeptLeader = false;
386
         this.isDeptLeader = false;
369
         this.isManager = true;
387
         this.isManager = true;
370
         this.isStaff = false;
388
         this.isStaff = false;
371
-      } else if (this.tableForm.taskName == '员工填报') {
389
+      } else if (this.taskName == '员工填报') {
372
         this.isPiLeader = false;
390
         this.isPiLeader = false;
373
         this.isDeptLeader = false;
391
         this.isDeptLeader = false;
374
         this.isManager = false;
392
         this.isManager = false;
377
     },
395
     },
378
     submit() {
396
     submit() {
379
       let flag = this.formValidate(this.tableForm)
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
     formValidate(form) {
441
     formValidate(form) {
384
       let flag = [];
442
       let flag = [];
394
       let isF = false;
452
       let isF = false;
395
       if (flag.length == 0) {
453
       if (flag.length == 0) {
396
         this.$modal.msgError("表格未填写,请填写表格");
454
         this.$modal.msgError("表格未填写,请填写表格");
397
-      }else{
455
+      } else {
398
         isF = true
456
         isF = true
399
       }
457
       }
400
       return isF
458
       return isF
401
     },
459
     },
402
     cancelSelect(value, name, disabled) {
460
     cancelSelect(value, name, disabled) {
403
-      if(disabled){
461
+      if (disabled) {
404
         return
462
         return
405
       }
463
       }
406
       if (this.isStaff) {
464
       if (this.isStaff) {
422
             this.tableForm[name] = value
480
             this.tableForm[name] = value
423
         }
481
         }
424
       }
482
       }
425
-    }
483
+    },
426
   },
484
   },
427
 }
485
 }
428
 </script>
486
 </script>
509
   transform: rotate(-45deg);
567
   transform: rotate(-45deg);
510
   border-radius: 0px;
568
   border-radius: 0px;
511
   background: none;
569
   background: none;
512
-}</style>
570
+}
571
+</style>

+ 117
- 35
oa-ui/src/views/flowable/form/scTable.vue Zobrazit soubor

150
         <td rowspan="5">
150
         <td rowspan="5">
151
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
151
           <el-radio-group v-model="tableForm.skill01" :disabled="!isPiLeader">
152
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
155
                 {{ dict.label }}
155
               </el-radio>
156
               </el-radio>
156
             </div>
157
             </div>
237
         <td rowspan="10">
238
         <td rowspan="10">
238
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
239
           <el-radio-group v-model="tableForm.skill02" :disabled="!isPiLeader">
239
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
243
                 {{ dict.label }}
242
               </el-radio>
244
               </el-radio>
243
             </div>
245
             </div>
361
         <td rowspan="5">
363
         <td rowspan="5">
362
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
364
           <el-radio-group v-model="tableForm.skill03" :disabled="!isPiLeader">
363
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
368
                 {{ dict.label }}
366
               </el-radio>
369
               </el-radio>
367
             </div>
370
             </div>
445
         <td rowspan="4">
448
         <td rowspan="4">
446
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
449
           <el-radio-group v-model="tableForm.skill04" :disabled="!isPiLeader">
447
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
453
                 {{ dict.label }}
450
               </el-radio>
454
               </el-radio>
451
             </div>
455
             </div>
518
         <td rowspan="6">
522
         <td rowspan="6">
519
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
523
           <el-radio-group v-model="tableForm.skill05" :disabled="!isPiLeader">
520
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
527
                 {{ dict.label }}
523
               </el-radio>
528
               </el-radio>
524
             </div>
529
             </div>
606
         <td rowspan="6">
611
         <td rowspan="6">
607
           <el-radio-group v-model="tableForm.skill06" :disabled="!isPiLeader">
612
           <el-radio-group v-model="tableForm.skill06" :disabled="!isPiLeader">
608
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
616
                 {{ dict.label }}
611
               </el-radio>
617
               </el-radio>
612
             </div>
618
             </div>
694
         <td rowspan="4">
700
         <td rowspan="4">
695
           <el-radio-group v-model="tableForm.skill07" :disabled="!isPiLeader">
701
           <el-radio-group v-model="tableForm.skill07" :disabled="!isPiLeader">
696
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
705
                 {{ dict.label }}
699
               </el-radio>
706
               </el-radio>
700
             </div>
707
             </div>
767
         <td rowspan="3">
774
         <td rowspan="3">
768
           <el-radio-group v-model="tableForm.skill08" :disabled="!isPiLeader">
775
           <el-radio-group v-model="tableForm.skill08" :disabled="!isPiLeader">
769
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
779
                 {{ dict.label }}
772
               </el-radio>
780
               </el-radio>
773
             </div>
781
             </div>
833
         <td rowspan="6">
841
         <td rowspan="6">
834
           <el-radio-group v-model="tableForm.skill09" :disabled="!isPiLeader">
842
           <el-radio-group v-model="tableForm.skill09" :disabled="!isPiLeader">
835
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
846
                 {{ dict.label }}
838
               </el-radio>
847
               </el-radio>
839
             </div>
848
             </div>
922
         <td rowspan="5">
931
         <td rowspan="5">
923
           <el-radio-group v-model="tableForm.skill10" :disabled="!isPiLeader">
932
           <el-radio-group v-model="tableForm.skill10" :disabled="!isPiLeader">
924
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
936
                 {{ dict.label }}
927
               </el-radio>
937
               </el-radio>
928
             </div>
938
             </div>
1003
         <td rowspan="6">
1013
         <td rowspan="6">
1004
           <el-radio-group v-model="tableForm.skill11" :disabled="!isPiLeader">
1014
           <el-radio-group v-model="tableForm.skill11" :disabled="!isPiLeader">
1005
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1018
                 {{ dict.label }}
1008
               </el-radio>
1019
               </el-radio>
1009
             </div>
1020
             </div>
1092
         <td rowspan="5">
1103
         <td rowspan="5">
1093
           <el-radio-group v-model="tableForm.skill12" :disabled="!isPiLeader">
1104
           <el-radio-group v-model="tableForm.skill12" :disabled="!isPiLeader">
1094
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1108
                 {{ dict.label }}
1097
               </el-radio>
1109
               </el-radio>
1098
             </div>
1110
             </div>
1173
         <td rowspan="6">
1185
         <td rowspan="6">
1174
           <el-radio-group v-model="tableForm.skill13" :disabled="!isPiLeader">
1186
           <el-radio-group v-model="tableForm.skill13" :disabled="!isPiLeader">
1175
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1190
                 {{ dict.label }}
1178
               </el-radio>
1191
               </el-radio>
1179
             </div>
1192
             </div>
1262
         <td rowspan="6">
1275
         <td rowspan="6">
1263
           <el-radio-group v-model="tableForm.skill14" :disabled="!isPiLeader">
1276
           <el-radio-group v-model="tableForm.skill14" :disabled="!isPiLeader">
1264
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1280
                 {{ dict.label }}
1267
               </el-radio>
1281
               </el-radio>
1268
             </div>
1282
             </div>
1351
         <td rowspan="6">
1365
         <td rowspan="6">
1352
           <el-radio-group v-model="tableForm.skill15" :disabled="!isPiLeader">
1366
           <el-radio-group v-model="tableForm.skill15" :disabled="!isPiLeader">
1353
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1370
                 {{ dict.label }}
1356
               </el-radio>
1371
               </el-radio>
1357
             </div>
1372
             </div>
1440
         <td rowspan="4">
1455
         <td rowspan="4">
1441
           <el-radio-group v-model="tableForm.skill16" :disabled="!isPiLeader">
1456
           <el-radio-group v-model="tableForm.skill16" :disabled="!isPiLeader">
1442
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1460
                 {{ dict.label }}
1445
               </el-radio>
1461
               </el-radio>
1446
             </div>
1462
             </div>
1512
         <td rowspan="5">
1528
         <td rowspan="5">
1513
           <el-radio-group v-model="tableForm.skill17" :disabled="!isPiLeader">
1529
           <el-radio-group v-model="tableForm.skill17" :disabled="!isPiLeader">
1514
             <div v-for="dict in dict.type.cmc_skill" style="text-align:left">
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
                 {{ dict.label }}
1533
                 {{ dict.label }}
1517
               </el-radio>
1534
               </el-radio>
1518
             </div>
1535
             </div>
1570
         </td>
1587
         </td>
1571
       </tr>
1588
       </tr>
1572
     </table>
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
     </el-row>
1593
     </el-row>
1578
   </div>
1594
   </div>
1579
 </template>
1595
 </template>
1583
 import { getDicts as getDicts } from '@/api/system/dict/data'
1599
 import { getDicts as getDicts } from '@/api/system/dict/data'
1584
 import { listProject } from '@/api/oa/project/project.js'
1600
 import { listProject } from '@/api/oa/project/project.js'
1585
 import { getProject } from '@/api/oa/project/project'
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
 export default {
1606
 export default {
1588
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment'],
1607
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment'],
1589
   props: {
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
   watch: {
1616
   watch: {
1596
     tableForm: function (newval, oldval) {
1617
     tableForm: function (newval, oldval) {
1599
   },
1620
   },
1600
   data() {
1621
   data() {
1601
     return {
1622
     return {
1623
+      tableForm: {},
1602
       form: {},
1624
       form: {},
1603
       radio1: "",
1625
       radio1: "",
1604
       radio2: "",
1626
       radio2: "",
1619
   },
1641
   },
1620
   methods: {
1642
   methods: {
1621
     initForm() {
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
       listProject({ pageSize: 200 }).then(res => {
1658
       listProject({ pageSize: 200 }).then(res => {
1623
         this.projectList = res.rows;
1659
         this.projectList = res.rows;
1624
       })
1660
       })
1642
             this.form['role' + i] = this.tableForm['role' + i]
1678
             this.form['role' + i] = this.tableForm['role' + i]
1643
         }
1679
         }
1644
       }
1680
       }
1645
-      if (this.tableForm.taskName == '负责人审核') {
1681
+      if (this.taskName == '项目负责人审核') {
1646
         this.isPiLeader = true;
1682
         this.isPiLeader = true;
1647
         this.isDeptLeader = false;
1683
         this.isDeptLeader = false;
1648
         this.isManager = false;
1684
         this.isManager = false;
1649
         this.isStaff = false;
1685
         this.isStaff = false;
1650
-      } else if (this.tableForm.taskName == '部门审核') {
1686
+      } else if (this.taskName == '部门审核') {
1651
         this.isPiLeader = false;
1687
         this.isPiLeader = false;
1652
         this.isDeptLeader = true;
1688
         this.isDeptLeader = true;
1653
         this.isManager = false;
1689
         this.isManager = false;
1654
         this.isStaff = false;
1690
         this.isStaff = false;
1655
-      } else if (this.tableForm.taskName == '分管审核') {
1691
+      } else if (this.taskName == '分管审核') {
1656
         this.isPiLeader = false;
1692
         this.isPiLeader = false;
1657
         this.isDeptLeader = false;
1693
         this.isDeptLeader = false;
1658
         this.isManager = true;
1694
         this.isManager = true;
1659
         this.isStaff = false;
1695
         this.isStaff = false;
1660
-      } else if (this.tableForm.taskName == '员工填报') {
1696
+      } else if (this.taskName == '员工填报') {
1661
         this.isPiLeader = false;
1697
         this.isPiLeader = false;
1662
         this.isDeptLeader = false;
1698
         this.isDeptLeader = false;
1663
         this.isManager = false;
1699
         this.isManager = false;
1694
       if (flag) {
1730
       if (flag) {
1695
         this.assignmentToTableForm();
1731
         this.assignmentToTableForm();
1696
         this.initTableFormFromForm();
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
     formValidate(form) {
1785
     formValidate(form) {
1703
       let flag = [];
1786
       let flag = [];
1718
       return isF
1801
       return isF
1719
     },
1802
     },
1720
     cancelSelect(value, name, disabled) {
1803
     cancelSelect(value, name, disabled) {
1721
-      if(disabled){
1804
+      if (disabled) {
1722
         return
1805
         return
1723
       }
1806
       }
1724
       if (this.isStaff) {
1807
       if (this.isStaff) {
1740
             this.tableForm[name] = value
1823
             this.tableForm[name] = value
1741
         }
1824
         }
1742
       }
1825
       }
1743
-    }
1826
+    },
1744
   },
1827
   },
1745
 }
1828
 }
1746
 </script>
1829
 </script>
1826
   transform: rotate(-45deg);
1909
   transform: rotate(-45deg);
1827
   border-radius: 0px;
1910
   border-radius: 0px;
1828
   background: none;
1911
   background: none;
1829
-}
1830
-</style>
1912
+}</style>

+ 76
- 17
oa-ui/src/views/flowable/form/xmTable.vue Zobrazit soubor

335
         </td>
335
         </td>
336
       </tr>
336
       </tr>
337
     </table>
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
     </el-row>
341
     </el-row>
343
   </div>
342
   </div>
344
 </template>
343
 </template>
346
 <script>
345
 <script>
347
 import { XMContent } from '@/assets/datas/XMContent'
346
 import { XMContent } from '@/assets/datas/XMContent'
348
 import { getDicts as getDicts } from '@/api/system/dict/data'
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
 export default {
351
 export default {
350
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
352
   dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
351
   props: {
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
   watch: {
361
   watch: {
358
     tableForm: function (newval, oldval) {
362
     tableForm: function (newval, oldval) {
361
   },
365
   },
362
   data() {
366
   data() {
363
     return {
367
     return {
368
+      tableForm: {},      
364
       form: {},
369
       form: {},
365
       radio1: "",
370
       radio1: "",
366
       radio2: "",
371
       radio2: "",
380
   },
385
   },
381
   methods: {
386
   methods: {
382
     initForm() {
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
     formatForm() {
403
     formatForm() {
386
-      if (this.tableForm.taskName == '负责人审核') {
404
+      if (this.taskName == '项目负责人审核') {
387
         this.isPiLeader = true;
405
         this.isPiLeader = true;
388
         this.isDeptLeader = false;
406
         this.isDeptLeader = false;
389
         this.isManager = false;
407
         this.isManager = false;
390
         this.isStaff = false;
408
         this.isStaff = false;
391
-      } else if (this.tableForm.taskName == '部门审核') {
409
+      } else if (this.taskName == '部门审核') {
392
         this.isPiLeader = false;
410
         this.isPiLeader = false;
393
         this.isDeptLeader = true;
411
         this.isDeptLeader = true;
394
         this.isManager = false;
412
         this.isManager = false;
395
         this.isStaff = false;
413
         this.isStaff = false;
396
-      } else if (this.tableForm.taskName == '分管审核') {
414
+      } else if (this.taskName == '分管审核') {
397
         this.isPiLeader = false;
415
         this.isPiLeader = false;
398
         this.isDeptLeader = false;
416
         this.isDeptLeader = false;
399
         this.isManager = true;
417
         this.isManager = true;
400
         this.isStaff = false;
418
         this.isStaff = false;
401
-      } else if (this.tableForm.taskName == '员工填报') {
419
+      } else if (this.taskName == '员工填报') {
402
         this.isPiLeader = false;
420
         this.isPiLeader = false;
403
         this.isDeptLeader = false;
421
         this.isDeptLeader = false;
404
         this.isManager = false;
422
         this.isManager = false;
407
     },
425
     },
408
     submit() {
426
     submit() {
409
       let flag = this.formValidate(this.tableForm)
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
     formValidate(form) {
471
     formValidate(form) {
414
       let flag = [];
472
       let flag = [];
430
       return isF
488
       return isF
431
     },
489
     },
432
     cancelSelect(value, name, disabled) {
490
     cancelSelect(value, name, disabled) {
433
-      if(disabled){
491
+      if (disabled) {
434
         return
492
         return
435
       }
493
       }
436
       if (this.isStaff) {
494
       if (this.isStaff) {
452
             this.tableForm[name] = value
510
             this.tableForm[name] = value
453
         }
511
         }
454
       }
512
       }
455
-    }
513
+    },
456
   },
514
   },
457
 }
515
 }
458
 </script>
516
 </script>
539
   transform: rotate(-45deg);
597
   transform: rotate(-45deg);
540
   border-radius: 0px;
598
   border-radius: 0px;
541
   background: none;
599
   background: none;
542
-}</style>
600
+}
601
+</style>

+ 104
- 34
oa-ui/src/views/flowable/form/zhTable.vue Zobrazit soubor

101
 
101
 
102
         <td rowspan="9">
102
         <td rowspan="9">
103
           <div>{{ tableForm.remark01 }}</div>
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
         </td>
105
         </td>
106
         <td rowspan="9">
106
         <td rowspan="9">
107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
107
           <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
108
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
111
                 {{ dict.label }}
111
               </el-radio>
112
               </el-radio>
112
             </div>
113
             </div>
215
         </td>
216
         </td>
216
         <td rowspan="8">
217
         <td rowspan="8">
217
           <div>{{ tableForm.remark02 }}</div>
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
         </td>
220
         </td>
220
         <td rowspan="8">
221
         <td rowspan="8">
221
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
222
           <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
222
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
226
                 {{ dict.label }}
225
               </el-radio>
227
               </el-radio>
226
             </div>
228
             </div>
317
         </td>
319
         </td>
318
         <td rowspan="5">
320
         <td rowspan="5">
319
           <div>{{ tableForm.remark03 }}</div>
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
         </td>
323
         </td>
322
         <td rowspan="5">
324
         <td rowspan="5">
323
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
325
           <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
324
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
329
                 {{ dict.label }}
327
               </el-radio>
330
               </el-radio>
328
             </div>
331
             </div>
394
         </td>
397
         </td>
395
         <td rowspan="7">
398
         <td rowspan="7">
396
           <div>{{ tableForm.remark04 }}</div>
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
         </td>
401
         </td>
399
         <td rowspan="7">
402
         <td rowspan="7">
400
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
403
           <el-radio-group v-model="tableForm.workload04" :disabled="!isPiLeader">
401
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
407
                 {{ dict.label }}
404
               </el-radio>
408
               </el-radio>
405
             </div>
409
             </div>
487
         </td>
491
         </td>
488
         <td rowspan="10">
492
         <td rowspan="10">
489
           <div>{{ tableForm.remark05 }}</div>
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
         </td>
495
         </td>
492
         <td rowspan="10">
496
         <td rowspan="10">
493
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
497
           <el-radio-group v-model="tableForm.workload05" :disabled="!isPiLeader">
494
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
501
                 {{ dict.label }}
497
               </el-radio>
502
               </el-radio>
498
             </div>
503
             </div>
603
         </td>
608
         </td>
604
         <td rowspan="7">
609
         <td rowspan="7">
605
           <div>{{ tableForm.remark06 }}</div>
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
         </td>
612
         </td>
608
         <td rowspan="7">
613
         <td rowspan="7">
609
           <el-radio-group v-model="tableForm.workload06" :disabled="!isPiLeader">
614
           <el-radio-group v-model="tableForm.workload06" :disabled="!isPiLeader">
610
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
618
                 {{ dict.label }}
613
               </el-radio>
619
               </el-radio>
614
             </div>
620
             </div>
695
         </td>
701
         </td>
696
         <td rowspan="2">
702
         <td rowspan="2">
697
           <div>{{ tableForm.remark07 }}</div>
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
         </td>
705
         </td>
700
         <td rowspan="2">
706
         <td rowspan="2">
701
           <el-radio-group v-model="tableForm.workload07" :disabled="!isPiLeader">
707
           <el-radio-group v-model="tableForm.workload07" :disabled="!isPiLeader">
702
             <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
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
                 {{ dict.label }}
711
                 {{ dict.label }}
705
               </el-radio>
712
               </el-radio>
706
             </div>
713
             </div>
746
         </td>
753
         </td>
747
       </tr>
754
       </tr>
748
     </table>
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
     </el-row>
759
     </el-row>
754
   </div>
760
   </div>
755
 </template>
761
 </template>
757
 <script>
763
 <script>
758
 import { JYContent } from '@/assets/datas/JYContent'
764
 import { JYContent } from '@/assets/datas/JYContent'
759
 import { getDicts as getDicts } from '@/api/system/dict/data'
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
 export default {
769
 export default {
761
-  dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment','cmc_workload'],
770
+  dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
762
   props: {
771
   props: {
763
     tableForm: {
772
     tableForm: {
764
       type: Object,
773
       type: Object,
765
       required: true
774
       required: true
766
     },
775
     },
776
+    taskName: {
777
+      type: String
778
+    },
779
+    taskForm: {
780
+      type: Object
781
+    }
767
   },
782
   },
768
   watch: {
783
   watch: {
769
     tableForm: function (newval, oldval) {
784
     tableForm: function (newval, oldval) {
772
   },
787
   },
773
   data() {
788
   data() {
774
     return {
789
     return {
790
+      tableForm: {},
775
       form: {},
791
       form: {},
776
       radio1: "",
792
       radio1: "",
777
       radio2: "",
793
       radio2: "",
790
     this.formatForm();
806
     this.formatForm();
791
   },
807
   },
792
   methods: {
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
     formatForm() {
825
     formatForm() {
797
-      if (this.tableForm.taskName == '负责人审核') {
826
+      if (this.taskName == '项目负责人审核') {
798
         this.isPiLeader = true;
827
         this.isPiLeader = true;
799
         this.isDeptLeader = false;
828
         this.isDeptLeader = false;
800
         this.isManager = false;
829
         this.isManager = false;
801
         this.isStaff = false;
830
         this.isStaff = false;
802
-      } else if (this.tableForm.taskName == '部门审核') {
831
+      } else if (this.taskName == '部门审核') {
803
         this.isPiLeader = false;
832
         this.isPiLeader = false;
804
         this.isDeptLeader = true;
833
         this.isDeptLeader = true;
805
         this.isManager = false;
834
         this.isManager = false;
806
         this.isStaff = false;
835
         this.isStaff = false;
807
-      } else if (this.tableForm.taskName == '分管审核') {
836
+      } else if (this.taskName == '分管审核') {
808
         this.isPiLeader = false;
837
         this.isPiLeader = false;
809
         this.isDeptLeader = false;
838
         this.isDeptLeader = false;
810
         this.isManager = true;
839
         this.isManager = true;
811
         this.isStaff = false;
840
         this.isStaff = false;
812
-      } else if (this.tableForm.taskName == '员工填报') {
841
+      } else if (this.taskName == '员工填报') {
813
         this.isPiLeader = false;
842
         this.isPiLeader = false;
814
         this.isDeptLeader = false;
843
         this.isDeptLeader = false;
815
         this.isManager = false;
844
         this.isManager = false;
818
     },
847
     },
819
     submit() {
848
     submit() {
820
       let flag = this.formValidate(this.tableForm)
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
     formValidate(form) {
893
     formValidate(form) {
825
       let flag = [];
894
       let flag = [];
835
       let isF = false;
904
       let isF = false;
836
       if (flag.length == 0) {
905
       if (flag.length == 0) {
837
         this.$modal.msgError("表格未填写,请填写表格");
906
         this.$modal.msgError("表格未填写,请填写表格");
838
-      }else{
907
+      } else {
839
         isF = true
908
         isF = true
840
       }
909
       }
841
       return isF
910
       return isF
842
     },
911
     },
843
     cancelSelect(value, name, disabled) {
912
     cancelSelect(value, name, disabled) {
844
-      if(disabled){
913
+      if (disabled) {
845
         return
914
         return
846
       }
915
       }
847
       if (this.isStaff) {
916
       if (this.isStaff) {
863
             this.tableForm[name] = value
932
             this.tableForm[name] = value
864
         }
933
         }
865
       }
934
       }
866
-    }
935
+    },
867
   },
936
   },
868
 }
937
 }
869
 </script>
938
 </script>
878
   background-color: #90d6f1;
947
   background-color: #90d6f1;
879
   font-weight: bold;
948
   font-weight: bold;
880
 }
949
 }
881
-.table-fillin{
950
+
951
+.table-fillin {
882
   background-color: #bfee93;
952
   background-color: #bfee93;
883
   font-weight: bold;
953
   font-weight: bold;
884
 }
954
 }
885
-.table-fzr{
955
+
956
+.table-fzr {
886
   background-color: #eead93;
957
   background-color: #eead93;
887
   font-weight: bold;
958
   font-weight: bold;
888
 }
959
 }
948
   transform: rotate(-45deg);
1019
   transform: rotate(-45deg);
949
   border-radius: 0px;
1020
   border-radius: 0px;
950
   background: none;
1021
   background: none;
951
-}
952
-</style>
1022
+}</style>

+ 6
- 6
oa-ui/src/views/flowable/task/finished/detail/index.vue Zobrazit soubor

15
           </el-col>
15
           </el-col>
16
         </el-tab-pane> -->
16
         </el-tab-pane> -->
17
         <el-tab-pane label="表单信息" name="1">
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
           <el-col :span="16" :offset="4" v-else>
24
           <el-col :span="16" :offset="4" v-else>
25
             <div class="test-form">
25
             <div class="test-form">
26
               <parser :key="new Date().getTime()" :form-conf="variablesData" />
26
               <parser :key="new Date().getTime()" :form-conf="variablesData" />

+ 23
- 65
oa-ui/src/views/flowable/task/todo/detail/index.vue Zobrazit soubor

10
       <el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
10
       <el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
11
         <!--表单信息-->
11
         <!--表单信息-->
12
         <el-tab-pane label="表单信息" name="1">
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
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批'"
25
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批'"
26
             @goBack="goBack"></car-form>
26
             @goBack="goBack"></car-form>
27
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批(工会)'"
27
           <car-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '用车审批(工会)'"
38
             @goBack="goBack"></safe-form>
38
             @goBack="goBack"></safe-form>
39
           <technical-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '技术交底'"
39
           <technical-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '技术交底'"
40
             @goBack="goBack"></technical-form>
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
             <!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button> -->
47
             <!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button> -->
47
           </el-row>
48
           </el-row>
48
         </el-tab-pane>
49
         </el-tab-pane>
175
 import flow from '@/views/flowable/task/todo/detail/flow'
176
 import flow from '@/views/flowable/task/todo/detail/flow'
176
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
177
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
177
 import { listUser } from "@/api/system/user";
178
 import { listUser } from "@/api/system/user";
178
-import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
179
 import ScTable from "@/views/flowable/form/scTable.vue";
179
 import ScTable from "@/views/flowable/form/scTable.vue";
180
 import JyTable from "@/views/flowable/form/jyTable.vue";
180
 import JyTable from "@/views/flowable/form/jyTable.vue";
181
 import ZhTable from "@/views/flowable/form/zhTable.vue";
181
 import ZhTable from "@/views/flowable/form/zhTable.vue";
276
       startUser: null, // 发起人信息,
276
       startUser: null, // 发起人信息,
277
       multiInstanceVars: '', // 会签节点
277
       multiInstanceVars: '', // 会签节点
278
       formKeyExist: false, // 当前节点是否存在表单
278
       formKeyExist: false, // 当前节点是否存在表单
279
-      // 表单信息
280
-      tableForm: {}
281
     };
279
     };
282
   },
280
   },
283
   created() {
281
   created() {
295
       if (this.taskForm.taskId) {
293
       if (this.taskForm.taskId) {
296
         this.processVariables(this.taskForm.taskId)
294
         this.processVariables(this.taskForm.taskId)
297
         this.getFlowTaskForm(this.taskForm.taskId)
295
         this.getFlowTaskForm(this.taskForm.taskId)
298
-        this.getAssessByAssessId(this.taskForm.formId)
299
       }
296
       }
300
       this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
297
       this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
301
     }
298
     }
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
     handleComplete() {
387
     handleComplete() {
412
       // this.completeOpen = true;
388
       // this.completeOpen = true;
413
       // this.completeTitle = "流程审批";
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
     taskComplete() {
393
     taskComplete() {
526
       this.returnTaskList = [];
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
       // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
500
       // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
544
       const params = { taskId: this.taskForm.taskId }
501
       const params = { taskId: this.taskForm.taskId }
545
       getNextFlowNode(params).then(res => {
502
       getNextFlowNode(params).then(res => {
564
           }
521
           }
565
         }
522
         }
566
         this.completeOpen = true;
523
         this.completeOpen = true;
567
-        this.completeTitle = "选择下一节点审核人";
524
+        this.completeTitle = "流程审批";
568
       })
525
       })
569
     },
526
     },
570
     // 是否显示审批通过
527
     // 是否显示审批通过
608
 
565
 
609
 .my-label {
566
 .my-label {
610
   background: #E1F3D8;
567
   background: #E1F3D8;
611
-}</style>
568
+}
569
+</style>

Loading…
Zrušit
Uložit