Forráskód Böngészése

2022.3.18批量修改部门的接口修改

17613754660 3 éve
szülő
commit
ae5d3824e9

+ 9 - 45
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -532,13 +532,15 @@
                     this.$message('请选择部门');
                     return
                 }
-
-                console.log(this.handleSelectionZzjgwillchange);
                 //接口调用样例代码如下
-                var ids = ['8189056724477485056', '8189056816878002176'];
+                var ids = [];
+                for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
+                    ids.push(this.handleSelectionZzjgDate[index].id)
+                }
+                var changeId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
                 this.http.post('/user/batchUpdateDept', {
                         userIds: JSON.stringify(ids),
-                        deptId: 4
+                        deptId: changeId
                     },
                     res => {
                         if (res.code == "ok") {
@@ -1022,28 +1024,9 @@
                 this.dialogVisible = true;
             },
 
-            submitInsert(event,i) {
+            submitInsert() {
                 var form = {}
-                if (i == 1) {
-                    form = {
-                            name: event.name,
-                            phone: event.phone,
-                            role: event.role,
-                            monthCost: event.monthCost,
-                            cost: event.cost,
-                            salaryType: event.salaryType,
-                        };
-                    if (event.id != null) {
-                            form.id = event.id;
-                        }
-                        if (event.costApplyDate != null) {
-                            form.costApplyDate = event.costApplyDate;
-                        }
-                        if (event.departmentId != null) {
-                            form.departmentId = event.departmentId;
-                        }
-                } else {
-                     this.$refs.form1.validate(valid => {
+                this.$refs.form1.validate(valid => {
                     if (valid) {
                         this.submitLoading = true;
                         form = {
@@ -1065,7 +1048,6 @@
                         }
                     }
                 });
-                }
                 this.http.post( this.port.manage.insert, form,
                         res => {
                             this.submitLoading = false;
@@ -1189,25 +1171,8 @@
                 this.dialogVisible1 = true;
             },
 
-            submitInsert1(event,i) {
+            submitInsert1() {
                 var form = {}
-                if (i == 1) {
-                    this.submitLoading = true;
-                        form = {
-                            id: event.id,
-                            name: event.name,
-                            phone: event.phone,
-                            role: event.role,
-                            monthCost: event.monthCost,
-                            cost: event.cost
-                        };
-                        if (event.departmentId != null) {
-                            form.departmentId = event.departmentId;
-                        }
-                        if (event.costApplyDate != null) {
-                            form.costApplyDate = event.costApplyDate;
-                        }
-                } else {
                     this.$refs.form1.validate(valid => {
                     if (valid) {
                         this.submitLoading = true;
@@ -1227,7 +1192,6 @@
                         }
                     }
                 });
-                }
                 this.http.post( this.port.manage.insert, form,
                         res => {
                             this.submitLoading = false;