|
|
@@ -153,7 +153,7 @@
|
|
|
<el-table-column label="状态" align="center" key="isLock" v-if="columns[5].visible">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
|
- v-model="scope.row.status"
|
|
|
+ v-model="scope.row.isLock"
|
|
|
active-value="0"
|
|
|
inactive-value="1"
|
|
|
@change="handleStatusChange(scope.row)"
|
|
|
@@ -220,7 +220,19 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="归属部门" prop="orgId">
|
|
|
- <treeselect v-model="form.orgId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
+<!-- <el-cascader-->
|
|
|
+<!-- v-model="form.orgId"-->
|
|
|
+<!-- :options="deptOptions"-->
|
|
|
+<!-- :props="{checkStrictly: true, label:'name'}"-->
|
|
|
+<!-- placeholder="请选择归属部门">-->
|
|
|
+<!-- </el-cascader>-->
|
|
|
+ <treeselect
|
|
|
+ v-model="form.orgId"
|
|
|
+ :options="deptOptions"
|
|
|
+ :show-count="true"
|
|
|
+ :normalizer="tenantIdnormalizer"
|
|
|
+ :props="{checkStrictly: true, label:'name'}"
|
|
|
+ placeholder="请选择归属部门" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -238,12 +250,12 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item v-if="form.id == undefined" label="用户名称" prop="name">
|
|
|
+ <el-form-item v-if="!form.id" label="用户名称" prop="name">
|
|
|
<el-input v-model="form.username" placeholder="请输入用户名称" maxlength="30" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item v-if="form.id == undefined" label="用户密码" prop="password">
|
|
|
+ <el-form-item v-if="!form.id" label="用户密码" prop="password">
|
|
|
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -256,7 +268,7 @@
|
|
|
v-for="dict in dict.type.sys_user_sex"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
+ :value="`${dict.value}`"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -477,6 +489,17 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ //自定义数据
|
|
|
+ tenantIdnormalizer(node, instanceId) {
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
+ delete node.children
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: node.id,
|
|
|
+ label: node.name,
|
|
|
+ children: node.children
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 下穿状态改变*/
|
|
|
changeCheckBox(){
|
|
|
this.getList();
|
|
|
@@ -501,8 +524,8 @@ export default {
|
|
|
getDeptTree() {
|
|
|
deptTreeSelect().then(response => {
|
|
|
this.deptOptions = response.data;
|
|
|
+ console.log( this.deptOptions,' this.deptOptions')
|
|
|
this.defaultKeys.push(response.data[0].id);
|
|
|
- console.log( this.defaultKeys,' this.defaultKeys')
|
|
|
this.queryParams.orgId = response.data[0].id;
|
|
|
this.handleQuery();
|
|
|
});
|
|
|
@@ -519,9 +542,13 @@ export default {
|
|
|
},
|
|
|
// 用户状态修改
|
|
|
handleStatusChange(row) {
|
|
|
- let text = row.status === "0" ? "启用" : "停用";
|
|
|
- this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
|
|
- return changeUserStatus(row.userId, row.status);
|
|
|
+ let text = row.status === "1" ? "启用" : "停用";
|
|
|
+ this.$modal.confirm( '确认要' + text + '"' + row.name + '"用户吗?').then(function() {
|
|
|
+ const data = {
|
|
|
+ id:row.id,
|
|
|
+ isLock:row.isLock
|
|
|
+ }
|
|
|
+ return changeUserStatus(data);
|
|
|
}).then(() => {
|
|
|
this.$modal.msgSuccess(text + "成功");
|
|
|
}).catch(function() {
|
|
|
@@ -600,7 +627,11 @@ export default {
|
|
|
this.reset();
|
|
|
const userId = row.id || this.ids;
|
|
|
getUser(userId).then(response => {
|
|
|
- console.log(response.data)
|
|
|
+ console.log(response.data,'data')
|
|
|
+ // response.data.dept = {
|
|
|
+ // deptName:response.data.orgName,
|
|
|
+ // deptId:response.data.orgId
|
|
|
+ // }
|
|
|
this.form = response.data;
|
|
|
this.postOptions = response.posts;
|
|
|
this.roleOptions = response.roles;
|