diff --git a/src/api/dayPlan/PngAppro/index.ts b/src/api/dayPlan/PngAppro/index.ts index bf90216..3c2e49b 100644 --- a/src/api/dayPlan/PngAppro/index.ts +++ b/src/api/dayPlan/PngAppro/index.ts @@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/dayPlan/pngAppro/page', + // Page = '/dayPlan/pngAppro/page', + Page = '/magic-api/dayPlan/pngApproXs/page', List = '/dayPlan/pngAppro/list', Info = '/dayPlan/pngAppro/info', LngPngAppro = '/dayPlan/pngAppro', diff --git a/src/components/SecondDev/OpinionDialog.vue b/src/components/SecondDev/OpinionDialog.vue index a106c06..9398f68 100644 --- a/src/components/SecondDev/OpinionDialog.vue +++ b/src/components/SecondDev/OpinionDialog.vue @@ -51,7 +51,7 @@ - + @@ -261,6 +261,10 @@ if (!isChoose) { return message.error('请选择审批人'); } + if (!formState.opinion) { + return message.error('请填写审批意见'); + } + rejectNodeList.value.forEach((nNode) => { if (nNode.activityId == rejectNodeId.value) { nextTaskUser[nNode.activityId] = isEnd.value ? '' : typeof nNode.assignees == 'string' ? nNode.assignees : nNode.assignees.join(','); diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index fb80364..131f9e0 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -270,6 +270,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{ title: (route) => '合同详情' } }, + { + path: '/dayPlan/PngAppro/createForm', + name: 'PngAppro', + component: () => import('/@/views/dayPlan/PngAppro/components/createForm.vue'), + meta: { + title: (route) => '管道气审批' + } + }, ] diff --git a/src/views/dayPlan/PngAppro/components/basicForm.vue b/src/views/dayPlan/PngAppro/components/basicForm.vue new file mode 100644 index 0000000..1b49578 --- /dev/null +++ b/src/views/dayPlan/PngAppro/components/basicForm.vue @@ -0,0 +1,150 @@ + + + + + diff --git a/src/views/dayPlan/PngAppro/components/config.ts b/src/views/dayPlan/PngAppro/components/config.ts index 8024004..423def2 100644 --- a/src/views/dayPlan/PngAppro/components/config.ts +++ b/src/views/dayPlan/PngAppro/components/config.ts @@ -21,7 +21,20 @@ export const searchFormSchema: FormSchema[] = [ field: 'cuCode', label: '客户名称/简称/编码', component: 'Input', - } + }, + { + field: 'approCode', + label: '审批状态', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '2011630929726271489' }, + labelField: 'name', + valueField: 'value', + + getPopupContainer: () => document.body, + }, + }, ]; export const columns: BasicColumn[] = [ diff --git a/src/views/dayPlan/PngAppro/components/createForm.vue b/src/views/dayPlan/PngAppro/components/createForm.vue new file mode 100644 index 0000000..4b3799e --- /dev/null +++ b/src/views/dayPlan/PngAppro/components/createForm.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/views/dayPlan/PngAppro/index.vue b/src/views/dayPlan/PngAppro/index.vue index 6bbe9a5..4a4b3b1 100644 --- a/src/views/dayPlan/PngAppro/index.vue +++ b/src/views/dayPlan/PngAppro/index.vue @@ -126,12 +126,23 @@ schemas: customSearchFormSchema, fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]], showResetButton: true, + submitButtonOptions: { + text: '搜索', + onClick: () => { + clearSelectedRowKeys() + }, + }, + resetButtonOptions: { + text: '重置', + onClick: () => { + clearSelectedRowKeys() + }, + }, }, beforeFetch: (params) => { - return { ...params, FormId: formIdComputedRef.value, PK: 'id'}; + return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit}; }, afterFetch: (res) => { - clearSelectedRowKeys() tableRef.value.setToolBarWidth(); }, @@ -221,8 +232,16 @@ } function handleApprove(record: Recordable) { - - } + router.push({ + path: '/dayPlan/PngAppro/createForm', + query: { + formPath: 'dayPlan/PngAppro', + formName: formName, + formId:currentRoute.value.meta.formId, + id: record.id + } + }); +} function handleCompare (record: Recordable) { } @@ -253,9 +272,11 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let approveBtn: ActionItem[] = []; + let compareBtn: ActionItem[] = []; + let hasFlowRecord = false; actionButtonConfig.value?.map((button) => { - if (['view', 'copyData'].includes(button.code)) { + if (['view', 'copyData', 'compare'].includes(button.code)) { actionsList.push({ icon: button?.icon, tooltip: button?.name, @@ -270,21 +291,31 @@ onClick: btnEvent[button.code].bind(null, record), }); } + if (['approve'].includes(button.code)) { + approveBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } if (button.code === 'flowRecord') hasFlowRecord = true; }); - if (record.workflowData?.enabled) { - //与工作流有关联的表单 - if (record.workflowData.status) { - actionsList.unshift(setIndexFlowStatus(record.workflowData)) - } else { - actionsList = actionsList.concat(editAndDelBtn); - } - } else { - if (!record.workflowData?.processId) { - //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 - actionsList = actionsList.concat(editAndDelBtn); - } + if (record.approCode == 'XS') { + actionsList = actionsList.concat(approveBtn); } + // if (record.workflowData?.enabled) { + // //与工作流有关联的表单 + // if (record.workflowData.status) { + // actionsList.unshift(setIndexFlowStatus(record.workflowData)) + // } else { + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } else { + // if (!record.workflowData?.processId) { + // //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } return actionsList; } function handleStartwork(record: Recordable) { diff --git a/src/views/secondDev/approveFlowPage.vue b/src/views/secondDev/approveFlowPage.vue index adb8670..54a399c 100644 --- a/src/views/secondDev/approveFlowPage.vue +++ b/src/views/secondDev/approveFlowPage.vue @@ -348,7 +348,13 @@ } async function saveDraft() { if (customFormConfig.codeList.includes(curPageCode.value)) { - await formInformation.value.handleSubmit(); + let value = await formInformation.value.handleSubmit(); + if (value) { + setTimeout(() => { + bus.emit(FLOW_PROCESSED) + close(); + }, 500); + } return } try { diff --git a/src/views/secondDev/createFlow.vue b/src/views/secondDev/createFlow.vue index 92716c2..b746abd 100644 --- a/src/views/secondDev/createFlow.vue +++ b/src/views/secondDev/createFlow.vue @@ -355,7 +355,7 @@ disableSubmit.value = true let value = await formInformation.value.handleSubmit(); disableSubmit.value = false - if (rQuery.type == 'update'&&value) { + if (value) { setTimeout(() => { bus.emit(CREATE_FLOW, {}); close();