diff --git a/src/api/price/PricePurPngApp/index.ts b/src/api/price/PricePurPngApp/index.ts index 81d6e45..0ff522a 100644 --- a/src/api/price/PricePurPngApp/index.ts +++ b/src/api/price/PricePurPngApp/index.ts @@ -9,12 +9,22 @@ enum Api { Info = '/price/pricePurPngApp/info', LngPricePurPngApp = '/price/pricePurPngApp', - + udpagePage = '/magic-api/price/pricePurPngApp/udpage', DataLog = '/price/pricePurPngApp/datalog', } - +export async function getLngPriceContractPurPng(params: LngPricePurPngAppPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.udpagePage, + params, + }, + { + errorMessageMode: mode, + }, + ); +} /** * @description: 查询LngPricePurPngApp分页列表 */ diff --git a/src/components/common/contractPurPngtListModal.vue b/src/components/common/contractPurPngtListModal.vue new file mode 100644 index 0000000..2c7f1a8 --- /dev/null +++ b/src/components/common/contractPurPngtListModal.vue @@ -0,0 +1,133 @@ + + + + diff --git a/src/components/common/priceInfoList.vue b/src/components/common/priceInfoList.vue new file mode 100644 index 0000000..2aed8bf --- /dev/null +++ b/src/components/common/priceInfoList.vue @@ -0,0 +1,269 @@ + + + diff --git a/src/views/price/PricePurPngApp/components/createForm.vue b/src/views/price/PricePurPngApp/components/createForm.vue new file mode 100644 index 0000000..9b9e87c --- /dev/null +++ b/src/views/price/PricePurPngApp/components/createForm.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/src/views/price/PricePurPngApp/index.vue b/src/views/price/PricePurPngApp/index.vue index ec6be82..6f3d9ee 100644 --- a/src/views/price/PricePurPngApp/index.vue +++ b/src/views/price/PricePurPngApp/index.vue @@ -59,6 +59,9 @@ import useEventBus from '/@/hooks/event/useEventBus'; import { cloneDeep } from 'lodash-es'; + import { useUserStore } from '/@/store/modules/user'; + const userStore = useUserStore(); + const userInfo = userStore.getUserInfo; const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); @@ -159,7 +162,9 @@ query: { taskId: taskIds[0], formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, + readonly: 1, } }); } else if (schemaId && !taskIds && processId) { @@ -169,18 +174,32 @@ readonly: 1, taskId: '', formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, } }); } else { - router.push({ - path: '/form/PricePurPngApp/' + record.id + '/viewForm', - query: { - formPath: 'price/PricePurPngApp', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'price/PricePurPngApp', + formName: "查看"+formName, + formId:currentRoute.value.meta.formId, + type:'', + id: record.id, + disabled: 1, + } + }); + } + // router.push({ + // path: '/form/PricePurPngApp/' + record.id + '/viewForm', + // query: { + // formPath: 'price/PricePurPngApp', + // formName: formName, + // formId:currentRoute.value.meta.formId + // } + // }); } } @@ -196,7 +215,11 @@ function handleAdd() { if (schemaIdComputedRef.value) { router.push({ - path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow' + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'price/PricePurPngApp', + formName: "新建"+formName, + } }); } else { router.push({ @@ -211,18 +234,41 @@ } function handleEdit(record: Recordable) { - - router.push({ - path: '/form/PricePurPngApp/' + record.id + '/updateForm', - query: { + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { formPath: 'price/PricePurPngApp', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); + formName: "编辑"+formName, + formId:currentRoute.value.meta.formId, + type:'edit', + id: record.id + } + }); + } else { + router.push({ + path: '/form/PricePurPngApp/' + record.id + '/updateForm', + query: { + formPath: 'price/PricePurPngApp', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); + } } function handleApprove(record: Recordable) { - + const { processId, taskIds, schemaId } = record.workflowData || {}; + if (taskIds && taskIds.length) { + router.push({ + path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow', + query: { + taskId: taskIds[0], + formName: "审批"+formName, + formId:currentRoute.value.meta.formId, + id: record.id + } + }); + } } function handleDelete(record: Recordable) { deleteList([record.id]); @@ -283,9 +329,10 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let approveBtn: ActionItem[] = []; + let hasFlowRecord = false; actionButtonConfig.value?.map((button) => { - if (['view', 'copyData'].includes(button.code)) { + if (['view', 'copyData', 'datalog'].includes(button.code)) { actionsList.push({ icon: button?.icon, tooltip: button?.name, @@ -300,21 +347,42 @@ 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 == 'WTJ' || record.approCode == 'YBH' ) { + actionsList = actionsList.concat(editAndDelBtn); + + if (record.createUserId !== userInfo.id) { + let idx = actionsList.findIndex(v =>v.tooltip == '删除') + idx > -1 && actionsList.splice(idx, 1) } } + // 审批中SPZ + if (record.workflowData?.editable) { + 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/price/PriceSalesPngApp/components/createForm.vue b/src/views/price/PriceSalesPngApp/components/createForm.vue new file mode 100644 index 0000000..d851834 --- /dev/null +++ b/src/views/price/PriceSalesPngApp/components/createForm.vue @@ -0,0 +1,287 @@ + + + + + diff --git a/src/views/price/PriceSalesPngApp/index.vue b/src/views/price/PriceSalesPngApp/index.vue index 891066c..7185b57 100644 --- a/src/views/price/PriceSalesPngApp/index.vue +++ b/src/views/price/PriceSalesPngApp/index.vue @@ -59,7 +59,10 @@ import useEventBus from '/@/hooks/event/useEventBus'; import { cloneDeep } from 'lodash-es'; - + import { useUserStore } from '/@/store/modules/user'; + const userStore = useUserStore(); + const userInfo = userStore.getUserInfo; + const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { notification } = useMessage(); @@ -159,7 +162,9 @@ query: { taskId: taskIds[0], formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, + readonly: 1, } }); } else if (schemaId && !taskIds && processId) { @@ -169,18 +174,32 @@ readonly: 1, taskId: '', formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, } }); } else { - router.push({ - path: '/form/PriceSalesPngApp/' + record.id + '/viewForm', - query: { - formPath: 'price/PriceSalesPngApp', - formName: formName, - formId:currentRoute.value.meta.formId + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'price/PriceSalesPngApp', + formName: "查看"+formName, + formId:currentRoute.value.meta.formId, + type:'', + id: record.id, + disabled: 1, + } + }); } - }); + // router.push({ + // path: '/form/PriceSalesPngApp/' + record.id + '/viewForm', + // query: { + // formPath: 'price/PriceSalesPngApp', + // formName: formName, + // formId:currentRoute.value.meta.formId + // } + // }); } } @@ -196,7 +215,11 @@ function handleAdd() { if (schemaIdComputedRef.value) { router.push({ - path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow' + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'price/PriceSalesPngApp', + formName: "新建"+formName, + } }); } else { router.push({ @@ -211,18 +234,41 @@ } function handleEdit(record: Recordable) { - - router.push({ - path: '/form/PriceSalesPngApp/' + record.id + '/updateForm', - query: { + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { formPath: 'price/PriceSalesPngApp', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); + formName: "编辑"+formName, + formId:currentRoute.value.meta.formId, + type:'edit', + id: record.id + } + }); + } else { + router.push({ + path: '/form/PriceSalesPngApp/' + record.id + '/updateForm', + query: { + formPath: 'price/PriceSalesPngApp', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); + } } function handleApprove (record: Recordable) { - + const { processId, taskIds, schemaId } = record.workflowData || {}; + if (taskIds && taskIds.length) { + router.push({ + path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow', + query: { + taskId: taskIds[0], + formName: "审批"+formName, + formId:currentRoute.value.meta.formId, + id: record.id + } + }); + } } function handleDelete(record: Recordable) { deleteList([record.id]); @@ -283,9 +329,10 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let approveBtn: ActionItem[] = []; + let hasFlowRecord = false; actionButtonConfig.value?.map((button) => { - if (['view', 'copyData'].includes(button.code)) { + if (['view', 'copyData','datalog'].includes(button.code)) { actionsList.push({ icon: button?.icon, tooltip: button?.name, @@ -300,21 +347,41 @@ 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 == 'WTJ' || record.approCode == 'YBH' ) { + actionsList = actionsList.concat(editAndDelBtn); + + if (record.createUserId !== userInfo.id) { + let idx = actionsList.findIndex(v =>v.tooltip == '删除') + idx > -1 && actionsList.splice(idx, 1) } } + // 审批中SPZ + if (record.workflowData?.editable) { + 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) {