tijiao
This commit is contained in:
@@ -171,6 +171,7 @@ interface UploadFileItem {
|
||||
fileSize: number;
|
||||
fileName: string;
|
||||
fileType: string;
|
||||
id?: string; // 文件ID
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
@@ -359,10 +360,12 @@ const uploadedSuccessfully = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleRemove = (file: { name: string }) => {
|
||||
const handleRemove = (file: { name?: string }) => {
|
||||
if (file.name) {
|
||||
fileList.value = fileList.value.filter((f) => f.name !== file.name);
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
emit('change', listToString(fileList.value), fileList.value);
|
||||
}
|
||||
};
|
||||
|
||||
const handlePreview = (file: any) => {
|
||||
|
||||
@@ -236,7 +236,8 @@
|
||||
<!-- 委托采购中心 -->
|
||||
<template v-if="isPurchaseType(PURCHASE_TYPE_IDS.ENTRUST_CENTER)">
|
||||
<el-form-item label="委托采购中心方式" prop="entrustCenterType" class="mb20">
|
||||
<el-radio-group v-model="dataForm.entrustCenterType">
|
||||
<!-- 由系统根据品目末级节点标记自动判断,不允许用户手动选择 -->
|
||||
<el-radio-group v-model="dataForm.entrustCenterType" disabled>
|
||||
<el-radio label="service_online">服务类网上商城</el-radio>
|
||||
<el-radio label="other">其他方式</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -869,16 +870,16 @@ const FILE_TYPE_MAP: Record<string, string> = {
|
||||
singleSourceProof: '70', // 单一来源专家论证表
|
||||
importApplication: '80', // 进口产品申请表
|
||||
governmentPurchaseIntent: '100', // 政府采购意向表
|
||||
// 需求文件相关
|
||||
serviceDirectSelect: '30', // 服务商城项目需求模板(直选)- 归类到网上商城采购相关材料
|
||||
serviceInviteSelect: '30', // 服务商城项目需求模板(邀请比选)- 归类到网上商城采购相关材料
|
||||
servicePublicSelect: '30', // 服务商城项目需求模板(公开比选)- 归类到网上商城采购相关材料
|
||||
servicePublicSelectAuto: '30', // 服务商城项目需求模板(公开比选-自动)- 归类到网上商城采购相关材料
|
||||
// 需求文件相关 - 所有需求模板都应该是120(采购需求表)
|
||||
serviceDirectSelect: '120', // 服务商城项目需求模板(直选)- 采购需求表
|
||||
serviceInviteSelect: '120', // 服务商城项目需求模板(邀请比选)- 采购需求表
|
||||
servicePublicSelect: '120', // 服务商城项目需求模板(公开比选)- 采购需求表
|
||||
servicePublicSelectAuto: '120', // 服务商城项目需求模板(公开比选-自动)- 采购需求表
|
||||
purchaseRequirementTemplate: '120', // 采购需求填报模板 - 采购需求表
|
||||
purchaseRequirement: '120', // 采购需求填报模板 - 采购需求表
|
||||
serviceInviteSelectSchool: '30', // 服务商城项目需求模板(邀请比选-学校)- 归类到网上商城采购相关材料
|
||||
servicePublicSelectSchoolAuto: '30', // 服务商城项目需求模板(公开比选-学校-自动)- 归类到网上商城采购相关材料
|
||||
servicePublicSelectSchool: '30', // 服务商城项目需求模板(公开比选-学校)- 归类到网上商城采购相关材料
|
||||
serviceInviteSelectSchool: '120', // 服务商城项目需求模板(邀请比选-学校)- 采购需求表
|
||||
servicePublicSelectSchoolAuto: '120', // 服务商城项目需求模板(公开比选-学校-自动)- 采购需求表
|
||||
servicePublicSelectSchool: '120', // 服务商城项目需求模板(公开比选-学校)- 采购需求表
|
||||
};
|
||||
|
||||
// 辅助函数:判断当前采购方式是否为指定类型(通过 id 或 value 匹配)
|
||||
@@ -1033,6 +1034,53 @@ const isSpecialServiceCategory = computed(() => {
|
||||
return Number(category.isMallService) === 1 || Number(category.isProjectService) === 1;
|
||||
});
|
||||
|
||||
// 委托采购中心方式自动判断:
|
||||
// - 服务类:若末级节点 isMallService=0 且 isMallProject=0,则选“其他方式”,否则选“服务类网上商城”
|
||||
// - 非服务类:默认选“其他方式”
|
||||
const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
|
||||
if (!isPurchaseType(PURCHASE_TYPE_IDS.ENTRUST_CENTER)) return '';
|
||||
if (!dataForm.categoryCode) return '';
|
||||
|
||||
const category = getCategoryInfo();
|
||||
if (!category) return '';
|
||||
|
||||
// 兼容字段:接口可能为 isMallProject,也可能历史字段为 isProjectService
|
||||
const mallService = Number(category.isMallService ?? 0);
|
||||
const mallProject = Number(category.isMallProject ?? category.isProjectService ?? 0);
|
||||
|
||||
if (isServiceCategory.value) {
|
||||
return mallService === 0 && mallProject === 0 ? 'other' : 'service_online';
|
||||
}
|
||||
return 'other';
|
||||
};
|
||||
|
||||
// 监听品目/采购方式变化,自动设置委托采购中心方式,并清理无关字段
|
||||
watch(
|
||||
[() => dataForm.purchaseType, () => dataForm.categoryCode, () => categoryTreeData.value],
|
||||
() => {
|
||||
const nextType = calcEntrustCenterType();
|
||||
if (!nextType) return;
|
||||
|
||||
const prevType = dataForm.entrustCenterType as any;
|
||||
if (prevType === nextType) return;
|
||||
|
||||
dataForm.entrustCenterType = nextType;
|
||||
|
||||
// 切换时清理不相关字段,避免脏数据
|
||||
if (nextType === 'other') {
|
||||
dataForm.hasSupplier = '';
|
||||
dataForm.suppliers = '';
|
||||
dataForm.serviceDirectSelect = '';
|
||||
dataForm.serviceInviteSelect = '';
|
||||
dataForm.servicePublicSelect = '';
|
||||
dataForm.servicePublicSelectAuto = '';
|
||||
} else if (nextType === 'service_online') {
|
||||
dataForm.purchaseRequirementTemplate = '';
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 判断是否自动选择网上商城采购方式(5万<=金额<40万,服务类目,特殊服务类目)
|
||||
const isAutoSelectPurchaseType = computed(() => {
|
||||
if (!dataForm.budget) return false;
|
||||
|
||||
Reference in New Issue
Block a user