修改问题

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