From 1431ceaec8791bb738a2b540375a1a608bdd2d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Thu, 5 Feb 2026 14:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E9=99=85=E9=94=80=E5=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/contract/ContractFact/index.ts | 14 +- src/api/contract/ContractSalesInt/index.ts | 3 +- src/components/SecondDev/OpinionDialog.vue | 2 +- .../common/contractFactListModal.vue | 6 +- .../ContractSalesInt/components/config.ts | 73 +- .../components/createForm.vue | 729 ++++++++++++++++++ src/views/contract/ContractSalesInt/index.vue | 192 ++++- src/views/secondDev/customFormConfig.ts | 3 +- 8 files changed, 968 insertions(+), 54 deletions(-) create mode 100644 src/views/contract/ContractSalesInt/components/createForm.vue diff --git a/src/api/contract/ContractFact/index.ts b/src/api/contract/ContractFact/index.ts index 88b39c0..6386b63 100644 --- a/src/api/contract/ContractFact/index.ts +++ b/src/api/contract/ContractFact/index.ts @@ -11,9 +11,21 @@ enum Api { queryAllCurrency ='/magic-api/mdm/queryAllCurrency', queryAllUser ='/magic-api/mdm/queryAllUser', - queryBankByCode ='/magic-api/sales/queryBankByCode' + queryBankByCode ='/magic-api/sales/queryBankByCode', + PageModal ='/magic-api/contract/lngContractFact/page/modal' } +export async function getLngContractFactPageModal(params: LngContractFactPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.PageModal, + params, + }, + { + errorMessageMode: mode, + }, + ); +} export async function getBankBList(code:String, type:String, mode: ErrorMessageMode = 'modal') { return defHttp.get( { diff --git a/src/api/contract/ContractSalesInt/index.ts b/src/api/contract/ContractSalesInt/index.ts index 3e5cd72..83d6b87 100644 --- a/src/api/contract/ContractSalesInt/index.ts +++ b/src/api/contract/ContractSalesInt/index.ts @@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/contract/contractSalesInt/page', + // Page = '/contract/contractSalesInt/page', + Page = '/magic-api/contract/contractSalesInt/page', List = '/contract/contractSalesInt/list', Info = '/contract/contractSalesInt/info', LngContract = '/contract/contractSalesInt', diff --git a/src/components/SecondDev/OpinionDialog.vue b/src/components/SecondDev/OpinionDialog.vue index b99a88d..1037910 100644 --- a/src/components/SecondDev/OpinionDialog.vue +++ b/src/components/SecondDev/OpinionDialog.vue @@ -208,7 +208,7 @@ let res = await getRejectNodeList(_processId, _taskId); if (res && Array.isArray(res) && res.length > 0) { rejectNodeList.value = res; - dialogTitle.value = `退回`; + dialogTitle.value = `驳回`; if (res?.length) { res.forEach((nNode) => { if (!nNode.userList?.length) { diff --git a/src/components/common/contractFactListModal.vue b/src/components/common/contractFactListModal.vue index 166897a..198b602 100644 --- a/src/components/common/contractFactListModal.vue +++ b/src/components/common/contractFactListModal.vue @@ -13,7 +13,7 @@ import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table'; import { useMessage } from '/@/hooks/web/useMessage'; import { useI18n } from '/@/hooks/web/useI18n'; - import { getLngContractFactPage,} from '/@/api/contract/ContractFact'; + import { getLngContractFactPageModal,} from '/@/api/contract/ContractFact'; const { t } = useI18n(); const codeFormSchema: FormSchema[] = [ @@ -62,7 +62,7 @@ const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({ title: t('合同列表'), - api: getLngContractFactPage, + api: getLngContractFactPageModal, columns, bordered: true, @@ -76,7 +76,7 @@ }, immediate: false, // 设置为不立即调用 beforeFetch: (params) => { - return { ...params, valid: 'Y',approCode: 'YSP'}; + return { ...params, valid: 'Y',approCode: 'YSP',page:params.limit}; }, rowSelection: { type: props.selectType, diff --git a/src/views/contract/ContractSalesInt/components/config.ts b/src/views/contract/ContractSalesInt/components/config.ts index ca59ab5..a30a36e 100644 --- a/src/views/contract/ContractSalesInt/components/config.ts +++ b/src/views/contract/ContractSalesInt/components/config.ts @@ -6,6 +6,16 @@ export const formConfig = { }; export const searchFormSchema: FormSchema[] = [ + { + field: 'dateFrom', + label: '有效期', + component: 'RangePicker', + componentProps: { + format: 'YYYY-MM-DD', + style: { width: '100%' }, + getPopupContainer: () => document.body, + }, + }, { field: 'kName', label: '合同号/名称', @@ -16,6 +26,51 @@ export const searchFormSchema: FormSchema[] = [ label: '客户', component: 'Input', }, + { + field: 'longSpotCode', + label: '长协现货', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '2018871666841546754' }, + labelField: 'name', + valueField: 'value', + + getPopupContainer: () => document.body, + }, + }, + { + field: 'comId', + label: '合同主体', + component: 'Select', + componentProps: { + showSearch: true, + optionFilterProp: 'label', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + options: [ + // { label: '全部', value: '' }, + ], + placeholder: '请选择', + allowClear: true, + + getPopupContainer: () => document.body, + }, + }, + { + field: 'approCode', + label: '审批状态', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '1990669393069129729' }, + labelField: 'name', + valueField: 'value', + + getPopupContainer: () => document.body, + }, + }, ]; export const columns: BasicColumn[] = [ @@ -25,7 +80,7 @@ export const columns: BasicColumn[] = [ title: '合同号', componentType: 'input', align: 'left', - + width:150, sorter: true, }, @@ -39,7 +94,7 @@ export const columns: BasicColumn[] = [ }, { - dataIndex: 'cpCode', + dataIndex: 'cpName', title: '客户', componentType: 'input', align: 'left', @@ -52,7 +107,7 @@ export const columns: BasicColumn[] = [ title: '有效期开始', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -61,30 +116,30 @@ export const columns: BasicColumn[] = [ title: '有效期结束', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, { - dataIndex: 'approCode', + dataIndex: 'approName', title: '状态', componentType: 'input', align: 'left', - + width: 100, sorter: true, }, { - dataIndex: 'onlineSign', + dataIndex: 'longSpotName', title: ' 长协/现货', componentType: 'input', align: 'left', - + width: 100, sorter: true, }, { - dataIndex: 'comId', + dataIndex: 'comName', title: '合同主体', componentType: 'input', align: 'left', diff --git a/src/views/contract/ContractSalesInt/components/createForm.vue b/src/views/contract/ContractSalesInt/components/createForm.vue new file mode 100644 index 0000000..345998a --- /dev/null +++ b/src/views/contract/ContractSalesInt/components/createForm.vue @@ -0,0 +1,729 @@ + + + + + diff --git a/src/views/contract/ContractSalesInt/index.vue b/src/views/contract/ContractSalesInt/index.vue index 576847a..12d9abc 100644 --- a/src/views/contract/ContractSalesInt/index.vue +++ b/src/views/contract/ContractSalesInt/index.vue @@ -57,6 +57,10 @@ import useEventBus from '/@/hooks/event/useEventBus'; import { cloneDeep } from 'lodash-es'; + import { getAllCom} from '/@/api/contract/ContractPurInt'; + import { useUserStore } from '/@/store/modules/user'; + const userStore = useUserStore(); + const userInfo = userStore.getUserInfo; const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); @@ -72,7 +76,7 @@ const tableRef = ref(); //所有按钮 - const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true, "type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]); + const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true, "type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]); //展示在列表内的按钮 const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']); const buttonConfigs = computed(()=>{ @@ -87,7 +91,7 @@ return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); }); - const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,update : handleUpdate,approve : handleApprove,delete : handleDelete,} + const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,update : handleUpdate,approve : handleApprove,delete : handleDelete,datalog : handleDatalog} const { currentRoute } = useRouter(); const router = useRouter(); @@ -119,7 +123,7 @@ gutter: 16, }, schemas: customSearchFormSchema, - fieldMapToTime: [], + fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']], showResetButton: true, }, beforeFetch: (params) => { @@ -157,7 +161,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) { @@ -167,18 +173,32 @@ readonly: 1, taskId: '', formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, } }); } else { - router.push({ - path: '/form/ContractSalesInt/' + record.id + '/viewForm', - query: { - formPath: 'contract/ContractSalesInt', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'contract/ContractSalesInt', + formName: "查看"+formName, + formId:currentRoute.value.meta.formId, + type:'edit', + id: record.id, + disabled: 1, + } + }); + } + // router.push({ + // path: '/form/ContractSalesInt/' + record.id + '/viewForm', + // query: { + // formPath: 'contract/ContractSalesInt', + // formName: formName, + // formId:currentRoute.value.meta.formId + // } + // }); } } @@ -213,21 +233,57 @@ } function handleEdit(record: Recordable) { - - router.push({ - path: '/form/ContractSalesInt/' + record.id + '/updateForm', - query: { + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { formPath: 'contract/ContractSalesInt', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); + formName: "编辑"+formName, + formId:currentRoute.value.meta.formId, + type:'edit', + id: record.id + } + }); + } else { + router.push({ + path: '/form/ContractSalesInt/' + record.id + '/updateForm', + query: { + formPath: 'contract/ContractSalesInt', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); + } } function handleUpdate(record: Recordable) { - + const { processId, taskIds, schemaId } = record.workflowData || {}; + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { + formPath: 'contract/ContractSalesInt', + formName: "变更"+formName, + formId:currentRoute.value.meta.formId, + type:'update', + id: record.id, + processId: processId + } + }); + } } 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]); @@ -264,8 +320,18 @@ dbClickRow(record); } - onMounted(() => { - + onMounted(async() => { + let res = await getAllCom() || [] + customSearchFormSchema.value.forEach(v => { + if (v.field == 'comId') { + v.componentProps.options = res.map(v=> { + return { + label: v.name, + value: v.id + } + }) + } + }); if (schemaIdComputedRef.value) { bus.on(FLOW_PROCESSED, handleRefresh); bus.on(CREATE_FLOW, handleRefresh); @@ -288,9 +354,11 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let updateBtn: ActionItem[] = []; + 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, @@ -304,22 +372,53 @@ color: button.code === 'delete' ? 'error' : undefined, onClick: btnEvent[button.code].bind(null, record), }); + } + if (['update'].includes(button.code)) { + updateBtn.push({ + icon: button?.icon, + tooltip: button?.name, + 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.approCode == 'YSP') { + actionsList = actionsList.concat(updateBtn); + } + // 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) { @@ -410,4 +509,21 @@ .hide{ display: none !important; } + :deep( .ant-col-8:nth-child(1)) { + width: 320px !important; + max-width: 320px !important;; + } + :deep(.ant-col-8:nth-child(1) .ant-form-item-label) { + width: 80px !important; + } + :deep( .ant-col-8:nth-child(4)) { + width: 320px !important; + max-width: 320px !important;; + } + :deep(.ant-col-8:nth-child(4) .ant-form-item-label) { + width: 80px !important; + } + :deep(.ant-col-8:nth-child(5) .ant-select-selector) { + width: 172px !important; + } \ No newline at end of file diff --git a/src/views/secondDev/customFormConfig.ts b/src/views/secondDev/customFormConfig.ts index d4e18f4..6a130b8 100644 --- a/src/views/secondDev/customFormConfig.ts +++ b/src/views/secondDev/customFormConfig.ts @@ -9,6 +9,7 @@ export const customFormConfig = { 'addContractPurPng', 'addContractSales', 'addContractSalesLng', - 'ContractPurInt' + 'ContractPurInt', + 'ContractSalesInt' ], }; \ No newline at end of file