修改问题

This commit is contained in:
2026-02-02 00:54:24 +08:00
parent abc1f76c8c
commit 4d4ec340a5
2 changed files with 86 additions and 43 deletions

View File

@@ -8,4 +8,4 @@ VITE_OPEN=true
ENV=development
# ADMIN 服务地址
VITE_ADMIN_PROXY_PATH = http://127.0.0.1:9999
VITE_ADMIN_PROXY_PATH = http://scj-v3.zhxy.link/api

View File

@@ -112,7 +112,7 @@
v-model="categoryCodePath"
:options="categoryTreeData"
:props="{ value: 'code', label: 'name', children: 'children', checkStrictly: true }"
placeholder="请选择品目编码(需要显示所有的层级)"
placeholder="请选择品目编码"
clearable
filterable
:show-all-levels="true"
@@ -218,16 +218,32 @@
</el-radio-group>
</el-form-item>
<!-- 服务类网上商城 -->
<template v-if="dataForm.entrustCenterType === 'service_online' && isServiceCategory">
<!-- 服务类网上商城判断品目编码的第一个值是否为C -->
<template v-if="dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath.length > 0 && categoryCodePath[0] === 'C'">
<el-form-item label="是否有供应商" prop="hasSupplier" class="mb20">
<el-radio-group v-model="dataForm.hasSupplier">
<el-radio label="yes"></el-radio>
<el-radio label="no"></el-radio>
</el-radio-group>
</el-form-item>
<!-- 有供应商显示供应商名称输入框 -->
<template v-if="dataForm.hasSupplier === 'yes'">
<el-form-item
label="供应商名称"
prop="suppliers"
class="mb20">
<el-input
v-model="dataForm.suppliers"
type="textarea"
:rows="3"
placeholder="请输入供应商名称,多个供应商请用逗号或分号分隔"
maxlength="500"
show-word-limit />
<div class="template-note mt5">
<el-text type="info" size="small">多个供应商请用逗号,或分号;分隔</el-text>
</div>
</el-form-item>
<el-form-item
v-if="dataForm.hasSupplier === 'yes'"
label="服务商城项目需求模板(直选)"
prop="serviceDirectSelect"
class="mb20">
@@ -244,21 +260,22 @@
:limit="5"
upload-file-url="/purchase/purchasingfiles/upload" />
</el-form-item>
</template>
<el-form-item
v-if="dataForm.hasSupplier === 'no'"
label="服务商城项目需求模板(公开比选)"
prop="servicePublicSelect"
label="服务商城项目需求模板(邀请比选)"
prop="serviceInviteSelect"
class="mb20">
<el-button
type="primary"
link
icon="Download"
@click="downloadTemplate('public_select')"
@click="downloadTemplate('invite_select')"
class="mb10">
下载服务商城项目需求模板公开比选模版
下载服务商城项目需求模板邀请比选模版
</el-button>
<upload-file
v-model="dataForm.servicePublicSelect"
v-model="dataForm.serviceInviteSelect"
:limit="5"
upload-file-url="/purchase/purchasingfiles/upload" />
</el-form-item>
@@ -653,6 +670,7 @@ const dataForm = reactive({
onlineMallMaterials: '',
entrustCenterType: '',
hasSupplier: '',
suppliers: '', // 供应商名称(逗号或分号分隔)
serviceDirectSelect: '',
servicePublicSelect: '',
purchaseRequirementTemplate: '',
@@ -694,9 +712,27 @@ const PURCHASE_TYPE_IDS = {
ENTRUST_CENTER: '981bf052a0b30b028a4a89ae490c9b1d' // 委托采购中心
};
// 判断是否为部门自行采购(是否集采=0
// 判断是否为部门自行采购
// 条件:特殊情况=否 且 集采=否 且 预算金额<5万 → 部门自行采购
// 其他情况 → 学校统一采购
const isDeptPurchase = computed(() => {
return dataForm.isCentralized === '0';
// 检查是否特殊情况是否为"否"id: "1799c07f3a3b8a484f60c495ab9227b6"
const isSpecialNo = isSpecialList.value.find(item => item.id === '1799c07f3a3b8a484f60c495ab9227b6');
const isSpecialNoValue = isSpecialNo ? isSpecialNo.value : null;
// 检查是否集采是否为"否"id: "8e60f8860c1ea2459a41a8ae64fe5518"
const isCentralizedNo = isCentralizedList.value.find(item => item.id === '8e60f8860c1ea2459a41a8ae64fe5518');
const isCentralizedNoValue = isCentralizedNo ? isCentralizedNo.value : null;
// 三个条件必须同时满足:特殊情况=否 且 集采=否 且 预算金额<5万
if (isSpecialNoValue && isCentralizedNoValue &&
dataForm.isSpecial === isSpecialNoValue &&
dataForm.isCentralized === isCentralizedNoValue &&
dataForm.budget && dataForm.budget < 50000) {
return true;
}
return false;
});
// 第二步标题
@@ -751,6 +787,11 @@ const getCategoryInfo = () => {
// 判断是否为服务类
const isServiceCategory = computed(() => {
// 通过 categoryCodePath 判断:第一个字符为 'C' 表示服务类
if (categoryCodePath.value && categoryCodePath.value.length > 0) {
return categoryCodePath.value[0] === 'C';
}
// 备用判断:通过 category 对象判断
const category = getCategoryInfo();
if (!category) return false;
return category.type === 'C' || category.projectType === 'C';
@@ -1010,21 +1051,22 @@ const getIsCentralizedDict = async () => {
isCentralizedList.value = [];
if (res.data && Array.isArray(res.data)) {
isCentralizedList.value = res.data.map((item: any) => ({
id: item.id,
label: item.label || item.dictLabel || item.name,
value: item.value || item.dictValue || item.code
}));
} else {
isCentralizedList.value = [
{ label: '否', value: '0' },
{ label: '政府集中采购', value: '1' },
{ label: '学校集中采购', value: '2' }
{ id: '8e60f8860c1ea2459a41a8ae64fe5518', label: '否', value: '0' },
{ id: '', label: '政府集中采购', value: '1' },
{ id: '', label: '学校集中采购', value: '2' }
];
}
} catch (err) {
isCentralizedList.value = [
{ label: '否', value: '0' },
{ label: '政府集中采购', value: '1' },
{ label: '学校集中采购', value: '2' }
{ id: '8e60f8860c1ea2459a41a8ae64fe5518', label: '否', value: '0' },
{ id: '', label: '政府集中采购', value: '1' },
{ id: '', label: '学校集中采购', value: '2' }
];
}
};
@@ -1036,23 +1078,24 @@ const getIsSpecialDict = async () => {
isSpecialList.value = [];
if (res.data && Array.isArray(res.data)) {
isSpecialList.value = res.data.map((item: any) => ({
id: item.id,
label: item.label || item.dictLabel || item.name,
value: item.value || item.dictValue || item.code
}));
} else {
isSpecialList.value = [
{ label: '否', value: '0' },
{ label: '紧急', value: '1' },
{ label: '单一', value: '2' },
{ label: '进口', value: '3' }
{ id: '1799c07f3a3b8a484f60c495ab9227b6', label: '否', value: '0' },
{ id: '', label: '紧急', value: '1' },
{ id: '', label: '单一', value: '2' },
{ id: '', label: '进口', value: '3' }
];
}
} catch (err) {
isSpecialList.value = [
{ label: '否', value: '0' },
{ label: '紧急', value: '1' },
{ label: '单一', value: '2' },
{ label: '进口', value: '3' }
{ id: '1799c07f3a3b8a484f60c495ab9227b6', label: '否', value: '0' },
{ id: '', label: '紧急', value: '1' },
{ id: '', label: '单一', value: '2' },
{ id: '', label: '进口', value: '3' }
];
}
};