From 8ae61b472c9a343864b1fd288def1a41e3a507ff Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Tue, 13 Aug 2024 10:42:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/company/staff/index.js | 17 ++ src/api/company/staffChange/index.js | 7 +- src/utils/dict.js | 4 + .../company/staff/form/StaffChangeForm.vue | 54 +++-- src/views/company/staff/form/StaffForm.vue | 207 +++++++++++------- .../company/staff/form/StaffResetPassword.vue | 107 +++++++++ src/views/company/staff/index.vue | 41 +++- .../form/StaffChangeFormData.vue | 19 +- src/views/company/staffChange/index.vue | 174 +++++++++++++++ 9 files changed, 517 insertions(+), 113 deletions(-) create mode 100644 src/views/company/staff/form/StaffResetPassword.vue rename src/views/company/{staff => staffChange}/form/StaffChangeFormData.vue (93%) create mode 100644 src/views/company/staffChange/index.vue diff --git a/src/api/company/staff/index.js b/src/api/company/staff/index.js index f314649..4819d96 100644 --- a/src/api/company/staff/index.js +++ b/src/api/company/staff/index.js @@ -67,3 +67,20 @@ export function getStaffList(){ method: 'get' }) } + +// 验证工号是否重复 +export function checkWorkNo(workNo){ + return request({ + url: '/company/staff/checkWorkNo?workNo=' + workNo, + method: 'get' + }) +} + +// 重置密码 +export function resetPassword(data){ + return request({ + url: '/company/staff/resetPassword', + method: 'post', + data + }) +} diff --git a/src/api/company/staffChange/index.js b/src/api/company/staffChange/index.js index 6a3cef5..38bc2a8 100644 --- a/src/api/company/staffChange/index.js +++ b/src/api/company/staffChange/index.js @@ -9,10 +9,11 @@ export function createStaffChange(data) { }) } -// 获取企业管理-员工交接信息及交接双方信息 -export function getChangeStaff(id) { +// 获取企业管理-员工交接信息分页 +export function getStaffChangePage(params) { return request({ - url: '/company/staffChange/changeItem?id=' + id, + url: '/company/staffChange/page', method: 'get', + params }) } diff --git a/src/utils/dict.js b/src/utils/dict.js index c11bf0c..d1ed57b 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -118,6 +118,10 @@ export const DICT_TYPE = { // ------- 企业管理模块 ------- // 员工学历 COMPANY_STAFF_EDU: 'company_staff_edu', + // 员工工作交接状态 + STAFF_CHANGE_STATUS: 'staff_change_status', + // 员工工作交接类型 + STAFF_CHANGE_TYPE: 'staff_change_type', // ------- 资产管理模块 ------- //资产处置方式 diff --git a/src/views/company/staff/form/StaffChangeForm.vue b/src/views/company/staff/form/StaffChangeForm.vue index c8b5a2d..6ea8acc 100644 --- a/src/views/company/staff/form/StaffChangeForm.vue +++ b/src/views/company/staff/form/StaffChangeForm.vue @@ -10,27 +10,36 @@ +
+ 姓名:{{ item.name }} + 工号:{{ item.workNo }} + 手机:{{ item.tel }} +
- - - - + + + @@ -145,14 +149,14 @@ import * as StaffApi from '@/api/company/staff' import StaffForm from './form/StaffForm.vue' import StaffChangeForm from './form/StaffChangeForm' -import StaffChangeFormData from './form/StaffChangeFormData' +import StaffResetPassword from './form/StaffResetPassword' export default { name: 'Staff', components: { StaffForm, StaffChangeForm, - StaffChangeFormData + StaffResetPassword }, data() { return { @@ -209,6 +213,9 @@ export default { case 'handleStaffChangeData': this.handleStaffChangeData(row) break + case 'handleResetPassword': + this.handleResetPassword(row) + break default: break } @@ -219,7 +226,16 @@ export default { }, /** 查看交接记录 */ handleStaffChangeData(row) { - this.$refs['staffChangeDataRef'].open(row.id) + this.$router.push({ + path: '/company/staffChange', + query: { + data: JSON.stringify(row) + } + }) + }, + /** 重置密码 */ + handleResetPassword(row) { + this.$refs['staffResetPassword'].open(row) }, /** 查询列表 */ async getList() { @@ -248,6 +264,11 @@ export default { }, /** 删除按钮操作 */ async handleDelete(row) { + const isChange = row.isChange + if (!isChange) { + this.$modal.msgError('该员工还有工作未交接,不可删除') + return + } const workNo = row.workNo const id = row.id await this.$modal.confirm('是否确认删除员工工号为"' + workNo + '"的数据项?') diff --git a/src/views/company/staff/form/StaffChangeFormData.vue b/src/views/company/staffChange/form/StaffChangeFormData.vue similarity index 93% rename from src/views/company/staff/form/StaffChangeFormData.vue rename to src/views/company/staffChange/form/StaffChangeFormData.vue index 4eee423..75475dc 100644 --- a/src/views/company/staff/form/StaffChangeFormData.vue +++ b/src/views/company/staffChange/form/StaffChangeFormData.vue @@ -1,8 +1,7 @@ - + @@ -58,11 +57,6 @@ - - -