diff --git a/src/views/PersonManager/user/components/list.vue b/src/views/PersonManager/user/components/list.vue index baa782a..620ff4a 100644 --- a/src/views/PersonManager/user/components/list.vue +++ b/src/views/PersonManager/user/components/list.vue @@ -134,7 +134,7 @@ @@ -452,10 +453,10 @@ export default { this.$refs.tree.filter(val) } }, - created() { - this.getList('') - this.hasButton() - this.getTreeList() + async created() { + await this.getList('') + await this.hasButton() + await this.getTreeList() }, methods: { goPush(row) { @@ -499,6 +500,38 @@ export default { this.listLoading = false }) }, + resign(e) { + this.$confirm('确定后该员工会离职, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + requestFN( + 'user/resign', + { + USER_ID: e.USER_ID + } + ).then((data) => { + if (data.result === 'success') { + this.$message({ + type: 'success', + message: '离职成功!' + }) + this.getList() + } else { + this.$message.error('推送失败,' + data.msg) + this.getList() + } + }).catch((e) => { + this.listLoading = false + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消离职' + }) + }) + }, getRowKey(row) { return row.USER_ID }, @@ -655,41 +688,43 @@ export default { }, getList(DEPARTMENT_ID) { - console.info(DEPARTMENT_ID) - this.listLoading = true - if (DEPARTMENT_ID) { - this.DEPARTMENT_ID = DEPARTMENT_ID - } - this.CORPINFO_ID = JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID - requestFN( - '/user/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page, - { - KEYWORDS: this.KEYWORDS, - DEPARTMENT_ID: this.DEPARTMENT_ID, - CORPINFO_ID: this.CORPINFO_ID, - ISFLOW: this.ISFLOW, - AUDIT_STATE: this.AUDIT_STATE, - DEPART_STATE: this.DEPART_STATE, - BASIC_STATE: this.BASIC_STATE, - CARD_ID: this.ID_CARD, - USER_ID: this.USER_ID + return new Promise((resolve, reject) => { + this.listLoading = true + if (DEPARTMENT_ID) { + this.DEPARTMENT_ID = DEPARTMENT_ID } - ).then((data) => { - this.listLoading = false - this.varList = data.userList - console.log(this.varList) - for (let i = 0; i < this.varList.length; i++) { - if (this.varList[i].cardImgCount) { - this.varList[i].BASIC_STATE = 1 - } else if (this.varList[i].ROLE_ID == '362add4102cd4d1ebe3768a8e58c737f') { - this.varList[i].BASIC_STATE = '' - } else { - this.varList[i].BASIC_STATE = 2 + this.CORPINFO_ID = JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID + requestFN( + '/user/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page, + { + KEYWORDS: this.KEYWORDS, + DEPARTMENT_ID: this.DEPARTMENT_ID, + CORPINFO_ID: this.CORPINFO_ID, + ISFLOW: this.ISFLOW, + AUDIT_STATE: this.AUDIT_STATE, + DEPART_STATE: this.DEPART_STATE, + BASIC_STATE: this.BASIC_STATE, + CARD_ID: this.ID_CARD, + USER_ID: this.USER_ID } - } - this.total = data.page.total - }).catch((e) => { - this.listLoading = false + ).then((data) => { + this.listLoading = false + this.varList = data.userList + for (let i = 0; i < this.varList.length; i++) { + if (this.varList[i].cardImgCount) { + this.varList[i].BASIC_STATE = 1 + } else if (this.varList[i].ROLE_ID == '362add4102cd4d1ebe3768a8e58c737f') { + this.varList[i].BASIC_STATE = '' + } else { + this.varList[i].BASIC_STATE = 2 + } + } + this.total = data.page.total + resolve() + }).catch((e) => { + this.listLoading = false + reject() + }) }) }, // 禁用 启用