diff --git a/src/api/finance/purchasingrequisition.ts b/src/api/finance/purchasingrequisition.ts index 84b49f4..a9680f7 100644 --- a/src/api/finance/purchasingrequisition.ts +++ b/src/api/finance/purchasingrequisition.ts @@ -90,6 +90,18 @@ export function assignAgent(applyId: number | string, mode: 'random' | 'designat }); } +/** + * 发送招标代理:将采购项目发送给已分配的招标代理 + * @param applyId 采购申请ID + */ +export function sendToAgent(applyId: number | string) { + return request({ + url: '/purchase/purchasingapply/sendToAgent', + method: 'post', + data: { id: Number(applyId) } + }); +} + /** * 修改采购申请 * @param obj 对象数据 @@ -226,3 +238,74 @@ export function getFileApplyTemplateDownloadUrl(id: string | number) { return `/purchase/purchasingapply/export-file-apply-template?id=${encodeURIComponent(String(id))}`; } +// ==================== 招标代理专用接口 ==================== + +/** + * 招标代理获取待处理列表 + * @param params 分页参数 + */ +export function getAgentPendingList(params?: any) { + return request({ + url: '/purchase/purchasingdoc/agent/list', + method: 'get', + params + }); +} + +/** + * 招标代理获取采购需求文件列表 + * @param applyId 采购申请ID + */ +export function getAgentRequirementFiles(applyId: number | string) { + return request({ + url: `/purchase/purchasingdoc/agent/requirement/${applyId}`, + method: 'get' + }); +} + +/** + * 招标代理获取项目详情(仅返回采购编号和项目名称) + * @param applyId 采购申请ID + */ +export function getAgentApplyDetail(applyId: number | string) { + return request({ + url: `/purchase/purchasingdoc/agent/detail/${applyId}`, + method: 'get' + }); +} + +/** + * 招标代理上传采购文件 + * @param data 文件数据 + */ +export function uploadAgentDoc(data: any) { + return request({ + url: '/purchase/purchasingdoc/upload', + method: 'post', + data + }); +} + +/** + * 招标代理重新上传采购文件 + * @param data 文件数据 + */ +export function reuploadAgentDoc(data: any) { + return request({ + url: '/purchase/purchasingdoc/reupload', + method: 'post', + data + }); +} + +/** + * 获取采购文件列表 + * @param applyId 采购申请ID + */ +export function getDocList(applyId: number | string) { + return request({ + url: `/purchase/purchasingdoc/list/${applyId}`, + method: 'get' + }); +} + diff --git a/src/views/finance/purchasingrequisition/add.vue b/src/views/finance/purchasingrequisition/add.vue index 5c73bae..d1b84ed 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -93,16 +93,16 @@ - -
- + @@ -640,6 +640,8 @@ const fundSourceList = ref([]); const isCentralizedList = ref([]); const isSpecialList = ref([]); const purchaseTypeDeptList = ref([]); +/** 部门采购方式字典(委托采购中心采购时使用) */ +const purchaseTypeDeptDelegationList = ref([]); const purchaseModeSchoolList = ref([]); const purchaseTypeUnionList = ref([]); const businessDeptList = ref([]); @@ -974,12 +976,6 @@ const isAutoSelectPurchaseTypeUnion = computed(() => { watch( [() => dataForm.categoryCode, () => dataForm.budget, () => isDeptPurchase.value, () => isFlowEmbed.value, () => dataForm.purchaseChannel, () => isPurchaseCenter.value], () => { - // 学校统一采购申请阶段:采购方式隐藏,由审批环节采购中心补充,此处不自动写入且清空已有值 - if (!isDeptPurchase.value && !isFlowEmbed.value) { - dataForm.purchaseType = ''; - return; - } - // 部门自行采购 & 采购途径为”委托采购中心采购”且为新增申请阶段:采购方式隐藏且不设置 // 注意:查看模式和编辑模式不清空已有的采购方式 if (isDeptPurchase.value && isEntrustCenterChannel.value && !isFlowEmbed.value && !isViewMode.value && !isEditMode.value) { @@ -1219,10 +1215,10 @@ 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 ?? '', - purchaseType: detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? '' : (detail.purchaseType ?? ''), + purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '', + purchaseType: detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? '' : (detail.purchaseType != null ? String(detail.purchaseType) : (detail.purchaseTypeUnion != null ? String(detail.purchaseTypeUnion) : '')), purchaseChannel: (detail as any).purchaseChannel ?? (detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? PURCHASE_CHANNEL.ENTRUST_CENTER : ''), - purchaseTypeUnion: detail.purchaseTypeUnion ?? '', + purchaseTypeUnion: detail.purchaseTypeUnion != null ? String(detail.purchaseTypeUnion) : '', categoryCode: detail.categoryCode ?? '', remark: detail.remark ?? '', status: detail.status ?? '', @@ -1480,7 +1476,7 @@ const getIsSpecialDict = async () => { } }; -// 获取部门采购方式字典(过滤掉“委托采购中心采购”,由采购途径字段控制) +// 获取部门采购方式字典(过滤掉”委托采购中心采购”,由采购途径字段控制) const getPurchaseTypeDeptDict = async () => { try { const res = await getDicts('PURCHASE_TYPE_DEPT'); @@ -1498,6 +1494,30 @@ const getPurchaseTypeDeptDict = async () => { } }; +// 获取部门采购方式字典(委托采购中心采购时使用) +const getPurchaseTypeDeptDelegationDict = async () => { + try { + const res = await getDicts('PURCHASE_TYPE_DEPT_DELEGATION'); + purchaseTypeDeptDelegationList.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) { + purchaseTypeDeptDelegationList.value = []; + } +}; + +/** 部门采购方式下拉选项:根据采购途径动态切换字典 */ +const purchaseTypeDeptOptions = computed(() => { + if (isEntrustCenterChannel.value) { + return purchaseTypeDeptDelegationList.value; + } + return purchaseTypeDeptList.value; +}); + // 获取学校采购形式字典 const getPurchaseModeSchoolDict = async () => { try { @@ -1946,6 +1966,7 @@ onMounted(async () => { getIsCentralizedDict(), getIsSpecialDict(), getPurchaseTypeDeptDict(), + getPurchaseTypeDeptDelegationDict(), getPurchaseModeSchoolDict(), getPurchaseTypeUnionDict(), getBusinessDeptListData(), diff --git a/src/views/finance/purchasingrequisition/agentDoc/AgentDocDialog.vue b/src/views/finance/purchasingrequisition/agentDoc/AgentDocDialog.vue new file mode 100644 index 0000000..3011e0b --- /dev/null +++ b/src/views/finance/purchasingrequisition/agentDoc/AgentDocDialog.vue @@ -0,0 +1,288 @@ + + + + + \ No newline at end of file diff --git a/src/views/finance/purchasingrequisition/agentDoc/index.vue b/src/views/finance/purchasingrequisition/agentDoc/index.vue new file mode 100644 index 0000000..a08c069 --- /dev/null +++ b/src/views/finance/purchasingrequisition/agentDoc/index.vue @@ -0,0 +1,166 @@ + + + + + \ No newline at end of file diff --git a/src/views/finance/purchasingrequisition/implement.vue b/src/views/finance/purchasingrequisition/implement.vue index a0fdb2d..2bf6c94 100644 --- a/src/views/finance/purchasingrequisition/implement.vue +++ b/src/views/finance/purchasingrequisition/implement.vue @@ -38,6 +38,10 @@ 随机分配 + + + 发送招标代理 + @@ -71,7 +75,7 @@