From d68c74d3bc4d25c5465fa542b42871cc6354b003 Mon Sep 17 00:00:00 2001 From: RISE Date: Tue, 3 Feb 2026 10:30:33 +0800 Subject: [PATCH 1/4] tijiao --- .../finance/purchasingrequisition/add.vue | 400 +++++++++++++----- 1 file changed, 298 insertions(+), 102 deletions(-) diff --git a/src/views/finance/purchasingrequisition/add.vue b/src/views/finance/purchasingrequisition/add.vue index c28293d..7816f8f 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -145,11 +145,11 @@ clearable :disabled="isAutoSelectPurchaseType" style="width: 100%"> - + @@ -170,6 +170,7 @@ @@ -190,6 +191,7 @@ @@ -202,11 +204,8 @@ -
- 请上传zip格式的压缩包 -
@@ -258,6 +257,7 @@ @@ -277,6 +277,7 @@ @@ -298,6 +299,7 @@ @@ -339,6 +341,7 @@ @@ -359,9 +362,20 @@ + + + + +
支持上传zip格式的压缩包文件
+
@@ -395,6 +409,40 @@ + + + + + + + + + + + + + + @@ -428,6 +478,7 @@ @@ -449,12 +500,14 @@ @@ -476,32 +529,18 @@ - - - - 下载《采购需求填报模板》模版 - - - - - - - - - 下载《服务商城项目需求模板(公开比选)》模版 - - + + + + @@ -594,8 +657,19 @@ + + + + +
支持上传zip格式的压缩包文件
+
@@ -651,6 +725,8 @@ import { useMessage } from '/@/hooks/message'; import UploadFile from '/@/components/Upload/index.vue'; import other from '/@/utils/other'; import { Document, Download } from '@element-plus/icons-vue'; +import { fetchList as getBusinessDeptList } from '/@/api/purchase/purchasingBusinessDept'; +import { getPage as getSchoolLeaderPage } from '/@/api/finance/purchasingschoolleader'; // 路由 const router = useRouter(); @@ -704,6 +780,13 @@ const dataForm = reactive({ recommendedSuppliersSchool: '', serviceInviteSelectSchool: '', servicePublicSelectSchoolAuto: '', + // 业务分管处室和分管校领导 + deptClassifyId: '', + deptClassifyName: '', + schoolLeaderUserId: '', + schoolLeaderName: '', + // 其他材料(zip压缩包) + otherMaterials: '', }); const categoryTreeData = ref([]); const categoryCodePath = ref([]); // 级联选择器的路径数组 @@ -713,6 +796,8 @@ const isSpecialList = ref([]); const purchaseTypeDeptList = ref([]); const purchaseModeSchoolList = ref([]); const purchaseTypeUnionList = ref([]); +const businessDeptList = ref([]); +const schoolLeaderList = ref([]); const loading = ref(false); // 采购方式ID常量 @@ -727,12 +812,16 @@ const PURCHASE_TYPE_IDS = { // 条件:特殊情况=否 且 集采=否 且 预算金额<5万 → 部门自行采购 // 其他情况 → 学校统一采购 const isDeptPurchase = computed(() => { - // 检查是否特殊情况是否为"否"(id: "1799c07f3a3b8a484f60c495ab9227b6") - const isSpecialNo = isSpecialList.value.find(item => item.id === '1799c07f3a3b8a484f60c495ab9227b6'); + // 检查是否特殊情况是否为"否"(通过 id 或 value 查找,value 为 '0') + const isSpecialNo = isSpecialList.value.find(item => + item.id === '1799c07f3a3b8a484f60c495ab9227b6' || item.value === '0' + ); const isSpecialNoValue = isSpecialNo ? isSpecialNo.value : null; - // 检查是否集采是否为"否"(id: "8e60f8860c1ea2459a41a8ae64fe5518") - const isCentralizedNo = isCentralizedList.value.find(item => item.id === '8e60f8860c1ea2459a41a8ae64fe5518'); + // 检查是否集采是否为"否"(通过 id 或 value 查找,value 为 '0') + const isCentralizedNo = isCentralizedList.value.find(item => + item.id === '8e60f8860c1ea2459a41a8ae64fe5518' || item.value === '0' + ); const isCentralizedNoValue = isCentralizedNo ? isCentralizedNo.value : null; // 三个条件必须同时满足:特殊情况=否 且 集采=否 且 预算金额<5万 @@ -746,9 +835,12 @@ const isDeptPurchase = computed(() => { return false; }); -// 判断是否为紧急情况(ID: 6509b59e24c1c6568f4277e544f3e55e) +// 判断是否为紧急情况(通过 id 或 value 查找,value 为 '1') const isUrgentSpecial = computed(() => { - const urgentItem = isSpecialList.value.find(item => item.id === '6509b59e24c1c6568f4277e544f3e55e'); + const urgentItem = isSpecialList.value.find(item => + item.id === '6509b59e24c1c6568f4277e544f3e55e' || + (item.value === '1' && (item.label?.includes('紧急') || item.dictLabel?.includes('紧急'))) + ); if (!urgentItem) return false; return dataForm.isSpecial === urgentItem.value; }); @@ -860,6 +952,20 @@ const showAutoPublicSelect = computed(() => { return budget >= 400000 && budget < 1000000 && isSpecialServiceCategory.value; }); +// 获取需求文件的 prop 名称(用于表单验证) +const getRequirementFileProp = () => { + if (showAutoInviteSelectSchool.value) { + if (dataForm.hasRecommendedSupplierSchool === 'yes') { + return 'serviceInviteSelectSchool'; + } else if (dataForm.hasRecommendedSupplierSchool === 'no') { + return 'servicePublicSelectSchoolAuto'; + } + } else if (showAutoPublicSelect.value) { + return 'servicePublicSelectSchool'; + } + return 'purchaseRequirement'; +}; + // 判断学校统一采购是否需要自动设置采购方式(5万<=金额<40万,服务类目,特殊服务类目) const isAutoSelectPurchaseTypeUnion = computed(() => { if (isDeptPurchase.value) return false; @@ -872,11 +978,13 @@ const isAutoSelectPurchaseTypeUnion = computed(() => { watch([() => dataForm.categoryCode, () => dataForm.budget], () => { // 部门自行采购:自动设置网上商城 if (isAutoSelectPurchaseType.value && isDeptPurchase.value) { - // 查找网上商城选项(通过id或value匹配) - const onlineMallOption = purchaseTypeDeptList.value.find(item => - item.id === PURCHASE_TYPE_IDS.ONLINE_MALL || - item.value === PURCHASE_TYPE_IDS.ONLINE_MALL - ); + // 查找网上商城选项(通过 id 或 label 匹配) + const onlineMallOption = purchaseTypeDeptList.value.find(item => { + const label = item.label || item.dictLabel || item.name || ''; + return item.id === PURCHASE_TYPE_IDS.ONLINE_MALL || + item.value === PURCHASE_TYPE_IDS.ONLINE_MALL || + label.includes('网上商城') || label.includes('商城'); + }); if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) { dataForm.purchaseType = onlineMallOption.value; } @@ -1036,6 +1144,7 @@ const getFundSourceDict = async () => { fundSourceList.value = []; if (res.data && Array.isArray(res.data)) { fundSourceList.value = res.data.map((item: any) => ({ + id: item.id, label: item.label || item.dictLabel || item.name, value: item.value || item.dictValue || item.code })); @@ -1134,7 +1243,7 @@ const getPurchaseTypeDeptDict = async () => { purchaseTypeDeptList.value = res.data.map((item: any) => ({ id: item.id, label: item.label || item.dictLabel || item.name, - value: item.id || item.dictValue || item.code + value: item.value || item.dictValue || item.code })); } } catch (err) { @@ -1149,6 +1258,7 @@ const getPurchaseModeSchoolDict = async () => { purchaseModeSchoolList.value = []; if (res.data && Array.isArray(res.data)) { purchaseModeSchoolList.value = res.data.map((item: any) => ({ + id: item.id, label: item.label || item.dictLabel || item.name, value: item.value || item.dictValue || item.code })); @@ -1173,6 +1283,7 @@ const getPurchaseTypeUnionDict = async () => { purchaseTypeUnionList.value = []; if (res.data && Array.isArray(res.data)) { purchaseTypeUnionList.value = res.data.map((item: any) => ({ + id: item.id, label: item.label || item.dictLabel || item.name, value: item.value || item.dictValue || item.code })); @@ -1182,6 +1293,72 @@ const getPurchaseTypeUnionDict = async () => { } }; +// 获取业务分管处室列表 +const getBusinessDeptListData = async () => { + try { + const res = await getBusinessDeptList({ records: 1000 }); // 获取所有数据 + if (res.data && res.data.records) { + businessDeptList.value = res.data.records.map((item: any) => ({ + id: item.id, + deptId: item.deptId, + deptName: item.deptName, + userId: item.userId, + name: item.name, + username: item.username + })); + } + } catch (err) { + console.error('获取业务分管处室列表失败:', err); + businessDeptList.value = []; + } +}; + +// 获取分管校领导列表 +const getSchoolLeaderListData = async () => { + try { + const res = await getSchoolLeaderPage({ records: 1000 }); // 获取所有数据 + if (res.data && res.data.records) { + schoolLeaderList.value = res.data.records.map((item: any) => ({ + id: item.id, + userId: item.userId, + name: item.name, + username: item.username + })); + } + } catch (err) { + console.error('获取分管校领导列表失败:', err); + schoolLeaderList.value = []; + } +}; + +// 处理业务分管处室选择变化 +const handleBusinessDeptChange = (value: string) => { + if (value) { + const selected = businessDeptList.value.find(item => item.id === value); + if (selected) { + dataForm.deptClassifyId = selected.id; + dataForm.deptClassifyName = selected.deptName || ''; + } + } else { + dataForm.deptClassifyId = ''; + dataForm.deptClassifyName = ''; + } +}; + +// 处理分管校领导选择变化 +const handleSchoolLeaderChange = (value: string) => { + if (value) { + const selected = schoolLeaderList.value.find(item => item.userId === value); + if (selected) { + dataForm.schoolLeaderUserId = selected.userId; + dataForm.schoolLeaderName = selected.name || ''; + } + } else { + dataForm.schoolLeaderUserId = ''; + dataForm.schoolLeaderName = ''; + } +}; + // 处理文件ID字符串转数组 const getFileIdsArray = (fileIds: string | string[]): string[] => { if (!fileIds) return []; @@ -1234,7 +1411,7 @@ const handleSubmit = async () => { 'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement', 'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent', 'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication', - 'governmentPurchaseIntent', 'servicePublicSelectSchool' + 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials' ]; fileFields.forEach(field => { @@ -1283,7 +1460,7 @@ const handleTempStore = async () => { 'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement', 'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent', 'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication', - 'governmentPurchaseIntent', 'servicePublicSelectSchool' + 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials' ]; fileFields.forEach(field => { @@ -1366,7 +1543,26 @@ onMounted(async () => { getPurchaseTypeDeptDict(), getPurchaseModeSchoolDict(), getPurchaseTypeUnionDict(), + getBusinessDeptListData(), + getSchoolLeaderListData(), ]); + + // 新增模式下设置默认值(只有在没有 id 的情况下才设置) + if (!dataForm.id) { + // 填报日期默认为当天 + const today = new Date(); + const year = today.getFullYear(); + const month = String(today.getMonth() + 1).padStart(2, '0'); + const day = String(today.getDate()).padStart(2, '0'); + dataForm.applyDate = `${year}-${month}-${day}`; + + // 是否集采默认为"否"(value: '0') + dataForm.isCentralized = '0'; + + // 是否特殊情况默认为"否"(value: '0') + dataForm.isSpecial = '0'; + } + // 如果有 categoryCode,设置回显路径 if (dataForm.categoryCode) { setCategoryCodePath(); From fd92b6ef54ae746d6d1d67363d07366cc75ddfe0 Mon Sep 17 00:00:00 2001 From: RISE Date: Tue, 3 Feb 2026 10:59:14 +0800 Subject: [PATCH 2/4] tijiao --- .../finance/purchasingrequisition/add.vue | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/views/finance/purchasingrequisition/add.vue b/src/views/finance/purchasingrequisition/add.vue index 7816f8f..5d04caa 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -155,7 +155,7 @@ @@ -176,7 +176,7 @@ @@ -197,7 +197,7 @@ @@ -209,7 +209,7 @@ - @@ -373,6 +381,7 @@ v-model="dataForm.otherMaterials" :limit="5" :file-type="['zip']" + :data="{ fileType: FILE_TYPE_MAP.otherMaterials }" upload-file-url="/purchase/purchasingfiles/upload" />
支持上传zip格式的压缩包文件
@@ -461,6 +470,7 @@ v-model="dataForm.feasibilityReport" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.feasibilityReport }" upload-file-url="/purchase/purchasingfiles/upload" />
@@ -468,6 +478,7 @@ v-model="dataForm.meetingMinutes" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.meetingMinutes }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -479,6 +490,7 @@ v-model="dataForm.meetingMinutesUrgent" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.meetingMinutesUrgent }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -501,6 +513,7 @@ v-model="dataForm.singleSourceProof" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.singleSourceProof }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -508,6 +521,7 @@ v-model="dataForm.meetingMinutesSingle" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.meetingMinutesSingle }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -530,6 +544,7 @@ v-model="dataForm.importApplication" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.importApplication }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -537,6 +552,7 @@ v-model="dataForm.meetingMinutesImport" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.meetingMinutesImport }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -587,6 +603,7 @@ v-model="dataForm.serviceInviteSelectSchool" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.serviceInviteSelectSchool }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -605,6 +622,7 @@ v-model="dataForm.servicePublicSelectSchoolAuto" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.servicePublicSelectSchoolAuto }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -625,6 +643,7 @@ v-model="dataForm.servicePublicSelectSchool" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.servicePublicSelectSchool }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -644,6 +663,7 @@ v-model="dataForm.purchaseRequirement" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.purchaseRequirement }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -658,6 +678,7 @@ v-model="dataForm.governmentPurchaseIntent" :limit="5" :file-type="['doc', 'docx', 'pdf']" + :data="{ fileType: FILE_TYPE_MAP.governmentPurchaseIntent }" upload-file-url="/purchase/purchasingfiles/upload" /> @@ -667,6 +688,7 @@ v-model="dataForm.otherMaterials" :limit="5" :file-type="['zip']" + :data="{ fileType: FILE_TYPE_MAP.otherMaterials }" upload-file-url="/purchase/purchasingfiles/upload" />
支持上传zip格式的压缩包文件
@@ -808,6 +830,33 @@ const PURCHASE_TYPE_IDS = { ENTRUST_CENTER: '981bf052a0b30b028a4a89ae490c9b1d' // 委托采购中心 }; +// 文件类型映射(对应数据库 file_type 字段) +// 10:商务洽谈纪要 20:市场采购纪要 30:网上商城采购相关材料 40:可行性论证报告 50:会议记录 60:其他材料 70:单一来源专家论证表 80:进口产品申请表 90:进口产品专家论证表 100:政府采购意向表 110:履约验收单 +const FILE_TYPE_MAP: Record = { + businessNegotiationTable: '10', // 商务洽谈纪要 + marketPurchaseMinutes: '20', // 市场采购纪要 + onlineMallMaterials: '30', // 网上商城采购相关材料 + feasibilityReport: '40', // 可行性论证报告 + meetingMinutes: '50', // 会议记录 + meetingMinutesUrgent: '50', // 会议记录 + meetingMinutesSingle: '50', // 会议记录 + meetingMinutesImport: '50', // 会议记录 + otherMaterials: '60', // 其他材料 + singleSourceProof: '70', // 单一来源专家论证表 + importApplication: '80', // 进口产品申请表 + governmentPurchaseIntent: '100', // 政府采购意向表 + // 需求文件相关(暂时使用默认值,可根据实际需求调整) + serviceDirectSelect: '30', // 服务商城项目需求模板(直选)- 归类到网上商城采购相关材料 + serviceInviteSelect: '30', // 服务商城项目需求模板(邀请比选) + servicePublicSelect: '30', // 服务商城项目需求模板(公开比选) + servicePublicSelectAuto: '30', // 服务商城项目需求模板(公开比选-自动) + purchaseRequirementTemplate: '30', // 采购需求填报模板 + purchaseRequirement: '30', // 采购需求填报模板 + serviceInviteSelectSchool: '30', // 服务商城项目需求模板(邀请比选-学校) + servicePublicSelectSchoolAuto: '30', // 服务商城项目需求模板(公开比选-学校-自动) + servicePublicSelectSchool: '30', // 服务商城项目需求模板(公开比选-学校) +}; + // 辅助函数:判断当前采购方式是否为指定类型(通过 id 或 value 匹配) const isPurchaseType = (purchaseTypeId: string) => { if (!dataForm.purchaseType) return false; @@ -1388,6 +1437,7 @@ const handleSchoolLeaderChange = (value: string) => { }; // 处理文件ID字符串转数组 +// 从上传返回的URL中提取文件ID,拼成数组格式:["id1", "id2"] const getFileIdsArray = (fileIds: string | string[]): string[] => { if (!fileIds) return []; if (Array.isArray(fileIds)) return fileIds; @@ -1397,19 +1447,41 @@ const getFileIdsArray = (fileIds: string | string[]): string[] => { urls.forEach(url => { try { + // 尝试解析为URL const urlObj = new URL(url, window.location.origin); - const id = urlObj.searchParams.get('id') || urlObj.searchParams.get('fileName'); + // 优先从URL参数中获取id + let id = urlObj.searchParams.get('id'); + + // 如果没有id参数,尝试从路径中提取(可能是直接的文件ID) + if (!id) { + const pathParts = urlObj.pathname.split('/').filter(p => p); + // 检查最后一个路径段是否是32位十六进制字符串(文件ID格式) + const lastPart = pathParts[pathParts.length - 1]; + if (lastPart && /^[a-f0-9]{32}$/i.test(lastPart)) { + id = lastPart; + } else if (lastPart) { + id = lastPart; + } + } + if (id) { ids.push(id); } else { - const pathParts = urlObj.pathname.split('/'); - const lastPart = pathParts[pathParts.length - 1]; - if (lastPart) { - ids.push(lastPart); + // 如果URL解析失败,检查原始字符串是否是ID格式 + if (/^[a-f0-9]{32}$/i.test(url.trim())) { + ids.push(url.trim()); + } else { + ids.push(url); } } } catch { - ids.push(url); + // URL解析失败,检查是否是直接的ID格式(32位十六进制) + if (/^[a-f0-9]{32}$/i.test(url.trim())) { + ids.push(url.trim()); + } else { + // 否则直接使用原始字符串 + ids.push(url); + } } }); @@ -1439,7 +1511,8 @@ const handleSubmit = async () => { 'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement', 'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent', 'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication', - 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials' + 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'serviceInviteSelectSchool', + 'servicePublicSelectSchoolAuto', 'otherMaterials' ]; fileFields.forEach(field => { @@ -1488,7 +1561,8 @@ const handleTempStore = async () => { 'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement', 'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent', 'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication', - 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials' + 'governmentPurchaseIntent', 'servicePublicSelectSchool', 'serviceInviteSelectSchool', + 'servicePublicSelectSchoolAuto', 'otherMaterials' ]; fileFields.forEach(field => { From 399096e062fadad5a56d4630b134a9e2be708a6c Mon Sep 17 00:00:00 2001 From: zhoutianchi <1305666981@qq.com> Date: Tue, 3 Feb 2026 11:51:30 +0800 Subject: [PATCH 4/4] 1 --- src/views/professional/teacherbase/export-teacher-info.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/professional/teacherbase/export-teacher-info.vue b/src/views/professional/teacherbase/export-teacher-info.vue index 43ba104..2a7d2c9 100644 --- a/src/views/professional/teacherbase/export-teacher-info.vue +++ b/src/views/professional/teacherbase/export-teacher-info.vue @@ -154,7 +154,7 @@ {label:'高校教师资格证',value:'highCer_高校教师资格证'}, {label:'中等教师资格证',value:'midCer_中等教师资格证'}, {label:'教师上岗证',value:'priCer_教师上岗证'}, - {label:'共同居住人',value:'livewith_共同居住人'}, + // {label:'共同居住人',value:'livewith_共同居住人'}, ] // 导出文件函数 @@ -169,7 +169,7 @@ 'Content-Type': 'application/json' } }) - const blob = new Blob([res.data]) + const blob = new Blob([res]) const fileName = fileNameStr const elink = document.createElement('a') elink.download = fileName @@ -239,7 +239,7 @@ "teacherBaseDTO": searchData } - await exportForModel(params, "教职工信息.xls", "/professional/teacherbase/exportTeacherInfoBySelf") + await exportForModel(params, "教职工信息.xls", "/professional/file/exportTeacherInfoBySelf") setTimeout(() => { exportLoading.value = false