Merge branch 'pet' into dev

dev
liujun 2024-12-24 17:15:20 +08:00
commit 7b416f962c
1 changed files with 73 additions and 38 deletions

View File

@ -134,7 +134,7 @@
<template slot-scope="{row}"> <template slot-scope="{row}">
<div style="display: flex;"> <div style="display: flex;">
<div style="margin-right: 13px;"> <div style="margin-right: 13px;">
<el-button v-if="row.USER_ID != userId" type="primary" icon="el-icon-view" size="mini" @click="handleShow(row)"></el-button> <el-button v-if="row.USER_ID !== userId" type="primary" icon="el-icon-view" size="mini" @click="handleShow(row)"></el-button>
<el-button v-if="row.AUDIT_STATE == 1 && row.USER_ID != userId" type="success" icon="el-icon-s-check" size="mini" @click="handleEditState(row)"></el-button> <el-button v-if="row.AUDIT_STATE == 1 && row.USER_ID != userId" type="success" icon="el-icon-s-check" size="mini" @click="handleEditState(row)"></el-button>
</div> </div>
<template v-show="loginUser.ACCOUNT_TYPE === '0'"> <template v-show="loginUser.ACCOUNT_TYPE === '0'">
@ -146,6 +146,7 @@
</template> </template>
<el-button v-if="row.ACCOUNT_TYPE == '1'" type="info" icon="el-icon-postcard" size="mini" @click="handlePrinting(row)"></el-button> <el-button v-if="row.ACCOUNT_TYPE == '1'" type="info" icon="el-icon-postcard" size="mini" @click="handlePrinting(row)"></el-button>
<el-button v-if="row.ISPUSH == '0'" type="primary" icon="el-icon-position" size="mini" @click="goPush(row)"></el-button> <el-button v-if="row.ISPUSH == '0'" type="primary" icon="el-icon-position" size="mini" @click="goPush(row)"></el-button>
<el-button v-if="row.USER_ID !== userId" type="danger" icon="el-icon-position" size="mini" @click="resign(row)"></el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -452,10 +453,10 @@ export default {
this.$refs.tree.filter(val) this.$refs.tree.filter(val)
} }
}, },
created() { async created() {
this.getList('') await this.getList('')
this.hasButton() await this.hasButton()
this.getTreeList() await this.getTreeList()
}, },
methods: { methods: {
goPush(row) { goPush(row) {
@ -499,6 +500,38 @@ export default {
this.listLoading = false 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) { getRowKey(row) {
return row.USER_ID return row.USER_ID
}, },
@ -655,7 +688,7 @@ export default {
}, },
getList(DEPARTMENT_ID) { getList(DEPARTMENT_ID) {
console.info(DEPARTMENT_ID) return new Promise((resolve, reject) => {
this.listLoading = true this.listLoading = true
if (DEPARTMENT_ID) { if (DEPARTMENT_ID) {
this.DEPARTMENT_ID = DEPARTMENT_ID this.DEPARTMENT_ID = DEPARTMENT_ID
@ -677,7 +710,6 @@ export default {
).then((data) => { ).then((data) => {
this.listLoading = false this.listLoading = false
this.varList = data.userList this.varList = data.userList
console.log(this.varList)
for (let i = 0; i < this.varList.length; i++) { for (let i = 0; i < this.varList.length; i++) {
if (this.varList[i].cardImgCount) { if (this.varList[i].cardImgCount) {
this.varList[i].BASIC_STATE = 1 this.varList[i].BASIC_STATE = 1
@ -688,8 +720,11 @@ export default {
} }
} }
this.total = data.page.total this.total = data.page.total
resolve()
}).catch((e) => { }).catch((e) => {
this.listLoading = false this.listLoading = false
reject()
})
}) })
}, },
// //