This commit is contained in:
吴红兵
2026-03-06 22:48:58 +08:00
parent 33bc94fce5
commit adc511cfdc
3 changed files with 60 additions and 17 deletions

View File

@@ -28,7 +28,7 @@ export function getFileTypes() {
} }
/** /**
* 获取 140 部门自行采购会议纪要文件类型 * 获取 140 部门会议纪要文件类型
*/ */
export function getDeptSelfMeetingFiletype() { export function getDeptSelfMeetingFiletype() {
return '140'; return '140';

View File

@@ -36,7 +36,7 @@
<!-- 审批项 --> <!-- 审批项 -->
<el-form v-if="!data.currJob.hiJob && !orderVue.vueKeySys.sysPaths.includes(data.currElTab.path)" label-width="72px" style="margin-top: 22px;"> <el-form v-if="!data.currJob.hiJob && !orderVue.vueKeySys.sysPaths.includes(data.currElTab.path)" label-width="72px" style="margin-top: 22px;">
<template v-if="data.currElTab.isAutoAudit !== '1'"> <template v-if="data.currElTab.isAutoAudit !== '1'">
@@ -48,6 +48,7 @@
<el-form-item :label="t('jfcomment.signName')" style="display: none"> <el-form-item :label="t('jfcomment.signName')" style="display: none">
<sign-name ref="signNameRef" :currJob="data.currJob"></sign-name> <sign-name ref="signNameRef" :currJob="data.currJob"></sign-name>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<template v-for="(jobBtn, index) in data.jobBtns.length > 6 ? data.jobBtns.slice(0, 6) : data.jobBtns" :key="index"> <template v-for="(jobBtn, index) in data.jobBtns.length > 6 ? data.jobBtns.slice(0, 6) : data.jobBtns" :key="index">
<el-button :loading="data.loading" <el-button :loading="data.loading"

View File

@@ -201,7 +201,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.BUSINESS_NEGOTIATION) && isEntrustCenterChannel"> <el-col :span="24" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.BUSINESS_NEGOTIATION)">
<el-form-item label="洽谈理由" prop="negotiationReason" required> <el-form-item label="洽谈理由" prop="negotiationReason" required>
<el-input <el-input
v-model="dataForm.negotiationReason" v-model="dataForm.negotiationReason"
@@ -932,7 +932,7 @@
</template> </template>
<template v-else> <template v-else>
<el-button v-if="!isFlowEmbed" @click="handleCancel">取消</el-button> <el-button v-if="!isFlowEmbed" @click="handleCancel">取消</el-button>
<el-button v-if="!isEditMode && !flowSubmitDisabled" type="warning" @click="handleTempStore" :disabled="loading"> 暂存 </el-button> <el-button v-if="!flowSubmitDisabled" type="warning" @click="handleTempStore" :disabled="loading"> 暂存 </el-button>
<!-- <el-button --> <!-- <el-button -->
<!-- type="primary" --> <!-- type="primary" -->
<!-- @click="handleSubmit" --> <!-- @click="handleSubmit" -->
@@ -1076,7 +1076,7 @@ const dataForm = reactive({
serviceInviteSelect: '', serviceInviteSelect: '',
servicePublicSelectAuto: '', servicePublicSelectAuto: '',
deptSelfMeetingMinutes: '', // 部门自行采购会议纪要 deptSelfMeetingMinutes: '', // 部门会议纪要
// 学校统一采购字段 // 学校统一采购字段
purchaseRequirement: '', purchaseRequirement: '',
meetingMinutes: '', meetingMinutes: '',
@@ -1135,9 +1135,11 @@ const businessLeaderList = ref<any[]>([]);
const representorTypeList = ref<any[]>([]); const representorTypeList = ref<any[]>([]);
const loading = ref(false); const loading = ref(false);
const helpDialogVisible = ref(false); const helpDialogVisible = ref(false);
/** 数据是否已加载完成(用于控制自动设置采购方式的逻辑) */
const initialDataLoaded = ref(false);
// 文件类型映射(对应数据库 file_type 字段) // 文件类型映射(对应数据库 file_type 字段)
// 10:商务洽谈纪要 20:市场采购纪要 30:网上商城采购相关材料 40:可行性论证报告 50:会议记录 60:其他材料 70:单一来源专家论证表 90:进口产品专家论证表 100:政府采购意向表 110:履约验收单 120:采购需求表 130:招标文件 140: 部门自行采购会议纪要 // 10:商务洽谈纪要 20:市场采购纪要 30:网上商城采购相关材料 40:可行性论证报告 50:会议记录 60:其他材料 70:单一来源专家论证表 90:进口产品专家论证表 100:政府采购意向表 110:履约验收单 120:采购需求表 130:招标文件 140: 部门会议纪要
const FILE_TYPE_MAP: Record<string, string> = { const FILE_TYPE_MAP: Record<string, string> = {
businessNegotiationTable: '10', // 商务洽谈纪要 businessNegotiationTable: '10', // 商务洽谈纪要
marketPurchaseMinutes: '20', // 市场采购纪要 marketPurchaseMinutes: '20', // 市场采购纪要
@@ -1162,7 +1164,7 @@ const FILE_TYPE_MAP: Record<string, string> = {
serviceInviteSelectSchool: '120', // 服务商城项目需求模板(邀请比选 - 学校)- 采购需求表 serviceInviteSelectSchool: '120', // 服务商城项目需求模板(邀请比选 - 学校)- 采购需求表
servicePublicSelectSchoolAuto: '120', // 服务商城项目需求模板(公开比选 - 学校 - 自动)- 采购需求表 servicePublicSelectSchoolAuto: '120', // 服务商城项目需求模板(公开比选 - 学校 - 自动)- 采购需求表
servicePublicSelectSchool: '120', // 服务商城项目需求模板(公开比选 - 学校)- 采购需求表 servicePublicSelectSchool: '120', // 服务商城项目需求模板(公开比选 - 学校)- 采购需求表
deptSelfMeetingMinutes: '140', // 部门自行采购会议纪要 deptSelfMeetingMinutes: '140', // 部门会议纪要
}; };
// fileType -> 表单字段名数组(顺序与回填分配一致,同类型多字段时按此顺序分配) // fileType -> 表单字段名数组(顺序与回填分配一致,同类型多字段时按此顺序分配)
@@ -1395,9 +1397,42 @@ const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
return 'other'; return 'other';
}; };
// 监听品目/采购途径变化,自动设置委托采购中心方式,并清理无关字段 // 监听采购途径变化,清理所有与采购方式相关的材料字段
watch( watch(
[() => dataForm.purchaseChannel, () => dataForm.categoryCode, () => categoryTreeData.value], () => dataForm.purchaseChannel,
(newChannel, oldChannel) => {
// 仅在采购途径发生变化时清理
if (newChannel === oldChannel) return;
// 编辑模式dataForm.id存在如果是首次加载数据oldChannel为空不清理
// 首次加载时保持原有数据,用户手动切换时需要清理
if (dataForm.id && !oldChannel) return;
// 采购途径变化时清空采购方式和所有材料字段
// 避免"自行采购"切换回"委托采购中心采购"时,仍显示原"网上商城"对应的字段
dataForm.purchaseType = '';
dataForm.entrustCenterType = '';
// 自行采购的材料字段
dataForm.businessNegotiationTable = '';
dataForm.marketPurchaseMinutes = '';
dataForm.onlineMallMaterials = '';
dataForm.inquiryTemplate = '';
dataForm.serviceInviteSelect = '';
dataForm.servicePublicSelectAuto = '';
// 委托采购中心的材料字段
dataForm.serviceDirectSelect = '';
dataForm.servicePublicSelect = '';
dataForm.purchaseRequirementTemplate = '';
dataForm.hasSupplier = '0';
dataForm.suppliers = '';
},
{ immediate: true }
);
// 监听品目变化,自动设置委托采购中心方式
watch(
[() => dataForm.categoryCode, () => categoryTreeData.value],
() => { () => {
const nextType = calcEntrustCenterType(); const nextType = calcEntrustCenterType();
if (!nextType) return; if (!nextType) return;
@@ -1407,7 +1442,7 @@ watch(
dataForm.entrustCenterType = nextType; dataForm.entrustCenterType = nextType;
// 切换时清理不相关字段,避免脏数据 // 品目变化时清理不相关字段
if (nextType === 'other') { if (nextType === 'other') {
dataForm.hasSupplier = '0'; dataForm.hasSupplier = '0';
dataForm.suppliers = ''; dataForm.suppliers = '';
@@ -1497,6 +1532,11 @@ watch(
() => isPurchaseCenter.value, () => isPurchaseCenter.value,
], ],
(newValues, oldValues) => { (newValues, oldValues) => {
// 如果是初始化触发oldValues 为 undefined且是编辑模式dataForm.id 存在),则跳过自动设置
// 这样可以保持从后台加载的采购方式不变
const isInitTrigger = oldValues === undefined || oldValues === null;
const isEditModeWithData = isInitTrigger && dataForm.id;
const oldIsDeptPurchase = oldValues?.[2]; const oldIsDeptPurchase = oldValues?.[2];
const newIsDeptPurchase = newValues?.[2]; const newIsDeptPurchase = newValues?.[2];
@@ -1512,8 +1552,9 @@ watch(
return; return;
} }
// 部门自行采购 & 采购途径为自行采购 & 特殊服务类目:固定网上商城(无论金额区间) // 部门自行采购 & 采购途径为自行采购 & 特殊服务类目:固定网上商城(无论金额区间)
if (isDeptSelfMallLocked.value) { // 编辑模式下加载数据时保持原有值,用户手动切换时仍自动更新
if (isDeptSelfMallLocked.value && !isEditModeWithData) {
const onlineMallOption = purchaseTypeDeptList.value.find((item) => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL); const onlineMallOption = purchaseTypeDeptList.value.find((item) => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL);
if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) { if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) {
dataForm.purchaseType = onlineMallOption.value; dataForm.purchaseType = onlineMallOption.value;
@@ -1522,8 +1563,9 @@ watch(
return; return;
} }
// 其他部门自行采购 & 采购途径为自行采购:在金额区间内自动推荐网上商城 // 其他部门自行采购 & 采购途径为"自行采购":在金额区间内自动推荐网上商城
if (isAutoSelectPurchaseType.value && isDeptPurchase.value && !isEntrustCenterChannel.value) { // 编辑模式下加载数据时保持原有值,用户手动切换时仍自动更新
if (isAutoSelectPurchaseType.value && isDeptPurchase.value && !isEntrustCenterChannel.value && !isEditModeWithData) {
const onlineMallOption = purchaseTypeDeptList.value.find((item) => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL); const onlineMallOption = purchaseTypeDeptList.value.find((item) => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL);
if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) { if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) {
dataForm.purchaseType = onlineMallOption.value; dataForm.purchaseType = onlineMallOption.value;
@@ -1939,7 +1981,7 @@ async function flowSubmitForm() {
'purchaseRequirementTemplate', 'purchaseRequirementTemplate',
'serviceInviteSelect', 'serviceInviteSelect',
'servicePublicSelectAuto', 'servicePublicSelectAuto',
'deptSelfMeetingMinutes', // 部门自行采购会议纪要 'deptSelfMeetingMinutes', // 部门会议纪要
'purchaseRequirement', 'purchaseRequirement',
'meetingMinutes', 'meetingMinutes',
'feasibilityReport', 'feasibilityReport',
@@ -2377,7 +2419,7 @@ const handleSubmit = async () => {
'purchaseRequirementTemplate', 'purchaseRequirementTemplate',
'serviceInviteSelect', 'serviceInviteSelect',
'servicePublicSelectAuto', 'servicePublicSelectAuto',
'deptSelfMeetingMinutes', // 部门自行采购会议纪要 'deptSelfMeetingMinutes', // 部门会议纪要
'purchaseRequirement', 'purchaseRequirement',
'meetingMinutes', 'meetingMinutes',
'feasibilityReport', 'feasibilityReport',
@@ -2477,7 +2519,7 @@ const handleTempStore = async () => {
'purchaseRequirementTemplate', 'purchaseRequirementTemplate',
'serviceInviteSelect', 'serviceInviteSelect',
'servicePublicSelectAuto', 'servicePublicSelectAuto',
'deptSelfMeetingMinutes', // 部门自行采购会议纪要 'deptSelfMeetingMinutes', // 部门会议纪要
'purchaseRequirement', 'purchaseRequirement',
'meetingMinutes', 'meetingMinutes',
'feasibilityReport', 'feasibilityReport',