diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue new file mode 100644 index 0000000..866ef12 --- /dev/null +++ b/src/components/Approval/selectApproverDialog.vue @@ -0,0 +1,225 @@ + + + + + + diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue new file mode 100644 index 0000000..866ef12 --- /dev/null +++ b/src/components/Approval/selectApproverDialog.vue @@ -0,0 +1,225 @@ + + + + + + diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 2ea30d3..b76a306 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -133,7 +133,17 @@ return } } - if (!approverConfig.value.noHanderAction) { + // 审批人自选 + else if (approverConfig.value.settype === 4) { + if (!approverConfig.value.tempExamineMode) { + ElMessage({ + message: '请选择审批方式', + type: 'warning', + }) + return + } + } + if (approverConfig.value.settype !== 4 && !approverConfig.value.noHanderAction) { ElMessage({ message: '审批人为空的选项不能为空', type: 'warning', @@ -202,6 +212,9 @@ 连续多级主管 + + 审批人自选 +

@@ -240,10 +253,10 @@ -

+
多人审批时采用的审批方式
- + 会签(需所有审批人同意) @@ -270,10 +283,10 @@ -
+
审批人为空时
- + 自动审批通过 diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue new file mode 100644 index 0000000..866ef12 --- /dev/null +++ b/src/components/Approval/selectApproverDialog.vue @@ -0,0 +1,225 @@ + + + + + + diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 2ea30d3..b76a306 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -133,7 +133,17 @@ return } } - if (!approverConfig.value.noHanderAction) { + // 审批人自选 + else if (approverConfig.value.settype === 4) { + if (!approverConfig.value.tempExamineMode) { + ElMessage({ + message: '请选择审批方式', + type: 'warning', + }) + return + } + } + if (approverConfig.value.settype !== 4 && !approverConfig.value.noHanderAction) { ElMessage({ message: '审批人为空的选项不能为空', type: 'warning', @@ -202,6 +212,9 @@ 连续多级主管 + + 审批人自选 +

@@ -240,10 +253,10 @@ -

+
多人审批时采用的审批方式
- + 会签(需所有审批人同意) @@ -270,10 +283,10 @@ -
+
审批人为空时
- + 自动审批通过 diff --git a/src/plugins/preload.ts b/src/plugins/preload.ts index a4cc107..9873f6c 100644 --- a/src/plugins/preload.ts +++ b/src/plugins/preload.ts @@ -53,6 +53,9 @@ else if (nodeConfig.settype == 7) { return `从直接主管到通讯录中级别最高的第${nodeConfig.examineEndDirectorLevel}个层级主管` } + else if (nodeConfig.settype == 4) { + return '审批人自选' + } }, dealStr(str: any, obj: any) { const arr = [] as any diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue new file mode 100644 index 0000000..866ef12 --- /dev/null +++ b/src/components/Approval/selectApproverDialog.vue @@ -0,0 +1,225 @@ + + + + + + diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 2ea30d3..b76a306 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -133,7 +133,17 @@ return } } - if (!approverConfig.value.noHanderAction) { + // 审批人自选 + else if (approverConfig.value.settype === 4) { + if (!approverConfig.value.tempExamineMode) { + ElMessage({ + message: '请选择审批方式', + type: 'warning', + }) + return + } + } + if (approverConfig.value.settype !== 4 && !approverConfig.value.noHanderAction) { ElMessage({ message: '审批人为空的选项不能为空', type: 'warning', @@ -202,6 +212,9 @@ 连续多级主管 + + 审批人自选 +

@@ -240,10 +253,10 @@ -

+
多人审批时采用的审批方式
- + 会签(需所有审批人同意) @@ -270,10 +283,10 @@ -
+
审批人为空时
- + 自动审批通过 diff --git a/src/plugins/preload.ts b/src/plugins/preload.ts index a4cc107..9873f6c 100644 --- a/src/plugins/preload.ts +++ b/src/plugins/preload.ts @@ -53,6 +53,9 @@ else if (nodeConfig.settype == 7) { return `从直接主管到通讯录中级别最高的第${nodeConfig.examineEndDirectorLevel}个层级主管` } + else if (nodeConfig.settype == 4) { + return '审批人自选' + } }, dealStr(str: any, obj: any) { const arr = [] as any diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue index 5ff18a9..19dfd61 100644 --- a/src/views/business/lab/measureData/measureDataDetail.vue +++ b/src/views/business/lab/measureData/measureDataDetail.vue @@ -14,14 +14,15 @@ import type { IEquipmentList, IForm, ISampleList } from './measureData-interface' import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue' import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue' +import selectApproverDialog from '@/components/Approval/selectApproverDialog.vue' +import ApprovalDialog from '@/components/Approval/ApprovalDialogCustom.vue' import { getCustomerList } from '@/api/customer/customer' import { getPhotoUrl, listPageApi } from '@/api/system/tool' import { SCHEDULE } from '@/utils/scheduleDict' import { UploadFile } from '@/api/measure/file' import { updateSample } from '@/api/customer/sampleList' import { getStaffList } from '@/api/measure/person' -// import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' +// import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData' import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' @@ -33,7 +34,7 @@ import type { dictType } from '@/global' import { getOrderDetail } from '@/api/business/schedule/order' import { exportFile } from '@/utils/exportUtils' -import { logout } from '@/api/system/login' +import customApproval from '/public/config/customApproval.json' const user = useUserStore() // 用户信息 const textMap: { [key: string]: string } = { @@ -547,44 +548,42 @@ } // 获取详情信息 -function getDetail(id?: string, certificateReportCode?: string) { +async function getDetail(id?: string, certificateReportCode?: string) { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => { - loading.close() - form.value = res.data - fileList.value = res.data.fileList // 依据的技术文件 - if (Array.isArray(res.data.fileList)) { - form.value.techFilesName = fileList.value.map((item: { fileName: string }) => item.fileName).join(',') + const res = await getMeasureDataDetail({ id: infoId.value! || id! }) + loading.close() + form.value = res.data + form.value.processId = '' + fileList.value = res.data.fileList // 依据的技术文件 + if (Array.isArray(res.data.fileList)) { + form.value.techFilesName = fileList.value.map((item: { fileName: string }) => item.fileName).join(',') + } + sampleList.value = [{ + sampleNo: res.data.sampleNo, // 样品编号 + sampleName: res.data.sampleName, // 样品名称 + sampleModel: res.data.sampleModel, // 型号 + manufacturingNo: res.data.manufacturingNo, // 出厂编号 + manufacturer: res.data.manufacturer, // 生产厂家 + remark: res.data.sampleRemark, // 备注 + id: res.data.sampleId, + }] + equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => { + return { + ...item, + validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate, } - sampleList.value = [{ - sampleNo: res.data.sampleNo, // 样品编号 - sampleName: res.data.sampleName, // 样品名称 - sampleModel: res.data.sampleModel, // 型号 - manufacturingNo: res.data.manufacturingNo, // 出厂编号 - manufacturer: res.data.manufacturer, // 生产厂家 - remark: res.data.sampleRemark, // 备注 - id: res.data.sampleId, - }] - equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => { - return { - ...item, - validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate, - } - }) // 所用的计量标准器具 + }) // 所用的计量标准器具 - businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据 - form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号 - if (id && certificateReportCode) { - form.value.oldCertificateCode = certificateReportCode - form.value.invalid = 1 - form.value.measurePerson = user.name // 检定员名字 - } - }).catch(() => { - loading.close() - }) + businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据 + form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号 + if (id && certificateReportCode) { + form.value.oldCertificateCode = certificateReportCode + form.value.invalid = 1 + form.value.measurePerson = user.name // 检定员名字 + } } // 关闭新增页面的回调 @@ -643,6 +642,11 @@ else if (pageType.value === 'edit' || (pageType.value === 'add' && infoId.value)) { // 编辑 if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回 + const param = { + ...params, + processId: form.value.processId, + // assignees: approverList, + } failUpdateMeasureData(params).then((res) => { handleUpdateSample() ElMessage.success('保存成功') @@ -664,29 +668,53 @@ } }) } +// -----------------------------------提交------------------------------------------------------- +const selectApproverRef = ref() // 审批人自选组件ref +// 选好审批人 +const confirmSelectApprover = async (approverList: string[] = []) => { + if (!approverList.length) { + ElMessage.warning('无审批人,无法提交!') + return false + } + console.log('审批人', approverList) + console.log('processId', form.value.processId) -// 提交 + if (form.value === null || form.value.processId === undefined || form.value.processId === '') { + // 流程id为空 表示还未进入流程中 直接提交 + + ElMessageBox.confirm(`是否提交计量数据管理 ${form.value.certificateReportCode}-${form.value.certificateReportName}`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + if (submitId.value) { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + const params = { + id: submitId.value, + formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, // 表单id + assignees: approverList, + processId: form.value.processId, + } + submit(params).then(() => { + ElMessage.success('提交成功') + loading.close() + close() + }).catch(() => { + loading.close() + }) + } + else { + ElMessage.warning('请先保存!') + } + }) + } +} +// 提交按钮 const handleSubmit = () => { - if (submitId.value) { - const loading = ElLoading.service({ - lock: true, - background: 'rgba(255, 255, 255, 0.8)', - }) - const params = { - id: submitId.value, - formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, // 表单id - } - submit(params).then(() => { - ElMessage.success('提交成功') - loading.close() - close() - }).catch(() => { - loading.close() - }) - } - else { - ElMessage.warning('请先保存!') - } + selectApproverRef.value.initDialog() } // ------------------------------------------审批----------------------------------------- @@ -737,7 +765,7 @@ } else if (val === '同意') { - approvalDialog.value.initDialog('agree', query.taskId, infoId.value, query.decisionItem) + approvalDialog.value.initDialog('agree', query.taskId, infoId.value, query.decisionItem, form.value.processId) } else if (val === '驳回') { approvalDialog.value.initDialog('reject', query.taskId, infoId.value, query.decisionItem) @@ -802,7 +830,11 @@ await getDict() form.value.processId = query.processId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + getDetail().then(() => { + nextTick(() => { + form.value.processId = query.processId as string // 流程实例 + }) + }) if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(form.value.processId) // 获取审批流程 } @@ -1005,7 +1037,7 @@ /> - + - + + + diff --git a/public/config/customApproval.json b/public/config/customApproval.json new file mode 100644 index 0000000..f791343 --- /dev/null +++ b/public/config/customApproval.json @@ -0,0 +1,7 @@ +{ + "approvalLastName--Describe": "审批流程最后一个节点的名字,用来判断审批自选的时候是否是最后一个节点", + "approvalLastName": { + "measureData--Describe": "计量数据管理", + "measureData": "审批人" + } +} diff --git a/src/api/system/process.ts b/src/api/system/process.ts index c2d4419..6bef77b 100644 --- a/src/api/system/process.ts +++ b/src/api/system/process.ts @@ -121,3 +121,11 @@ data, }) } +// 动态添加审批人 +export function addApprovalUser(data: object) { + return request({ + url: '/approval/operate/addTaskApprover', + method: 'post', + data, + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 6cd708a..fde4221 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,6 +13,8 @@ AppContainer: typeof import('./components/AppContainer/index.vue')['default'] ApprovalDialog: typeof import('./components/Approval/ApprovalDialog.vue')['default'] ApprovalDialogByProcess: typeof import('./components/Approval/ApprovalDialogByProcess.vue')['default'] + ApprovalDialogCustom: typeof import('./components/Approval/ApprovalDialogCustom.vue')['default'] + 'ApprovalDialogCustom copy': typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] ApprovalRecord: typeof import('./components/ApprovalRecord/ApprovalRecord.vue')['default'] ApprovalRecordTable: typeof import('./components/ApprovalRecord/ApprovalRecordTable.vue')['default'] ApproverDrawer: typeof import('./components/drawer/approverDrawer.vue')['default'] @@ -27,6 +29,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Approval/ApprovalDialogCustom copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -64,6 +67,7 @@ SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] SearchItem: typeof import('./components/SearchArea/SearchItem.vue')['default'] + SelectApproverDialog: typeof import('./components/Approval/selectApproverDialog.vue')['default'] SelectEmployeesDialog: typeof import('./components/dialog/selectEmployeesDialog.vue')['default'] SelectRoleDialog: typeof import('./components/dialog/selectRoleDialog.vue')['default'] SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default'] diff --git a/src/components/Approval/ApprovalDialogCustom copy.vue b/src/components/Approval/ApprovalDialogCustom copy.vue new file mode 100644 index 0000000..d2f3dac --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom copy.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/components/Approval/ApprovalDialogCustom.vue b/src/components/Approval/ApprovalDialogCustom.vue new file mode 100644 index 0000000..0bda369 --- /dev/null +++ b/src/components/Approval/ApprovalDialogCustom.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/components/Approval/selectApproverDialog.vue b/src/components/Approval/selectApproverDialog.vue new file mode 100644 index 0000000..866ef12 --- /dev/null +++ b/src/components/Approval/selectApproverDialog.vue @@ -0,0 +1,225 @@ + + + + + + diff --git a/src/components/drawer/approverDrawer.vue b/src/components/drawer/approverDrawer.vue index 2ea30d3..b76a306 100644 --- a/src/components/drawer/approverDrawer.vue +++ b/src/components/drawer/approverDrawer.vue @@ -133,7 +133,17 @@ return } } - if (!approverConfig.value.noHanderAction) { + // 审批人自选 + else if (approverConfig.value.settype === 4) { + if (!approverConfig.value.tempExamineMode) { + ElMessage({ + message: '请选择审批方式', + type: 'warning', + }) + return + } + } + if (approverConfig.value.settype !== 4 && !approverConfig.value.noHanderAction) { ElMessage({ message: '审批人为空的选项不能为空', type: 'warning', @@ -202,6 +212,9 @@ 连续多级主管 + + 审批人自选 +

@@ -240,10 +253,10 @@ -

+
多人审批时采用的审批方式
- + 会签(需所有审批人同意) @@ -270,10 +283,10 @@ -
+
审批人为空时
- + 自动审批通过 diff --git a/src/plugins/preload.ts b/src/plugins/preload.ts index a4cc107..9873f6c 100644 --- a/src/plugins/preload.ts +++ b/src/plugins/preload.ts @@ -53,6 +53,9 @@ else if (nodeConfig.settype == 7) { return `从直接主管到通讯录中级别最高的第${nodeConfig.examineEndDirectorLevel}个层级主管` } + else if (nodeConfig.settype == 4) { + return '审批人自选' + } }, dealStr(str: any, obj: any) { const arr = [] as any diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue index 5ff18a9..19dfd61 100644 --- a/src/views/business/lab/measureData/measureDataDetail.vue +++ b/src/views/business/lab/measureData/measureDataDetail.vue @@ -14,14 +14,15 @@ import type { IEquipmentList, IForm, ISampleList } from './measureData-interface' import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue' import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue' +import selectApproverDialog from '@/components/Approval/selectApproverDialog.vue' +import ApprovalDialog from '@/components/Approval/ApprovalDialogCustom.vue' import { getCustomerList } from '@/api/customer/customer' import { getPhotoUrl, listPageApi } from '@/api/system/tool' import { SCHEDULE } from '@/utils/scheduleDict' import { UploadFile } from '@/api/measure/file' import { updateSample } from '@/api/customer/sampleList' import { getStaffList } from '@/api/measure/person' -// import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' +// import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData' import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' @@ -33,7 +34,7 @@ import type { dictType } from '@/global' import { getOrderDetail } from '@/api/business/schedule/order' import { exportFile } from '@/utils/exportUtils' -import { logout } from '@/api/system/login' +import customApproval from '/public/config/customApproval.json' const user = useUserStore() // 用户信息 const textMap: { [key: string]: string } = { @@ -547,44 +548,42 @@ } // 获取详情信息 -function getDetail(id?: string, certificateReportCode?: string) { +async function getDetail(id?: string, certificateReportCode?: string) { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => { - loading.close() - form.value = res.data - fileList.value = res.data.fileList // 依据的技术文件 - if (Array.isArray(res.data.fileList)) { - form.value.techFilesName = fileList.value.map((item: { fileName: string }) => item.fileName).join(',') + const res = await getMeasureDataDetail({ id: infoId.value! || id! }) + loading.close() + form.value = res.data + form.value.processId = '' + fileList.value = res.data.fileList // 依据的技术文件 + if (Array.isArray(res.data.fileList)) { + form.value.techFilesName = fileList.value.map((item: { fileName: string }) => item.fileName).join(',') + } + sampleList.value = [{ + sampleNo: res.data.sampleNo, // 样品编号 + sampleName: res.data.sampleName, // 样品名称 + sampleModel: res.data.sampleModel, // 型号 + manufacturingNo: res.data.manufacturingNo, // 出厂编号 + manufacturer: res.data.manufacturer, // 生产厂家 + remark: res.data.sampleRemark, // 备注 + id: res.data.sampleId, + }] + equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => { + return { + ...item, + validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate, } - sampleList.value = [{ - sampleNo: res.data.sampleNo, // 样品编号 - sampleName: res.data.sampleName, // 样品名称 - sampleModel: res.data.sampleModel, // 型号 - manufacturingNo: res.data.manufacturingNo, // 出厂编号 - manufacturer: res.data.manufacturer, // 生产厂家 - remark: res.data.sampleRemark, // 备注 - id: res.data.sampleId, - }] - equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => { - return { - ...item, - validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate, - } - }) // 所用的计量标准器具 + }) // 所用的计量标准器具 - businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据 - form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号 - if (id && certificateReportCode) { - form.value.oldCertificateCode = certificateReportCode - form.value.invalid = 1 - form.value.measurePerson = user.name // 检定员名字 - } - }).catch(() => { - loading.close() - }) + businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据 + form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号 + if (id && certificateReportCode) { + form.value.oldCertificateCode = certificateReportCode + form.value.invalid = 1 + form.value.measurePerson = user.name // 检定员名字 + } } // 关闭新增页面的回调 @@ -643,6 +642,11 @@ else if (pageType.value === 'edit' || (pageType.value === 'add' && infoId.value)) { // 编辑 if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回 + const param = { + ...params, + processId: form.value.processId, + // assignees: approverList, + } failUpdateMeasureData(params).then((res) => { handleUpdateSample() ElMessage.success('保存成功') @@ -664,29 +668,53 @@ } }) } +// -----------------------------------提交------------------------------------------------------- +const selectApproverRef = ref() // 审批人自选组件ref +// 选好审批人 +const confirmSelectApprover = async (approverList: string[] = []) => { + if (!approverList.length) { + ElMessage.warning('无审批人,无法提交!') + return false + } + console.log('审批人', approverList) + console.log('processId', form.value.processId) -// 提交 + if (form.value === null || form.value.processId === undefined || form.value.processId === '') { + // 流程id为空 表示还未进入流程中 直接提交 + + ElMessageBox.confirm(`是否提交计量数据管理 ${form.value.certificateReportCode}-${form.value.certificateReportName}`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + if (submitId.value) { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + const params = { + id: submitId.value, + formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, // 表单id + assignees: approverList, + processId: form.value.processId, + } + submit(params).then(() => { + ElMessage.success('提交成功') + loading.close() + close() + }).catch(() => { + loading.close() + }) + } + else { + ElMessage.warning('请先保存!') + } + }) + } +} +// 提交按钮 const handleSubmit = () => { - if (submitId.value) { - const loading = ElLoading.service({ - lock: true, - background: 'rgba(255, 255, 255, 0.8)', - }) - const params = { - id: submitId.value, - formId: SCHEDULE.BUSINESS_REPORT_ON_CREDENTIALS, // 表单id - } - submit(params).then(() => { - ElMessage.success('提交成功') - loading.close() - close() - }).catch(() => { - loading.close() - }) - } - else { - ElMessage.warning('请先保存!') - } + selectApproverRef.value.initDialog() } // ------------------------------------------审批----------------------------------------- @@ -737,7 +765,7 @@ } else if (val === '同意') { - approvalDialog.value.initDialog('agree', query.taskId, infoId.value, query.decisionItem) + approvalDialog.value.initDialog('agree', query.taskId, infoId.value, query.decisionItem, form.value.processId) } else if (val === '驳回') { approvalDialog.value.initDialog('reject', query.taskId, infoId.value, query.decisionItem) @@ -802,7 +830,11 @@ await getDict() form.value.processId = query.processId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + getDetail().then(() => { + nextTick(() => { + form.value.processId = query.processId as string // 流程实例 + }) + }) if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(form.value.processId) // 获取审批流程 } @@ -1005,7 +1037,7 @@ /> - + - + + + diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue index 181fc10..fe0d70d 100644 --- a/src/views/business/lab/measureData/measureDataList.vue +++ b/src/views/business/lab/measureData/measureDataList.vue @@ -10,11 +10,13 @@ import type { dictType } from '@/global' import type { IMenu } from '@/components/buttonBox/buttonBox' // import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' +// import ApprovalDialog from '@/components/Approval/ApprovalDialogByProcess.vue' import ButtonBox from '@/components/buttonBox/buttonBox.vue' import { keepSearchParams, renewSearchParams } from '@/utils/keepQuery' import { cancelApproval } from '@/api/approval' import { SCHEDULE } from '@/utils/scheduleDict' +import ApprovalDialog from '@/components/Approval/ApprovalDialogCustom.vue' +import customApproval from '/public/config/customApproval.json' import { deleteMeasureData, getMeasureDataList, submit } from '@/api/business/lab/measureData' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 初始化路由 @@ -236,7 +238,7 @@ }) } else if (val === '同意') { - approvalDialog.value.initDialog('agree', row.taskId, row.id, row.decisionItem) + approvalDialog.value.initDialog('agree', row.taskId, row.id, row.decisionItem, row.processId) // approvalDialog.value.initDialog('agree', row.taskId, row.decisionItem) } else if (val === '驳回') { @@ -506,7 +508,7 @@ - +