diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
import { getCurrentInstance, ref } from 'vue' -import type { Ref } from 'vue' -import type { DateModelType } from 'element-plus' -import { ElLoading, ElMessage } from 'element-plus' +import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' +// import { Row } from 'element-plus/es/components/table-v2/src/components' import type { ICerPrintList, ICertPrintSearch } from './cert-interface' -import DistributeDialog from './components/distributeDialog.vue' import ApprovalDialogPart from './components/ApprovalDialogPart.vue' -import BarCodeBind from '@/components/BarCodeBind/index.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' import { getDictByCode } from '@/api/system/dict' -import { exportTaskList, getTaskList } from '@/api/business/task' import { exportCert, getCertList, submitApproval } from '@/api/business/cert' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/global' +import ButtonBox from '@/components/buttonBox/buttonBox.vue' +import type { IMenu } from '@/components/buttonBox/buttonBox' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 右上角按钮 -const menus = [ - { name: '未打印', value: '未打印' }, - { name: '全部', value: '全部' }, - { name: '待审批', value: '待审批' }, - { name: '已通过', value: '已通过' }, - { name: '未通过', value: '未通过' }, -] -const currentMenu = ref('未打印') // 当前选中状态 +const menu = ref([]) // 右上角审批状态按钮组合 +const active = ref('') // 选中的按钮 +const activeTitle = ref('') // active对应的审批状态名字 // 查询条件 const listQuery = ref({ certificationReportCode: '', // 证书编号 @@ -37,7 +30,11 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - formId: 'jlglsygfsp', + orderId: '0', // 委托书id + reason: '', // 操作原因 + sampleId: '0', // 样品id + status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + formId: SCHEDULE.BUSINESS_CERT_PRINT, offset: 1, limit: 20, }) @@ -49,8 +46,40 @@ getDictByCode('certificationClass').then((response) => { certificationClassList.value = response.data }) + getDictByCode('approvalStatus').then((response) => { + // 审批状态字典 {1:草稿箱} + // response.data.forEach((item: any) => { + // approvalStatusMap.value[`${item.value}`] = item.name + // }) + + // 审批状态字典 {草稿箱: 1} + // response.data.forEach((item: any) => { + // approvalStatusReserveMap.value[item.name] = `${item.value}` + // }) + // 制作右上角的菜单 + response.data.forEach((item: dictType) => { + if (item.name === '可打印' || item.name === '全部' + || item.name === '待审批' || item.name === '审批中' + || item.name === '已通过' || item.name === '未通过' + ) { + if (item.name === '可打印') { + active.value = item.value + activeTitle.value = item.name + menu.value.unshift({ + name: item.name, + id: `${item.value}`, + }) + } + else { + menu.value.push({ + name: item.name, + id: `${item.value}`, + }) + } + } + }) + }) } -getDict() // 表头 const columns = ref([ @@ -78,8 +107,9 @@ // 根据过滤查询条件 function filterQuery() { - switch (currentMenu.value) { - case '未打印': + console.log(activeTitle) + switch (activeTitle.value) { + case '可打印': listQuery.value.printNum = 0 listQuery.value.approvalStatus = '' break @@ -117,8 +147,8 @@ // 模拟数据 loadingTable.value = false list.value = [ - { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '0', printStatusName: '未打印', certificateReportTypeName: '自检', approvalStatusName: '待审批', taskId: 100, id: 10 }, - { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '1', printStatusName: '已打印', certificateReportTypeName: '自检', approvalStatusName: '待审批' }, + { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '0', printStatusName: '未打印', certificateReportTypeName: '自检', approvalStatusName: '待审批', taskId: '100', id: '10' }, + { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '1', printStatusName: '已打印', certificateReportTypeName: '自检', approvalStatusName: '待审批', taskId: '1001', id: '101' }, ] // getCertList(listQuery.value).then((response) => { // list.value = response.data.rows @@ -146,7 +176,11 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - formId: 'jlglsygfsp', + orderId: '0', // 委托书id + reason: '', // 操作原因 + sampleId: '0', // 样品id + status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + formId: SCHEDULE.BUSINESS_CERT_PRINT, offset: 1, limit: 20, } @@ -166,7 +200,6 @@ else { approvalDialogPart.value.initDialog('refuse', row.taskId, row.id) } - // distributeDialogRef.value.initDialog(row.orderId, row.sampleId) } // 审批结束回调 @@ -194,15 +227,12 @@ }) if (list.value.length > 0) { // const params = { - // bussinessSize: listQuery.value.bussinessSize, // 业务规模 - // customerName: listQuery.value.customerName, // 公司名称 - // customerNo: listQuery.value.customerNo, // 任务分发编号 - // grade: listQuery.value.grade, // 履约评级 + // ...listQuery.value, // ids: checkoutList.value, // } - // exportCustomerList(params).then((res) => { + // exportCert(params).then((res) => { // const blob = new Blob([res.data]) - // exportFile(blob, '任务分发列表.xlsx') + // exportFile(blob, '证书打印列表.xlsx') // }) } else { @@ -212,10 +242,50 @@ } // 打印 -const bindLabel = () => { - // exportCert({orderId:row.orderId,reason:row.reason,sampleId:row.sampleId,status:row.status}).then(res=>{ - // console.log(res) - // }) +const bindLabel = (row: ICerPrintList) => { + console.log(1) + row.printNum = 1 + // 判断状态第一次可以直接打印,之后的打印需要审批 + if (row.printNum == 1) { + ElMessageBox.confirm( + '确定要打印吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + exportCert({ orderId: row.orderId, reason: row.reason, sampleId: row.sampleId, status: row.status }).then((res) => { + console.log(res) + }) + }) + } + else { + ElMessageBox.confirm( + '打印前需申请 确定要打印吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + dangerouslyUseHTMLString: true, + }, + ).then(() => { + submitApproval({ id: row.id, formId: listQuery.value.formId }).then((res) => { + console.log(res) + if (res === 200) { + ElMessageBox.confirm( + '已经发送申请!', + '确认操作', + { + type: 'success', + }, + ) + } + }) + }) + } } // 打印列表 @@ -239,25 +309,33 @@ } } -// 选择按钮变更 -watch(currentMenu, (val: string) => { - fetchData(false) -}) +// 按钮切换 +const changeCurrentButton = (val: string) => { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('buttonBoxActive', val) + clearList() +} -fetchData(false) +onMounted(async () => { + await getDict() // 获取字典-审批状态 + if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { + active.value = window.sessionStorage.getItem('buttonBoxActive')! + } + else { + active.value = menu.value.find(item => item.name === '可打印')!.id // 可打 + activeTitle.value === '可打印' + } + fetchData(true) +}) +onUnmounted(() => { + window.sessionStorage.setItem('buttonBoxActive', '') // 清除 +}) diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
{ - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input @@ -559,9 +571,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +584,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +597,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝 diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
{ - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input @@ -559,9 +571,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +584,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +597,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝 diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index d7e722c..b67d2eb 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -7,6 +7,8 @@ import passed from './components/approve/passed.vue' // 已通过 import unPassed from './components/approve/unPassed.vue' // 未通过 import cancel from './components/approve/cancel.vue' // 未通过 +import { getDictByCode } from '@/api/system/dict' + export interface menuType { name: string comp: any @@ -22,14 +24,32 @@ ]) const current = ref('全部') const currentComp = shallowRef(all) +const approvalStatusMap = ref({}) as any +const approvalStatusReserveMap = ref({}) as any +// 获取菜单状态 +const getMenuStatus = () => { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@
- + diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
{ - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input @@ -559,9 +571,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +584,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +597,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝 diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index d7e722c..b67d2eb 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -7,6 +7,8 @@ import passed from './components/approve/passed.vue' // 已通过 import unPassed from './components/approve/unPassed.vue' // 未通过 import cancel from './components/approve/cancel.vue' // 未通过 +import { getDictByCode } from '@/api/system/dict' + export interface menuType { name: string comp: any @@ -22,14 +24,32 @@ ]) const current = ref('全部') const currentComp = shallowRef(all) +const approvalStatusMap = ref({}) as any +const approvalStatusReserveMap = ref({}) as any +// 获取菜单状态 +const getMenuStatus = () => { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
{ - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input @@ -559,9 +571,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +584,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +597,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝 diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index d7e722c..b67d2eb 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -7,6 +7,8 @@ import passed from './components/approve/passed.vue' // 已通过 import unPassed from './components/approve/unPassed.vue' // 未通过 import cancel from './components/approve/cancel.vue' // 未通过 +import { getDictByCode } from '@/api/system/dict' + export interface menuType { name: string comp: any @@ -22,14 +24,32 @@ ]) const current = ref('全部') const currentComp = shallowRef(all) +const approvalStatusMap = ref({}) as any +const approvalStatusReserveMap = ref({}) as any +// 获取菜单状态 +const getMenuStatus = () => { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index 7fd5f9c..dbce999 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -53,14 +53,6 @@ data, }) } -// 设备借用申请提交 -// export function submitApply(data: object) { -// return request({ -// url: '/equipmentApply/borrowEquipmentApply', -// method: 'post', -// data, -// }) -// } // 状态管理提交 export function submitApply(data: object) { @@ -71,7 +63,16 @@ }) } -// 设备借用归还提交 +// 设备借用设备-借用 +export function borrowApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} + +// 设备借用-归还 export function returnApply(data: object) { return request({ url: '/equipmentApply/returnEquipmentApply', diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 81c6b47..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -9,7 +9,7 @@ import ButtonBox from '@/components/buttonBox/buttonBox.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' +import { borrowApply, deleteApply, exportApply, getApplyList, returnApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' import { toTreeList } from '@/utils/structure' @@ -71,12 +71,12 @@ }, { text: '申请部门', - value: 'applyUnit', + value: 'applyUnitName', align: 'center', }, { text: '申请人', - value: 'applyPerson', + value: 'applyPersonName', align: 'center', }, { @@ -173,7 +173,7 @@ // 获取使用部门 const fetchDeptTreeList = () => { - getDeptTreeList().then((res: any) => { + getDeptTreeList().then((res) => { if (res.data) { // 将列表转树结构 useDeptList.value = toTreeList(res.data, '0', true) } @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { @@ -285,7 +285,7 @@ type: 'warning', }, ).then(() => { - submitApply({ id: row.id as string }).then((res) => { + borrowApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/stateManage/components/addRow.vue b/src/views/device/stateManage/components/addRow.vue index 3ba82d6..83a85a6 100644 --- a/src/views/device/stateManage/components/addRow.vue +++ b/src/views/device/stateManage/components/addRow.vue @@ -129,7 +129,7 @@
diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 94caf8d..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox, dayjs } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import type { EquipmentListRow, IdeviceList, IdeviceListQuery } from './status-interface' -import addRow from './addRow.vue' +// import addRow from './addRow.vue' import SelectDeviceDialog from './selectDeviceDialog.vue' import approveAction from './approvalActionDialog.vue' import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' @@ -32,7 +32,8 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') +// 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 remark: '', // 申请说明 @@ -49,7 +50,8 @@ equipmentId: '', equipmentList: [] as EquipmentListRow[], id: '', -}) // 表单 +}) +// 设备借用表单 const ruleForm2 = ref({ applyUnit: '', // 申请单位 applyPerson: '', // 申请人 @@ -200,11 +202,12 @@ fetchData() title.value = row.title name.value = row.name + // 设备借用 if (isDevice.value) { - // 设备借用 if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -214,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -239,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -325,8 +329,6 @@ }, ).then((res) => { if (title.value == '编辑') { - ruleForm1.value.applyPerson = ruleForm1.value.id - ruleForm1.value.applyUnit = ruleForm1.value.id if (ruleForm1.value.equipmentList && ruleForm1.value.equipmentList[0]) { ruleForm1.value.equipmentId = ruleForm1.value.equipmentList[0].equipmentId // delete ruleForm1.value.equipmentList @@ -839,8 +841,9 @@ - + + +
{ - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input @@ -559,9 +571,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="agree(row)" > 同意 @@ -572,9 +584,9 @@ type="primary" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 3" @click="reject(row)" > 驳回 @@ -585,9 +597,9 @@ type="danger" link :disabled=" - row.approvalStatus !== '待审批' - && row.approvalStatus !== '审批中' - " + (row.approvalStatus !== '待审批' + && row.approvalStatus !== '审批中') + || row.decisionItem === 1 || row.decisionItem === 2" @click="refuse(row)" > 拒绝 diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index d7e722c..b67d2eb 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -7,6 +7,8 @@ import passed from './components/approve/passed.vue' // 已通过 import unPassed from './components/approve/unPassed.vue' // 未通过 import cancel from './components/approve/cancel.vue' // 未通过 +import { getDictByCode } from '@/api/system/dict' + export interface menuType { name: string comp: any @@ -22,14 +24,32 @@ ]) const current = ref('全部') const currentComp = shallowRef(all) +const approvalStatusMap = ref({}) as any +const approvalStatusReserveMap = ref({}) as any +// 获取菜单状态 +const getMenuStatus = () => { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => 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, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@