diff --git a/src/api/purchase/purchasingrequisition.ts b/src/api/purchase/purchasingrequisition.ts index 53a6d8c..5e654cf 100644 --- a/src/api/purchase/purchasingrequisition.ts +++ b/src/api/purchase/purchasingrequisition.ts @@ -115,9 +115,9 @@ export function revokeAgent(applyId: number | string) { } /** - * 保存实施采购方式(分步骤实施采购-第一步) + * 保存实施采购途径(分步骤实施采购-第一步) * @param id 采购申请ID - * @param implementType 实施采购方式:1-自行组织采购,2-委托代理采购 + * @param implementType 实施采购途径:1-自行组织采购,2-委托代理采购 */ export function saveImplementType(id: number | string, implementType: string) { return request({ @@ -179,7 +179,7 @@ export function getContracts(params?: any) { * 实施采购:上传招标文件并关联到申请单(可同时保存采购代表人方式与人员) * @param id 采购申请ID * @param fileIds 已上传的招标文件ID列表(fileType=130) - * @param implementType 实施采购方式 1:自行组织采购 2:委托代理采购 + * @param implementType 实施采购途径 1:自行组织采购 2:委托代理采购 * @param representorTeacherNo 需求部门初审-指定采购代表人(单人) * @param representors 需求部门初审-部门多人逗号分隔 */ diff --git a/src/views/purchase/purchasingrequisition/add.vue b/src/views/purchase/purchasingrequisition/add.vue index 63e2edf..af191cc 100644 --- a/src/views/purchase/purchasingrequisition/add.vue +++ b/src/views/purchase/purchasingrequisition/add.vue @@ -395,12 +395,17 @@ - - - - {{ item.label }} - - + + + + @@ -810,7 +815,7 @@ 实施采购信息 -
实施采购方式
+
实施采购途径
{{ dataForm.implementType === '1' @@ -978,7 +983,7 @@ const dataForm = reactive({ isSpecial: '', hasAssets: '0', purchaseMode: '', - purchaseSchool: '', + implementChannel: '', // 实施采购途径:框架协议、网上商城 purchaseType: '', purchaseTypeUnion: '', purchaseChannel: '', @@ -1049,7 +1054,11 @@ const isSpecialList = ref([]); const purchaseTypeDeptList = ref([]); /** 部门采购方式字典(委托采购中心采购时使用) */ const purchaseTypeDeptDelegationList = ref([]); -const purchaseModeSchoolList = ref([]); +/** 实施采购途径选项:框架协议、网上商城 */ +const implementChannelList = ref([ + { value: '5', label: '框架协议' }, + { value: '8', label: '网上商城' }, +]); const purchaseTypeUnionList = ref([]); const businessDeptList = ref([]); const schoolLeaderList = ref([]); @@ -1215,8 +1224,8 @@ const isPurchaseTypeUnionRequired = computed(() => { return false; }); -// 学校统一采购 - 组织采购形式是否必填 -const isPurchaseSchoolRequired = computed(() => { +// 学校统一采购 - 实施采购途径是否必填 +const isImplementChannelRequired = computed(() => { // 审核阶段:采购中心必填 if (isFlowEmbed.value && isPurchaseCenter.value) { return true; @@ -1386,6 +1395,21 @@ const calcEntrustCenterType = (): 'service_online' | 'other' | '' => { return 'other'; }; +// 实施采购途径变化时,自动设置采购方式 +// 框架协议 → 采购方式自动选择"框架协议" +// 网上商城 → 采购方式自动选择"网上商城" +const handleImplementChannelChange = (value: string) => { + if (!value) { + // 清空实施采购途径时,清空采购方式 + dataForm.purchaseType = ''; + return; + } + + // 根据实施采购途径自动设置采购方式 + // value 与 PurchaseTypeEnum 编码一致:5=框架协议,8=网上商城 + dataForm.purchaseType = value; +}; + // 监听采购途径变化,清理所有与采购方式相关的材料字段,同时如果已选择品目则重新计算entrustCenterType watch( () => dataForm.purchaseChannel, @@ -1732,13 +1756,13 @@ const dataRules = reactive({ trigger: 'change', }, ], - // 学校统一采购 + 采购中心审核:采购形式必填 - purchaseSchool: [ + // 学校统一采购 + 采购中心审核:实施采购途径必填 + implementChannel: [ { validator: (_rule: any, value: string, callback: (e?: Error) => void) => { if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) { if (!value || String(value).trim() === '') { - callback(new Error('请选择组织采购形式')); + callback(new Error('请选择实施采购途径')); return; } } @@ -1864,8 +1888,8 @@ async function loadDetail(applyId: string | number) { budget: detail.budget != null ? Number(detail.budget) : null, isCentralized: detail.isCentralized != null ? String(detail.isCentralized) : '', isSpecial: detail.isSpecial != null ? String(detail.isSpecial) : '', - purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '', - purchaseSchool: detail.purchaseSchool != null ? String(detail.purchaseSchool) : '', +purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '', + implementChannel: detail.implementChannel != null ? String(detail.implementChannel) : '', purchaseType: detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? '' @@ -2220,23 +2244,6 @@ const purchaseTypeDeptOptions = computed(() => { })); }); -// 获取学校采购形式字典 -const getPurchaseModeSchoolDict = async () => { - try { - const res = await getDicts('PURCHASE_MODE_SCHOOL'); - purchaseModeSchoolList.value = - res.data && Array.isArray(res.data) - ? res.data.map((item: any) => ({ - id: item.id, - label: item.label || item.dictLabel || item.name, - value: item.value || item.dictValue || item.code, - })) - : []; - } catch (err) { - purchaseModeSchoolList.value = []; - } -}; - // 获取学校统一采购方式字典 const getPurchaseTypeUnionDict = async () => { try { @@ -2808,7 +2815,6 @@ onMounted(async () => { getIsSpecialDict(), getPurchaseTypeDeptDict(), getPurchaseTypeDeptDelegationDict(), - getPurchaseModeSchoolDict(), getPurchaseTypeUnionDict(), getBusinessDeptListData(), getSchoolLeaderListData(), diff --git a/src/views/purchase/purchasingrequisition/implement.vue b/src/views/purchase/purchasingrequisition/implement.vue index 0193ae9..700c27b 100644 --- a/src/views/purchase/purchasingrequisition/implement.vue +++ b/src/views/purchase/purchasingrequisition/implement.vue @@ -1,15 +1,15 @@