Browse Source

添加离职交接功能

lex-xin 4 years ago
parent
commit
5107dd502c

+ 9 - 0
src/api/system/sysuser.js

@@ -33,6 +33,15 @@ export function addUser(data) {
   })
 }
 
+// 离职交接
+export function changeAssignUser(data) {
+  return request({
+    url: '/api-oa/api/v1/sysUser/changeAssignUser',
+    method: 'post',
+    data: data
+  })
+}
+
 // 修改用户
 export function updateUser(data) {
   return request({

+ 82 - 8
src/views/system/sysuser/index.vue

@@ -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 + '"的新密码', '提示', {

File diff suppressed because it is too large
+ 0 - 0
web/index.html


+ 0 - 0
web/static/web/css/chunk-33e06368.d261830d.css → web/static/web/css/chunk-171662d1.d261830d.css


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/app.52c79a32.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-171662d1.cc198df3.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-192165dd.57297113.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-33e06368.fcc0f6fd.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-b2cdb5c2.4c391a36.js


File diff suppressed because it is too large
+ 0 - 0
web/static/web/js/chunk-b2cdb5c2.69332d07.js


Some files were not shown because too many files changed in this diff