|
@@ -130,6 +130,13 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
>编辑</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permisaction="['system:sysuser:changeAssignUser']"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-key"
|
|
|
+ @click="handleQuit(scope.row)"
|
|
|
+ >离职交接</el-button>
|
|
|
<!-- <el-button
|
|
|
v-if="scope.row.username !== 'admin'"
|
|
|
v-permisaction="['system:sysuser:remove']"
|
|
@@ -203,11 +210,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="归属部门" prop="deptId" style="width: 90%">
|
|
|
+ <el-form-item label="归属部门" prop="deptIds" style="width: 90%">
|
|
|
<treeselect
|
|
|
- v-model="form.deptId"
|
|
|
+ v-model="form.deptIds"
|
|
|
filterable
|
|
|
clearable
|
|
|
+ multiple
|
|
|
:options="deptOptions"
|
|
|
:normalizer="normalizer"
|
|
|
placeholder="请选择归属部门"
|
|
@@ -216,7 +224,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="岗位" style="width: 90%">
|
|
|
- <el-select v-model="form.postId" filterable clearable placeholder="请选择" style="width: 100%" @change="$forceUpdate()">
|
|
|
+ <el-select v-model="form.postIds" filterable clearable multiple placeholder="请选择" style="width: 100%" @change="$forceUpdate()">
|
|
|
<el-option
|
|
|
v-for="item in postOptions"
|
|
|
:key="item.postId"
|
|
@@ -241,6 +249,25 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 添加或修改参数配置对话框 -->
|
|
|
+ <el-dialog title="离职交接" :visible.sync="quitOpen" width="400px">
|
|
|
+ <el-form ref="quitForm" :model="quitForm" :rules="quitRules" label-width="80px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="交接人" prop="toUserId" style="width: 95%">
|
|
|
+ <el-select v-model="quitForm.toUserId" filterable clearable placeholder="请选择交接人" style="width: 100%">
|
|
|
+ <el-option v-for="user in users" :key="user.userId" :label="user.nickName===''?user.username:user.nickName" :value="user.userId" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitQuitForm">确 定</el-button>
|
|
|
+ <el-button @click="quitCancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 用户导入对话框 -->
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
|
|
|
<el-upload
|
|
@@ -275,12 +302,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate, getUserInit } from '@/api/system/sysuser'
|
|
|
+import { listUser, getUser, delUser, changeAssignUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate, getUserInit } from '@/api/system/sysuser'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
import { treeselect } from '@/api/system/dept'
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
-
|
|
|
+import load from '@/utils/loading'
|
|
|
export default {
|
|
|
name: 'User',
|
|
|
components: { Treeselect },
|
|
@@ -350,7 +377,7 @@ export default {
|
|
|
nickName: [
|
|
|
{ required: true, message: '用户昵称不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
- deptId: [
|
|
|
+ deptIds: [
|
|
|
{ required: true, message: '归属部门不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
password: [
|
|
@@ -372,7 +399,18 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ quitOpen: false,
|
|
|
+ quitForm: {
|
|
|
+ fromUserId: null,
|
|
|
+ toUserId: null
|
|
|
+ },
|
|
|
+ quitRules: {
|
|
|
+ toUserId: [
|
|
|
+ { required: true, message: '请选择离职交接人', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ users: []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -443,6 +481,14 @@ export default {
|
|
|
this.open = false
|
|
|
this.reset()
|
|
|
},
|
|
|
+ // 取消按钮
|
|
|
+ quitCancel() {
|
|
|
+ this.quitOpen = false
|
|
|
+ this.quitForm = {
|
|
|
+ fromUserId: null,
|
|
|
+ toUserId: null
|
|
|
+ }
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
@@ -500,13 +546,41 @@ export default {
|
|
|
this.form = response.data
|
|
|
this.postOptions = response.posts
|
|
|
this.roleOptions = response.roles
|
|
|
- this.form.postIds = response.postIds[0]
|
|
|
+ this.form.postIds = response.postIds
|
|
|
this.form.roleIds = response.roleIds[0]
|
|
|
this.open = true
|
|
|
this.title = '修改用户'
|
|
|
this.form.password = ''
|
|
|
})
|
|
|
},
|
|
|
+ /** 离职交接人按钮操作 */
|
|
|
+ async handleQuit(row) {
|
|
|
+ load.startLoading()
|
|
|
+ await listUser({
|
|
|
+ pageSize: 999999
|
|
|
+ }).then(response => {
|
|
|
+ this.users = response.data.list
|
|
|
+ })
|
|
|
+ load.endLoading()
|
|
|
+ this.quitOpen = true
|
|
|
+ this.quitForm.fromUserId = row.userId
|
|
|
+ },
|
|
|
+ /** 离职交接操作 */
|
|
|
+ submitQuitForm() {
|
|
|
+ this.$refs['quitForm'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ changeAssignUser(this.quitForm).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess('交接成功')
|
|
|
+ this.quitOpen = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 重置密码按钮操作 */
|
|
|
handleResetPwd(row) {
|
|
|
this.$prompt('请输入"' + row.username + '"的新密码', '提示', {
|