tijiao
This commit is contained in:
@@ -147,7 +147,7 @@
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in purchaseTypeDeptList"
|
||||
:key="item.id"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
@@ -170,6 +170,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.businessNegotiationTable"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -190,6 +191,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.marketPurchaseMinutes"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -202,11 +204,8 @@
|
||||
<upload-file
|
||||
v-model="dataForm.onlineMallMaterials"
|
||||
:limit="1"
|
||||
accept=".zip"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
<div class="template-note mt5">
|
||||
<el-text type="info" size="small">请上传zip格式的压缩包</el-text>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 委托采购中心 -->
|
||||
@@ -258,6 +257,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.serviceDirectSelect"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -277,6 +277,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.serviceInviteSelect"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -298,6 +299,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.purchaseRequirementTemplate"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -339,6 +341,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.serviceInviteSelect"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -359,9 +362,20 @@
|
||||
<upload-file
|
||||
v-model="dataForm.servicePublicSelectAuto"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<!-- 其他材料(zip压缩包) -->
|
||||
<el-form-item label="其他材料" prop="otherMaterials" class="mb20">
|
||||
<upload-file
|
||||
v-model="dataForm.otherMaterials"
|
||||
:limit="5"
|
||||
:file-type="['zip']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
<div class="template-note">支持上传zip格式的压缩包文件</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 分支二:学校统一采购 -->
|
||||
@@ -395,6 +409,40 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 业务分管处室 -->
|
||||
<el-form-item label="业务分管处室" prop="deptClassifyId" class="mb20">
|
||||
<el-select
|
||||
v-model="dataForm.deptClassifyId"
|
||||
placeholder="请选择业务分管处室"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleBusinessDeptChange"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in businessDeptList"
|
||||
:key="item.id"
|
||||
:label="item.deptName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 分管校领导 -->
|
||||
<el-form-item label="分管校领导" prop="schoolLeaderUserId" class="mb20">
|
||||
<el-select
|
||||
v-model="dataForm.schoolLeaderUserId"
|
||||
placeholder="请选择分管校领导"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleSchoolLeaderChange"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolLeaderList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 金额>=30万,显示可行性论证报告和会议纪要 -->
|
||||
<template v-if="dataForm.budget && dataForm.budget >= 300000">
|
||||
<el-form-item
|
||||
@@ -412,12 +460,14 @@
|
||||
<upload-file
|
||||
v-model="dataForm.feasibilityReport"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会议纪要" prop="meetingMinutes" class="mb20">
|
||||
<upload-file
|
||||
v-model="dataForm.meetingMinutes"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -428,6 +478,7 @@
|
||||
<upload-file
|
||||
v-model="dataForm.meetingMinutesUrgent"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -449,12 +500,14 @@
|
||||
<upload-file
|
||||
v-model="dataForm.singleSourceProof"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesSingle" class="mb20">
|
||||
<upload-file
|
||||
v-model="dataForm.meetingMinutesSingle"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -476,32 +529,18 @@
|
||||
<upload-file
|
||||
v-model="dataForm.importApplication"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesImport" class="mb20">
|
||||
<upload-file
|
||||
v-model="dataForm.meetingMinutesImport"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<!-- 需求文件(默认) -->
|
||||
<el-form-item label="需求文件" prop="purchaseRequirement" class="mb20">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
@click="downloadTemplate('purchase_requirement')"
|
||||
class="mb10">
|
||||
下载《采购需求填报模板》模版
|
||||
</el-button>
|
||||
<upload-file
|
||||
v-model="dataForm.purchaseRequirement"
|
||||
:limit="5"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 特殊规则:5万<=金额<40万,服务类目(isMallService=1、isProjectService=1),自动使用邀请比选模版 -->
|
||||
<template v-if="showAutoInviteSelectSchool">
|
||||
<el-form-item label="是否有推荐供应商" prop="hasRecommendedSupplierSchool" class="mb20">
|
||||
@@ -510,9 +549,9 @@
|
||||
<el-radio label="no">无</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 有推荐供应商:显示推荐供应商输入框和邀请比选模板 -->
|
||||
<template v-if="dataForm.hasRecommendedSupplierSchool === 'yes'">
|
||||
<!-- 有推荐供应商:显示推荐供应商输入框 -->
|
||||
<el-form-item
|
||||
v-if="dataForm.hasRecommendedSupplierSchool === 'yes'"
|
||||
label="推荐供应商"
|
||||
prop="recommendedSuppliersSchool"
|
||||
class="mb20">
|
||||
@@ -526,10 +565,15 @@
|
||||
<el-text type="info" size="small">请输入三家供应商名称,用逗号或分号分隔</el-text>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="服务商城项目需求模板(邀请比选)"
|
||||
prop="serviceInviteSelectSchool"
|
||||
class="mb20">
|
||||
</template>
|
||||
|
||||
<!-- 需求文件 -->
|
||||
<el-form-item label="需求文件" :prop="getRequirementFileProp()" class="mb20">
|
||||
<!-- 特殊规则:5万<=金额<40万,服务类目(isMallService=1、isProjectService=1),自动使用邀请比选模版 -->
|
||||
<template v-if="showAutoInviteSelectSchool">
|
||||
<!-- 有推荐供应商:显示邀请比选模板 -->
|
||||
<template v-if="dataForm.hasRecommendedSupplierSchool === 'yes'">
|
||||
<div class="mb10">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@@ -538,18 +582,16 @@
|
||||
class="mb10">
|
||||
下载《服务商城项目需求模板(邀请比选)》模版
|
||||
</el-button>
|
||||
</div>
|
||||
<upload-file
|
||||
v-model="dataForm.serviceInviteSelectSchool"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<!-- 无推荐供应商:显示公开比选模板 -->
|
||||
<el-form-item
|
||||
v-if="dataForm.hasRecommendedSupplierSchool === 'no'"
|
||||
label="服务商城项目需求模板(公开比选)"
|
||||
prop="servicePublicSelectSchoolAuto"
|
||||
class="mb20">
|
||||
<template v-else-if="dataForm.hasRecommendedSupplierSchool === 'no'">
|
||||
<div class="mb10">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@@ -558,19 +600,18 @@
|
||||
class="mb10">
|
||||
下载《服务商城项目需求模板(公开比选)》模版
|
||||
</el-button>
|
||||
</div>
|
||||
<upload-file
|
||||
v-model="dataForm.servicePublicSelectSchoolAuto"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- 特殊规则:40万<=金额<100万,服务类目,自动使用公开比选需求模版 -->
|
||||
<el-form-item
|
||||
v-if="showAutoPublicSelect"
|
||||
label="服务商城项目需求模板(公开比选)"
|
||||
prop="servicePublicSelectSchool"
|
||||
class="mb20">
|
||||
<template v-else-if="showAutoPublicSelect">
|
||||
<div class="mb10">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@@ -579,10 +620,32 @@
|
||||
class="mb10">
|
||||
下载《服务商城项目需求模板(公开比选)》模版
|
||||
</el-button>
|
||||
</div>
|
||||
<upload-file
|
||||
v-model="dataForm.servicePublicSelectSchool"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</template>
|
||||
|
||||
<!-- 默认:采购需求填报模板 -->
|
||||
<template v-else>
|
||||
<div class="mb10">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
@click="downloadTemplate('purchase_requirement')"
|
||||
class="mb10">
|
||||
下载《采购需求填报模板》模版
|
||||
</el-button>
|
||||
</div>
|
||||
<upload-file
|
||||
v-model="dataForm.purchaseRequirement"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</template>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 金额>=100万,政府采购意向表 -->
|
||||
@@ -594,8 +657,19 @@
|
||||
<upload-file
|
||||
v-model="dataForm.governmentPurchaseIntent"
|
||||
:limit="5"
|
||||
:file-type="['doc', 'docx', 'pdf']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 其他材料(zip压缩包) -->
|
||||
<el-form-item label="其他材料" prop="otherMaterials" class="mb20">
|
||||
<upload-file
|
||||
v-model="dataForm.otherMaterials"
|
||||
:limit="5"
|
||||
:file-type="['zip']"
|
||||
upload-file-url="/purchase/purchasingfiles/upload" />
|
||||
<div class="template-note">支持上传zip格式的压缩包文件</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -651,6 +725,8 @@ import { useMessage } from '/@/hooks/message';
|
||||
import UploadFile from '/@/components/Upload/index.vue';
|
||||
import other from '/@/utils/other';
|
||||
import { Document, Download } from '@element-plus/icons-vue';
|
||||
import { fetchList as getBusinessDeptList } from '/@/api/purchase/purchasingBusinessDept';
|
||||
import { getPage as getSchoolLeaderPage } from '/@/api/finance/purchasingschoolleader';
|
||||
|
||||
// 路由
|
||||
const router = useRouter();
|
||||
@@ -704,6 +780,13 @@ const dataForm = reactive({
|
||||
recommendedSuppliersSchool: '',
|
||||
serviceInviteSelectSchool: '',
|
||||
servicePublicSelectSchoolAuto: '',
|
||||
// 业务分管处室和分管校领导
|
||||
deptClassifyId: '',
|
||||
deptClassifyName: '',
|
||||
schoolLeaderUserId: '',
|
||||
schoolLeaderName: '',
|
||||
// 其他材料(zip压缩包)
|
||||
otherMaterials: '',
|
||||
});
|
||||
const categoryTreeData = ref<any[]>([]);
|
||||
const categoryCodePath = ref<string[]>([]); // 级联选择器的路径数组
|
||||
@@ -713,6 +796,8 @@ const isSpecialList = ref<any[]>([]);
|
||||
const purchaseTypeDeptList = ref<any[]>([]);
|
||||
const purchaseModeSchoolList = ref<any[]>([]);
|
||||
const purchaseTypeUnionList = ref<any[]>([]);
|
||||
const businessDeptList = ref<any[]>([]);
|
||||
const schoolLeaderList = ref<any[]>([]);
|
||||
const loading = ref(false);
|
||||
|
||||
// 采购方式ID常量
|
||||
@@ -727,12 +812,16 @@ const PURCHASE_TYPE_IDS = {
|
||||
// 条件:特殊情况=否 且 集采=否 且 预算金额<5万 → 部门自行采购
|
||||
// 其他情况 → 学校统一采购
|
||||
const isDeptPurchase = computed(() => {
|
||||
// 检查是否特殊情况是否为"否"(id: "1799c07f3a3b8a484f60c495ab9227b6")
|
||||
const isSpecialNo = isSpecialList.value.find(item => item.id === '1799c07f3a3b8a484f60c495ab9227b6');
|
||||
// 检查是否特殊情况是否为"否"(通过 id 或 value 查找,value 为 '0')
|
||||
const isSpecialNo = isSpecialList.value.find(item =>
|
||||
item.id === '1799c07f3a3b8a484f60c495ab9227b6' || item.value === '0'
|
||||
);
|
||||
const isSpecialNoValue = isSpecialNo ? isSpecialNo.value : null;
|
||||
|
||||
// 检查是否集采是否为"否"(id: "8e60f8860c1ea2459a41a8ae64fe5518")
|
||||
const isCentralizedNo = isCentralizedList.value.find(item => item.id === '8e60f8860c1ea2459a41a8ae64fe5518');
|
||||
// 检查是否集采是否为"否"(通过 id 或 value 查找,value 为 '0')
|
||||
const isCentralizedNo = isCentralizedList.value.find(item =>
|
||||
item.id === '8e60f8860c1ea2459a41a8ae64fe5518' || item.value === '0'
|
||||
);
|
||||
const isCentralizedNoValue = isCentralizedNo ? isCentralizedNo.value : null;
|
||||
|
||||
// 三个条件必须同时满足:特殊情况=否 且 集采=否 且 预算金额<5万
|
||||
@@ -746,9 +835,12 @@ const isDeptPurchase = computed(() => {
|
||||
return false;
|
||||
});
|
||||
|
||||
// 判断是否为紧急情况(ID: 6509b59e24c1c6568f4277e544f3e55e)
|
||||
// 判断是否为紧急情况(通过 id 或 value 查找,value 为 '1')
|
||||
const isUrgentSpecial = computed(() => {
|
||||
const urgentItem = isSpecialList.value.find(item => item.id === '6509b59e24c1c6568f4277e544f3e55e');
|
||||
const urgentItem = isSpecialList.value.find(item =>
|
||||
item.id === '6509b59e24c1c6568f4277e544f3e55e' ||
|
||||
(item.value === '1' && (item.label?.includes('紧急') || item.dictLabel?.includes('紧急')))
|
||||
);
|
||||
if (!urgentItem) return false;
|
||||
return dataForm.isSpecial === urgentItem.value;
|
||||
});
|
||||
@@ -860,6 +952,20 @@ const showAutoPublicSelect = computed(() => {
|
||||
return budget >= 400000 && budget < 1000000 && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 获取需求文件的 prop 名称(用于表单验证)
|
||||
const getRequirementFileProp = () => {
|
||||
if (showAutoInviteSelectSchool.value) {
|
||||
if (dataForm.hasRecommendedSupplierSchool === 'yes') {
|
||||
return 'serviceInviteSelectSchool';
|
||||
} else if (dataForm.hasRecommendedSupplierSchool === 'no') {
|
||||
return 'servicePublicSelectSchoolAuto';
|
||||
}
|
||||
} else if (showAutoPublicSelect.value) {
|
||||
return 'servicePublicSelectSchool';
|
||||
}
|
||||
return 'purchaseRequirement';
|
||||
};
|
||||
|
||||
// 判断学校统一采购是否需要自动设置采购方式(5万<=金额<40万,服务类目,特殊服务类目)
|
||||
const isAutoSelectPurchaseTypeUnion = computed(() => {
|
||||
if (isDeptPurchase.value) return false;
|
||||
@@ -872,11 +978,13 @@ const isAutoSelectPurchaseTypeUnion = computed(() => {
|
||||
watch([() => dataForm.categoryCode, () => dataForm.budget], () => {
|
||||
// 部门自行采购:自动设置网上商城
|
||||
if (isAutoSelectPurchaseType.value && isDeptPurchase.value) {
|
||||
// 查找网上商城选项(通过id或value匹配)
|
||||
const onlineMallOption = purchaseTypeDeptList.value.find(item =>
|
||||
item.id === PURCHASE_TYPE_IDS.ONLINE_MALL ||
|
||||
item.value === PURCHASE_TYPE_IDS.ONLINE_MALL
|
||||
);
|
||||
// 查找网上商城选项(通过 id 或 label 匹配)
|
||||
const onlineMallOption = purchaseTypeDeptList.value.find(item => {
|
||||
const label = item.label || item.dictLabel || item.name || '';
|
||||
return item.id === PURCHASE_TYPE_IDS.ONLINE_MALL ||
|
||||
item.value === PURCHASE_TYPE_IDS.ONLINE_MALL ||
|
||||
label.includes('网上商城') || label.includes('商城');
|
||||
});
|
||||
if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) {
|
||||
dataForm.purchaseType = onlineMallOption.value;
|
||||
}
|
||||
@@ -1036,6 +1144,7 @@ const getFundSourceDict = async () => {
|
||||
fundSourceList.value = [];
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
fundSourceList.value = res.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
@@ -1134,7 +1243,7 @@ const getPurchaseTypeDeptDict = async () => {
|
||||
purchaseTypeDeptList.value = res.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.id || item.dictValue || item.code
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -1149,6 +1258,7 @@ const getPurchaseModeSchoolDict = async () => {
|
||||
purchaseModeSchoolList.value = [];
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
purchaseModeSchoolList.value = res.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
@@ -1173,6 +1283,7 @@ const getPurchaseTypeUnionDict = async () => {
|
||||
purchaseTypeUnionList.value = [];
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
purchaseTypeUnionList.value = res.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
@@ -1182,6 +1293,72 @@ const getPurchaseTypeUnionDict = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 获取业务分管处室列表
|
||||
const getBusinessDeptListData = async () => {
|
||||
try {
|
||||
const res = await getBusinessDeptList({ records: 1000 }); // 获取所有数据
|
||||
if (res.data && res.data.records) {
|
||||
businessDeptList.value = res.data.records.map((item: any) => ({
|
||||
id: item.id,
|
||||
deptId: item.deptId,
|
||||
deptName: item.deptName,
|
||||
userId: item.userId,
|
||||
name: item.name,
|
||||
username: item.username
|
||||
}));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取业务分管处室列表失败:', err);
|
||||
businessDeptList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 获取分管校领导列表
|
||||
const getSchoolLeaderListData = async () => {
|
||||
try {
|
||||
const res = await getSchoolLeaderPage({ records: 1000 }); // 获取所有数据
|
||||
if (res.data && res.data.records) {
|
||||
schoolLeaderList.value = res.data.records.map((item: any) => ({
|
||||
id: item.id,
|
||||
userId: item.userId,
|
||||
name: item.name,
|
||||
username: item.username
|
||||
}));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取分管校领导列表失败:', err);
|
||||
schoolLeaderList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 处理业务分管处室选择变化
|
||||
const handleBusinessDeptChange = (value: string) => {
|
||||
if (value) {
|
||||
const selected = businessDeptList.value.find(item => item.id === value);
|
||||
if (selected) {
|
||||
dataForm.deptClassifyId = selected.id;
|
||||
dataForm.deptClassifyName = selected.deptName || '';
|
||||
}
|
||||
} else {
|
||||
dataForm.deptClassifyId = '';
|
||||
dataForm.deptClassifyName = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 处理分管校领导选择变化
|
||||
const handleSchoolLeaderChange = (value: string) => {
|
||||
if (value) {
|
||||
const selected = schoolLeaderList.value.find(item => item.userId === value);
|
||||
if (selected) {
|
||||
dataForm.schoolLeaderUserId = selected.userId;
|
||||
dataForm.schoolLeaderName = selected.name || '';
|
||||
}
|
||||
} else {
|
||||
dataForm.schoolLeaderUserId = '';
|
||||
dataForm.schoolLeaderName = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 处理文件ID字符串转数组
|
||||
const getFileIdsArray = (fileIds: string | string[]): string[] => {
|
||||
if (!fileIds) return [];
|
||||
@@ -1234,7 +1411,7 @@ const handleSubmit = async () => {
|
||||
'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement',
|
||||
'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent',
|
||||
'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication',
|
||||
'governmentPurchaseIntent', 'servicePublicSelectSchool'
|
||||
'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials'
|
||||
];
|
||||
|
||||
fileFields.forEach(field => {
|
||||
@@ -1283,7 +1460,7 @@ const handleTempStore = async () => {
|
||||
'serviceInviteSelect', 'servicePublicSelectAuto', 'purchaseRequirement',
|
||||
'meetingMinutes', 'feasibilityReport', 'meetingMinutesUrgent',
|
||||
'meetingMinutesSingle', 'meetingMinutesImport', 'singleSourceProof', 'importApplication',
|
||||
'governmentPurchaseIntent', 'servicePublicSelectSchool'
|
||||
'governmentPurchaseIntent', 'servicePublicSelectSchool', 'otherMaterials'
|
||||
];
|
||||
|
||||
fileFields.forEach(field => {
|
||||
@@ -1366,7 +1543,26 @@ onMounted(async () => {
|
||||
getPurchaseTypeDeptDict(),
|
||||
getPurchaseModeSchoolDict(),
|
||||
getPurchaseTypeUnionDict(),
|
||||
getBusinessDeptListData(),
|
||||
getSchoolLeaderListData(),
|
||||
]);
|
||||
|
||||
// 新增模式下设置默认值(只有在没有 id 的情况下才设置)
|
||||
if (!dataForm.id) {
|
||||
// 填报日期默认为当天
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
dataForm.applyDate = `${year}-${month}-${day}`;
|
||||
|
||||
// 是否集采默认为"否"(value: '0')
|
||||
dataForm.isCentralized = '0';
|
||||
|
||||
// 是否特殊情况默认为"否"(value: '0')
|
||||
dataForm.isSpecial = '0';
|
||||
}
|
||||
|
||||
// 如果有 categoryCode,设置回显路径
|
||||
if (dataForm.categoryCode) {
|
||||
setCategoryCodePath();
|
||||
|
||||
Reference in New Issue
Block a user