diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/views/dialog/selectOrderTestEquipment.vue b/src/views/dialog/selectOrderTestEquipment.vue new file mode 100644 index 0000000..97efcd8 --- /dev/null +++ b/src/views/dialog/selectOrderTestEquipment.vue @@ -0,0 +1,329 @@ + + + + + + diff --git a/src/api/business/certManage/cert.ts b/src/api/business/certManage/cert.ts index 93db6c6..d7b564c 100644 --- a/src/api/business/certManage/cert.ts +++ b/src/api/business/certManage/cert.ts @@ -1,9 +1,9 @@ /** * 证书打印 -*/ + */ import request from '../../index' -import type { IListQuery } from '@/views/business/certManage/cert/cert-interface' -const prefix = 'business/certificatePrint' +import type { IListQuery } from '@/views/certManage/cert-interface' +const prefix = '/business/device/measureApproval' // 证书打印列表 export function getCertList(data: IListQuery) { @@ -22,6 +22,61 @@ data, }) } +// 新建 +export function addCert(data: any) { + return request({ + url: `${prefix}/save`, + method: 'post', + data, + }) +} + +// 草稿箱编辑 +export function draftUpdateCert(data: any) { + return request({ + url: `${prefix}/draftUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 未通过、已取消编辑 +export function failUpdateCert(data: any) { + return request({ + url: `${prefix}/failUpdate`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 草稿箱删除 +export function draftDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftDelete`, + method: 'post', + data, + }) +} + +// 已取消删除 +export function approvalDelete(data: { id: string }) { + return request({ + url: `${prefix}/approval/delete`, + method: 'post', + data, + }) +} + +// 草稿箱批量删除 +export function draftBatchDelete(data: { id: string }) { + return request({ + url: `${prefix}/draftBatchDelete`, + method: 'post', + data, + }) +} // 证书导出 export function exportCertList(data: Omit) { @@ -34,7 +89,7 @@ } // 发起申请提交 -export function submitApproval(data: any) { +export function submitCert(data: any) { return request({ url: `${prefix}/submit`, method: 'post', @@ -43,7 +98,11 @@ } // 驳回 -export function rejectApproval(data: { comments: string; id: string; taskId: string }) { +export function rejectApproval(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/reject`, method: 'post', @@ -52,7 +111,11 @@ } // 拒绝 -export function refuseCert(data: { comments: string; id: string; taskId: string }) { +export function refuseCert(data: { + comments: string + id: string + taskId: string +}) { return request({ url: `${prefix}/approval/refuse`, method: 'post', @@ -60,21 +123,24 @@ }) } -// 更改状态为不可打印 -export function changePrintStatus(data: { id: string }) { +// 取消 +export function cancelApproval(data: { + comments: string + id: string + processInstanceId: string +}) { return request({ - url: '/business/certificatePrint/noPrintable', + url: `${prefix}/approval/revoke`, method: 'post', data, }) } -// 打印记录 -export function getPrintRecordList(data: { id: string; limit: number; offset: number }) { +// 重新生成检定证书 +export function createMeasureCert(data: { id: string }) { return request({ - url: `${prefix}/log?offset=${data.offset}&limit=${data.limit}`, + url: `${prefix}/generate/certificate`, method: 'post', data, }) } - diff --git a/src/api/business/manager/order.ts b/src/api/business/manager/order.ts index 4a938c6..3c80d3f 100644 --- a/src/api/business/manager/order.ts +++ b/src/api/business/manager/order.ts @@ -25,7 +25,7 @@ } // 退回 -export function deleteOrder(data: { id: string }) { +export function deleteOrder(data: { ids: string[] }) { return request({ url: `${prefix}/delete`, method: 'post', diff --git a/src/assets/icons/icon-loginLog.svg b/src/assets/icons/icon-loginLog.svg new file mode 100644 index 0000000..f32a382 --- /dev/null +++ b/src/assets/icons/icon-loginLog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-module.svg b/src/assets/icons/icon-module.svg new file mode 100644 index 0000000..d27bb46 --- /dev/null +++ b/src/assets/icons/icon-module.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/icon-sign.svg b/src/assets/icons/icon-sign.svg new file mode 100644 index 0000000..9ec62e5 --- /dev/null +++ b/src/assets/icons/icon-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/buttonBox/buttonBox.vue b/src/components/buttonBox/buttonBox.vue index ed83b5a..5feadd1 100644 --- a/src/components/buttonBox/buttonBox.vue +++ b/src/components/buttonBox/buttonBox.vue @@ -86,6 +86,10 @@ .el-radio-button:first-child:last-child .el-radio-button__inner { border-radius: 0 !important; } + + .el-badge__content.is-fixed { + z-index: 999999; + } } diff --git a/src/router/modules/cert.ts b/src/router/modules/cert.ts index b8b46f5..7973517 100644 --- a/src/router/modules/cert.ts +++ b/src/router/modules/cert.ts @@ -27,7 +27,7 @@ }, }, { - path: ':type/:id?', + path: '/cert/:type/:id?', name: 'certManageDetail', component: () => import('@/views/certManage/detail.vue'), diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts index b3c1624..bb354b6 100644 --- a/src/router/modules/system.ts +++ b/src/router/modules/system.ts @@ -24,17 +24,17 @@ auth: '/sys/dict', }, }, - { - path: 'autograph', - name: 'logAutograph', - component: () => - import('@/views/system/baseInfo/autograph/autograph.vue'), - meta: { - title: '签名管理', - icon: 'ep:key', - auth: '/sys/baseInfo/autograph', - }, - }, + // { + // path: 'autograph', + // name: 'logAutograph', + // component: () => + // import('@/views/system/baseInfo/autograph/autograph.vue'), + // meta: { + // title: '签名管理', + // icon: 'ep:key', + // auth: '/sys/baseInfo/autograph', + // }, + // }, { path: 'resourceList', name: 'ResourceList', @@ -86,6 +86,53 @@ }, }, { + path: 'process/list', + name: 'ProcessList', + component: () => import('@/views/system/process/process.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + }, + }, + { + path: '/process/edit', + name: 'ProcessListEdit', + component: () => import('@/views/system/process/editProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + auth: '/sys/process', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/detail', + name: 'ProcessListDetail', + component: () => import('@/views/system/process/detailProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { + path: '/process/add', + name: 'ProcessListAdd', + component: () => import('@/views/system/process/addProcess.vue'), + meta: { + title: '流程管理', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/process/list', + }, + }, + { path: 'businessLog', name: 'BusinessLog', component: () => import('@/views/system/log/listLog.vue'), diff --git a/src/views/certManage/cert-interface.ts b/src/views/certManage/cert-interface.ts index e2ddd67..7589e06 100644 --- a/src/views/certManage/cert-interface.ts +++ b/src/views/certManage/cert-interface.ts @@ -1,26 +1,17 @@ // 证书打印查询 export interface IListQuery { approvalStatus: string // 审批状态类型code,导出接口不用传 - certificateReportNo: string // 证书报告编号 - certificateReportName: string // 证书报告名称 - customerId: string // 委托方id - customerName: string // 委托方 - deptName: string // 使用部门 - sampleNo: string // 受检设备编号 - sampleName: string // 受检设备名称 - model: string // 规格型号 - manufactureNo: string // 出厂编号 - measureCategory: string // 检校类别(字典code) - traceDateStart: string // 测试、校准或检定日期开始 - traceDateEnd: string // 测试、校准或检定日期结束 - conclusion: string // 结论(所检项目合格/不合格/除*外其余所检项目合格,用户手选) - measureValidDateStart: string // 检定有效期开始 - measureValidDateEnd: string // 检定有效期结束 - labCode: string // 实验室(字典code) - groupCode: string // 部门(字典code) - createUserName: string // 检定员 - formId: string // 表单id - printStatus: string // 打印状态(未打印传1,其他状态不传) + certificateName: string // 证书名称 + certificateNo: string // 证书编号 + conclusion: string // 结论 + customerName: string // 委托方 + deptName: string // 实验室/使用部门 + formId: string // 表单id(流程定义对应的表单id,等价于业务id),导出接口不用传 + manufactureNo: string // 出厂编号 + measureCategory: string // 业务类型 + model: string // 规格型号 + sampleName: string // 受检设备名称 + staffName: string // 检定员名字 offset: number limit: number } @@ -46,4 +37,33 @@ processId: string approvalStatusName: string // 审批状态名称 decisionItem?: string + deptName?: string // 实验室 +} + +export interface IForm { + id: string // id,更新/删除使用参数 + certificateNo: string // 证书编号 + certificateName: string // 证书名称 + orderId: string // 委托单id + customerName: string // 委托方名称 + sampleId: string // 被检设备id + sampleNo: string // 被检设备统一编号 + sampleName: string // 被检设备名称 + model: string // 规格型号 + manufactureNo: string // 出厂编号 + staffName: string // 检定员 + conclusion: string // 结论 + traceDate: string // 检定日期 + measureValidDate: string // 检定有效期 + deptId: string // 实验室id + deptName: string // 实验室/使用部门 + measureCategory: string // 业务类型 + certificateFile: string // 证书报告文件(minio存储文件名) + + createTime: string // 创建时间 + createUserId: string // 创建用户id + createUserName: string // 创建用户 + decisionItem: string // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: string // 流程实例id + taskId: string // 任务id(同意、驳回等操作使用) } diff --git a/src/views/certManage/components/basic.vue b/src/views/certManage/components/basic.vue index e74f911..c94de7e 100644 --- a/src/views/certManage/components/basic.vue +++ b/src/views/certManage/components/basic.vue @@ -3,15 +3,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { FormRules } from 'element-plus' import dayjs from 'dayjs' +import type { IForm } from '../cert-interface' import showPhoto from '@/components/showPhoto/index.vue' +import selectOrderTestEquipment from '@/views/dialog/selectOrderTestEquipment.vue' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' +import { getDeptTreeList } from '@/api/system/dept' import useUserStore from '@/store/modules/user' import useOpenPdfinBrowser from '@/commonMethods/useOpenPdfinBrowser' -import { getMeasureDataList } from '@/api/business/taskMeasure/measureData' -import { getChangeCertApplyList } from '@/api/business/certManage/changeApply' -import { getCertDetail } from '@/api/business/certManage/cert' +import { addCert, draftUpdateCert, failUpdateCert, getCertDetail, submitCert } from '@/api/business/certManage/cert' +import { UploadFile } from '@/api/file' const props = defineProps({ pageType: { // 页面类型 add新建 edit编辑 detail详情 type: String, @@ -28,28 +30,53 @@ }) const emits = defineEmits(['addSuccess', 'submitSuccess']) const $router = useRouter() +const ruleFormRef = ref() const user = useUserStore() // 用户信息 -const form = ref({ - certificateNo: '', // 证书编号 - certificateName: '', // 证书名称 - orderNo: '', // 任务单编号 - customerName: '', // 委托方 - deptName: '', // 使用部门 - sampleName: '', // 设备名称 - model: '', // 规格型号 - manufactureNo: '', // 出厂编号 - dataNo: '', // 检定数据编号 - createUserName: '', // 检定员 - conclusion: '', // 检定结论 - limitInstruction: '', // 限用说明 - traceDate: '', // 测试、校准检定日期 - printStatusName: '', // 打印状态 - printFileName: '', // 证书报告 - changeApplyNo: [] as any, // 证书/报告补充或更换申请单编号 - certSupplementNo: [] as any, // 对编号为XXX的证书/报告的补充件编号 +const form = ref({ + id: '', // id,更新/删除使用参数 + certificateNo: '', // 证书编号 + certificateName: '', // 证书名称 + orderId: '', // 委托单id + customerName: '', // 委托方名称 + sampleId: '', // 被检设备id + sampleNo: '', // 被检设备统一编号 + sampleName: '', // 被检设备名称 + model: '', // 规格型号 + manufactureNo: '', // 出厂编号 + staffName: '', // 检定员 + conclusion: '', // 结论 + traceDate: '', // 检定日期 + measureValidDate: '', // 检定有效期 + deptId: '', // 实验室 + deptName: '', // 实验室/使用部门 + measureCategory: '', // 业务类型 + certificateFile: '', // 证书报告文件(minio存储文件名) + + createTime: '', // 创建时间 + createUserId: '', // 创建用户id + createUserName: '', // 创建用户 + decisionItem: '', // 可选决策项(1同意驳回拒绝 2同意驳回 3同意拒绝,用于待审批列表同意/驳回/拒绝按钮展示) + processId: '', // 流程实例id + taskId: '', // 任务id(同意、驳回等操作使用) }) const infoId = ref('') // id +const rules = reactive({ // 表单验证规则 + certificateNo: [{ required: true, message: '证书编号不能为空', trigger: ['change', 'blur'] }], + certificateName: [{ required: true, message: '证书名称不能为空', trigger: ['change', 'blur'] }], + customerName: [{ required: true, message: '委托方名称不能为空', trigger: ['change', 'blur'] }], + sampleName: [{ required: true, message: '设备名称不能为空', trigger: ['change', 'blur'] }], + model: [{ required: true, message: '规格型号不能为空', trigger: ['change', 'blur'] }], + manufactureNo: [{ required: true, message: '出厂编号不能为空', trigger: ['change', 'blur'] }], + staffName: [{ required: true, message: '检定员不能为空', trigger: ['change', 'blur'] }], + conclusion: [{ required: true, message: '检定结论不能为空', trigger: ['change', 'blur'] }], + traceDate: [{ required: true, message: '检定日期不能为空', trigger: ['change', 'blur'] }], + measureValidDate: [{ required: true, message: '检定有效期不能为空', trigger: ['change', 'blur'] }], + deptId: [{ required: true, message: '实验室不能为空', trigger: ['change', 'blur'] }], + measureCategory: [{ required: true, message: '业务类型不能为空', trigger: ['change', 'blur'] }], + certificateFile: [{ required: true, message: '证书报告不能为空', trigger: ['change', 'blur'] }], +}) + // -----------------------------------------路由参数---------------------------------------- // 从路由中获取页面类型参数 const $route = useRoute() @@ -58,301 +85,384 @@ infoId.value = $route.params.id as string } } + +// --------------------------------------字典--------------------------------------------- +const measureCategoryList = ref([])// 业务类型 +const conclusionList = ref([])// 检定结论 +const deptList = ref([]) as any +async function getDict() { + // 获取部门列表 + const resDept = await getDeptTreeList() + deptList.value = resDept.data + console.log('部门列表', deptList.value) + // 业务类型 + getDictByCode('businessType').then((response) => { + measureCategoryList.value = response.data + }) + + // 检定结论 + getDictByCode('bizConclusion').then((response) => { + conclusionList.value = response.data + }) +} +// -------------------------------------------文件上传-------------------------------------- +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + const files = event.target.files // 上传的文件列表 + if (files.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + for (var i = 0; i < files.length; i++) { + fd.append('multipartFile', files[i]) + } + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + UploadFile(fd).then((res) => { + if (res.code === 200) { + form.value.certificateFile = res.data[0] + ElMessage.success('文件上传成功') + loading.close() + } + else { + loading.close() + ElMessage.error(res.message) + } + }) + } +} +const upload = () => { + fileRef.value.click() +} +// -------------------------------------------选择受检设备------------------------------------------ +const selectTestEquipmentRef = ref() // 选择设备组件ref +// 点击从受检设备中添加 +const selectTestEquipment = () => { + selectTestEquipmentRef.value.initDialog(false) +} + +// 选好设备 +const clickConfirmTestEquipment = (val: any) => { + console.log(val) + form.value.sampleId = val.sampleId // 被检设备id + form.value.sampleNo = val.sampleNo // 被检设备编号 + form.value.sampleName = val.sampleName // 被检设备名称 + form.value.model = val.sampleModel // 规格型号 + form.value.manufactureNo = val.manufactureNo // 出厂编号 + form.value.customerName = val.customerName // 委托方名称 + form.value.orderId = val.orderId // 委托单id + form.value.measureCategory = val.measureCategory // 业务类型 +} // --------------------------------------------------------------------------------- // 点击证书报告 const clickPrintFile = () => { - useOpenPdfinBrowser(form.value.printFileName) -} - -// 请求证书申请更换申请单编号 -const fetchCertChangeData = () => { - if (!form.value.certificateNo) { - return false - } - // 查询条件 - const listQuery = { - approvalStatus: '0', // 审批状态类型code - changeApplyNo: '', // 申请单编号 - changeReportName: '', // 更换证书名称 - changeReportNo: form.value.certificateNo, // 更换证书编号 - changeType: '', // 变更类型(字典code) - createTimeEnd: '', // 创建结束时间 - createTimeStart: '', // 创建开始时间 - createUserName: '', // 创建用户名字 - formId: SCHEDULE.CERTIFICATE_CHANGE_APPROVAL, // formId - limit: 999999, - offset: 1, - } - getChangeCertApplyList(listQuery).then((response) => { - if (response && response.data && response.data.rows && response.data.rows.length) { - form.value.changeApplyNo = response.data.rows - } - }) -} - -// 点击证书更换补充申请单 -const clickChangeApplyFileNo = (row: any) => { - $router.push({ - path: `/certManage/changeCertApplyDoc/detail/${row.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: row.processId, // 流程实例id - taskId: row.taskId, // 任务id - row: { ...row } as any, - }, - }) -} - -// 点击对编号为XXX的证书/报告的补充件编号: -const clickSupplementFileNo = (row: any) => { - // -} - -// 点击检定数据编号跳转检定数据管理详情页 -const clickDataNo = () => { - if (!form.value.dataNo) { - return false - } - const params = { - certificateFile: '', // 检定证书(minio存储文件名) - conclusion: '', // 结论 - createUserName: '', // 检定员 - customerName: '', // 委托单位 - dataNo: form.value.dataNo, // 检定数据编号 - helpInstruction: '', // 辅助字段 - manufactureNo: '', // 出厂编号 - measureAddress: '', // 测试、校准或检定地点 - measureCategory: '', // 检校类别 - measureValidDateEnd: '', // 检定有效期结束 - measureValidDateStart: '', // 检定有效期开始 - meterIdentify: '', // 计量标识 - model: '', // 规格型号 - restrictionInstruction: '', // 限用说明 - sampleName: '', // 受检设备名称 - traceDateStart: '', // 测试、校准或检定日期开始 - traceDateEnd: '', // 测试、校准或检定日期结束 - deptId: '', // 使用部门 - offset: 1, - limit: 20, - } - const loading = ElLoading.service({ - lock: true, - text: '加载中...', - background: 'rgba(255, 255, 255, 0.6)', - }) - getMeasureDataList(params).then((res) => { - if (res && res.data && res.data.rows && res.data.rows.length) { - loading.close() - $router.push({ - path: `/taskMeasure/measureData/detail/${res.data.rows[0].id}`, - query: { - ...res.data.rows[0], - }, - }) - } - else { - loading.close() - ElMessage.warning('跳转失败,请联系管理员') - } - }).catch(() => loading.close()) + useOpenPdfinBrowser(form.value.certificateFile) } // 获取证书详情 -const fetchCertDetail = () => { +const fetchInfo = () => { if (!infoId.value) { return } getCertDetail({ id: infoId.value }).then((res) => { form.value = res.data + + // 处理实验室id + let tempDeptId = '' + const tempIndex = deptList.value.findIndex((item: { name: string | number | undefined }) => item.name === form.value.deptName) + if (tempIndex !== -1) { + tempDeptId = deptList.value[tempIndex].id + } + form.value.deptId = tempDeptId + }) +} + +// 点击保存 +const saveForm = () => { + let tempDeptName = '' + const tempIndex = deptList.value.findIndex((item: { id: string | number | undefined }) => item.id === form.value.deptId) + if (tempIndex !== -1) { + tempDeptName = deptList.value[tempIndex].name + } + form.value.deptName = tempDeptName + ruleFormRef.value.validate((valid: any) => { + if (valid) { + // ElMessageBox.confirm( + // '确认保存吗?', + // '提示', + // { + // confirmButtonText: '确认', + // cancelButtonText: '取消', + // type: 'warning', + // }, + // ).then(() => { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + + const params = { + ...form.value, + id: infoId.value, + } + if (props.pageType === 'add') { // 新建 + addCert(params).then((res) => { + loading.close() + form.value.certificateNo = res.data.certificateNo // 证书编号 + infoId.value = res.data.id // id + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else if (props.pageType === 'edit') { // 编辑 + console.log(props.approvalStatusName) + if (props.approvalStatusName === '草稿箱' || props.approvalStatusName === '全部') { + draftUpdateCert(params).then((res) => { + loading.close() + emits('addSuccess', infoId.value) + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + else { // '未通过' || '已取消' + failUpdateCert(params).then((res) => { + loading.close() + emits('submitSuccess') + // fetchInfo() + ElMessage.success('已保存') + }).catch(() => { + loading.close() + }) + } + } + // }) + } + }) +} + +// ----------------------------------------------提交-------------------------------------------- +// 提交 +/** + * + * @param processId 流程实例id + * @param id + */ +const submitForm = (processId: string, id: string) => { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + const loading = ElLoading.service({ + lock: true, + text: '加载中...', + background: 'rgba(255, 255, 255, 0.6)', + }) + submitCert({ id, formId: SCHEDULE.CERTIFICATE_PRINT_APPROVAL }).then((res) => { + ElMessage.success('已提交') + emits('submitSuccess') + loading.close() + }) }) } // ---------------------------------------------钩子---------------------------------------------- onMounted(async () => { - // form.value.certificateNo = $route.query.certificateNo as string // 证书编号 - // form.value.certificateName = $route.query.certificateName as string // 证书名称 - // form.value.orderNo = $route.query.orderNo as string // 任务单编号 - // form.value.customerName = $route.query.customerName as string // 委托方 - // form.value.deptName = $route.query.deptName as string // 使用部门 - // form.value.sampleName = $route.query.sampleName as string // 设备名称 - // form.value.model = $route.query.model as string // 规格型号 - // form.value.manufactureNo = $route.query.manufactureNo as string // 出厂编号 - // form.value.dataNo = $route.query.dataNo as string // 检定数据编号 - // form.value.createUserName = $route.query.createUserName as string // 检定员 - // form.value.conclusion = $route.query.conclusion as string // 检定结论 - // form.value.limitInstruction = $route.query.limitInstruction as string // 限用说明 - // form.value.traceDate = $route.query.traceDate as string // 测试、校准检定日期 - // form.value.printStatusName = $route.query.printStatusName as string // 打印状态 - // form.value.printFileName = $route.query.printFileName as string // 证书报告 - fetchCertDetail() - fetchCertChangeData() // 证书/报告补充或更换申请单编号 + await getDict() + form.value.createUserId = user.id// 创建人id + form.value.createUserName = user.name // 创建人名字 + form.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')// 创建时间 + if (props.pageType !== 'add') { + fetchInfo() // 获取详情信息 + } }) +defineExpose({ saveForm, submitForm, fetchInfo }) diff --git a/src/views/dialog/selectOrderTestEquipment.vue b/src/views/dialog/selectOrderTestEquipment.vue new file mode 100644 index 0000000..97efcd8 --- /dev/null +++ b/src/views/dialog/selectOrderTestEquipment.vue @@ -0,0 +1,329 @@ + + + + + + diff --git a/src/views/order/detail.vue b/src/views/order/detail.vue index d98fd73..34abfcc 100644 --- a/src/views/order/detail.vue +++ b/src/views/order/detail.vue @@ -4,27 +4,17 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { DateModelType, FormInstance, FormRules, UploadUserFile } from 'element-plus' import dayjs from 'dayjs' -import { fromPairs } from 'lodash-es' import type { IForm } from './order-interface' +import { exportFile } from '@/utils/exportUtils' import selectTestEquipment from '@/views/dialog/selectTestEquipment.vue' import selectCustomerDialog from '@/views/dialog/selectCustomer.vue' -// import selectEquipment from '@/' -// import selectCustomerDialog from '../business/manager/order/dialog/selectCustomer.vue' -// import ReplenishOrBackDialog from '../business/manager/order/dialog/replenishOrBackDialog.vue' -// import selectFieldTestApprovalDialog from '../business/manager/order/dialog/selectFieldTestApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' -import { getUid } from '@/utils/getUid' -import scanSampleDialog from '@/components/ScanSampleDialog/index.vue' import type { dictType } from '@/global' import { useCheckList } from '@/commonMethods/useCheckList' -import { useDoubleClickTableRow, useSetAllRowReadable } from '@/commonMethods/useSetAllRowReadable' +import { useSetAllRowReadable } from '@/commonMethods/useSetAllRowReadable' import useUserStore from '@/store/modules/user' import { getUserList } from '@/api/system/user' -import { getAllDeptList, getDept, getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import QRcodeDeviceDialog from '@/components/QRcodeDeviceDialog/index.vue' - -import { addOrder, exportReceive, exportSpread, getOrderDetail, receiveOrder, updateOrder } from '@/api/business/manager/order' +import { addOrder, exportReceive, exportSpread, getOrderDetail, updateOrder } from '@/api/business/manager/order' const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -34,6 +24,7 @@ const pageType = ref('add') // 页面类型: add, edit, detail const infoId = ref('') // id const ruleFormRef = ref() // 表单ref +const { proxy } = getCurrentInstance() as any // 表单 const form: Ref = ref({ @@ -58,7 +49,7 @@ undertakerName: '', // 仪器收发员 }) const onSiteCheckTimeRange = ref<[DateModelType, DateModelType]>(['', '']) // 现场检定时间范围 - +const exportParams = ref() // 导出按钮的入参 // 自定义校验规则--要求检完时间不能比预计送达时间大 const requireOverTimeValid = (rule: any, value: any, callback: any) => { if (!value) { @@ -367,12 +358,30 @@ // ---------------------------------------------------------------------------------------------- // 导出流转单 const exportCirculation = () => { - exportSpread + const loading = ElLoading.service({ + lock: true, + text: '下载中请稍后', + background: 'rgba(255, 255, 255, 0.8)', + }) + exportSpread(exportParams.value).then((res) => { + const blob = new Blob([res.data]) + loading.close() + exportFile(blob, '流转单.xlsx') + }) } // 导出收发单 const exportReceiveAndDispatch = () => { - + const loading = ElLoading.service({ + lock: true, + text: '下载中请稍后', + background: 'rgba(255, 255, 255, 0.8)', + }) + exportReceive(exportParams.value).then((res) => { + const blob = new Blob([res.data]) + loading.close() + exportFile(blob, '收发单.xlsx') + }) } const showReceiveMajorSelect = ref(false) @@ -452,12 +461,13 @@ }) getOrderDetail({ id: infoId.value }).then((res) => { form.value = res.data.data + exportParams.value = res.data.data form.value.isUrgent = `${res.data.data.isUrgent}` // 是否加急 list.value = res.data.data.customerSampleInfoList.map((item: { editable: Boolean; sampleStatus: string | number; onSiteCheckTime: string }) => { return { ...item, editable: pageType.value !== 'detail', - sampleStatus: pageType.value === 'detail' && `${item.sampleStatus}` ? sampleStatusMap.value[item.sampleStatus] : item.sampleStatus, + sampleStatusName: pageType.value === 'detail' && `${item.sampleStatus}` ? sampleStatusMap.value[item.sampleStatus] : item.sampleStatus, } }) if (res.data.data.onSiteCheckTime) { @@ -479,7 +489,31 @@ const trigger = () => { isFold.value = !isFold.value } + +// 点击业务类型 +const handleBusinessType = () => { + ElMessage.info('敬请期待') +} + +// 点击检测分发 +const distribute = () => { + ElMessage.info('敬请期待') +} // ============================================================================= +watch(() => pageType.value, (newValue) => { + if (newValue === 'detail') { + const index = columns.value.findIndex(item => item.value === 'sampleStatus') + if (index !== -1) { + columns.value[index].value = 'sampleStatusName' + } + } + else { + const index = columns.value.findIndex(item => item.value === 'sampleStatusName') + if (index !== -1) { + columns.value[index].value = 'sampleStatus' + } + } +}) onMounted(async () => { getDict().then(() => { @@ -729,7 +763,7 @@