Commit 1fbc7492 authored by shen_yan_pu's avatar shen_yan_pu

超级管理员状态不可停用

parent 88e7a5b0
......@@ -74,10 +74,10 @@ export function resetUserPwd(businessId, password) {
}
// 用户状态修改
export function changeUserStatus(businessId, status) {
export function changeUserStatus(businessId, flag) {
const data = {
businessId,
status
flag
}
return request({
url: '/system/user/changeStatus',
......@@ -136,7 +136,6 @@ export function importTemplate(params) {
return request({
url: '/system/user/importTemplate',
method: 'get',
responseType: 'blob',
params
})
}
......
......@@ -88,7 +88,6 @@
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<!-- <div class="placeholder" style="width: calc(100% + 20px);margin-left: -10px" />-->
<div class="mb12 font-small-bold" style="margin-top: 20px">用户管理列表</div>
<el-table
v-loading="loading"
......@@ -118,12 +117,11 @@
{{ scope.row.phone || '-' }}
</template>
</el-table-column>
<el-table-column width="120" label="状态" prop="status">
<el-table-column width="120" label="状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
:disabled="true"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
......@@ -239,7 +237,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态">
<el-form-item v-if="form.businessId == undefined" label="状态">
<el-radio-group v-model="form.flag">
<el-radio
v-for="dict in statusOptions"
......@@ -498,7 +496,7 @@ export default {
idNumber: '',
userType: '',
allowLogin: '',
status: '',
flag: '',
deptId: '',
flag: undefined,
name: undefined
......@@ -578,25 +576,6 @@ export default {
changeValue() {
this.$refs.form.validateField('id')
},
/** // 用户登录控制
toggleLoginAuth(row) {
const status = row.allowLogin === '1' ? '禁止' : '允许'
this.$confirm(`“${row.username}”即将被${status}登录, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
userLoginManage({
userId: row.userId,
allowLogin: row.allowLogin === '0' ? '1' : '0'
}).then(res => {
this.$message.success('操作成功')
row.allowLogin = row.allowLogin === '0' ? '1' : '0'
})
}).catch(() => {
})
},*/
/** 查询用户列表 */
getList() {
this.loading = true
......@@ -652,7 +631,7 @@ export default {
},
// 用户状态修改
handleStatusChange(row) {
const text = row.flag === '0' ? '启用' : '停用'
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认要"' + text + '""' + row.name + '"用户吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -665,7 +644,7 @@ export default {
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '1' ? '0' : '1'
row.flag = row.flag === '0' ? '1' : '0'
})
},
// 取消按钮
......@@ -686,7 +665,7 @@ export default {
idNumber: undefined,
email: undefined,
sex: undefined,
status: '0',
flag: '0',
remark: undefined,
postIds: [],
roleIds: []
......@@ -696,7 +675,7 @@ export default {
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
this.getList(listUser)
},
/** 重置按钮操作 */
resetQuery() {
......@@ -729,16 +708,9 @@ export default {
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.name + '"的新密码', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
resetUserPwd(this.businessId, value).then(response => {
this.$message({
message: '修改成功,新密码是:' + value
})
})
}).catch(() => {})
this.ruleForm.newPassword = ''
this.ruleForm.row = row.userId
this.resetPwdDiaLog = !this.resetPwdDiaLog
},
handleResetPwdSure() {
this.$refs.ruleForm.validate(pass => {
......@@ -839,7 +811,7 @@ export default {
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
importTemplate(params) {
importTemplate().then(response => {
this.download(response.msg)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment