This commit is contained in:
吴红兵
2026-03-09 00:18:42 +08:00
parent 4b33dc9aab
commit 236e5f5594
2 changed files with 16 additions and 31 deletions

View File

@@ -11,9 +11,9 @@
</div> </div>
</template> </template>
<div v-loading="loading" style="padding-bottom: 20px"> <div v-loading="loading" style="padding-bottom: 20px">
<div class="form-toolbar mb12" style="text-align: right"> <!-- <div class="form-toolbar mb12" style="text-align: right">-->
<el-button type="primary" link icon="QuestionFilled" @click="helpDialogVisible = true"> 帮助 </el-button> <!-- <el-button type="primary" link icon="QuestionFilled" @click="helpDialogVisible = true"> 帮助 </el-button>-->
</div> <!-- </div>-->
<el-form <el-form
ref="formRef" ref="formRef"
:model="dataForm" :model="dataForm"
@@ -375,8 +375,8 @@ upload-file-url="/purchase/purchasingfiles/upload"
<div class="step-title mb12">学校统一采购</div> <div class="step-title mb12">学校统一采购</div>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="8" class="mb12"> <el-col :span="8" class="mb12">
<el-form-item label="采购形式" prop="purchaseMode" :required="isPurchaseModeRequired"> <el-form-item label="组织采购形式" prop="purchaseSchool" :required="isPurchaseSchoolRequired">
<el-radio-group v-model="dataForm.purchaseMode" :disabled="schoolUnifiedPurchaseFormDisabled"> <el-radio-group v-model="dataForm.purchaseSchool" :disabled="schoolUnifiedPurchaseFormDisabled">
<el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value"> <el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value">
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
@@ -841,7 +841,7 @@ upload-file-url="/purchase/purchasingfiles/upload"
</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="!flowSubmitDisabled" type="warning" @click="handleTempStore" :disabled="loading"> 暂存 </el-button> <el-button v-if="!isFlowEmbed && !flowSubmitDisabled" type="warning" @click="handleTempStore" :disabled="loading"> 暂存 </el-button>
<!-- <el-button --> <!-- <el-button -->
<!-- type="primary" --> <!-- type="primary" -->
<!-- @click="handleSubmit" --> <!-- @click="handleSubmit" -->
@@ -963,6 +963,7 @@ const dataForm = reactive({
isSpecial: '', isSpecial: '',
hasAssets: '0', hasAssets: '0',
purchaseMode: '', purchaseMode: '',
purchaseSchool:'',
purchaseType: '', purchaseType: '',
purchaseTypeUnion: '', purchaseTypeUnion: '',
purchaseChannel: '', purchaseChannel: '',
@@ -1199,8 +1200,8 @@ const isPurchaseTypeUnionRequired = computed(() => {
return false; return false;
}); });
// 学校统一采购 - 采购形式是否必填 // 学校统一采购 - 组织采购形式是否必填
const isPurchaseModeRequired = computed(() => { const isPurchaseSchoolRequired = computed(() => {
// 审核阶段:采购中心必填 // 审核阶段:采购中心必填
if (isFlowEmbed.value && isPurchaseCenter.value) { if (isFlowEmbed.value && isPurchaseCenter.value) {
return true; return true;
@@ -1231,20 +1232,7 @@ const showPurchaseDetailBlocks = computed(() => {
return !!isViewMode.value || !!isFlowEmbed.value || !!dataForm.id || isPurchaseTypeDetermined.value; return !!isViewMode.value || !!isFlowEmbed.value || !!dataForm.id || isPurchaseTypeDetermined.value;
}); });
// 学校统一采购时采购形式默认值(不由用户选择):>=100万→政府采购('1')5万~100万且集采=否→学校自主('2')5万~100万且集采=政府集中采购→政府采购('1')5万~100万且集采=学校集中采购→学校自主('2') // 学校统一采购时组织采购形式是否禁用
const schoolUnifiedPurchaseFormDefault = computed(() => {
if (isDeptPurchase.value || dataForm.budget == null) return null;
const budget = Number(dataForm.budget);
if (budget >= BUDGET_GOV_PURCHASE_THRESHOLD.value) return '1'; // 政府采购
if (budget >= BUDGET_DEPT_PURCHASE_THRESHOLD.value && budget < BUDGET_GOV_PURCHASE_THRESHOLD.value) {
if (dataForm.isCentralized === '0') return '2'; // 集采=否 → 学校自主采购
if (dataForm.isCentralized === '1') return '1'; // 政府集中采购 → 政府采购
if (dataForm.isCentralized === '2') return '2'; // 学校集中采购 → 学校自主采购
}
return null;
});
// 学校统一采购时采购形式是否禁用
// 申请阶段:始终可选(根据默认值自动选中后,允许用户自行修改) // 申请阶段:始终可选(根据默认值自动选中后,允许用户自行修改)
// 流程嵌入:采购中心节点可编辑,其他节点只读 // 流程嵌入:采购中心节点可编辑,其他节点只读
const schoolUnifiedPurchaseFormDisabled = computed(() => { const schoolUnifiedPurchaseFormDisabled = computed(() => {
@@ -1587,15 +1575,11 @@ watch(
{ immediate: true } { immediate: true }
); );
// 学校统一采购:采购形式由规则默认选择,随预算与集采变化自动更新 // 学校统一采购:组织采购形式由规则默认选择,随预算与集采变化自动更新
watch( watch(
[() => schoolUnifiedPurchaseFormDefault.value, () => isDeptPurchase.value], [ () => isDeptPurchase.value],
() => { () => {
if (isDeptPurchase.value) return; if (isDeptPurchase.value) return;
const def = schoolUnifiedPurchaseFormDefault.value;
if (def != null && dataForm.purchaseMode !== def) {
dataForm.purchaseMode = def;
}
}, },
{ immediate: true } { immediate: true }
); );
@@ -1745,12 +1729,12 @@ const dataRules = reactive({
}, },
], ],
// 学校统一采购 + 采购中心审核:采购形式必填 // 学校统一采购 + 采购中心审核:采购形式必填
purchaseMode: [ purchaseSchool: [
{ {
validator: (_rule: any, value: string, callback: (e?: Error) => void) => { validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) { if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) {
if (!value || String(value).trim() === '') { if (!value || String(value).trim() === '') {
callback(new Error('请选择采购形式')); callback(new Error('请选择组织采购形式'));
return; return;
} }
} }
@@ -1877,6 +1861,7 @@ async function loadDetail(applyId: string | number) {
isCentralized: detail.isCentralized != null ? String(detail.isCentralized) : '', isCentralized: detail.isCentralized != null ? String(detail.isCentralized) : '',
isSpecial: detail.isSpecial != null ? String(detail.isSpecial) : '', isSpecial: detail.isSpecial != null ? String(detail.isSpecial) : '',
purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '', purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '',
purchaseSchool: detail.purchaseSchool != null ? String(detail.purchaseSchool) : '',
purchaseType: purchaseType:
detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER
? '' ? ''

View File

@@ -55,7 +55,7 @@
采购申请管理 采购申请管理
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button icon="Files" link type="primary"> 采购申请汇总</el-button> <!-- <el-button icon="QuestionFilled" link type="primary"> 采购申请操作说明文档下载</el-button>-->
<el-button icon="FolderAdd" type="primary" @click="handleAdd"> 新增</el-button> <el-button icon="FolderAdd" type="primary" @click="handleAdd"> 新增</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" @queryTable="getDataList" /> <right-toolbar v-model:showSearch="showSearch" class="ml10" @queryTable="getDataList" />
</div> </div>