Bladeren bron

批量修改部门样例代码

seyason 3 jaren geleden
bovenliggende
commit
ccb9b83a19

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -617,6 +617,7 @@
                             this.tblCols.push(this.customCols.insuranceMedical);
                             this.tblCols.push(this.customCols.insuranceLosejob);
                             this.tblCols.push(this.customCols.insuranceInjury);
+                            this.tblCols.push(this.customCols.houseFund);
                             if (this.customCols.field1 != null) {
                                 this.tblCols.push(this.customCols.field1);
                             }

+ 38 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -532,18 +532,46 @@
                     this.$message('请选择部门');
                     return
                 }
+
+                console.log(this.handleSelectionZzjgwillchange);
+                //接口调用样例代码如下
+                var ids = ['8189056724477485056', '8189056816878002176'];
+                this.http.post('/user/batchUpdateDept', {
+                        userIds: JSON.stringify(ids),
+                        deptId: 4
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '修改成功',
+                                type: "success"
+                            });
+                            this.getUser()
+                        } else {
+                            this.$message({
+                            message: res.msg,
+                            type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
                 
-                for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
-                    this.handleSelectionZzjgDate[index].departmentId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
-                    if (this.handleSelectionZzjgDate[index].role == 1) {
-                        this.submitInsert1(this.handleSelectionZzjgDate[index],1)
-                    }else{
-                        this.submitInsert(this.handleSelectionZzjgDate[index],1)
-                    }
+                // for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
+                //     this.handleSelectionZzjgDate[index].departmentId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
+                //     if (this.handleSelectionZzjgDate[index].role == 1) {
+                //         this.submitInsert1(this.handleSelectionZzjgDate[index],1)
+                //     }else{
+                //         this.submitInsert(this.handleSelectionZzjgDate[index],1)
+                //     }
                     
-                }
-                this.handleSelectionZzjgwillchange = null
-                this.handleSelectionZzjgshow = false
+                // }
+                // this.handleSelectionZzjgwillchange = null
+                // this.handleSelectionZzjgshow = false
             },
             handleSelectionZzjgbtn3(){
                 if(this.handleSelectionZzjgDate.length == 0){