采购申请调整
This commit is contained in:
48
src/api/finance/purchasingtemplate.ts
Normal file
48
src/api/finance/purchasingtemplate.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 采购模板管理 API
|
||||
*/
|
||||
|
||||
import request from '/@/utils/request';
|
||||
|
||||
/**
|
||||
* 模板列表
|
||||
*/
|
||||
export function listTemplates(params?: any) {
|
||||
return request({
|
||||
url: '/purchase/purchasingtemplate/list',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传 / 覆盖模板
|
||||
* @param formData 含 file、type 的 FormData
|
||||
*/
|
||||
export function uploadTemplate(formData: FormData) {
|
||||
return request({
|
||||
url: '/purchase/purchasingtemplate/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板下载地址
|
||||
*/
|
||||
export function getTemplateDownloadUrl(type: string) {
|
||||
return `/purchase/purchasingtemplate/download?type=${encodeURIComponent(type)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新模板类型名称
|
||||
*/
|
||||
export function updateTemplateTitle(data: { id: number | string; templateTitle: string }) {
|
||||
return request({
|
||||
url: '/purchase/purchasingtemplate/updateTitle',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<template #header v-if="isEditMode">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
@@ -19,112 +19,51 @@
|
||||
:disabled="isViewMode || flowFormDisabled"
|
||||
class="compact-form">
|
||||
|
||||
<!-- 基本信息(与采购详情同页展示) -->
|
||||
<div>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<!-- 基本信息(三列紧凑) -->
|
||||
<div class="form-section-compact">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="采购项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="dataForm.projectName"
|
||||
placeholder="请输入采购项目名称"
|
||||
clearable
|
||||
:disabled="flowFieldDisabled('projectName')" />
|
||||
<el-input v-model="dataForm.projectName" placeholder="请输入采购项目名称" clearable :disabled="flowFieldDisabled('projectName')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="填报日期" prop="applyDate">
|
||||
<el-date-picker
|
||||
v-model="dataForm.applyDate"
|
||||
type="date"
|
||||
placeholder="请选择填报日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('applyDate')" />
|
||||
<el-date-picker v-model="dataForm.applyDate" type="date" placeholder="请选择填报日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100%" :disabled="flowFieldDisabled('applyDate')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="资金来源" prop="fundSource">
|
||||
<el-select
|
||||
v-model="dataForm.fundSource"
|
||||
placeholder="请选择资金来源"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('fundSource')">
|
||||
<el-option
|
||||
v-for="item in fundSourceList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
<el-select v-model="dataForm.fundSource" placeholder="请选择资金来源" clearable style="width: 100%" :disabled="flowFieldDisabled('fundSource')">
|
||||
<el-option v-for="item in fundSourceList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="预算金额" prop="budget">
|
||||
<div class="budget-yuan-wrap">
|
||||
<el-input-number
|
||||
v-model="dataForm.budget"
|
||||
:min="0.01"
|
||||
:precision="2"
|
||||
placeholder="请输入金额"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('budget')" />
|
||||
<el-input-number v-model="dataForm.budget" :min="0.01" :precision="2" placeholder="请输入金额" :controls="false" style="width: 100%" :disabled="flowFieldDisabled('budget')" />
|
||||
<span class="budget-unit">元</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="是否集采" prop="isCentralized">
|
||||
<el-select
|
||||
v-model="dataForm.isCentralized"
|
||||
placeholder="请选择是否集采"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('isCentralized')">
|
||||
<el-option
|
||||
v-for="item in isCentralizedList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
<el-select v-model="dataForm.isCentralized" placeholder="请选择是否集采" clearable style="width: 100%" :disabled="flowFieldDisabled('isCentralized')">
|
||||
<el-option v-for="item in isCentralizedList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="是否特殊情况" prop="isSpecial">
|
||||
<el-select
|
||||
v-model="dataForm.isSpecial"
|
||||
placeholder="请选择是否特殊情况"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('isSpecial')">
|
||||
<el-option
|
||||
v-for="item in isSpecialList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
<el-select v-model="dataForm.isSpecial" placeholder="请选择是否特殊情况" clearable style="width: 100%" :disabled="flowFieldDisabled('isSpecial')">
|
||||
<el-option v-for="item in isSpecialList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb16">
|
||||
<el-col :span="24" class="mb12">
|
||||
<el-form-item label="品目编码" prop="categoryCode">
|
||||
<el-cascader
|
||||
v-model="categoryCodePath"
|
||||
:options="categoryTreeData"
|
||||
:props="{ value: 'code', label: 'name', children: 'children', checkStrictly: true }"
|
||||
placeholder="请选择品目编码"
|
||||
clearable
|
||||
filterable
|
||||
:show-all-levels="true"
|
||||
style="width: 100%"
|
||||
:disabled="flowFieldDisabled('categoryCode')"
|
||||
@change="handleCategoryChange" />
|
||||
<el-cascader v-model="categoryCodePath" :options="categoryTreeData" :props="{ value: 'code', label: 'name', children: 'children', checkStrictly: false }" placeholder="请选择品目编码(仅最后一级)" clearable filterable :show-all-levels="true" style="width: 100%" :disabled="flowFieldDisabled('categoryCode')" @change="handleCategoryChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -135,24 +74,19 @@
|
||||
<el-alert v-if="!showPurchaseDetailBlocks" type="info" :closable="false" class="mb16" show-icon>
|
||||
请先填写上方「是否特殊情况」「是否集采」「预算金额」,系统将根据填写结果展示「部门自行采购」或「学校统一采购」表单。
|
||||
</el-alert>
|
||||
<!-- 分支一:部门自行采购(单行两列流式布局,条件显示的项自动填满两列) -->
|
||||
<div class="mb20" v-if="showPurchaseDetailBlocks && isDeptPurchase">
|
||||
<div class="step-title mb16">部门自行采购</div>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="采购内容" prop="projectContent" class="mb16">
|
||||
<el-input
|
||||
v-model="dataForm.projectContent"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
:maxlength="1000"
|
||||
show-word-limit
|
||||
placeholder="请输入采购内容(限制1000字)"
|
||||
clearable
|
||||
:disabled="flowFieldDisabled('projectContent')" />
|
||||
<!-- 分支一:部门自行采购(三列紧凑,textarea 单独一行) -->
|
||||
<div class="mb20 form-section-compact" v-if="showPurchaseDetailBlocks && isDeptPurchase">
|
||||
<div class="step-title mb12">部门自行采购</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="采购途径" prop="purchaseChannel">
|
||||
<el-select v-model="dataForm.purchaseChannel" placeholder="请选择采购途径" clearable :disabled="flowFieldDisabled('purchaseChannel')" style="width: 100%">
|
||||
<el-option :label="'自行采购'" :value="PURCHASE_CHANNEL.SELF" />
|
||||
<el-option :label="'委托采购中心采购'" :value="PURCHASE_CHANNEL.ENTRUST_CENTER" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="!isEntrustCenterChannel || (isFlowEmbed && isPurchaseCenter)">
|
||||
<el-form-item label="采购方式" prop="purchaseType" required class="mb16">
|
||||
<el-select
|
||||
v-model="dataForm.purchaseType"
|
||||
@@ -166,182 +100,69 @@
|
||||
: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>
|
||||
<el-col :span="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.BUSINESS_NEGOTIATION)">
|
||||
<el-form-item label="商务洽谈表" prop="businessNegotiationTable" required class="mb16">
|
||||
<el-col :span="24" class="mb12">
|
||||
<el-form-item label="采购内容" prop="projectContent">
|
||||
<el-input v-model="dataForm.projectContent" type="textarea" :rows="3" :maxlength="1000" show-word-limit placeholder="请输入采购内容(限制1000字)" clearable :disabled="flowFieldDisabled('projectContent')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.BUSINESS_NEGOTIATION)">
|
||||
<el-form-item label="商务洽谈表" prop="businessNegotiationTable" required>
|
||||
<upload-file v-model="dataForm.businessNegotiationTable" :limit="1" :file-type="['doc', 'docx', 'pdf']" :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="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.MARKET_PURCHASE)">
|
||||
<el-form-item label="市场采购纪要" prop="marketPurchaseMinutes" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.MARKET_PURCHASE)">
|
||||
<el-form-item label="市场采购纪要" prop="marketPurchaseMinutes" required>
|
||||
<upload-file v-model="dataForm.marketPurchaseMinutes" :limit="1" :file-type="['doc', 'docx', 'pdf']" :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="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ONLINE_MALL)">
|
||||
<el-form-item label="网上商城采购相关材料" prop="onlineMallMaterials" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ONLINE_MALL)">
|
||||
<el-form-item label="网上商城采购相关材料" prop="onlineMallMaterials" required>
|
||||
<upload-file v-model="dataForm.onlineMallMaterials" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.onlineMallMaterials }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('onlineMallMaterials')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isInquiryPurchaseType">
|
||||
<el-form-item label="询价模板" prop="inquiryTemplate" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isInquiryPurchaseType">
|
||||
<el-form-item label="询价模板" prop="inquiryTemplate" required>
|
||||
<upload-file v-model="dataForm.inquiryTemplate" :limit="1" :file-type="['doc', 'docx', 'pdf']" :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="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER)">
|
||||
<el-form-item label="委托采购中心方式" prop="entrustCenterType" class="mb16">
|
||||
<el-radio-group v-model="dataForm.entrustCenterType" disabled>
|
||||
<el-radio label="service_online">服务类网上商城</el-radio>
|
||||
<el-radio label="other">其他方式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="12"
|
||||
class="mb16"
|
||||
v-if="
|
||||
isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER) &&
|
||||
dataForm.entrustCenterType === 'service_online' &&
|
||||
categoryCodePath &&
|
||||
categoryCodePath[0] === 'C'
|
||||
"
|
||||
>
|
||||
<el-form-item label="是否有供应商" prop="hasSupplier" class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isEntrustCenterChannel && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C'">
|
||||
<el-form-item label="是否有供应商" prop="hasSupplier">
|
||||
<el-radio-group v-model="dataForm.hasSupplier" :disabled="flowFieldDisabled('hasSupplier')">
|
||||
<el-radio label="1">有</el-radio>
|
||||
<el-radio label="0">无</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER) && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C' && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="需求文件" prop="serviceDirectSelect" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isEntrustCenterChannel && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C' && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="需求文件" prop="serviceDirectSelect" required>
|
||||
<upload-file v-model="dataForm.serviceDirectSelect" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.serviceDirectSelect }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('serviceDirectSelect')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('direct_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(直选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER) && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C' && dataForm.hasSupplier === '0'">
|
||||
<el-form-item label="需求文件" prop="serviceInviteSelect" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isEntrustCenterChannel && dataForm.entrustCenterType === 'service_online' && categoryCodePath && categoryCodePath[0] === 'C' && dataForm.hasSupplier === '0'">
|
||||
<el-form-item label="需求文件" prop="serviceInviteSelect" required>
|
||||
<upload-file v-model="dataForm.serviceInviteSelect" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.serviceInviteSelect }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('serviceInviteSelect')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('public_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(公开比选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER) && dataForm.entrustCenterType === 'other' && categoryCodePath && categoryCodePath[0] === 'A'">
|
||||
<el-form-item label="需求模板" prop="purchaseRequirementTemplate" required class="mb16">
|
||||
<el-col :span="8" class="mb12" v-if="isEntrustCenterChannel && dataForm.entrustCenterType === 'other' && categoryCodePath && categoryCodePath[0] === 'A'">
|
||||
<el-form-item label="需求模板" prop="purchaseRequirementTemplate" required>
|
||||
<upload-file v-model="dataForm.purchaseRequirementTemplate" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.purchaseRequirementTemplate }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('purchaseRequirementTemplate')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('purchase_requirement')" style="margin-top: 8px; display: inline-block">下载《表1:需求模板》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="showAutoInviteSelect">
|
||||
<el-form-item label="是否有推荐供应商" prop="hasSupplier" class="mb16">
|
||||
<el-radio-group v-model="dataForm.hasSupplier" :disabled="flowFieldDisabled('hasSupplier')">
|
||||
<el-radio label="1">有</el-radio>
|
||||
<el-radio label="0">无</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" class="mb16" v-if="showAutoInviteSelect && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="推荐供应商" prop="suppliers" class="mb16">
|
||||
<el-input v-model="dataForm.suppliers" placeholder="请输入三家供应商名称,用逗号分隔" clearable />
|
||||
<div class="template-note mt5"><el-text type="info" size="small">请输入三家供应商名称,用逗号分隔</el-text></div>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12" class="mb16" v-if="showAutoInviteSelect && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="服务商城项目需求模板(邀请比选)" prop="serviceInviteSelect" required class="mb16">
|
||||
<upload-file v-model="dataForm.serviceInviteSelect" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.serviceInviteSelect }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('serviceInviteSelect')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('invite_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(邀请比选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="showAutoInviteSelect && dataForm.hasSupplier === '0'">
|
||||
<el-form-item label="服务商城项目需求模板(公开比选)" prop="servicePublicSelectAuto" required class="mb16">
|
||||
<upload-file v-model="dataForm.servicePublicSelectAuto" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.servicePublicSelectAuto }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('servicePublicSelectAuto')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('public_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(公开比选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="其他材料" prop="otherMaterials" class="mb16">
|
||||
<upload-file v-model="dataForm.otherMaterials" :limit="1" :file-type="['zip']" :data="{ fileType: FILE_TYPE_MAP.otherMaterials }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('otherMaterials')" />
|
||||
<div class="template-note">支持上传zip格式的压缩包文件</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 分支二:学校统一采购(单行两列流式布局);申请时隐藏采购方式,由审批环节采购中心补充 -->
|
||||
<div class="mb20" v-if="showPurchaseDetailBlocks && !isDeptPurchase">
|
||||
<div class="step-title mb16">学校统一采购</div>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="采购形式" prop="purchaseMode">
|
||||
<el-radio-group v-model="dataForm.purchaseMode" :disabled="schoolUnifiedPurchaseFormDisabled">
|
||||
<el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <div v-if="schoolUnifiedPurchaseFormDefault != null" class="template-note mt5"><el-text type="info" size="small">根据预算金额与是否集采由系统自动选择</el-text></div> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 学校统一采购时申请阶段不显示采购方式;审批环节(流程嵌入)时显示,由采购中心补充选择、其他节点只读 -->
|
||||
<el-col :span="12" class="mb16" v-if="isDeptPurchase || isFlowEmbed">
|
||||
<el-form-item label="采购方式" prop="purchaseType" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.purchaseType" placeholder="请选择采购方式" clearable :disabled="(isFlowEmbed && isPurchaseCenter) ? false : (isAutoSelectPurchaseTypeUnion || flowFieldDisabled('purchaseType'))" style="width: 100%">
|
||||
<el-option v-for="item in purchaseTypeUnionList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="业务分管处室" prop="deptClassifyUserId" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.deptClassifyUserId" placeholder="请选择业务分管处室" clearable filterable @change="handleBusinessDeptChange" style="width: 100%" :disabled="flowFieldDisabled('deptClassifyUserId')">
|
||||
<el-option v-for="item in businessDeptList" :key="item.id" :label="item.deptName" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="分管校领导" prop="schoolLeaderUserId" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.schoolLeaderUserId" placeholder="请选择分管校领导" clearable filterable @change="handleSchoolLeaderChange" style="width: 100%" :disabled="flowFieldDisabled('schoolLeaderUserId')">
|
||||
<el-option v-for="item in schoolLeaderList" :key="item.id" :label="item.name" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="dataForm.budget && dataForm.budget >= 300000">
|
||||
<el-form-item label="项目可行性论证报告" prop="feasibilityReport" required>
|
||||
<upload-file v-model="dataForm.feasibilityReport" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.feasibilityReport }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('feasibilityReport')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('feasibility_report')" style="margin-top: 8px; display: inline-block">下载《项目可行性论证报告模板.doc》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="dataForm.budget && dataForm.budget >= 300000 && !isUrgentSpecial && !isSpecialType('2') && !isSpecialType('3')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutes" required>
|
||||
<upload-file v-model="dataForm.meetingMinutes" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutes }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutes')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isUrgentSpecial">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesUrgent" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesUrgent" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesUrgent }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesUrgent')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isSpecialType('2')">
|
||||
<el-form-item label="单一来源论专家证附件" prop="singleSourceProof" required>
|
||||
<upload-file v-model="dataForm.singleSourceProof" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.singleSourceProof }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('singleSourceProof')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('single_source')" style="margin-top: 8px; display: inline-block">下载《单一来源论专家证附件.docx》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isSpecialType('2')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesSingle" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesSingle" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesSingle }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesSingle')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isSpecialType('3')">
|
||||
<el-form-item label="进口产品申请及专家论证意见表" prop="importApplication" required>
|
||||
<upload-file v-model="dataForm.importApplication" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.importApplication }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('importApplication')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('import_application')" style="margin-top: 8px; display: inline-block">下载《进口产品申请及专家论证意见表.doc》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="isSpecialType('3')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesImport" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesImport" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesImport }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesImport')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="showAutoInviteSelectSchool">
|
||||
<el-col :span="8" class="mb12" v-if="showAutoInviteSelect">
|
||||
<el-form-item label="是否有推荐供应商" prop="hasSupplier">
|
||||
<el-radio-group v-model="dataForm.hasSupplier" :disabled="flowFieldDisabled('hasSupplier')">
|
||||
<el-radio label="1">有</el-radio>
|
||||
@@ -349,13 +170,119 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" class="mb16" v-if="showAutoInviteSelectSchool && dataForm.hasSupplier === '1'">
|
||||
<!-- <el-col :span="8" class="mb12" v-if="showAutoInviteSelect && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="推荐供应商" prop="suppliers" class="mb16">
|
||||
<el-input v-model="dataForm.suppliers" placeholder="请输入三家供应商名称,用逗号分隔" clearable />
|
||||
<div class="template-note mt5"><el-text type="info" size="small">请输入三家供应商名称,用逗号分隔</el-text></div>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8" class="mb12" v-if="showAutoInviteSelect && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="服务商城项目需求模板(邀请比选)" prop="serviceInviteSelect" required>
|
||||
<upload-file v-model="dataForm.serviceInviteSelect" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.serviceInviteSelect }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('serviceInviteSelect')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('invite_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(邀请比选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="showAutoInviteSelect && dataForm.hasSupplier === '0'">
|
||||
<el-form-item label="服务商城项目需求模板(公开比选)" prop="servicePublicSelectAuto" required>
|
||||
<upload-file v-model="dataForm.servicePublicSelectAuto" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.servicePublicSelectAuto }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('servicePublicSelectAuto')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('public_select')" style="margin-top: 8px; display: inline-block">下载《服务商城项目需求模板(公开比选)》模版</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="其他材料" prop="otherMaterials">
|
||||
<upload-file v-model="dataForm.otherMaterials" :limit="1" :file-type="['zip']" :data="{ fileType: FILE_TYPE_MAP.otherMaterials }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('otherMaterials')" />
|
||||
<div class="template-note">支持上传zip格式的压缩包文件</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 分支二:学校统一采购(三列紧凑) -->
|
||||
<div class="mb20 form-section-compact" v-if="showPurchaseDetailBlocks && !isDeptPurchase">
|
||||
<div class="step-title mb12">学校统一采购</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="采购形式" prop="purchaseMode">
|
||||
<el-radio-group v-model="dataForm.purchaseMode" :disabled="schoolUnifiedPurchaseFormDisabled">
|
||||
<el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <div v-if="schoolUnifiedPurchaseFormDefault != null" class="template-note mt5"><el-text type="info" size="small">根据预算金额与是否集采由系统自动选择</el-text></div> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isDeptPurchase || isFlowEmbed">
|
||||
<el-form-item label="采购方式" prop="purchaseType" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.purchaseType" placeholder="请选择采购方式" clearable :disabled="(isFlowEmbed && isPurchaseCenter) ? false : (isAutoSelectPurchaseTypeUnion || flowFieldDisabled('purchaseType'))" style="width: 100%">
|
||||
<el-option v-for="item in purchaseTypeUnionList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="业务分管处室" prop="deptClassifyUserId" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.deptClassifyUserId" placeholder="请选择业务分管处室" clearable filterable @change="handleBusinessDeptChange" style="width: 100%" :disabled="flowFieldDisabled('deptClassifyUserId')">
|
||||
<el-option v-for="item in businessDeptList" :key="item.id" :label="item.deptName" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="分管校领导" prop="schoolLeaderUserId" :required="!isDeptPurchase">
|
||||
<el-select v-model="dataForm.schoolLeaderUserId" placeholder="请选择分管校领导" clearable filterable @change="handleSchoolLeaderChange" style="width: 100%" :disabled="flowFieldDisabled('schoolLeaderUserId')">
|
||||
<el-option v-for="item in schoolLeaderList" :key="item.id" :label="item.name" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.budget && dataForm.budget >= BUDGET_FEASIBILITY_THRESHOLD">
|
||||
<el-form-item label="项目可行性论证报告" prop="feasibilityReport" required>
|
||||
<upload-file v-model="dataForm.feasibilityReport" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.feasibilityReport }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('feasibilityReport')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('feasibility_report')" style="margin-top: 8px; display: inline-block">下载《项目可行性论证报告模板.doc》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.budget && dataForm.budget >= BUDGET_FEASIBILITY_THRESHOLD && !isUrgentSpecial && !isSpecialType('2') && !isSpecialType('3')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutes" required>
|
||||
<upload-file v-model="dataForm.meetingMinutes" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutes }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutes')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isUrgentSpecial">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesUrgent" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesUrgent" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesUrgent }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesUrgent')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isSpecialType('2')">
|
||||
<el-form-item label="单一来源论专家证附件" prop="singleSourceProof" required>
|
||||
<upload-file v-model="dataForm.singleSourceProof" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.singleSourceProof }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('singleSourceProof')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('single_source')" style="margin-top: 8px; display: inline-block">下载《单一来源论专家证附件.docx》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isSpecialType('2')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesSingle" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesSingle" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesSingle }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesSingle')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isSpecialType('3')">
|
||||
<el-form-item label="进口产品申请及专家论证意见表" prop="importApplication" required>
|
||||
<upload-file v-model="dataForm.importApplication" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.importApplication }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('importApplication')" />
|
||||
<el-button type="primary" link icon="Download" size="small" @click="downloadTemplate('import_application')" style="margin-top: 8px; display: inline-block">下载《进口产品申请及专家论证意见表.doc》</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="isSpecialType('3')">
|
||||
<el-form-item label="会议纪要" prop="meetingMinutesImport" required>
|
||||
<upload-file v-model="dataForm.meetingMinutesImport" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.meetingMinutesImport }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('meetingMinutesImport')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12" v-if="showAutoInviteSelectSchool">
|
||||
<el-form-item label="是否有推荐供应商" prop="hasSupplier">
|
||||
<el-radio-group v-model="dataForm.hasSupplier" :disabled="flowFieldDisabled('hasSupplier')">
|
||||
<el-radio label="1">有</el-radio>
|
||||
<el-radio label="0">无</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8" class="mb12" v-if="showAutoInviteSelectSchool && dataForm.hasSupplier === '1'">
|
||||
<el-form-item label="推荐供应商" prop="suppliers">
|
||||
<el-input v-model="dataForm.suppliers" type="textarea" :rows="2" placeholder="请输入至少三家供应商名称,用逗号或分号分隔" clearable :disabled="flowFieldDisabled('suppliers')" />
|
||||
<div class="template-note mt5"><el-text type="info" size="small">请输入至少三家供应商名称,用逗号或分号分隔</el-text></div>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="需求文件" :prop="getRequirementFileProp()" required class="mb16">
|
||||
<template v-if="showAutoInviteSelectSchool">
|
||||
<template v-if="dataForm.hasSupplier === '1'">
|
||||
@@ -377,12 +304,12 @@
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="dataForm.budget && dataForm.budget >= 1000000">
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.budget && dataForm.budget >= BUDGET_GOV_PURCHASE_THRESHOLD">
|
||||
<el-form-item label="政府采购意向申请表" prop="governmentPurchaseIntent" required>
|
||||
<upload-file v-model="dataForm.governmentPurchaseIntent" :limit="1" :file-type="['doc', 'docx', 'pdf']" :data="{ fileType: FILE_TYPE_MAP.governmentPurchaseIntent }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('governmentPurchaseIntent')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="其他材料" prop="otherMaterials">
|
||||
<upload-file v-model="dataForm.otherMaterials" :limit="1" :file-type="['zip']" :data="{ fileType: FILE_TYPE_MAP.otherMaterials }" upload-file-url="/purchase/purchasingfiles/upload" :disabled="flowFieldDisabled('otherMaterials')" />
|
||||
<div class="template-note">支持上传zip格式的压缩包文件</div>
|
||||
@@ -392,16 +319,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-form-item label="备注" prop="remark" class="mb16">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
:disabled="flowFieldDisabled('remark')" />
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="24" class="mb12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" type="textarea" :rows="2" placeholder="请输入备注" clearable :disabled="flowFieldDisabled('remark')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -410,7 +331,7 @@
|
||||
<div v-if="isViewMode && dataForm.agentName" class="implement-info-block mb20">
|
||||
<el-divider content-position="left">招标代理</el-divider>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<div class="view-label">代理名称</div>
|
||||
<div class="view-value">{{ dataForm.agentName }}</div>
|
||||
</el-col>
|
||||
@@ -421,11 +342,11 @@
|
||||
<div v-if="isViewMode && (dataForm.implementType || viewImplementPurchaseFiles.length)" class="implement-info-block mb20">
|
||||
<el-divider content-position="left">实施采购信息</el-divider>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb16" v-if="dataForm.implementType">
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.implementType">
|
||||
<div class="view-label">实施采购方式</div>
|
||||
<div class="view-value">{{ dataForm.implementType === '1' ? '自行组织采购' : dataForm.implementType === '2' ? '委托代理采购' : dataForm.implementType || '—' }}</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb16" v-if="dataForm.fileFlowInstId">
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.fileFlowInstId">
|
||||
<div class="view-label">文件审批状态</div>
|
||||
<div class="view-value">
|
||||
<el-tag v-if="dataForm.fileFlowStatus === '-2'" type="info">撤回</el-tag>
|
||||
@@ -555,9 +476,10 @@ const flowSubmitDisabled = ref(false);
|
||||
/** 流程嵌入时当前节点是否为采购中心(仅采购中心可编辑采购方式/采购形式) */
|
||||
const isPurchaseCenter = ref(false);
|
||||
|
||||
/** 流程嵌入且为采购中心时,除采购方式/采购形式外其余字段均只读 */
|
||||
function flowFieldDisabled(key: string) {
|
||||
return isFlowEmbed.value && isPurchaseCenter.value && !['purchaseType', 'purchaseMode'].includes(key);
|
||||
/** 流程嵌入时:采购中心审核节点放开所有字段编辑;非采购中心节点只读 */
|
||||
function flowFieldDisabled(_key: string) {
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) return false;
|
||||
return !!isFlowEmbed.value;
|
||||
}
|
||||
|
||||
// 定义变量内容
|
||||
@@ -575,6 +497,7 @@ const dataForm = reactive({
|
||||
purchaseMode: '',
|
||||
purchaseType: '',
|
||||
purchaseTypeUnion: '',
|
||||
purchaseChannel: '',
|
||||
categoryCode: '',
|
||||
remark: '',
|
||||
status: '',
|
||||
@@ -670,13 +593,19 @@ Object.entries(FILE_TYPE_MAP).forEach(([field, type]) => {
|
||||
FILE_TYPE_TO_FIELDS[type].push(field);
|
||||
});
|
||||
|
||||
// 金额阈值常量(与后端 PurchaseConstants 保持一致)
|
||||
const BUDGET_DEPT_PURCHASE_THRESHOLD = 50000; // 部门自行采购上限(< 5 万)
|
||||
const BUDGET_FEASIBILITY_THRESHOLD = 300000; // 可行性论证/会议纪要起点(≥ 30 万)
|
||||
const BUDGET_PUBLIC_SELECT_THRESHOLD = 400000; // 公开比选起点(≥ 40 万)
|
||||
const BUDGET_GOV_PURCHASE_THRESHOLD = 1000000; // 政府采购起点(≥ 100 万)
|
||||
|
||||
// 部门采购方式字典 value(与 DeptPurchaseTypeEnum 一致)
|
||||
const DEPT_PURCHASE_TYPE = {
|
||||
ONLINE_MALL: '1',
|
||||
MARKET_PURCHASE: '2',
|
||||
BUSINESS_NEGOTIATION: '3',
|
||||
ENTRUST_CENTER: '4',
|
||||
INQUIRY: '6',
|
||||
INQUIRY: '5',
|
||||
} as const;
|
||||
|
||||
// 学校统一采购方式字典 value(与 PurchaseTypeEnum 一致)
|
||||
@@ -700,6 +629,12 @@ const isSpecialType = (dictValue: string) => {
|
||||
return item ? dataForm.isSpecial === item.value : dataForm.isSpecial === dictValue;
|
||||
};
|
||||
|
||||
// 采购途径(与后端 purchasing_apply.purchase_channel 一致:1 自行采购 2 委托采购中心采购)
|
||||
const PURCHASE_CHANNEL = {
|
||||
SELF: '1',
|
||||
ENTRUST_CENTER: '2',
|
||||
} as const;
|
||||
|
||||
// 判断是否为部门自行采购
|
||||
// 条件:特殊情况=否 且 集采=否 且 预算金额<5万 → 部门自行采购
|
||||
// 其他情况 → 学校统一采购
|
||||
@@ -714,6 +649,9 @@ const isDeptPurchase = computed(() => {
|
||||
dataForm.budget && dataForm.budget < 50000);
|
||||
});
|
||||
|
||||
// 是否为“委托采购中心采购”途径
|
||||
const isEntrustCenterChannel = computed(() => dataForm.purchaseChannel === PURCHASE_CHANNEL.ENTRUST_CENTER);
|
||||
|
||||
// 是否已填入“是否特殊情况”“是否集采”“预算金额”,从而能明确是部门自行采购还是学校统一采购(新增时先隐藏采购详情,填完后再显示)
|
||||
const isPurchaseTypeDetermined = computed(() => {
|
||||
return dataForm.isSpecial !== '' && dataForm.isCentralized !== '' &&
|
||||
@@ -728,8 +666,8 @@ const showPurchaseDetailBlocks = computed(() => {
|
||||
const schoolUnifiedPurchaseFormDefault = computed(() => {
|
||||
if (isDeptPurchase.value || dataForm.budget == null) return null;
|
||||
const budget = Number(dataForm.budget);
|
||||
if (budget >= 1000000) return '1'; // 政府采购
|
||||
if (budget >= 50000 && budget < 1000000) {
|
||||
if (budget >= BUDGET_GOV_PURCHASE_THRESHOLD) return '1'; // 政府采购
|
||||
if (budget >= BUDGET_DEPT_PURCHASE_THRESHOLD && budget < BUDGET_GOV_PURCHASE_THRESHOLD) {
|
||||
if (dataForm.isCentralized === '0') return '2'; // 集采=否 → 学校自主采购
|
||||
if (dataForm.isCentralized === '1') return '1'; // 政府集中采购 → 政府采购
|
||||
if (dataForm.isCentralized === '2') return '2'; // 学校集中采购 → 学校自主采购
|
||||
@@ -737,8 +675,9 @@ const schoolUnifiedPurchaseFormDefault = computed(() => {
|
||||
return null;
|
||||
});
|
||||
|
||||
// 学校统一采购时采购形式是否禁用(由规则自动选择,不由用户选择)
|
||||
const schoolUnifiedPurchaseFormDisabled = computed(() => flowFieldDisabled('purchaseMode') || (schoolUnifiedPurchaseFormDefault.value != null));
|
||||
// 学校统一采购时采购形式是否禁用(采购中心审核时放开;否则由规则自动选择时禁用)
|
||||
const schoolUnifiedPurchaseFormDisabled = computed(() =>
|
||||
(isFlowEmbed.value && isPurchaseCenter.value) ? false : (flowFieldDisabled('purchaseMode') || (schoolUnifiedPurchaseFormDefault.value != null)));
|
||||
|
||||
// 特殊情况字典 value:0否 1紧急 2单一 3进口
|
||||
const isUrgentSpecial = computed(() => dataForm.isSpecial === '1');
|
||||
@@ -823,7 +762,7 @@ const isSpecialServiceCategory = computed(() => {
|
||||
// - 服务类:若末级节点 isMallService=0 且 isMallProject=0,则选“其他方式”,否则选“服务类网上商城”
|
||||
// - 非服务类:默认选“其他方式”
|
||||
const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
|
||||
if (!isPurchaseType(DEPT_PURCHASE_TYPE.ENTRUST_CENTER)) return '';
|
||||
if (!isEntrustCenterChannel.value) return '';
|
||||
if (!dataForm.categoryCode) return '';
|
||||
|
||||
const category = getCategoryInfo();
|
||||
@@ -839,9 +778,9 @@ const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
|
||||
return 'other';
|
||||
};
|
||||
|
||||
// 监听品目/采购方式变化,自动设置委托采购中心方式,并清理无关字段
|
||||
// 监听品目/采购途径变化,自动设置委托采购中心方式,并清理无关字段
|
||||
watch(
|
||||
[() => dataForm.purchaseType, () => dataForm.categoryCode, () => categoryTreeData.value],
|
||||
[() => dataForm.purchaseChannel, () => dataForm.categoryCode, () => categoryTreeData.value],
|
||||
() => {
|
||||
const nextType = calcEntrustCenterType();
|
||||
if (!nextType) return;
|
||||
@@ -870,7 +809,7 @@ watch(
|
||||
const isAutoSelectPurchaseType = computed(() => {
|
||||
if (!dataForm.budget) return false;
|
||||
const budget = dataForm.budget;
|
||||
return budget >= 50000 && budget < 400000 && isServiceCategory.value && isSpecialServiceCategory.value;
|
||||
return budget >= BUDGET_DEPT_PURCHASE_THRESHOLD && budget < BUDGET_PUBLIC_SELECT_THRESHOLD && isServiceCategory.value && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 判断是否显示自动邀请比选模版(5万<=金额<40万,服务类目,特殊服务类目)
|
||||
@@ -878,7 +817,7 @@ const showAutoInviteSelect = computed(() => {
|
||||
if (!isDeptPurchase.value) return false;
|
||||
if (!dataForm.budget) return false;
|
||||
const budget = dataForm.budget;
|
||||
return budget >= 50000 && budget < 400000 && isServiceCategory.value && isSpecialServiceCategory.value;
|
||||
return budget >= BUDGET_DEPT_PURCHASE_THRESHOLD && budget < BUDGET_PUBLIC_SELECT_THRESHOLD && isServiceCategory.value && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 判断是否显示学校统一采购的自动邀请比选模版(5万<=金额<40万,服务类目,特殊服务类目)
|
||||
@@ -886,7 +825,7 @@ const showAutoInviteSelectSchool = computed(() => {
|
||||
if (isDeptPurchase.value) return false;
|
||||
if (!dataForm.budget) return false;
|
||||
const budget = dataForm.budget;
|
||||
return budget >= 50000 && budget < 400000 && isSpecialServiceCategory.value;
|
||||
return budget >= BUDGET_DEPT_PURCHASE_THRESHOLD && budget < BUDGET_PUBLIC_SELECT_THRESHOLD && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 判断是否显示自动公开比选模版(40万<=金额<100万,特殊服务类目:isMallService=1、isProjectService=1)
|
||||
@@ -894,7 +833,7 @@ const showAutoPublicSelect = computed(() => {
|
||||
if (isDeptPurchase.value) return false;
|
||||
if (!dataForm.budget) return false;
|
||||
const budget = dataForm.budget;
|
||||
return budget >= 400000 && budget < 1000000 && isSpecialServiceCategory.value;
|
||||
return budget >= BUDGET_PUBLIC_SELECT_THRESHOLD && budget < BUDGET_GOV_PURCHASE_THRESHOLD && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 获取需求文件的 prop 名称(用于表单验证)
|
||||
@@ -916,19 +855,35 @@ const isAutoSelectPurchaseTypeUnion = computed(() => {
|
||||
if (isDeptPurchase.value) return false;
|
||||
if (!dataForm.budget) return false;
|
||||
const budget = dataForm.budget;
|
||||
return budget >= 50000 && budget < 400000 && isSpecialServiceCategory.value;
|
||||
return budget >= BUDGET_DEPT_PURCHASE_THRESHOLD && budget < BUDGET_PUBLIC_SELECT_THRESHOLD && isSpecialServiceCategory.value;
|
||||
});
|
||||
|
||||
// 监听品目编码、预算金额及采购类型变化,自动设置/清空采购方式
|
||||
watch([() => dataForm.categoryCode, () => dataForm.budget, () => isDeptPurchase.value, () => isFlowEmbed.value], () => {
|
||||
// 监听品目编码、预算金额、采购类型及采购途径变化,自动设置/清空采购方式
|
||||
watch(
|
||||
[() => dataForm.categoryCode, () => dataForm.budget, () => isDeptPurchase.value, () => isFlowEmbed.value, () => dataForm.purchaseChannel, () => isPurchaseCenter.value],
|
||||
() => {
|
||||
// 学校统一采购申请阶段:采购方式隐藏,由审批环节采购中心补充,此处不自动写入且清空已有值
|
||||
if (!isDeptPurchase.value && !isFlowEmbed.value) {
|
||||
dataForm.purchaseType = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// 部门自行采购:自动设置网上商城
|
||||
if (isAutoSelectPurchaseType.value && isDeptPurchase.value) {
|
||||
// 部门自行采购 & 采购途径为“委托采购中心采购”且为申请阶段:采购方式隐藏且不设置
|
||||
if (isDeptPurchase.value && isEntrustCenterChannel.value && !isFlowEmbed.value) {
|
||||
dataForm.purchaseType = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// 部门自行采购 & 采购途径为“自行采购”:自动设置网上商城
|
||||
if (isAutoSelectPurchaseType.value && isDeptPurchase.value && !isEntrustCenterChannel.value) {
|
||||
const onlineMallOption = purchaseTypeDeptList.value.find(item => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL);
|
||||
if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) {
|
||||
dataForm.purchaseType = onlineMallOption.value;
|
||||
}
|
||||
}
|
||||
|
||||
// 部门自行采购 & 采购途径为“委托采购中心采购” & 采购中心审批节点:根据特殊服务类目自动设置网上商城
|
||||
if (isAutoSelectPurchaseType.value && isDeptPurchase.value && isEntrustCenterChannel.value && isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
const onlineMallOption = purchaseTypeDeptList.value.find(item => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL);
|
||||
if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) {
|
||||
dataForm.purchaseType = onlineMallOption.value;
|
||||
@@ -942,7 +897,8 @@ watch([() => dataForm.categoryCode, () => dataForm.budget, () => isDeptPurchase.
|
||||
dataForm.purchaseType = onlineMallOption.value;
|
||||
}
|
||||
}
|
||||
}, { immediate: true });
|
||||
},
|
||||
{ immediate: true });
|
||||
|
||||
// 学校统一采购:采购形式由规则默认选择,随预算与集采变化自动更新
|
||||
watch([() => schoolUnifiedPurchaseFormDefault.value, () => isDeptPurchase.value], () => {
|
||||
@@ -953,19 +909,19 @@ watch([() => schoolUnifiedPurchaseFormDefault.value, () => isDeptPurchase.value]
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// 下载模版
|
||||
// 下载模版:统一走后端接口,按原始文件下载(避免前端静态资源被当成 HTML 返回)
|
||||
const downloadTemplate = async (type: string) => {
|
||||
const templateMap: Record<string, { fileName: string, displayName: string }> = {
|
||||
'business_negotiation': { fileName: '商务洽谈表.xlsx', displayName: '商务洽谈表.xlsx' },
|
||||
'market_purchase_minutes': { fileName: '市场采购纪要.xlsx', displayName: '市场采购纪要.xlsx' },
|
||||
'inquiry': { fileName: '部门采购询价模版.docx', displayName: '部门采购询价模版.docx' },
|
||||
'direct_select': { fileName: '服务商城项目需求模板(直选).doc', displayName: '服务商城项目需求模板(直选).doc' },
|
||||
'public_select': { fileName: '服务商城项目需求模板(公开比选).doc', displayName: '服务商城项目需求模板(公开比选).doc' },
|
||||
'invite_select': { fileName: '服务商城项目需求模板(邀请比选).doc', displayName: '服务商城项目需求模板(邀请比选).doc' },
|
||||
'purchase_requirement': { fileName: '默认需求模板.doc', displayName: '默认需求模板.doc' },
|
||||
'import_application': { fileName: '附件1:进口产品申请及专家论证意见表.doc', displayName: '进口产品申请及专家论证意见表.doc' },
|
||||
'single_source': { fileName: '表7:单一来源论专家证附件.docx', displayName: '单一来源论专家证附件.docx' },
|
||||
'feasibility_report': { fileName: '表6:项目可行性论证报告模板.doc', displayName: '项目可行性论证报告模板.doc' },
|
||||
const templateMap: Record<string, { displayName: string }> = {
|
||||
business_negotiation: { displayName: '商务洽谈表.doc' },
|
||||
market_purchase_minutes: { displayName: '部门自行采购市场采购纪要.doc' },
|
||||
inquiry: { displayName: '部门采购询价模版.doc' },
|
||||
direct_select: { displayName: '服务商城项目需求模板(直选).doc' },
|
||||
public_select: { displayName: '服务商城项目需求模板(公开比选).doc' },
|
||||
invite_select: { displayName: '服务商城项目需求模板(邀请比选).doc' },
|
||||
purchase_requirement: { displayName: '采购需求填报模板.doc' },
|
||||
import_application: { displayName: '进口产品申请及专家论证意见表.doc' },
|
||||
single_source: { displayName: '单一来源论专家证附件.docx' },
|
||||
feasibility_report: { displayName: '项目可行性论证报告模板.doc' },
|
||||
};
|
||||
|
||||
const template = templateMap[type];
|
||||
@@ -974,33 +930,15 @@ const downloadTemplate = async (type: string) => {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const fileUrl = new URL(`../../assets/file/${template.fileName}`, import.meta.url).href;
|
||||
const response = await fetch(fileUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败');
|
||||
}
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = template.displayName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(link);
|
||||
useMessage().success('模版下载成功');
|
||||
} catch (error) {
|
||||
try {
|
||||
await other.downBlobFile(
|
||||
`/purchase/purchasingfiles/downloadTemplate?type=${type}`,
|
||||
`/purchase/purchasingtemplate/download?type=${encodeURIComponent(type)}`,
|
||||
{},
|
||||
template.displayName
|
||||
template.displayName,
|
||||
);
|
||||
useMessage().success('模版下载成功');
|
||||
} catch (err) {
|
||||
useMessage().error('模版下载失败,请先维护模版文件');
|
||||
}
|
||||
useMessage().error('模版下载失败,请联系管理员维护模版文件');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1031,8 +969,38 @@ const dataRules = reactive({
|
||||
{ required: true, message: '采购内容不能为空', trigger: 'blur' },
|
||||
{ max: 1000, message: '采购内容不能超过1000字', trigger: 'blur' }
|
||||
],
|
||||
purchaseChannel: [
|
||||
{
|
||||
validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
|
||||
if (!isDeptPurchase.value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择采购途径'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
purchaseType: [
|
||||
{ required: true, message: '请选择采购方式', trigger: 'change' }
|
||||
{
|
||||
validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
|
||||
// 部门自行采购且采购途径为“委托采购中心采购”并且为申请阶段:此处不校验采购方式
|
||||
if (isDeptPurchase.value && isEntrustCenterChannel.value && !isFlowEmbed.value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择采购方式'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
// 学校统一采购时必填
|
||||
deptClassifyUserId: [
|
||||
@@ -1098,7 +1066,8 @@ async function loadDetail(applyId: string | number) {
|
||||
isCentralized: detail.isCentralized != null ? String(detail.isCentralized) : '',
|
||||
isSpecial: detail.isSpecial != null ? String(detail.isSpecial) : '',
|
||||
purchaseMode: detail.purchaseMode ?? '',
|
||||
purchaseType: detail.purchaseType ?? '',
|
||||
purchaseType: detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? '' : (detail.purchaseType ?? ''),
|
||||
purchaseChannel: (detail as any).purchaseChannel ?? (detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER ? PURCHASE_CHANNEL.ENTRUST_CENTER : ''),
|
||||
purchaseTypeUnion: detail.purchaseTypeUnion ?? '',
|
||||
categoryCode: detail.categoryCode ?? '',
|
||||
remark: detail.remark ?? '',
|
||||
@@ -1346,16 +1315,18 @@ const getIsSpecialDict = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 获取部门采购方式字典
|
||||
// 获取部门采购方式字典(过滤掉“委托采购中心采购”,由采购途径字段控制)
|
||||
const getPurchaseTypeDeptDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('PURCHASE_TYPE_DEPT');
|
||||
purchaseTypeDeptList.value = res.data && Array.isArray(res.data)
|
||||
? res.data.map((item: any) => ({
|
||||
? res.data
|
||||
.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
value: item.value || item.dictValue || item.code,
|
||||
}))
|
||||
.filter((item: any) => item.value !== DEPT_PURCHASE_TYPE.ENTRUST_CENTER)
|
||||
: [];
|
||||
} catch (err) {
|
||||
purchaseTypeDeptList.value = [];
|
||||
|
||||
242
src/views/finance/purchasingtemplate/index.vue
Normal file
242
src/views/finance/purchasingtemplate/index.vue
Normal file
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
||||
<div class="header-actions">
|
||||
<el-button type="primary" icon="FolderAdd" @click="openUploadDialog()">
|
||||
新增模板
|
||||
</el-button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="tableData" v-loading="loading" stripe class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="templateTitle" label="模板类型名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="templateType" label="模板类型编码" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="templateName" label="模板名称" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column prop="updateTime" label="更新时间" width="180" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="260" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link icon="Download" @click="handleDownload(row)">
|
||||
下载
|
||||
</el-button>
|
||||
<el-button type="primary" link icon="UploadFilled" @click="openUploadDialog(row)">
|
||||
重新上传
|
||||
</el-button>
|
||||
<el-button type="primary" link icon="Edit" @click="openEditDialog(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="uploadDialogVisible" title="上传模板" width="450px" destroy-on-close>
|
||||
<el-form :model="uploadForm" label-width="100px">
|
||||
<el-form-item label="模板类型编码" required>
|
||||
<el-input
|
||||
v-model="uploadForm.templateType"
|
||||
placeholder="例如: business_negotiation, inquiry"
|
||||
:disabled="!!uploadForm.lockType"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板类型名称">
|
||||
<el-input
|
||||
v-model="uploadForm.templateTitle"
|
||||
placeholder="例如: 部门采购询价模版"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板文件" required>
|
||||
<el-upload
|
||||
class="upload-block"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:file-list="fileList"
|
||||
:on-change="handleFileChange"
|
||||
:on-remove="handleFileRemove"
|
||||
>
|
||||
<el-button type="primary" icon="UploadFilled">选择文件</el-button>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">支持 doc、docx 等 Word 模板文件,上传后前端下载将使用该文件。</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="uploadDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="uploading" @click="handleUploadConfirm">上 传</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="editDialogVisible" title="编辑模板" width="420px" destroy-on-close>
|
||||
<el-form :model="editForm" label-width="100px">
|
||||
<el-form-item label="模板类型编码">
|
||||
<el-input v-model="editForm.templateType" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板类型名称" required>
|
||||
<el-input v-model="editForm.templateTitle" placeholder="请输入模板类型名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="editing" @click="handleEditConfirm">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="PurchasingTemplateManage">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { Document, List, UploadFilled, Download, Edit } from '@element-plus/icons-vue';
|
||||
import { listTemplates, uploadTemplate, getTemplateDownloadUrl, updateTemplateTitle } from '/@/api/finance/purchasingtemplate';
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const tableData = ref<any[]>([]);
|
||||
|
||||
const uploadDialogVisible = ref(false);
|
||||
const uploading = ref(false);
|
||||
const uploadForm = reactive<{
|
||||
templateType: string;
|
||||
templateTitle: string;
|
||||
lockType?: boolean;
|
||||
}>({
|
||||
templateType: '',
|
||||
templateTitle: '',
|
||||
lockType: false,
|
||||
});
|
||||
const editDialogVisible = ref(false);
|
||||
const editing = ref(false);
|
||||
const editForm = reactive<{
|
||||
id: number | null;
|
||||
templateType: string;
|
||||
templateTitle: string;
|
||||
}>({
|
||||
id: null,
|
||||
templateType: '',
|
||||
templateTitle: '',
|
||||
});
|
||||
|
||||
const fileList = ref<any[]>([]);
|
||||
const currentFile = ref<File | null>(null);
|
||||
|
||||
const fetchData = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listTemplates();
|
||||
tableData.value = (res && res.data) || [];
|
||||
} catch (e) {
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(fetchData);
|
||||
|
||||
const openUploadDialog = (row?: any) => {
|
||||
uploadDialogVisible.value = true;
|
||||
uploadForm.templateType = row?.templateType || '';
|
||||
uploadForm.templateTitle = row?.templateTitle || '';
|
||||
uploadForm.lockType = !!row?.templateType;
|
||||
fileList.value = [];
|
||||
currentFile.value = null;
|
||||
};
|
||||
|
||||
const handleFileChange = (file: any, files: any[]) => {
|
||||
fileList.value = files.slice(-1);
|
||||
currentFile.value = file.raw || null;
|
||||
};
|
||||
|
||||
const handleFileRemove = () => {
|
||||
fileList.value = [];
|
||||
currentFile.value = null;
|
||||
};
|
||||
|
||||
const handleUploadConfirm = async () => {
|
||||
if (!uploadForm.templateType || !uploadForm.templateType.trim()) {
|
||||
useMessage().error('请填写模板类型编码');
|
||||
return;
|
||||
}
|
||||
if (!currentFile.value) {
|
||||
useMessage().error('请选择要上传的模板文件');
|
||||
return;
|
||||
}
|
||||
uploading.value = true;
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('type', uploadForm.templateType.trim());
|
||||
if (uploadForm.templateTitle && uploadForm.templateTitle.trim()) {
|
||||
formData.append('title', uploadForm.templateTitle.trim());
|
||||
}
|
||||
formData.append('file', currentFile.value);
|
||||
await uploadTemplate(formData);
|
||||
useMessage().success('模板上传成功');
|
||||
uploadDialogVisible.value = false;
|
||||
await fetchData();
|
||||
} catch (e) {
|
||||
useMessage().error('模板上传失败');
|
||||
} finally {
|
||||
uploading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleDownload = (row: any) => {
|
||||
if (!row?.templateType) {
|
||||
useMessage().error('缺少模板类型编码');
|
||||
return;
|
||||
}
|
||||
const url = getTemplateDownloadUrl(row.templateType);
|
||||
window.open(url, '_blank');
|
||||
};
|
||||
|
||||
const openEditDialog = (row: any) => {
|
||||
editDialogVisible.value = true;
|
||||
editForm.id = row?.id ?? null;
|
||||
editForm.templateType = row?.templateType || '';
|
||||
editForm.templateTitle = row?.templateTitle || '';
|
||||
};
|
||||
|
||||
const handleEditConfirm = async () => {
|
||||
if (!editForm.id) {
|
||||
useMessage().error('缺少模板ID');
|
||||
return;
|
||||
}
|
||||
if (!editForm.templateTitle || !editForm.templateTitle.trim()) {
|
||||
useMessage().error('请输入模板类型名称');
|
||||
return;
|
||||
}
|
||||
editing.value = true;
|
||||
try {
|
||||
await updateTemplateTitle({
|
||||
id: editForm.id,
|
||||
templateTitle: editForm.templateTitle.trim(),
|
||||
});
|
||||
useMessage().success('保存成功');
|
||||
editDialogVisible.value = false;
|
||||
await fetchData();
|
||||
} catch (e) {
|
||||
useMessage().error('保存失败');
|
||||
} finally {
|
||||
editing.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.upload-block {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user