|
@@ -25,15 +25,18 @@
|
|
|
<el-table-column align="center" prop="operation" label="操作">
|
|
|
<template v-slot="scoped">
|
|
|
<el-row :gutter="1" class="row-bg" type="flex" align="middle" justify="center" v-if="judUser(scoped.row)">
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-button size="mini" type="text" @click="openAlert('update', scoped.row)">修改密码</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-button size="mini" type="text" @click="toBind(scoped.row)">更绑微信</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-button size="mini" type="text" @click="toDelete(scoped.row)" v-if="judDelete(scoped.row)">注销用户</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-button size="mini" type="text" @click="change(scoped.row)" v-if="changeUser(scoped.row)">转让管理员</el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -74,12 +77,30 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialog = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog :visible.sync="dialogUser" @close="closeAlert">
|
|
|
+ <el-row type="flex" align="middle" justify="center">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form :model="formUser" label-width="auto" label-position="right">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="用户" prop="name">
|
|
|
+ <el-select v-model="formUser.name" placeholder="请选择用户" style="width:100%" @change="select">
|
|
|
+ <el-option v-for="(item, index) in regionList" :key="index" :label="item.title" :value="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogUser = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmitUser">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<bind :display="bindDialog" :mobile="mobile" @close="closeAlert">
|
|
|
<el-col :span="24" style="text-align:center;font-size:1.25rem;padding-top:1rem;">
|
|
|
扫码更换微信!
|
|
@@ -115,11 +136,14 @@ export default {
|
|
|
dataList: [],
|
|
|
input: '',
|
|
|
currentPage: 1,
|
|
|
- totalRow: 1,
|
|
|
+ totalRow: 0,
|
|
|
dialogTitle: '',
|
|
|
dialogWidth: 12,
|
|
|
dialog: false,
|
|
|
+ dialogUser: false,
|
|
|
form: {},
|
|
|
+ formUser: {},
|
|
|
+ regionList: [],
|
|
|
noUse: {},
|
|
|
pwInput: '',
|
|
|
mobile: '',
|
|
@@ -128,6 +152,7 @@ export default {
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
|
+ this.otherList();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -141,6 +166,7 @@ export default {
|
|
|
this.$set(this, `dataList`, [result.data]);
|
|
|
} else {
|
|
|
result = await this.hrOperation({ type: 'list', data: this.user.corpid });
|
|
|
+ this.$set(this, `totalRow`, result.data.length);
|
|
|
this.$set(this, `dataList`, result.data);
|
|
|
let res = this.dataList.filter(fil => fil.role === '0');
|
|
|
for (const item of res) {
|
|
@@ -220,6 +246,36 @@ export default {
|
|
|
if (this.is_admin) return true;
|
|
|
else return item.mobile === this.user.sub;
|
|
|
},
|
|
|
+ changeUser(item) {
|
|
|
+ //管理员,不能注销
|
|
|
+ if (item.role === '0') return true;
|
|
|
+ //此hr不是管理员,看当前用户是不是管理员,是管理员则允许
|
|
|
+ else if (this.is_admin) return false;
|
|
|
+ else return false;
|
|
|
+ },
|
|
|
+ async change(item) {
|
|
|
+ console.log(item.mobile);
|
|
|
+ let result = await this.hrOperation({ type: 'search', data: { tel: item.mobile } });
|
|
|
+ this.$set(this, `formUser`, result.data);
|
|
|
+ console.log(result.data);
|
|
|
+ this.dialogUser = true;
|
|
|
+ },
|
|
|
+ async otherList() {
|
|
|
+ let result = await this.hrOperation({ type: 'list', data: this.user.corpid });
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
+ this.$set(this, `regionList`, result.data);
|
|
|
+ } else {
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ select(select) {
|
|
|
+ let res = this.regionList.filter(item => {
|
|
|
+ return `${item.name}` === `${select}`;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onSubmitUser() {
|
|
|
+ this.dialogUser = false;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|