Просмотр исходного кода

提交企业微信验收的问题

Lijy 2 лет назад
Родитель
Сommit
50c995c9aa

+ 8 - 6
fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue

@@ -258,13 +258,15 @@ export default {
             if(arr) {
                 for(var i in arr) {
                     console.log(arr[i].value, idd)
-                    if(arr[i].value == idd) {
-                        console.log('将要付给的值', arr[i])
-                        this.selectName = arr[i].label
-                        if(arr[i].type) {
-                            this.selectNameType = arr[i].type
+                    if(arr[i].label != this.$t('lable.department') || arr[i].label != this.$t('designatedpersonnel')) {
+                        if(arr[i].value == idd) {
+                            console.log('将要付给的值', arr[i])
+                            this.selectName = arr[i].label
+                            if(arr[i].type) {
+                                this.selectNameType = arr[i].type
+                            }
+                            return
                         }
-                        return
                     }
                     if(arr[i].children) {
                         this.traverseArr(arr[i].children, idd)

+ 55 - 20
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -1764,8 +1764,8 @@ export default {
                     var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
                     this.sdata = list;
                     this.soption = [
-                        {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep'},
-                        {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user'}
+                        {value: 1, label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep', id: 0},
+                        {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user', id: 0}
                     ]
                 } else {
                     this.$message({
@@ -1861,37 +1861,44 @@ export default {
             this.curDeptId = null;
             this.curUserId = null;
             this.dialogVisible = true;
+            this.selectedAuuid = ''
         },
         submitInsert() {
-            this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id,type: 2},
-            res => {
-                this.listLoading = false;
-                if (res.code == "ok") {
-                    this.$message({
-                        message: this.$t('savesuccess'),
-                        type: "success"
-                    });
-                } else {
+            if(this.dataArray.length > 0) {
+                this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id,type: 2},
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: this.$t('savesuccess'),
+                            type: "success"
+                        });
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
                     this.$message({
-                        message: res.msg,
+                        message: error,
                         type: "error"
                     });
-                }
-            },
-            error => {
-                this.listLoading = false;
+                });
+            } else {
                 this.$message({
-                    message: error,
+                    message: '至少选择一个部门或者人员做为审核人',
                     type: "error"
                 });
-            });
+            }
         },
         deleteNode() {
             this.dialogVisible = false;
             this.dataArray.splice(this.sindex, 1);
         },
         addNode() {
-            this.dialogVisible = false;
             if (this.curDeptId == null) return;
 
             // var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
@@ -1902,7 +1909,35 @@ export default {
             } else {
               node = this.addNodeObj
             }
-
+            let flgUserRadio = true
+              if(this.user.userNameNeedTranslate == 1) {
+                for(let s in this.dataArray) {
+                  if(node.type == 'dep') {
+                    if(this.dataArray[s].auditDeptName == node.label) {
+                      flgUserRadio = false
+                    }
+                  } else {
+                    if(this.dataArray[s].userName == node.label) {
+                      flgUserRadio = false
+                    }
+                  }
+                }
+              }
+              if(!flgUserRadio) {
+                if(node.type == 'dep') {
+                  this.$message({
+                      message: '已存在重复部门',
+                      type: "error"
+                  });
+                } else {
+                  this.$message({
+                      message: '已存在重复人员',
+                      type: "error"
+                  });
+                }
+                return false
+              }
+              this.dialogVisible = false;
             // var node = this.$refs.deptCascader.getCheckedNodes()[0];
             if (this.isAdd) {
                 // if(node.path[0] == 1){

+ 63 - 30
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -1352,8 +1352,8 @@ export default {
                         var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
                         this.sdata = list;
                         this.soption = [
-                          {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep'},
-                          {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user'}
+                          {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep', id: 0},
+                          {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user', id: 0}
                         ]
                         console.log(this.soption, '选人的数据')
                         this.Nsdata = list1
@@ -1396,6 +1396,7 @@ export default {
               this.curDeptId = null;
               this.curUserId = null;
               this.dialogVisible = true;
+              this.selectedAuuid = ''
             },
     editNodeDialog(index, item) {
                 //检查是否可编辑
@@ -1428,9 +1429,7 @@ export default {
                 
             },
     addNode() {
-      // console.log(this.curDeptId, 'zhilail')
-      // return
-              this.dialogVisible = false;
+              
               if (this.curDeptId == null) return;
               // if(this.user.userNameNeedTranslate != '1') {
               // var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
@@ -1444,7 +1443,35 @@ export default {
               }
               console.log(this.vueCasaderItem)
               console.log("node",node);
-              
+              let flgUserRadio = true
+              if(this.user.userNameNeedTranslate == 1) {
+                for(let s in this.dataArray) {
+                  if(node.type == 'dep') {
+                    if(this.dataArray[s].auditDeptName == node.label) {
+                      flgUserRadio = false
+                    }
+                  } else {
+                    if(this.dataArray[s].userName == node.label) {
+                      flgUserRadio = false
+                    }
+                  }
+                }
+              }
+              if(!flgUserRadio) {
+                if(node.type == 'dep') {
+                  this.$message({
+                      message: '已存在重复部门',
+                      type: "error"
+                  });
+                } else {
+                  this.$message({
+                      message: '已存在重复人员',
+                      type: "error"
+                  });
+                }
+                return false
+              }
+              this.dialogVisible = false;
               if (this.isAdd) {
                 if(this.user.userNameNeedTranslate != 1) {
                   var nodes
@@ -1486,30 +1513,36 @@ export default {
                 this.dataArray.splice(this.sindex, 1);
             },
     submitInsert() {
-                this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
-                            res => {
-                                this.listLoading = false;
-                                if (res.code == "ok") {
-                                    this.$message({
-                                        message: this.$t('savesuccess'),
-                                        type: "success"
-                                    });
-                                } else {
-                                    this.$message({
-                                        message: res.msg,
-                                        type: "error"
-                                    });
-                                }
-                            },
-                            error => {
-                                this.listLoading = false;
-                                this.$message({
-                                    message: error,
-                                    type: "error"
-                                });
-                                }
-                            );
-            },
+      if(this.dataArray.length > 0) {
+        this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
+          res => {
+              this.listLoading = false;
+              if (res.code == "ok") {
+                  this.$message({
+                      message: this.$t('savesuccess'),
+                      type: "success"
+                  });
+              } else {
+                  this.$message({
+                      message: res.msg,
+                      type: "error"
+                  });
+              }
+          },
+          error => {
+              this.listLoading = false;
+              this.$message({
+                  message: error,
+                  type: "error"
+              });
+          });
+      } else {
+        this.$message({
+            message: '至少选择一个部门或者人员做为审核人',
+            type: "error"
+        });
+      }
+    },
     
     // 
     approve(item) {