| | |
| | | |
| | | deletePdProject, |
| | | exportPdProject, |
| | | getPdProjectApproveProcessList, |
| | | getPdProjectPage, |
| | | publishPdProject, |
| | | |
| | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import CreateForm from './modules/create-form.vue'; |
| | | import Form from './modules/form.vue'; |
| | | import ProcessSelectModal from './modules/process-select-modal.vue'; |
| | | |
| | | const router = useRouter(); |
| | | |
| | |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [ProcessModal, processModalApi] = useVbenModal({ |
| | | connectedComponent: ProcessSelectModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 提交审批 - 先获取流程列表 */ |
| | | async function handleSubmit(row: MesPdProjectApi.Project) { |
| | | const hideLoading = message.loading({ |
| | | content: '获取审批流程...', |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | const processList = await getPdProjectApproveProcessList(); |
| | | hideLoading(); |
| | | if (!processList || processList.length === 0) { |
| | | message.warning('暂无可用审批流程,请先配置 BPM 流程'); |
| | | return; |
| | | } |
| | | // 打开流程选择弹窗 |
| | | processModalApi.setData({ id: row.id, processList }).open(); |
| | | } catch { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 查看审批详情 */ |
| | | function handleProcessDetail(row: MesPdProjectApi.Project) { |
| | | if (!row.processInstanceId) { |
| | | message.warning('该项目尚未提交审批'); |
| | | return; |
| | | } |
| | | router.push({ |
| | | name: 'BpmProcessInstanceDetail', |
| | | query: { id: row.processInstanceId }, |
| | | }); |
| | | } |
| | | |
| | | async function handleArchive(row: MesPdProjectApi.Project) { |
| | |
| | | <Page auto-content-height> |
| | | <CreateFormModal @success="handleCreateSuccess" /> |
| | | <FormModal @success="handleRefresh" /> |
| | | <ProcessModal @success="handleRefresh" /> |
| | | |
| | | <Grid table-title="设计任务"> |
| | | <template #toolbar-tools> |
| | |
| | | onClick: () => handleDetail(row), |
| | | }, |
| | | { |
| | | label: '审核', |
| | | label: '提交审批', |
| | | type: 'link', |
| | | auth: ['mes:pd-project:audit'], |
| | | auth: ['mes:pd-project:update'], |
| | | ifShow: row.status === MesPdProjectStatusEnum.PENDING_AUDIT, |
| | | onClick: () => handleDetail(row), |
| | | onClick: handleSubmit.bind(null, row), |
| | | }, |
| | | { |
| | | label: '查看审批', |
| | | type: 'link', |
| | | auth: ['mes:pd-project:update'], |
| | | ifShow: row.status === MesPdProjectStatusEnum.APPROVING, |
| | | onClick: handleProcessDetail.bind(null, row), |
| | | }, |
| | | { |
| | | label: '归档', |