Commit 8c506bbf authored by caimeng's avatar caimeng

回滚修改用户的操作

parent ff20ed77
......@@ -262,11 +262,11 @@ export default {
// 用户管理
// 用户列表
userList(params){
userList(data){
return request({
url: '/user/searchAll',
method: 'get',
params
method: 'post',
data
})
},
// 用户详情
......
......@@ -4,18 +4,18 @@
<block-header title='搜索' />
<div class='search'>
<el-form ref='form' label-suffix=':' :inline='true' :model='queryForm' class='form-inline'>
<el-form-item prop='realName' label='客户姓名'>
<el-form-item prop='userName' label='姓名'>
<el-input
v-model='queryForm.realName'
v-model='queryForm.userName'
clearable
placeholder='请输入客户姓名'
placeholder='请输入姓名'
/>
</el-form-item>
<el-form-item prop='mobile' label='手机号码'>
<el-form-item prop='phone' label='手机号码'>
<el-input
v-model='queryForm.mobile'
v-model='queryForm.phone'
clearable
placeholder='请输入客户手机号码'
placeholder='请输入手机号码'
/>
</el-form-item>
<el-form-item>
......@@ -53,6 +53,16 @@
<el-tag v-if='row.userDutyState==="OFFLINE"' type='info'>离线</el-tag>
<el-tag v-else type='success'>在线</el-tag>
</div>
<!--<div v-else-if="item.label==='在职离职'">-->
<!-- <el-switch-->
<!-- v-model='row.status'-->
<!-- active-value='NORMAL'-->
<!-- inactive-value='LEAVE'-->
<!-- @change='(e)=>{-->
<!-- handleSwitch(e,row)-->
<!-- }'>-->
<!-- </el-switch>-->
<!--</div>-->
<span v-else>{{ row[item.prop] }}</span>
</template>
</el-table-column>
......@@ -164,7 +174,13 @@
order: 7,
label: '是否在线',
prop: 'userDutyState'
}
},
//{
// order: 8,
// label: '在职离职',
// prop: 'status',
//
//}
],
list: [],
listLoading: true,
......@@ -174,8 +190,8 @@
current: 1,
size: 10,
mobile: '',
realName: ''
phone: '',
userName: ''
}
}
},
......@@ -294,6 +310,47 @@
message: '操作成功'
})
}
},
// 更新用户
async handleSwitch(e, row) {
this.$confirm('是否确认修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async (res) => {
console.log(res, '是啥')
const { loginName, memo, userCell, userName } = row
let status
if (e !== 'LEAVE') {
status = 'NORMAL'
} else {
status = 'LEAVE'
}
const result = await API.userUpdate({
loginName,
memo,
status,
userCell,
userName
})
if (result.success) {
this.$message({
type: 'success',
message: '修改成功'
})
await this.fetchData()
}
}).catch((e) => {
console.log(e, '取消了')
})
}
}
}
......
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