diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 6b6f026..9643cb8 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -111,14 +111,14 @@ // 根据过滤查询条件 function filterQuery() { const StatuFlag = activeTitle.value == '可打印' - const value = menu.value.find(item => item.name === activeTitle.value)!.id + const value = menu.value.find(item => item.name === activeTitle.value)!.id as string if (StatuFlag) { - listQuery.value.printStatus = value - listQuery.value.approvalStatus = '' + listQuery.value.printStatus = value as string + listQuery.value.approvalStatus = 'null' } else { listQuery.value.printStatus = '' - listQuery.value.approvalStatus = value == '0' ? 'null' : value + listQuery.value.approvalStatus = value as string == '0' ? 'null' : value as string } } @@ -312,7 +312,7 @@ active.value = window.sessionStorage.getItem('certPrintActive') as string } else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + active.value = menu.value.find(item => item.name === '可打印')!.id as string// 可打印 } fetchData(true) }) diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 6b6f026..9643cb8 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -111,14 +111,14 @@ // 根据过滤查询条件 function filterQuery() { const StatuFlag = activeTitle.value == '可打印' - const value = menu.value.find(item => item.name === activeTitle.value)!.id + const value = menu.value.find(item => item.name === activeTitle.value)!.id as string if (StatuFlag) { - listQuery.value.printStatus = value - listQuery.value.approvalStatus = '' + listQuery.value.printStatus = value as string + listQuery.value.approvalStatus = 'null' } else { listQuery.value.printStatus = '' - listQuery.value.approvalStatus = value == '0' ? 'null' : value + listQuery.value.approvalStatus = value as string == '0' ? 'null' : value as string } } @@ -312,7 +312,7 @@ active.value = window.sessionStorage.getItem('certPrintActive') as string } else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + active.value = menu.value.find(item => item.name === '可打印')!.id as string// 可打印 } fetchData(true) }) diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 5d7fc0f..1ac692b 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -136,10 +136,18 @@ // 切换tab状态 const changeCurrentButton = (val: string) => { - active.value = val - activeTitle.value = menu.value.find(item => item.id === val)!.name - window.sessionStorage.setItem('buttonBoxActive', val) - clearList() + if (!val) { + active.value = '1' + activeTitle.value = '待借用' + window.sessionStorage.setItem('borrowhandleActive', '1') + clearList() + } + else { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('borrowhandleActive', val) + clearList() + } } // 搜索 @@ -369,18 +377,18 @@ onMounted(async () => { await getDict() // 获取字典-审批状态 - if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { - active.value = window.sessionStorage.getItem('buttonBoxActive')! + if (window.sessionStorage.getItem('borrowhandleActive') !== 'undefined' && window.sessionStorage.getItem('borrowhandleActive') !== '') { + active.value = window.sessionStorage.getItem('borrowhandleActive')! } else { - active.value = menu.value.find(item => item.name === '待借用')!.id // 待借用 + active.value = menu.value.find(item => item.name === '待借用')!.id as string // 待借用 activeTitle.value === '待借用' } - nextTick(() => { + setTimeout(() => { fetchData(true) // 获取表格数据 fetchDeptTreeList() // 获取使用部门 fetchUserList() // 获取人员列表 - }) + }, 300) }) diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 6b6f026..9643cb8 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -111,14 +111,14 @@ // 根据过滤查询条件 function filterQuery() { const StatuFlag = activeTitle.value == '可打印' - const value = menu.value.find(item => item.name === activeTitle.value)!.id + const value = menu.value.find(item => item.name === activeTitle.value)!.id as string if (StatuFlag) { - listQuery.value.printStatus = value - listQuery.value.approvalStatus = '' + listQuery.value.printStatus = value as string + listQuery.value.approvalStatus = 'null' } else { listQuery.value.printStatus = '' - listQuery.value.approvalStatus = value == '0' ? 'null' : value + listQuery.value.approvalStatus = value as string == '0' ? 'null' : value as string } } @@ -312,7 +312,7 @@ active.value = window.sessionStorage.getItem('certPrintActive') as string } else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + active.value = menu.value.find(item => item.name === '可打印')!.id as string// 可打印 } fetchData(true) }) diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 5d7fc0f..1ac692b 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -136,10 +136,18 @@ // 切换tab状态 const changeCurrentButton = (val: string) => { - active.value = val - activeTitle.value = menu.value.find(item => item.id === val)!.name - window.sessionStorage.setItem('buttonBoxActive', val) - clearList() + if (!val) { + active.value = '1' + activeTitle.value = '待借用' + window.sessionStorage.setItem('borrowhandleActive', '1') + clearList() + } + else { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('borrowhandleActive', val) + clearList() + } } // 搜索 @@ -369,18 +377,18 @@ onMounted(async () => { await getDict() // 获取字典-审批状态 - if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { - active.value = window.sessionStorage.getItem('buttonBoxActive')! + if (window.sessionStorage.getItem('borrowhandleActive') !== 'undefined' && window.sessionStorage.getItem('borrowhandleActive') !== '') { + active.value = window.sessionStorage.getItem('borrowhandleActive')! } else { - active.value = menu.value.find(item => item.name === '待借用')!.id // 待借用 + active.value = menu.value.find(item => item.name === '待借用')!.id as string // 待借用 activeTitle.value === '待借用' } - nextTick(() => { + setTimeout(() => { fetchData(true) // 获取表格数据 fetchDeptTreeList() // 获取使用部门 fetchUserList() // 获取人员列表 - }) + }, 300) }) diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 0a4cf0a..28555d7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -58,6 +58,15 @@ limit: 20, }) +const permUrl = { + edit: '/device/borrow/borrowapply/update', // 编辑 + agree: '/device/borrow/borrowapply/agree', // 同意 + reject: '/device/borrow/borrowapply/reject', // 驳回 + refuse: '/device/borrow/borrowapply/refuse', // 驳回 + cancel: '/device/borrow/borrowapply/cancel', // 取消 + delete: '/device/borrow/borrowapply/delete', // 删除 +} + const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} @@ -356,6 +365,11 @@ }) } else if (val === '提交') { + const postData = { + id: row.id, + formId: SCHEDULE.DEVICE_BORROW_APPROVAL, + ...row.approvalStatusName === '已取消' && { processId: row.processId }, + } ElMessageBox.confirm( '确认提交该审批吗?', '提示', @@ -366,7 +380,7 @@ }, ) .then(() => { - submitReceiveApplyList({ id: row.id, formId: SCHEDULE.DEVICE_BORROW_APPROVAL }).then((res) => { + submitReceiveApplyList(postData).then((res) => { ElMessage({ type: 'success', message: '已提交', @@ -421,7 +435,7 @@ active.value = window.sessionStorage.getItem('buttonBoxActive')! } else { - active.value = menu.value.find(item => item.name === '全部')!.id // 全部 + active.value = menu.value.find(item => item.name === '全部')!.id as string // 全部 activeTitle.value === '全部' } nextTick(() => { @@ -517,37 +531,37 @@ 查看 同意 驳回 拒绝 编辑 - - 编辑 - - 取消 @@ -589,11 +592,11 @@ 删除 diff --git a/src/api/device/receive.ts b/src/api/device/receive.ts index da7ac90..de38a57 100644 --- a/src/api/device/receive.ts +++ b/src/api/device/receive.ts @@ -46,7 +46,7 @@ }) } // 新建--提交 -export function submitReceiveApplyList(data: { formId: string; id: string }) { +export function submitReceiveApplyList(data: { formId: string; id: string; processId?: string }) { return request({ url: `${prefix}/submitEquipmentApply`, method: 'post', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 8bce535..f785f0f 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -45,7 +45,7 @@ }) } // 状态管理提交 -export function submitStatus(data: { id: string | number; formId: string }) { +export function submitStatus(data: { id: string | number; formId: string; processId?: string }) { return request({ url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', diff --git a/src/utils/buttonPerm.ts b/src/utils/buttonPerm.ts index 205d84a..51b9cba 100644 --- a/src/utils/buttonPerm.ts +++ b/src/utils/buttonPerm.ts @@ -37,12 +37,14 @@ edit: { if: (row: any, permPath: string) => { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 6b6f026..9643cb8 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -111,14 +111,14 @@ // 根据过滤查询条件 function filterQuery() { const StatuFlag = activeTitle.value == '可打印' - const value = menu.value.find(item => item.name === activeTitle.value)!.id + const value = menu.value.find(item => item.name === activeTitle.value)!.id as string if (StatuFlag) { - listQuery.value.printStatus = value - listQuery.value.approvalStatus = '' + listQuery.value.printStatus = value as string + listQuery.value.approvalStatus = 'null' } else { listQuery.value.printStatus = '' - listQuery.value.approvalStatus = value == '0' ? 'null' : value + listQuery.value.approvalStatus = value as string == '0' ? 'null' : value as string } } @@ -312,7 +312,7 @@ active.value = window.sessionStorage.getItem('certPrintActive') as string } else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + active.value = menu.value.find(item => item.name === '可打印')!.id as string// 可打印 } fetchData(true) }) diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 5d7fc0f..1ac692b 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -136,10 +136,18 @@ // 切换tab状态 const changeCurrentButton = (val: string) => { - active.value = val - activeTitle.value = menu.value.find(item => item.id === val)!.name - window.sessionStorage.setItem('buttonBoxActive', val) - clearList() + if (!val) { + active.value = '1' + activeTitle.value = '待借用' + window.sessionStorage.setItem('borrowhandleActive', '1') + clearList() + } + else { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('borrowhandleActive', val) + clearList() + } } // 搜索 @@ -369,18 +377,18 @@ onMounted(async () => { await getDict() // 获取字典-审批状态 - if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { - active.value = window.sessionStorage.getItem('buttonBoxActive')! + if (window.sessionStorage.getItem('borrowhandleActive') !== 'undefined' && window.sessionStorage.getItem('borrowhandleActive') !== '') { + active.value = window.sessionStorage.getItem('borrowhandleActive')! } else { - active.value = menu.value.find(item => item.name === '待借用')!.id // 待借用 + active.value = menu.value.find(item => item.name === '待借用')!.id as string // 待借用 activeTitle.value === '待借用' } - nextTick(() => { + setTimeout(() => { fetchData(true) // 获取表格数据 fetchDeptTreeList() // 获取使用部门 fetchUserList() // 获取人员列表 - }) + }, 300) }) diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 0a4cf0a..28555d7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -58,6 +58,15 @@ limit: 20, }) +const permUrl = { + edit: '/device/borrow/borrowapply/update', // 编辑 + agree: '/device/borrow/borrowapply/agree', // 同意 + reject: '/device/borrow/borrowapply/reject', // 驳回 + refuse: '/device/borrow/borrowapply/refuse', // 驳回 + cancel: '/device/borrow/borrowapply/cancel', // 取消 + delete: '/device/borrow/borrowapply/delete', // 删除 +} + const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} @@ -356,6 +365,11 @@ }) } else if (val === '提交') { + const postData = { + id: row.id, + formId: SCHEDULE.DEVICE_BORROW_APPROVAL, + ...row.approvalStatusName === '已取消' && { processId: row.processId }, + } ElMessageBox.confirm( '确认提交该审批吗?', '提示', @@ -366,7 +380,7 @@ }, ) .then(() => { - submitReceiveApplyList({ id: row.id, formId: SCHEDULE.DEVICE_BORROW_APPROVAL }).then((res) => { + submitReceiveApplyList(postData).then((res) => { ElMessage({ type: 'success', message: '已提交', @@ -421,7 +435,7 @@ active.value = window.sessionStorage.getItem('buttonBoxActive')! } else { - active.value = menu.value.find(item => item.name === '全部')!.id // 全部 + active.value = menu.value.find(item => item.name === '全部')!.id as string // 全部 activeTitle.value === '全部' } nextTick(() => { @@ -517,37 +531,37 @@ 查看 同意 驳回 拒绝 编辑 - - 编辑 - - 取消 @@ -589,11 +592,11 @@ 删除 diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 1d06902..d94f5ae 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -40,6 +40,14 @@ default: '', }, }) + +const permUrl = { + edit: '/device/unusedApply/edit', // 编辑 + agree: '/device/unusedApply/agree', // 同意 + reject: '/device/unusedApply/reject', // 驳回 拒绝 + cancel: '/device/unusedApply/cancle', // 取消 + delete: '/device/unusedApply/delete', // 删除 +} const activeTitle = ref(props.title) // 状态按钮选中 const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} @@ -282,14 +290,18 @@ // 提交 const submit = (row: ITableRow) => { - // 流程id为空 - const { id } = row + const { id, processId } = row + const postData = { + id, + formId: searchQuery.formId, + ...row.approvalStatusName === '已取消' && { processId }, + } ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }).then(() => { - submitStatus({ id, formId: searchQuery.formId }).then((res) => { + submitStatus(postData).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -368,7 +380,7 @@ applyNo: searchQuery.applyNo, // 申请编号 applyStatus: searchQuery.applyStatus, // 申请状态 applyUnit: searchQuery.applyUnit, // 申请部门 - approvalStatus: searchQuery.approvalStatus, // 申请人 + approvalStatus: searchQuery.approvalStatus, // 申请状态 createUser: searchQuery.createUser, // 创建人 equipmentName: searchQuery.equipmentName, // 设备名称 equipmentNo: searchQuery.equipmentNo, // 设备编号 @@ -548,7 +560,7 @@ 查看 同意 驳回 拒绝 取消 { error(permPath) - return hasPermission(permPath) && (row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消') + // eslint-disable-next-line no-mixed-operators + return hasPermission(permPath) && row.approvalStatusName === '未通过-驳回' || row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, submit: { - if: (row: any) => { - row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' + if: (row: any, permPath: string) => { + permPath ? console.log(permPath) : '' + return row.approvalStatusName === '草稿箱' || row.approvalStatusName === '已取消' }, }, cancel: { diff --git a/src/utils/common b/src/utils/common deleted file mode 100644 index e69de29..0000000 --- a/src/utils/common +++ /dev/null diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index e849fd3..4f361f3 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -256,7 +256,7 @@ active.value = window.sessionStorage.getItem('deptMeasureActive') as string } else { - active.value = menu.value.find(item => item.name === '待检测')!.id // 待分发 + active.value = menu.value.find(item => item.name === '待检测')!.id as string// 待分发 } nextTick(() => { fetchData(true) // 获取表格数据 diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 6b6f026..9643cb8 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -111,14 +111,14 @@ // 根据过滤查询条件 function filterQuery() { const StatuFlag = activeTitle.value == '可打印' - const value = menu.value.find(item => item.name === activeTitle.value)!.id + const value = menu.value.find(item => item.name === activeTitle.value)!.id as string if (StatuFlag) { - listQuery.value.printStatus = value - listQuery.value.approvalStatus = '' + listQuery.value.printStatus = value as string + listQuery.value.approvalStatus = 'null' } else { listQuery.value.printStatus = '' - listQuery.value.approvalStatus = value == '0' ? 'null' : value + listQuery.value.approvalStatus = value as string == '0' ? 'null' : value as string } } @@ -312,7 +312,7 @@ active.value = window.sessionStorage.getItem('certPrintActive') as string } else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + active.value = menu.value.find(item => item.name === '可打印')!.id as string// 可打印 } fetchData(true) }) diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 5d7fc0f..1ac692b 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -136,10 +136,18 @@ // 切换tab状态 const changeCurrentButton = (val: string) => { - active.value = val - activeTitle.value = menu.value.find(item => item.id === val)!.name - window.sessionStorage.setItem('buttonBoxActive', val) - clearList() + if (!val) { + active.value = '1' + activeTitle.value = '待借用' + window.sessionStorage.setItem('borrowhandleActive', '1') + clearList() + } + else { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('borrowhandleActive', val) + clearList() + } } // 搜索 @@ -369,18 +377,18 @@ onMounted(async () => { await getDict() // 获取字典-审批状态 - if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { - active.value = window.sessionStorage.getItem('buttonBoxActive')! + if (window.sessionStorage.getItem('borrowhandleActive') !== 'undefined' && window.sessionStorage.getItem('borrowhandleActive') !== '') { + active.value = window.sessionStorage.getItem('borrowhandleActive')! } else { - active.value = menu.value.find(item => item.name === '待借用')!.id // 待借用 + active.value = menu.value.find(item => item.name === '待借用')!.id as string // 待借用 activeTitle.value === '待借用' } - nextTick(() => { + setTimeout(() => { fetchData(true) // 获取表格数据 fetchDeptTreeList() // 获取使用部门 fetchUserList() // 获取人员列表 - }) + }, 300) }) diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 0a4cf0a..28555d7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -58,6 +58,15 @@ limit: 20, }) +const permUrl = { + edit: '/device/borrow/borrowapply/update', // 编辑 + agree: '/device/borrow/borrowapply/agree', // 同意 + reject: '/device/borrow/borrowapply/reject', // 驳回 + refuse: '/device/borrow/borrowapply/refuse', // 驳回 + cancel: '/device/borrow/borrowapply/cancel', // 取消 + delete: '/device/borrow/borrowapply/delete', // 删除 +} + const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} @@ -356,6 +365,11 @@ }) } else if (val === '提交') { + const postData = { + id: row.id, + formId: SCHEDULE.DEVICE_BORROW_APPROVAL, + ...row.approvalStatusName === '已取消' && { processId: row.processId }, + } ElMessageBox.confirm( '确认提交该审批吗?', '提示', @@ -366,7 +380,7 @@ }, ) .then(() => { - submitReceiveApplyList({ id: row.id, formId: SCHEDULE.DEVICE_BORROW_APPROVAL }).then((res) => { + submitReceiveApplyList(postData).then((res) => { ElMessage({ type: 'success', message: '已提交', @@ -421,7 +435,7 @@ active.value = window.sessionStorage.getItem('buttonBoxActive')! } else { - active.value = menu.value.find(item => item.name === '全部')!.id // 全部 + active.value = menu.value.find(item => item.name === '全部')!.id as string // 全部 activeTitle.value === '全部' } nextTick(() => { @@ -517,37 +531,37 @@ 查看 同意 驳回 拒绝 编辑 - - 编辑 - - 取消 @@ -589,11 +592,11 @@ 删除 diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 1d06902..d94f5ae 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -40,6 +40,14 @@ default: '', }, }) + +const permUrl = { + edit: '/device/unusedApply/edit', // 编辑 + agree: '/device/unusedApply/agree', // 同意 + reject: '/device/unusedApply/reject', // 驳回 拒绝 + cancel: '/device/unusedApply/cancle', // 取消 + delete: '/device/unusedApply/delete', // 删除 +} const activeTitle = ref(props.title) // 状态按钮选中 const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} @@ -282,14 +290,18 @@ // 提交 const submit = (row: ITableRow) => { - // 流程id为空 - const { id } = row + const { id, processId } = row + const postData = { + id, + formId: searchQuery.formId, + ...row.approvalStatusName === '已取消' && { processId }, + } ElMessageBox.confirm('确认提交吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }).then(() => { - submitStatus({ id, formId: searchQuery.formId }).then((res) => { + submitStatus(postData).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -368,7 +380,7 @@ applyNo: searchQuery.applyNo, // 申请编号 applyStatus: searchQuery.applyStatus, // 申请状态 applyUnit: searchQuery.applyUnit, // 申请部门 - approvalStatus: searchQuery.approvalStatus, // 申请人 + approvalStatus: searchQuery.approvalStatus, // 申请状态 createUser: searchQuery.createUser, // 创建人 equipmentName: searchQuery.equipmentName, // 设备名称 equipmentNo: searchQuery.equipmentNo, // 设备编号 @@ -548,7 +560,7 @@ 查看 同意 驳回 拒绝 取消 props.name, () => { - activeTitle.value = props.name - approvalStatus.value = approvalStatusReserveMap.value[props.name] -}, { deep: true, immediate: true }) const searchQuery = reactive({ fileNo: '', // 编号 fileName: '', // 名称 fileCode: '', // 文件号 createUser: '', // 创建人 createTime: '', // 创建 - approvalStatus: approvalStatus.value || '0', // 审批状态 + approvalStatus: approvalStatus.value, // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -182,7 +178,8 @@ // 提交 const submit = (row: TableRow) => { - const { id } = row + const { id, processId } = row + const postData = { id, formId: SCHEDULE.FILE_APPROVAL, ...row.approvalStatusName === '已取消' && { processId } } ElMessageBox.confirm( `确认提交${row.fileName}吗?`, '提示', @@ -193,7 +190,7 @@ }, ) .then(() => { - submitFile({ id, formId: SCHEDULE.FILE_APPROVAL }).then((res) => { + submitFile(postData).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -225,7 +222,6 @@ searchQuery.fileType = '' searchQuery.createTime = '' searchQuery.createUser = '' - getList() } // 表格被选中的行 @@ -276,9 +272,21 @@ } } +// 监视点击名称 +watch(() => props.name, () => { + activeTitle.value = props.name + sessionStorage.setItem('approveFileMenu', props.name) + approvalStatus.value = approvalStatusReserveMap.value[props.name] + // approvalStatus.value = approvalStatusReserveMap.value[props.name] // 失效 + searchQuery.approvalStatus = approvalStatusReserveMap.value[props.name] || '0' + $router.currentRoute.value.query.cacheActive = searchQuery.approvalStatus + getList() + // 缓存名称 +}, { deep: true, immediate: true }) + onMounted(() => { getFileType() - getList() + // getList() }) @@ -348,6 +356,8 @@ 提交