diff --git a/src/api/oa/erp/contractChange/types.ts b/src/api/oa/erp/contractChange/types.ts index ad03100..6bed241 100644 --- a/src/api/oa/erp/contractChange/types.ts +++ b/src/api/oa/erp/contractChange/types.ts @@ -74,11 +74,21 @@ export interface ContractChangeVO { */ undertakeDeptId: string | number; + /** + * 承办部门名称(列表连表) + */ + undertakeDeptName?: string; + /** * 承办人 */ undertakeBy: number; + /** + * 承办人姓名(列表连表) + */ + undertakeByName?: string; + /** * 行业/大区 */ diff --git a/src/views/oa/erp/contractChange/edit.vue b/src/views/oa/erp/contractChange/edit.vue index 8ea16e4..e3fc48f 100644 --- a/src/views/oa/erp/contractChange/edit.vue +++ b/src/views/oa/erp/contractChange/edit.vue @@ -20,26 +20,60 @@ 返回 - - - - - - {{ dict.label }} - - - - - - - + + + + + + + + + + {{ dict.label }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ dict.label }} + + + + ( - proxy?.useDict('contract_change_type', 'contract_category', 'business_direction', 'contract_flag', 'contract_template_flag', 'material_flag') + proxy?.useDict( + 'contract_change_type', + 'contract_category', + 'business_direction', + 'contract_flag', + 'contract_template_flag', + 'material_flag', + 'seal_legal_entity' + ) ); const paymentMethodOptions = ['电汇', '银行承兑(6个月内)', '电汇/银行承兑(6个月内)', '商业承兑']; @@ -459,6 +504,7 @@ const customerInfoList = ref([]); const userInfoList = ref([]); const paymentAccountList = ref([]); const printTemplateList = ref([]); +const deptInfoList = ref([]); // 变更后物料/付款方式列表(仅内容变更时使用) const changeMaterialList = computed(() => form.value.changeMaterialList || []); @@ -619,7 +665,11 @@ const form = ref< changeInfo: undefined, changeMaterialList: undefined, changePaymentMethodList: undefined, - changeCode: undefined + changeCode: undefined, + undertakeDeptId: undefined, + undertakeBy: undefined, + industryRegion: undefined, + sealLegalEntity: undefined }); const rules = { @@ -753,6 +803,10 @@ async function loadDetail() { form.value.changeInfo = d.changeInfo ? { ...d.changeInfo } : undefined; form.value.changeMaterialList = (d.changeMaterialList || []).map((x: any) => ({ ...x })); form.value.changePaymentMethodList = (d.changePaymentMethodList || []).map((x: any) => ({ ...x })); + form.value.undertakeDeptId = m.undertakeDeptId; + form.value.undertakeBy = m.undertakeBy; + form.value.industryRegion = m.industryRegion; + form.value.sealLegalEntity = m.sealLegalEntity; selectedContractName.value = m.contractName || ''; } @@ -763,6 +817,7 @@ function loadSelectOptions() { getUserList({ pageNum: 1, pageSize: 1000 }).then((res) => (userInfoList.value = res.data || [])); getCrmPaymentAccountList({}).then((res) => (paymentAccountList.value = res.data || [])); getBasePrintTemplateList({ templateType: '1' }).then((res) => (printTemplateList.value = res.data || [])); + allListDept({} as any).then((res) => (deptInfoList.value = res.data || [])); } // ----- 变更后物料:增删改 ----- @@ -933,7 +988,11 @@ function buildPayload(changeStatus: '1' | '2'): ContractChangeSaveForm { changeContractCode: f.changeContractCode, changeContractName: f.changeContractName, customerName: f.customerName, - changeContractAmount: f.changeContractAmount + changeContractAmount: f.changeContractAmount, + undertakeDeptId: f.undertakeDeptId, + undertakeBy: f.undertakeBy, + industryRegion: f.industryRegion, + sealLegalEntity: f.sealLegalEntity }; if (f.changeType === '1') { payload.changeInfo = f.changeInfo; @@ -1019,6 +1078,17 @@ onMounted(async () => { } else { form.value.changeType = '1'; form.value.flowStatus = 'draft'; + // 新增时默认承办部门、承办人为当前登录用户 + try { + const infoRes = await getInfo(); + if (infoRes?.data?.user) { + const user = infoRes.data.user as any; + if (user.deptId != null) form.value.undertakeDeptId = user.deptId; + if (user.userId != null) form.value.undertakeBy = user.userId; + } + } catch (e) { + console.error('获取登录用户信息失败', e); + } } }); diff --git a/src/views/oa/erp/contractChange/index.vue b/src/views/oa/erp/contractChange/index.vue index 98073c4..4b6fe10 100644 --- a/src/views/oa/erp/contractChange/index.vue +++ b/src/views/oa/erp/contractChange/index.vue @@ -20,9 +20,6 @@ - - - 搜索 重置 @@ -51,35 +48,56 @@ 导出 - + - - + + + - - - + + + + + + + + + + + + + + + + + + - - - - + + + + + + +