fix
This commit is contained in:
@@ -182,22 +182,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="!isEntrustCenterChannel">
|
||||
<el-form-item label="采购方式" prop="purchaseType" :required="!isEntrustCenterChannel">
|
||||
<el-col :span="8" class="mb12" v-if="showPurchaseTypeField">
|
||||
<el-form-item label="采购方式" prop="purchaseType" :required="isPurchaseTypeRequired">
|
||||
<el-select
|
||||
v-model="dataForm.purchaseType"
|
||||
placeholder="请选择采购方式"
|
||||
clearable
|
||||
:disabled="
|
||||
isFlowEmbed && isPurchaseCenter ? false : isDeptSelfMallLocked || isAutoSelectPurchaseType || isEntrustCenterChannel
|
||||
"
|
||||
:disabled="isPurchaseTypeDisabled"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="item in purchaseTypeDeptOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<!-- <div v-if="isFlowEmbed && isPurchaseCenter && isEntrustCenterChannel && isAutoSelectPurchaseType" class="template-note mt5">-->
|
||||
<!-- <el-text type="info" size="small">服务网上商城</el-text>-->
|
||||
<!-- </div>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -215,86 +210,12 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.BUSINESS_NEGOTIATION) && isEntrustCenterChannel">
|
||||
<el-form-item label="商务洽谈表" prop="businessNegotiationTable" required>
|
||||
<upload-file
|
||||
v-model="dataForm.businessNegotiationTable"
|
||||
:limit="1"
|
||||
:file-type="['doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']"
|
||||
:data="{ fileType: FILE_TYPE_MAP.businessNegotiationTable }"
|
||||
upload-file-url="/purchase/purchasingfiles/upload"
|
||||
:disabled="flowFieldDisabled('businessNegotiationTable')"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="downloadTemplate('business_negotiation')"
|
||||
style="margin-top: 8px; display: inline-block"
|
||||
>下载商务洽谈表模版
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.MARKET_PURCHASE) && isEntrustCenterChannel">
|
||||
<el-form-item label="市场采购纪要" prop="marketPurchaseMinutes" required>
|
||||
<upload-file
|
||||
v-model="dataForm.marketPurchaseMinutes"
|
||||
:limit="1"
|
||||
:file-type="['doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']"
|
||||
:data="{ fileType: FILE_TYPE_MAP.marketPurchaseMinutes }"
|
||||
upload-file-url="/purchase/purchasingfiles/upload"
|
||||
:disabled="flowFieldDisabled('marketPurchaseMinutes')"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="downloadTemplate('market_purchase_minutes')"
|
||||
style="margin-top: 8px; display: inline-block"
|
||||
>下载市场采购纪要模版
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ONLINE_MALL) && isEntrustCenterChannel">
|
||||
<el-form-item label="网上商城采购相关材料" prop="onlineMallMaterials" required>
|
||||
<upload-file
|
||||
v-model="dataForm.onlineMallMaterials"
|
||||
:limit="1"
|
||||
:file-type="['doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']"
|
||||
:data="{ fileType: FILE_TYPE_MAP.onlineMallMaterials }"
|
||||
upload-file-url="/purchase/purchasingfiles/upload"
|
||||
:disabled="flowFieldDisabled('onlineMallMaterials')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isInquiryPurchaseType && isEntrustCenterChannel">
|
||||
<el-form-item label="询价模板" prop="inquiryTemplate" required>
|
||||
<upload-file
|
||||
v-model="dataForm.inquiryTemplate"
|
||||
:limit="1"
|
||||
:file-type="['doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']"
|
||||
:data="{ fileType: FILE_TYPE_MAP.inquiryTemplate }"
|
||||
upload-file-url="/purchase/purchasingfiles/upload"
|
||||
:disabled="flowFieldDisabled('inquiryTemplate')"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
size="small"
|
||||
@click="downloadTemplate('inquiry')"
|
||||
style="margin-top: 8px; display: inline-block"
|
||||
>下载《部门采购询价模版》模版
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 委托采购中心采购 - 特殊服务品目:显示是否有供应商选择 -->
|
||||
<el-col
|
||||
:span="8"
|
||||
class="mb12"
|
||||
v-if="
|
||||
isEntrustCenterChannel && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C'
|
||||
isEntrustCenterChannel && isSpecialServiceCategory && isServiceCategory && dataForm.categoryCode
|
||||
"
|
||||
>
|
||||
<el-form-item label="是否有供应商" prop="hasSupplier">
|
||||
@@ -304,15 +225,16 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 委托采购中心采购 - 特殊服务品目 + 有供应商:直选模板 -->
|
||||
<el-col
|
||||
:span="8"
|
||||
class="mb12"
|
||||
v-if="
|
||||
isEntrustCenterChannel &&
|
||||
dataForm.entrustCenterType === 'service_online' &&
|
||||
categoryCodePath &&
|
||||
categoryCodePath[0] === 'C' &&
|
||||
dataForm.hasSupplier === '1'
|
||||
isSpecialServiceCategory &&
|
||||
isServiceCategory &&
|
||||
dataForm.hasSupplier === '1' &&
|
||||
dataForm.categoryCode
|
||||
"
|
||||
>
|
||||
<el-form-item label="需求文件" prop="serviceDirectSelect" required>
|
||||
@@ -335,15 +257,16 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 委托采购中心采购 - 特殊服务品目 + 无供应商:公开比选模板 -->
|
||||
<el-col
|
||||
:span="8"
|
||||
class="mb12"
|
||||
v-if="
|
||||
isEntrustCenterChannel &&
|
||||
dataForm.entrustCenterType === 'service_online' &&
|
||||
categoryCodePath &&
|
||||
categoryCodePath[0] === 'C' &&
|
||||
dataForm.hasSupplier === '0'
|
||||
isSpecialServiceCategory &&
|
||||
isServiceCategory &&
|
||||
dataForm.hasSupplier === '0' &&
|
||||
dataForm.categoryCode
|
||||
"
|
||||
>
|
||||
<el-form-item label="需求文件" prop="serviceInviteSelect" required>
|
||||
@@ -366,12 +289,13 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 委托采购中心采购 - 其他情况(非特殊服务品目):默认需求模板 -->
|
||||
<el-col
|
||||
:span="8"
|
||||
class="mb12"
|
||||
v-if="isEntrustCenterChannel && dataForm.entrustCenterType === 'other' && categoryCodePath && categoryCodePath[0] === 'A'"
|
||||
v-if="isEntrustCenterChannel && !isSpecialServiceCategory && dataForm.categoryCode"
|
||||
>
|
||||
<el-form-item label="需求模板" prop="purchaseRequirementTemplate" required>
|
||||
<el-form-item label="需求文件" prop="purchaseRequirementTemplate" required>
|
||||
<upload-file
|
||||
v-model="dataForm.purchaseRequirementTemplate"
|
||||
:limit="1"
|
||||
@@ -387,7 +311,7 @@
|
||||
size="small"
|
||||
@click="downloadTemplate('purchase_requirement')"
|
||||
style="margin-top: 8px; display: inline-block"
|
||||
>下载《表1:需求模板》模版
|
||||
>下载《需求模板》模版
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -462,7 +386,7 @@
|
||||
<div class="step-title mb12">学校统一采购</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="采购形式" prop="purchaseMode">
|
||||
<el-form-item label="采购形式" prop="purchaseMode" :required="isPurchaseModeRequired">
|
||||
<el-radio-group v-model="dataForm.purchaseMode" :disabled="schoolUnifiedPurchaseFormDisabled">
|
||||
<el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value">
|
||||
{{ item.label }}
|
||||
@@ -471,7 +395,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="采购方式" prop="purchaseType">
|
||||
<el-form-item label="采购方式" prop="purchaseType" :required="isPurchaseTypeUnionRequired">
|
||||
<el-select
|
||||
v-model="dataForm.purchaseType"
|
||||
placeholder="请选择采购方式"
|
||||
@@ -1030,10 +954,8 @@ function flowFieldDisabled(_key: string) {
|
||||
|
||||
/** 当前用户是否为申请人(在流程中可编辑) */
|
||||
const isApplicant = computed(() => {
|
||||
|
||||
const stores = useUserInfo();
|
||||
const currentUser = stores.userInfos?.user || {};
|
||||
console.log(currentUser)
|
||||
const stores = useUserInfo();
|
||||
const currentUser = stores.userInfos?.user || {};
|
||||
if (!dataForm.createBy) return false;
|
||||
|
||||
// const stores = useUserInfo();
|
||||
@@ -1248,6 +1170,70 @@ const isDeptPurchase = computed(() => {
|
||||
// 是否为“委托采购中心采购”途径
|
||||
const isEntrustCenterChannel = computed(() => dataForm.purchaseChannel === PURCHASE_CHANNEL.ENTRUST_CENTER);
|
||||
|
||||
// 是否显示采购方式字段
|
||||
// 申请阶段:部门自行采购 + 自行采购 时显示
|
||||
// 审核阶段:采购中心始终可见;其他角色在委托采购中心采购且有值时也可见
|
||||
const showPurchaseTypeField = computed(() => {
|
||||
// 审核阶段:采购中心始终可见
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
return true;
|
||||
}
|
||||
// 审核阶段(非采购中心):委托采购中心采购时,如果已有采购方式值则显示(只读查看)
|
||||
if (isFlowEmbed.value && !isPurchaseCenter.value && isEntrustCenterChannel.value && dataForm.purchaseType) {
|
||||
return true;
|
||||
}
|
||||
// 申请阶段:仅部门自行采购 + 自行采购时显示
|
||||
if (isDeptPurchase.value && !isEntrustCenterChannel.value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 部门自行采购 - 采购方式是否必填
|
||||
const isPurchaseTypeRequired = computed(() => {
|
||||
// 审核阶段:采购中心 + 委托采购中心采购 → 必填
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value && isEntrustCenterChannel.value) {
|
||||
return true;
|
||||
}
|
||||
// 申请阶段:部门自行采购 + 自行采购时必填
|
||||
if (isDeptPurchase.value && !isEntrustCenterChannel.value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 学校统一采购 - 采购方式是否必填
|
||||
const isPurchaseTypeUnionRequired = computed(() => {
|
||||
// 审核阶段:采购中心必填
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 学校统一采购 - 采购形式是否必填
|
||||
const isPurchaseModeRequired = computed(() => {
|
||||
// 审核阶段:采购中心必填
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 采购方式是否禁用
|
||||
const isPurchaseTypeDisabled = computed(() => {
|
||||
// 审核阶段:采购中心可编辑
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
return false;
|
||||
}
|
||||
// 审核阶段(非采购中心):委托采购中心采购时,只读
|
||||
if (isFlowEmbed.value && !isPurchaseCenter.value && isEntrustCenterChannel.value) {
|
||||
return true;
|
||||
}
|
||||
// 申请阶段:根据其他条件禁用
|
||||
return isDeptSelfMallLocked.value || isAutoSelectPurchaseType.value;
|
||||
});
|
||||
|
||||
// 是否已填入“是否特殊情况”“是否集采”“预算金额”,从而能明确是部门自行采购还是学校统一采购(新增时先隐藏采购详情,填完后再显示)
|
||||
const isPurchaseTypeDetermined = computed(() => {
|
||||
return dataForm.isSpecial !== '' && dataForm.isCentralized !== '' && dataForm.budget != null && Number(dataForm.budget) > 0;
|
||||
@@ -1365,6 +1351,18 @@ const isGoodsCategory = computed(() => {
|
||||
return category.type === 'A';
|
||||
});
|
||||
|
||||
// 判断是否为工程类
|
||||
const isEngineeringCategory = computed(() => {
|
||||
// 通过 categoryCodePath 判断:第一个字符为 'B' 表示工程类
|
||||
if (categoryCodePath.value && categoryCodePath.value.length > 0) {
|
||||
return categoryCodePath.value[0] === 'B';
|
||||
}
|
||||
// 备用判断:通过 category 对象判断
|
||||
const category = getCategoryInfo();
|
||||
if (!category) return false;
|
||||
return category.type === 'B';
|
||||
});
|
||||
|
||||
// 判断是否为特殊服务类目(isMallService=1、isProjectService=1)
|
||||
const isSpecialServiceCategory = computed(() => {
|
||||
const category = getCategoryInfo();
|
||||
@@ -1397,7 +1395,7 @@ const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
|
||||
return 'other';
|
||||
};
|
||||
|
||||
// 监听采购途径变化,清理所有与采购方式相关的材料字段
|
||||
// 监听采购途径变化,清理所有与采购方式相关的材料字段,同时如果已选择品目则重新计算entrustCenterType
|
||||
watch(
|
||||
() => dataForm.purchaseChannel,
|
||||
(newChannel, oldChannel) => {
|
||||
@@ -1426,6 +1424,16 @@ watch(
|
||||
dataForm.purchaseRequirementTemplate = '';
|
||||
dataForm.hasSupplier = '0';
|
||||
dataForm.suppliers = '';
|
||||
|
||||
// 如果切换到委托采购中心采购且已选择品目,重新计算entrustCenterType
|
||||
if (newChannel === PURCHASE_CHANNEL.ENTRUST_CENTER && dataForm.categoryCode) {
|
||||
nextTick(() => {
|
||||
const type = calcEntrustCenterType();
|
||||
if (type) {
|
||||
dataForm.entrustCenterType = type;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
@@ -1669,17 +1677,32 @@ const dataRules = reactive({
|
||||
purchaseType: [
|
||||
{
|
||||
validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
|
||||
// 学校统一采购:申请阶段不要求采购方式,由审批环节采购中心补充
|
||||
// 学校统一采购 + 采购中心审核:采购方式必填
|
||||
if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择采购方式'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 学校统一采购 + 申请阶段:不校验采购方式(由审批环节采购中心补充)
|
||||
if (!isDeptPurchase.value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
// 部门自行采购且采购途径为"委托采购中心采购"并且为申请阶段:此处不校验采购方式
|
||||
// 部门自行采购 + 委托采购中心采购 + 采购中心审核:采购方式必填
|
||||
if (isDeptPurchase.value && isEntrustCenterChannel.value && isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择采购方式'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 部门自行采购 + 委托采购中心采购 + 申请阶段:不校验(由审核环节选择)
|
||||
if (isEntrustCenterChannel.value && !isFlowEmbed.value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!value || String(value).trim() === '') {
|
||||
// 部门自行采购 + 自行采购:必填
|
||||
if (isDeptPurchase.value && !isEntrustCenterChannel.value && (!value || String(value).trim() === '')) {
|
||||
callback(new Error('请选择采购方式'));
|
||||
return;
|
||||
}
|
||||
@@ -1688,6 +1711,21 @@ const dataRules = reactive({
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
// 学校统一采购 + 采购中心审核:采购形式必填
|
||||
purchaseMode: [
|
||||
{
|
||||
validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
|
||||
if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择采购形式'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
// 学校统一采购时必填
|
||||
deptClassifyUserId: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user