diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/views/measure/train/trainPlanApprove.vue b/src/views/measure/train/trainPlanApprove.vue index a20249f..4c0d635 100644 --- a/src/views/measure/train/trainPlanApprove.vue +++ b/src/views/measure/train/trainPlanApprove.vue @@ -1,53 +1,121 @@ - + {{ item.name }} - + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 5ae03f9..28b50ba 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -4,7 +4,7 @@ import request from '../index' const prefix = '/meter' // 列表查询 -export function getStandardList(data: object) { +export function getStandardList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/standard/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -47,7 +47,7 @@ } // 获取部门信息 -export function getUsersDept(data: object) { +export function getUsersDept(data: { offset: number; limit: number }) { return request({ url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', @@ -56,7 +56,7 @@ } // 获取申请列表 -export function getstandardEquipmentApplyList(data: object) { +export function getstandardEquipmentApplyList(data: { offset: number; limit: number }) { return request({ url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 036ebbd..fd06b2b 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -68,6 +68,7 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') btnLoading.value = false + dialogVisible.value = false emit('onSuccess') }).catch((_) => { btnLoading.value = false diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 4e41e86..7bde3f8 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -143,6 +143,18 @@ auth: '/file/approve', }, }, + { + path: 'approvedetail/:id?', + name: 'approveDetail', + component: () => import('@/views/measure/file/components/approve/addDialog.vue'), + meta: { + title: '文件审批', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/file/approve', + }, + }, ], }, { diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9db0c6b..271a0b8 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -1,20 +1,20 @@ /** - * 流程字典, 流程代号:流程id + * 流程字典, 流程代号:流程id-对应表单中的formId */ export enum SCHEDULE { FILE_APPROVAL = 'jlglwjsp', // 文件审批, TRAIN_APPROVAL = 'jlglpxjhsp', // 培训计划审批 SUPPLIER_APPROVAL = 'jlglsygfsp', // 溯源供方审批 STANDARD_CHANGE_APPROVAL = 'sbglbzzzghsq', // 标准装置更换申请 - STANDARD_PAUSE_APPROVAL = 'sbglbzzzghsq', // 标准装置暂停申请 - STANDARD_REVERT_APPROVAL = 'sbglbzzzghsq', // 标准装置撤销申请 - STANDARD_RESUME_APPROVAL = 'sbglbzzzghsq', // 标准装置恢复申请 + STANDARD_PAUSE_APPROVAL = 'sbglbzzzztsq', // 标准装置暂停申请 + STANDARD_REVERT_APPROVAL = 'sbglbzzzcxsq', // 标准装置撤销申请 + STANDARD_RESUME_APPROVAL = 'sbglbzzzhfsq', // 标准装置恢复申请 STANDARD_CHECK_APPROVAL = 'sbglbzzzfcsq', // 标准装置复查申请 DEVICE_UNUSED_APPROVAL = 'sbglsbxzsq', // 设备闲置申请 DEVICE_SEALED_APPROVAL = 'sbglsbfcsq', // 设备封存申请 DEVICE_UNSEALED_APPROVAL = 'sbglsbqfsq', // 设备启封申请 DEVICE_SCRAPPED_ROVAL = 'sbglsbbfsq', // 设备报废申请 DEVICE_HANDLE_APPROVAL = 'sbglsbczsq', // 设备处置申请 - DEVICE_CONSUMING_APPROVAL = 'sbglsblysq', // 设备领用申请 - DEVICE_BORROW_APPROVAL = 'sbglsbjysq', // 设备借用申请 + DEVICE_CONSUMING_APPROVAL = 'clsblysp', // 设备领用申请 + DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 } diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue index 3926c2d..7f3ea3e 100644 --- a/src/views/device/borrow/components/handleList.vue +++ b/src/views/device/borrow/components/handleList.vue @@ -78,25 +78,25 @@ // }).catch((_) => { // loadingTable.value = false // }) - list.value = [ - { - applyName: '借用测试设备', - applyNo: '1433223', - applyUnit: '顶级', - applyPerson: '张三', - time: '2020-12-12 00:00:00', - approvalStatusName: '审批中', - }, - { - applyName: '借用电脑', - applyNo: '1433223', - applyUnit: '徐州分中心', - applyPerson: '里斯', - time: '2020-12-12 00:00:00', - approvalStatusName: '已通过', - }, - ] as any - total.value = 2 + // list.value = [ + // { + // applyName: '借用测试设备', + // applyNo: '1433223', + // applyUnit: '顶级', + // applyPerson: '张三', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '审批中', + // }, + // { + // applyName: '借用电脑', + // applyNo: '1433223', + // applyUnit: '徐州分中心', + // applyPerson: '里斯', + // time: '2020-12-12 00:00:00', + // approvalStatusName: '已通过', + // }, + // ] as any + // total.value = 2 } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b6f5cf3..fc2cfa7 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -15,6 +15,7 @@ checkResultName: string createTime: null | string createUser: string + createUserName: string fileList: [ { checkId: string diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 0c3445d..5143309 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -13,12 +13,12 @@ import { validatePhone } from '@/utils/validate' import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' -import { useUserStore } from '@/store/modules/user' +import useUserStore from '@/store/modules/user' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 -// const { id } = useUserStore() +const userInfo = useUserStore() const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -40,7 +40,8 @@ checkResult: '', checkResultName: '', createTime: null, - createUser: '', + createUser: userInfo.id, + createUserName: userInfo.username, fileList: [ { checkId: '', @@ -117,9 +118,18 @@ ).then(() => { if (pageType.value === 'add') { getselectCheckInfo(formInline.value).then((res) => { - console.log(res) + if (res.code === '200') { + close() + } }) } + else if (pageType.value === 'edit') { // 编辑 + // getselectCheckInfo(formInline.value).then((res) => { + // if (res.code === '200') { + // close() + // } + // }) + } }) } }) @@ -182,9 +192,6 @@ 打印 - 提交 @@ -259,7 +266,7 @@ 0) { - printJSON(list.value, properties, '溯源供方列表') + printJSON(list.value, properties, '设备管理点检查列表') } else if (checkoutList.value.length > 0) { const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) - printJSON(printList, properties, '溯源供方列表') + printJSON(printList, properties, '设备管理点检查列表') } else { ElMessage.warning('无可打印内容') diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index 5234d0b..8882124 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -135,7 +135,7 @@ const loadingTable = ref(false) // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index c25a836..b397cbb 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -143,7 +143,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index a75d816..fb10946 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -98,7 +98,7 @@ getSelectList('standardCategory') // 获取类别下拉框 // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', @@ -259,7 +259,7 @@ @@ -269,7 +269,7 @@ @@ -279,7 +279,7 @@ @@ -291,7 +291,7 @@ @@ -304,7 +304,7 @@ > @@ -315,7 +315,7 @@ @@ -346,7 +346,7 @@ @@ -415,7 +415,7 @@ @@ -458,7 +458,7 @@ @@ -471,7 +471,7 @@ @@ -520,7 +520,7 @@ v-model="formInline.assessDate" type="datetime" style="width: 100%;" - placeholder="请选择考核日期" + :placeholder="buttonType === 'detail' ? '' : '请选择考核日期'" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" :disabled="buttonType === 'detail'" @@ -534,7 +534,7 @@ @@ -545,7 +545,7 @@ @@ -560,7 +560,7 @@ @@ -569,7 +569,7 @@ @@ -581,7 +581,7 @@ diff --git a/src/views/device/standardEquipment/components/standardList/templateTable.vue b/src/views/device/standardEquipment/components/standardList/templateTable.vue index 79cc061..c378549 100644 --- a/src/views/device/standardEquipment/components/standardList/templateTable.vue +++ b/src/views/device/standardEquipment/components/standardList/templateTable.vue @@ -20,13 +20,21 @@ type: Number, default: 0, }, + buttonType: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, + title: { // 控制增加行按钮是否显示 + type: String, + default: '', + }, }) -const emits = defineEmits(['changePage']) +const emits = defineEmits(['changePage', 'addRow', 'deleteRow', 'handleSelectionChange', 'selectPerson']) const searchQuery = ref({ limit: 10, offset: 1, }) -console.log(props.list, '6666') + // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -37,16 +45,60 @@ } emits('changePage', searchQuery) } +// 点击增加行 +const addRow = () => { + emits('addRow') +} +// 点击删除行 +const deleteRow = () => { + emits('deleteRow', props.title) +} +// 多选发生改变 +const handleSelectionChange = (object: object[]) => { + emits('handleSelectionChange', object, props.title) +} +// 点击选择的时候 +const selectPerson = (index: string, text: string) => { + emits('selectPerson', index, text) +} - - - + + + + 删除行 + + + 增加行 + + + + + + + + *{{ item.text }} + + + + + + 选择 + + + + + + + + + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index bcdcf3b..f04e55b 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -5,6 +5,7 @@ import type { IOptions } from '../standard_interface' import baseInfo from './standardList/baseInfo.vue' import TemplateTable from './standardList/templateTable.vue' +import userListDialog from '@/views/measure/person/components/userListDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -80,7 +81,7 @@ const measurementPersonnelColumns = ref([ { text: '姓名', value: 'name', align: 'center' }, { text: '计量人员编号', value: 'staffNo', align: 'center' }, - { text: '工作部门', value: 'deptId', align: 'center' }, + { text: '工作部门', value: 'deptName', align: 'center' }, { text: '计量专业', value: 'major', align: 'center' }, { text: '证书编号', value: 'verifierCertificateNo', align: 'center' }, { text: '证书有效期', value: 'certificateDate', align: 'center' }, @@ -232,6 +233,81 @@ }) }) } +const measurementPersonnelSelectionList = ref([]) // 计量人员选中数组 +const corollaryEquipmentSelectionList = ref([]) // 标准配套设备选中数组 +const regulationVerificationSelectionList = ref([]) // 检定规程选中数组 +const userListRef = ref() +const listIndex = ref(0) +// 新增计量人员 +const measurementPersonnelAddRow = () => { + measurementPersonnel.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增标准配套设备 +const corollaryEquipmentAddRow = () => { + corollaryEquipment.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +// 新增检定规程 +const regulationVerificationAddRow = () => { + regulationVerification.value.push({}) + // ElMessage.warning('请先选择上一条信息') +} +function selectPerson(index: number, text: string) { + if (text === '姓名') { + userListRef.value.initDialog() + listIndex.value = index + } +} +// 多选框选中 +function handleSelectionChange(Array: object[], title: string) { + if (title === '计量人员') { + measurementPersonnelSelectionList.value = Array + } + else if (title === '标准配套设备') { + corollaryEquipmentSelectionList.value = Array + } + else if (title === '检定规程') { + regulationVerificationSelectionList.value = Array + } +} +// 点击删除行 +const deleteRow = (title: string) => { + if (title === '计量人员') { + if (measurementPersonnelSelectionList.value.length > 0) { + measurementPersonnel.value = measurementPersonnel.value.filter(item => !measurementPersonnelSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '标准配套设备') { + if (corollaryEquipmentSelectionList.value.length > 0) { + corollaryEquipment.value = corollaryEquipment.value.filter(item => !corollaryEquipmentSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } + else if (title === '检定规程') { + if (regulationVerificationSelectionList.value.length > 0) { + regulationVerification.value = regulationVerification.value.filter(item => !regulationVerificationSelectionList.value.includes(item)) + } + else { + ElMessage.warning('请先选择中数据') + } + } +} +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + if (!measurementPersonnel.value.includes(object)) { + measurementPersonnel.value[listIndex.value] = object + } + else { + ElMessage.warning('该人员已经存在') + measurementPersonnel.value.splice(listIndex.value, 1) + } +} onMounted(() => { if (pageType.value === 'detail') { // fetchmeasurementPersonnel() // 计量人员 @@ -271,7 +347,7 @@ 关闭 - + @@ -281,13 +357,15 @@ - - - - - - + + + + + + + + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 94520ba..7627e4e 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -120,7 +120,7 @@ const $router = useRouter() // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/standardEquipment/standardList.vue b/src/views/device/standardEquipment/standardList.vue index 17367cb..a66fb7b 100644 --- a/src/views/device/standardEquipment/standardList.vue +++ b/src/views/device/standardEquipment/standardList.vue @@ -128,7 +128,7 @@ // 获取部门信息 getUsersDept({ - createTime: '', + createTime: null, director: '', meterMajor: '', organizeName: '', diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index c1b20e7..5b7e91a 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -100,7 +100,10 @@ loadingTable.value = true getDictByCode('managerState').then((response) => { if (response.code === 200) { - console.log(response.data, 'response') + console.log(response.data, 'response') // 状态 + + // 根据闲置,封存,启封等状态获取不同的列表 + // 接口未写好 getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 7588c22..fecdc5f 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -1,13 +1,13 @@ + + + + + + + + 提交 + + + 编辑 + + + 删除 + + + 关闭 + + + + + 同意 + + + 驳回 + + + 拒绝 + + + 关闭 + + + + + 打印 + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }} + + + + + + + + + + + + diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index 08b03c3..9b5c151 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -1,36 +1,43 @@ @@ -259,20 +255,20 @@ - + - + - + - + - + - - - - + - @@ -337,22 +323,22 @@ - + 查看 - + 同意 - + 驳回 - + 拒绝 - + 取消 - + 删除 @@ -360,6 +346,7 @@ + diff --git a/src/views/measure/file/components/templatePage.vue b/src/views/measure/file/components/templatePage.vue index b45c38b..2f40ba2 100644 --- a/src/views/measure/file/components/templatePage.vue +++ b/src/views/measure/file/components/templatePage.vue @@ -8,6 +8,7 @@ // import { exportExcel } from '@/utils/exportXlsx' import { uploadApi } from '@/api/system/notice' import { exportFile } from '@/utils/exportUtils' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { type: String, @@ -37,6 +38,7 @@ offset: 1, fileType: '', // 类型 ids: [] as string[], + formId: SCHEDULE.FILE_APPROVAL, }) // 查询参数 watch(() => publishTime.value, (newVal) => { if (newVal) { diff --git a/src/views/measure/file/file-interface.ts b/src/views/measure/file/file-interface.ts index 585d618..b7a47a5 100644 --- a/src/views/measure/file/file-interface.ts +++ b/src/views/measure/file/file-interface.ts @@ -14,6 +14,7 @@ effectiveEndTime: string effectiveStartTime: string ids: string[] + formId: string } // 文件返回值类型 export interface fileListType { diff --git a/src/views/measure/price/list_interface.ts b/src/views/measure/price/list_interface.ts index 9e1df00..6f4ba44 100644 --- a/src/views/measure/price/list_interface.ts +++ b/src/views/measure/price/list_interface.ts @@ -43,11 +43,11 @@ // 价格表单对象类型 export interface priceForm { checkType: string // 校验类型-字典value - createTime: null | string // 创建时间 + createTime?: null | string // 创建时间 directorDiscountPermission: string // 负责人折扣权限-字典value historicalPriceList?: historyPriceItem[] // 历史价格列表 id: null | string // 主键id - isDel: number // 删除标记 + isDel?: number // 删除标记 model: string // 型号 operatorDiscountPermission: string // 业务员折扣权限-字典value price: string // 标准价格(元) @@ -59,5 +59,5 @@ priceStandard: string // 依据标准-计量规程文件名 priceType: string // 价格类别-字典value remark: string // 备注 - updateTime: null | string // 更新时间 + updateTime?: null | string // 更新时间 } diff --git a/src/views/measure/price/priceAdd.vue b/src/views/measure/price/priceAdd.vue index 082a538..6a5aafa 100644 --- a/src/views/measure/price/priceAdd.vue +++ b/src/views/measure/price/priceAdd.vue @@ -135,6 +135,10 @@ else if (type === '提交' && pageType.value === 'edit') { formInline.value.id = infoId.value buttonLoading.value = true + delete formInline.value.isDel + delete formInline.value.createTime + delete formInline.value.historicalPriceList + delete formInline.value.updateTime getUpdatePriceInfo(formInline.value).then((res) => { if (res.code === 200) { close() @@ -184,7 +188,7 @@ @@ -195,7 +199,7 @@ @@ -213,7 +217,7 @@ @@ -231,7 +235,7 @@ @@ -251,7 +255,7 @@ @@ -261,7 +265,7 @@ @@ -270,14 +274,14 @@ - + @@ -287,7 +291,7 @@ @@ -307,7 +311,7 @@ @@ -324,7 +328,7 @@ - + diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 0011ab3..4cab873 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -91,7 +91,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/views/measure/train/trainPlanApprove.vue b/src/views/measure/train/trainPlanApprove.vue index a20249f..4c0d635 100644 --- a/src/views/measure/train/trainPlanApprove.vue +++ b/src/views/measure/train/trainPlanApprove.vue @@ -1,53 +1,121 @@ - + {{ item.name }} - + diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue index b1e16c8..aaf7291 100644 --- a/src/views/system/dept/editDept.vue +++ b/src/views/system/dept/editDept.vue @@ -46,9 +46,10 @@ num: [{ required: true, message: '排序不可为空', trigger: 'blur' }, { pattern: /^\d+(\.\d+)?$/, trigger: ['blur', 'change'], message: '' }], }) -function submitForm() { - if (dataFormRef) { - dataFormRef.value?.validate((valid: boolean) => { +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { if (valid) { if (dialogStatus.value === 'create') { createData() @@ -57,8 +58,8 @@ updateData() } } - }) - } + } + }) } // 新增数据 function createData() { @@ -114,6 +115,9 @@ form[key] = defaultFormData[key] }) Object.assign(formData, form) + nextTick(() => { + dataFormRef.value?.clearValidate() + }) } const deptTypeList: Ref = ref([]) @@ -217,7 +221,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/views/measure/train/trainPlanApprove.vue b/src/views/measure/train/trainPlanApprove.vue index a20249f..4c0d635 100644 --- a/src/views/measure/train/trainPlanApprove.vue +++ b/src/views/measure/train/trainPlanApprove.vue @@ -1,53 +1,121 @@ - + {{ item.name }} - + diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue index b1e16c8..aaf7291 100644 --- a/src/views/system/dept/editDept.vue +++ b/src/views/system/dept/editDept.vue @@ -46,9 +46,10 @@ num: [{ required: true, message: '排序不可为空', trigger: 'blur' }, { pattern: /^\d+(\.\d+)?$/, trigger: ['blur', 'change'], message: '' }], }) -function submitForm() { - if (dataFormRef) { - dataFormRef.value?.validate((valid: boolean) => { +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { if (valid) { if (dialogStatus.value === 'create') { createData() @@ -57,8 +58,8 @@ updateData() } } - }) - } + } + }) } // 新增数据 function createData() { @@ -114,6 +115,9 @@ form[key] = defaultFormData[key] }) Object.assign(formData, form) + nextTick(() => { + dataFormRef.value?.clearValidate() + }) } const deptTypeList: Ref = ref([]) @@ -217,7 +221,7 @@ - + diff --git a/src/views/measure/source/components/listApproval.vue b/src/views/measure/source/components/listApproval.vue index e3491d5..72271a5 100644 --- a/src/views/measure/source/components/listApproval.vue +++ b/src/views/measure/source/components/listApproval.vue @@ -276,6 +276,10 @@ standard: '', extarCss: '', }) + +onActivated(() => { + fetchData(true) +}) @@ -306,7 +310,7 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index c36a618..9cc1da2 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -251,6 +251,10 @@ ElMessage.warning('无可打印内容') } } + +onActivated(() => { + fetchData(true) +}) diff --git a/src/views/measure/source/listAdd.vue b/src/views/measure/source/listAdd.vue index bda1c70..9a8d316 100644 --- a/src/views/measure/source/listAdd.vue +++ b/src/views/measure/source/listAdd.vue @@ -14,6 +14,7 @@ import { SCHEDULE } from '@/utils/scheduleDict' import type { IAddress } from '@/components/AddressSelect/address-interface' const loading = ref(false) // 表单加载状态 +const curFormId = SCHEDULE.SUPPLIER_APPROVAL const infoId = ref('') // id const pageType = ref('add') // 页面类型: add,edit, detail const buttonLoading = ref(false) // 按钮加载状态 @@ -70,6 +71,7 @@ website: '', traceSupplierPersonList: [], }) +const isChanged = ref(false) const companyAddress = ref([]) // 公司地址 const invoiceAddress = ref([]) // 开票地址 const traceSupplierPersonList: Ref = ref([]) // 人员列表 @@ -197,56 +199,90 @@ }) // 保存至草稿箱 -function saveForm(formEl: FormInstance | undefined) { +const saveForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } - formEl.validate((valid, fields) => { + await formEl.validate((valid, fields) => { if (valid) { - ElMessageBox.confirm( - '确认保存吗?', - '提示', + if (formInline.value.supplierNo) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + else { + sourceSave(formInline.value).then((res) => { + if (res.code === 200) { + formInline.value.id = res.data.id + formInline.value.supplierNo = res.data.supplierNo + ElMessage.success('已保存') + isChanged.value = false + } + }) + } + } + }) +} + +// 提交表单 +const submitFunc = () => { +// 再提交 + const params = { + id: formInline.value.id, + formId: curFormId, // 表单id + } + sourceSubmit(params).then((res) => { + ElMessage.success('提交成功') + close() + }) +} + +// 点击提交 +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }, ).then(() => { - if (formInline.value.supplierNo) { - sourceDraftUpdate(formInline.value).then((res) => { - if (res.code === 200) { - ElMessage.success('已保存') - } - }) + // 如果id存在, 调用更新接口 + if (formInline.value.id) { + // 如果表单变更过,先保存,再提交 + if (isChanged.value) { + sourceDraftUpdate(formInline.value).then((res) => { + if (res.code === 200) { + submitFunc() + } + else { + ElMessage.error('保存失败,请重新保存后提交') + } + }) + } + else { // 表单未变更过,直接提交 + submitFunc() + } } else { + // id不存在,调用新建接口 sourceSave(formInline.value).then((res) => { if (res.code === 200) { formInline.value.id = res.data.id formInline.value.supplierNo = res.data.supplierNo - ElMessage.success('已保存') + submitFunc() } }) + ElMessage.info('请先保存再提交!') } }) } }) } -// 提交表单 -function submitForm() { - if (formInline.value.id) { - const params = { - id: formInline.value.id, - formId: SCHEDULE.SUPPLIER_APPROVAL, // 表单id - } - sourceSubmit(params).then((res) => { - ElMessage.success('提交成功') - close() - }) - } - else { - ElMessage.info('请先保存再提交!') - } -} const isShow = ref(false) const testForm = ref({ fileList: [], @@ -299,7 +335,7 @@ 打印 - + 提交 diff --git a/src/views/measure/train/components/listApproval.vue b/src/views/measure/train/components/listApproval.vue new file mode 100644 index 0000000..1e93982 --- /dev/null +++ b/src/views/measure/train/components/listApproval.vue @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 107637b..c630f58 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -6,6 +6,7 @@ import { exportExcel } from '@/utils/exportXlsx' import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' import { printJSON } from '@/utils/printUtils' +import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ createEndTime: '', @@ -15,6 +16,7 @@ effectiveCompany: '', ids: [], trainEndTime: '', + formId: SCHEDULE.TRAIN_APPROVAL, trainStartTime: '', offset: 1, limit: 20, diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts index a41a274..4869328 100644 --- a/src/views/measure/train/plan_interface.ts +++ b/src/views/measure/train/plan_interface.ts @@ -31,6 +31,7 @@ createEndTime: string createStartTime: string ids: [] + formId: string logNo: string trainEndTime: string trainName: string diff --git a/src/views/measure/train/trainPlanApprove.vue b/src/views/measure/train/trainPlanApprove.vue index a20249f..4c0d635 100644 --- a/src/views/measure/train/trainPlanApprove.vue +++ b/src/views/measure/train/trainPlanApprove.vue @@ -1,53 +1,121 @@ - + {{ item.name }} - + diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue index b1e16c8..aaf7291 100644 --- a/src/views/system/dept/editDept.vue +++ b/src/views/system/dept/editDept.vue @@ -46,9 +46,10 @@ num: [{ required: true, message: '排序不可为空', trigger: 'blur' }, { pattern: /^\d+(\.\d+)?$/, trigger: ['blur', 'change'], message: '' }], }) -function submitForm() { - if (dataFormRef) { - dataFormRef.value?.validate((valid: boolean) => { +const submitForm = async (formEl: FormInstance | undefined) => { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { if (valid) { if (dialogStatus.value === 'create') { createData() @@ -57,8 +58,8 @@ updateData() } } - }) - } + } + }) } // 新增数据 function createData() { @@ -114,6 +115,9 @@ form[key] = defaultFormData[key] }) Object.assign(formData, form) + nextTick(() => { + dataFormRef.value?.clearValidate() + }) } const deptTypeList: Ref = ref([]) @@ -217,7 +221,7 @@ - + + + @@ -330,34 +332,8 @@ display: none; } - .table-title { - background-color: #409eff; - - .title { - padding: 5px 10px; - // background-color: ; - font-size: 15px; - line-height: 46px; - color: #fff; - display: flex; - align-items: center; - - .text { - margin-left: 10px; - } - } - } - .table { width: 78%; - - .pagination { - margin-top: 10px; - width: 100%; - display: flex; - flex-direction: column; - align-items: center; - } } } @@ -374,7 +350,7 @@ .user-dept-scroll { width: 100%; - height: calc(100vh - 265px); + height: calc(100vh - 120px); } } }