diff --git a/apps/web-contract/src/router/routes/modules/contract.ts b/apps/web-contract/src/router/routes/modules/contract.ts index 9ac02dcd..0bb65c4d 100644 --- a/apps/web-contract/src/router/routes/modules/contract.ts +++ b/apps/web-contract/src/router/routes/modules/contract.ts @@ -323,7 +323,6 @@ const routes: RouteRecordRaw[] = [ title: '履行提示', }, }, - { name: 'ContractPerformResult', path: '/contract/perform/result', @@ -333,6 +332,16 @@ const routes: RouteRecordRaw[] = [ title: '履行结果填报', }, }, + { + name: 'ContractPerformResultList', + path: '/contract/perform/resultList', + component: () => + import('#/views/contract/perform/result-list/index.vue'), + meta: { + icon: 'lucide:area-chart', + title: '履行结果编制', + }, + }, { name: 'ContractPerformTemporaryArchive', path: '/contract/perform/temporary-archive', diff --git a/apps/web-contract/src/views/contract/approval/edit/index.vue b/apps/web-contract/src/views/contract/approval/edit/index.vue index 72279815..eb00948b 100644 --- a/apps/web-contract/src/views/contract/approval/edit/index.vue +++ b/apps/web-contract/src/views/contract/approval/edit/index.vue @@ -19,6 +19,7 @@ import chooseUserModal from '#/views/system/user/choose-user-modal.vue'; import chooseSigningBasisModal from '../signing-basis/choose-signing-basis-modal.vue'; import { getColumns } from '../signing-basis/columns'; import { getFormSchema } from './curd'; +import AuditNodeTable from '#/views/contract/components/audit-node-table/audit-node-table.vue'; const { xGridRef, gridProps } = useVxeTable({ ref: 'xGridRef' }); @@ -86,7 +87,7 @@ const gridOptions = reactive( }), ); -const collapses = ['1', '2']; +const collapses = ['1', '2', '3']; const collapseActiveKey = ref(collapses); function areArraysEqualUnordered(arr1, arr2) { if (arr1.length !== arr2.length) return false; @@ -115,7 +116,7 @@ function handleBack() { * 页面返回并关闭tab */ function back() { - router.replace('/contract/approval/list'); + router.replace('/contract/approval/todo'); } function handleOpenSignBasisChooseModal() { @@ -189,38 +190,62 @@ async function handleAbolish(type: 'openModal' | 'confirm') { } async function handleAbolishAudit( - type: 'accessConfirm' | 'reject' | 'rejectConfirm', + type: 'access' | 'accessConfirm' | 'reject' | 'rejectConfirm', data?: any, ) { console.log(type); - if (type === 'accessConfirm') { + if (type === 'access') { Modal.confirm({ title: '提示', content: '是否确认立项废除审核通过?', - onOk: async () => { - try { - await Apis.contractBaseInfo.post_abolishSubmit({ - params: { - guid: id.value, + onOk: () => { + temporaryFormModalApi.setData({ + title: '备注信息', + schema: { + columns: { + comment: { + title: '', + key: 'comment', + col: { span: 24 }, + colon: false, + component: { + name: 'a-textarea', + vModel: 'value', + autoSize: { minRows: 4, maxRows: 6 }, + placeholder: '请输入', + }, + rules: [{ required: true, message: '请输入退回原因' }], + }, }, - data: { - // appId: id.value, - taskId: taskId, - nodeId: '', - comment: '通过', - }, - }); - message.success('审核通过'); - back(); - } catch (error) { - logger.error('审核通过失败', error); - message.error('审核通过失败,请稍候再试'); - } + }, + }); + temporaryFormModalApi.open(); }, }); } + if (type === 'accessConfirm') { + try { + await Apis.contractBaseInfo.post_abolishSubmit({ + params: { + guid: id.value, + }, + data: { + // appId: id.value, + taskId: taskId, + nodeId: '', + comment: '通过', + }, + }); + message.success('审核通过'); + back(); + } catch (error) { + logger.error('审核通过失败', error); + message.error('审核通过失败,请稍候再试'); + } + } + if (type === 'reject') { Modal.confirm({ title: '提示', @@ -406,7 +431,7 @@ async function handleSave() { handleSubmit(); }, onCancel: () => { - back(); + // back(); }, }); } catch (error) { @@ -427,74 +452,94 @@ async function handleSubmit() { chooseUserModalApi.open(); } +let auditType = ref(''); +const isTemporaryFormModalLoading = ref(false); + async function handleAudit( - type: 'accessConfirm' | 'reject' | 'rejectConfirm', + type: 'openAccessModal' | 'openRejectModal' | 'confirm', data?: any, ) { console.log(type); - if (type === 'accessConfirm') { - if (currAuditType.value === 'abolish') { - await handleAbolish('confirm'); - return; - } - Modal.confirm({ - title: '提示', - content: '是否确认审核通过?', - onOk: async () => { - try { - await Apis.contractBaseInfo.post_submit({ - params: { - guid: id.value, - }, - data: { - appId: id.value, - taskId: taskId, - nodeId: '', - comment: '通过', - }, - }); - message.success('审核通过'); - back(); - } catch (error) { - logger.error('审核通过失败', error); - message.error('审核通过失败,请稍候再试'); - } - }, - }); - } - - if (type === 'reject') { - Modal.confirm({ - title: '提示', - content: '是否确认退回?', - onOk: () => { - temporaryFormModalApi.setData({ - title: '退回原因', - schema: { - columns: { - comment: { - title: '', - key: 'comment', - col: { span: 24 }, - colon: false, - component: { - name: 'a-textarea', - vModel: 'value', - autoSize: { minRows: 4, maxRows: 6 }, - placeholder: '请输入', - }, - rules: [{ required: true, message: '请输入退回原因' }], - }, + if (type === 'openAccessModal') { + auditType.value = 'access'; + temporaryFormModalApi.setData({ + title: '审核通过备注', + schema: { + columns: { + comment: { + title: '', + key: 'comment', + col: { span: 24 }, + colon: false, + component: { + name: 'a-textarea', + vModel: 'value', + autoSize: { minRows: 4, maxRows: 6 }, + placeholder: '请输入', }, }, - }); - temporaryFormModalApi.open(); + }, }, }); + temporaryFormModalApi.open(); } - if (type === 'rejectConfirm') { + if (type === 'confirm' && auditType.value === 'access') { + isTemporaryFormModalLoading.value = true; + const comment = data.comment; + + try { + await Apis.contractBaseInfo.post_submit({ + params: { + guid: id.value, + }, + data: { + appId: id.value, + taskId: taskId, + nodeId: '', + comment: comment || '', + }, + }); + message.success('审核通过'); + back(); + } catch (error) { + logger.error('审核通过失败', error); + message.error('审核通过失败,请稍候再试'); + } finally { + isTemporaryFormModalLoading.value = false; + } + } + + if (type === 'openRejectModal') { + auditType.value = 'reject'; + + temporaryFormModalApi.setData({ + title: '审核退回原因', + schema: { + columns: { + comment: { + title: '', + key: 'comment', + col: { span: 24 }, + colon: false, + component: { + name: 'a-textarea', + vModel: 'value', + autoSize: { minRows: 4, maxRows: 6 }, + placeholder: '请输入', + }, + rules: [{ required: true, message: '请输入退回原因' }], + }, + }, + }, + }); + temporaryFormModalApi.open(); + } + + if (type === 'confirm' && auditType.value === 'reject') { + isTemporaryFormModalLoading.value = true; + const comment = data.comment; try { await Apis.contractBaseInfo.post_rollback({ @@ -514,6 +559,8 @@ async function handleAudit( } catch (error) { logger.error('合同立项退回失败', error); message.error('退回失败,请稍候再试'); + } finally { + isTemporaryFormModalLoading.value = false; } } } @@ -537,12 +584,12 @@ onMounted(async () => { formBinding.value.columns = getFormSchema({ contractTypeData: contractTypeData.value, - readOnly: !id.value || currData.value.step !== 'edit', + readOnly: !id.value || currData.value.step !== 'paEdit', }); xGridRef.value!.reloadColumn( getColumns({ - readOnly: !id.value || currData.value.step !== 'edit', + readOnly: !id.value || currData.value.step !== 'paEdit', }), ); @@ -600,8 +647,9 @@ onMounted(async () => { @@ -609,7 +657,7 @@ onMounted(async () => {
@@ -627,7 +675,7 @@ onMounted(async () => { v-if="['paDepartmentAudit'].includes(currData.step) && taskId" :disabled="!auditId" variant="primary" - @click="handleAudit('accessConfirm')" + @click="handleAudit('openAccessModal')" > 通过 @@ -635,7 +683,7 @@ onMounted(async () => { v-if="['paDepartmentAudit'].includes(currData.step) && taskId" :disabled="!auditId" variant="destructive" - @click="handleAudit('reject')" + @click="handleAudit('openRejectModal')" > 退回 @@ -658,16 +706,16 @@ onMounted(async () => { 删除 - 废除通过 - + --> - { @click="handleAudit('accessConfirm')" > 通过 - + --> 返回 @@ -745,6 +793,15 @@ onMounted(async () => { + + + +
diff --git a/apps/web-contract/src/views/contract/perform/result-list/crud.tsx b/apps/web-contract/src/views/contract/perform/result-list/crud.tsx new file mode 100644 index 00000000..82f9c1e2 --- /dev/null +++ b/apps/web-contract/src/views/contract/perform/result-list/crud.tsx @@ -0,0 +1,109 @@ +import type { VxeGridPropTypes } from 'vxe-table'; +import { useRender } from '#/hooks/useRender'; +import dayjs from 'dayjs'; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; +import { dict } from '@fast-crud/fast-crud'; +import { unitComponentProps } from '#/common/unit'; + +export const PrimaryKey = 'guid'; + +export function getColumns(params: any = {}): VxeGridPropTypes.Columns { + return [ + { + type: 'radio', + width: 40, + slots: { radio: 'radio_cell' }, + align: 'center', + fixed: 'left', + }, + { + field: 'step', + title: '节点状态', + width: 130, + slots: { + default: ({ row }) => { + return useRender.renderDict( + row.step, + DICT_TYPE.contract_business_flow_node, + ); + }, + }, + }, + { field: 'reportNo', title: '报审序号', width: 100 }, + { + field: 'contractName', + title: '合同名称', + minWidth: 200, + slots: { + default: 'contract-name-slot', + }, + }, + { field: 'choiceTypeName', title: '选商方式', width: 150 }, + { field: 'fundDitchName', title: '资金渠道', width: 150 }, + { field: 'contractMoney', title: '金额', width: 100 }, + { field: 'priceTypeName', title: '币种', width: 100 }, + { field: 'inputPerson', title: '承办人', width: 100 }, + { field: 'inputDepartName', title: '承办部门', width: 100 }, + { field: 'inputDate', title: '承办时间', width: 130 }, + { + field: 'operate', + title: '操作', + width: 60, + fixed: 'right', + slots: { default: 'operate' }, + }, + ]; +} + +export function getFormSchema(_params: any = {}) { + return { + initialForm: {}, + columns: { + contractName: { + title: '合同名称', + key: 'contractName', + component: { + name: 'a-input', + vModel: 'value', + allowClear: true, + }, + autoSearchTrigger: 'enter', + show: true, + }, + inputDepartId: { + title: '承办单位', + key: 'inputUnitId', + component: unitComponentProps, + autoSearchTrigger: 'enter', + show: true, + }, + contractMoney: { + title: '合同金额', + key: 'contractMoney', + component: { + name: 'a-input-number', + vModel: 'value', + min: 0, + allowClear: true, + }, + autoSearchTrigger: 'enter', + show: true, + }, + choiceType: { + title: '选商方式', + key: 'choiceType', + component: { + name: 'fs-dict-select', + vModel: 'value', + class: 'min-w-[180px]', + allowClear: true, + dict: dict({ + data: getDictOptions(DICT_TYPE.contract_selection_method), + }), + }, + autoSearchTrigger: 'enter', + show: true, + }, + }, + }; +} diff --git a/apps/web-contract/src/views/contract/perform/result-list/index.vue b/apps/web-contract/src/views/contract/perform/result-list/index.vue new file mode 100644 index 00000000..a8131919 --- /dev/null +++ b/apps/web-contract/src/views/contract/perform/result-list/index.vue @@ -0,0 +1,179 @@ + + + + +