修改采购途径
This commit is contained in:
@@ -395,12 +395,17 @@
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" class="mb12">
|
||||
<el-form-item label="组织采购形式" prop="purchaseSchool" :required="isPurchaseSchoolRequired">
|
||||
<el-radio-group v-model="dataForm.purchaseSchool" :disabled="schoolUnifiedPurchaseFormDisabled">
|
||||
<el-radio v-for="item in purchaseModeSchoolList" :key="item.value" :label="item.value">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="实施采购途径" prop="implementChannel" :required="isImplementChannelRequired">
|
||||
<el-select
|
||||
v-model="dataForm.implementChannel"
|
||||
placeholder="请选择实施采购途径"
|
||||
clearable
|
||||
:disabled="schoolUnifiedPurchaseFormDisabled"
|
||||
@change="handleImplementChannelChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="item in implementChannelList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="mb12">
|
||||
@@ -810,7 +815,7 @@
|
||||
<el-divider content-position="left">实施采购信息</el-divider>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8" class="mb12" v-if="dataForm.implementType">
|
||||
<div class="view-label">实施采购方式</div>
|
||||
<div class="view-label">实施采购途径</div>
|
||||
<div class="view-value">
|
||||
{{
|
||||
dataForm.implementType === '1'
|
||||
@@ -978,7 +983,7 @@ const dataForm = reactive({
|
||||
isSpecial: '',
|
||||
hasAssets: '0',
|
||||
purchaseMode: '',
|
||||
purchaseSchool: '',
|
||||
implementChannel: '', // 实施采购途径:框架协议、网上商城
|
||||
purchaseType: '',
|
||||
purchaseTypeUnion: '',
|
||||
purchaseChannel: '',
|
||||
@@ -1049,7 +1054,11 @@ const isSpecialList = ref<any[]>([]);
|
||||
const purchaseTypeDeptList = ref<any[]>([]);
|
||||
/** 部门采购方式字典(委托采购中心采购时使用) */
|
||||
const purchaseTypeDeptDelegationList = ref<any[]>([]);
|
||||
const purchaseModeSchoolList = ref<any[]>([]);
|
||||
/** 实施采购途径选项:框架协议、网上商城 */
|
||||
const implementChannelList = ref<any[]>([
|
||||
{ value: '5', label: '框架协议' },
|
||||
{ value: '8', label: '网上商城' },
|
||||
]);
|
||||
const purchaseTypeUnionList = ref<any[]>([]);
|
||||
const businessDeptList = ref<any[]>([]);
|
||||
const schoolLeaderList = ref<any[]>([]);
|
||||
@@ -1215,8 +1224,8 @@ const isPurchaseTypeUnionRequired = computed(() => {
|
||||
return false;
|
||||
});
|
||||
|
||||
// 学校统一采购 - 组织采购形式是否必填
|
||||
const isPurchaseSchoolRequired = computed(() => {
|
||||
// 学校统一采购 - 实施采购途径是否必填
|
||||
const isImplementChannelRequired = computed(() => {
|
||||
// 审核阶段:采购中心必填
|
||||
if (isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
return true;
|
||||
@@ -1386,6 +1395,21 @@ const calcEntrustCenterType = (): 'service_online' | 'other' | '' => {
|
||||
return 'other';
|
||||
};
|
||||
|
||||
// 实施采购途径变化时,自动设置采购方式
|
||||
// 框架协议 → 采购方式自动选择"框架协议"
|
||||
// 网上商城 → 采购方式自动选择"网上商城"
|
||||
const handleImplementChannelChange = (value: string) => {
|
||||
if (!value) {
|
||||
// 清空实施采购途径时,清空采购方式
|
||||
dataForm.purchaseType = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据实施采购途径自动设置采购方式
|
||||
// value 与 PurchaseTypeEnum 编码一致:5=框架协议,8=网上商城
|
||||
dataForm.purchaseType = value;
|
||||
};
|
||||
|
||||
// 监听采购途径变化,清理所有与采购方式相关的材料字段,同时如果已选择品目则重新计算entrustCenterType
|
||||
watch(
|
||||
() => dataForm.purchaseChannel,
|
||||
@@ -1732,13 +1756,13 @@ const dataRules = reactive({
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
// 学校统一采购 + 采购中心审核:采购形式必填
|
||||
purchaseSchool: [
|
||||
// 学校统一采购 + 采购中心审核:实施采购途径必填
|
||||
implementChannel: [
|
||||
{
|
||||
validator: (_rule: any, value: string, callback: (e?: Error) => void) => {
|
||||
if (!isDeptPurchase.value && isFlowEmbed.value && isPurchaseCenter.value) {
|
||||
if (!value || String(value).trim() === '') {
|
||||
callback(new Error('请选择组织采购形式'));
|
||||
callback(new Error('请选择实施采购途径'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1864,8 +1888,8 @@ async function loadDetail(applyId: string | number) {
|
||||
budget: detail.budget != null ? Number(detail.budget) : null,
|
||||
isCentralized: detail.isCentralized != null ? String(detail.isCentralized) : '',
|
||||
isSpecial: detail.isSpecial != null ? String(detail.isSpecial) : '',
|
||||
purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '',
|
||||
purchaseSchool: detail.purchaseSchool != null ? String(detail.purchaseSchool) : '',
|
||||
purchaseMode: detail.purchaseMode != null ? String(detail.purchaseMode) : '',
|
||||
implementChannel: detail.implementChannel != null ? String(detail.implementChannel) : '',
|
||||
purchaseType:
|
||||
detail.purchaseType === DEPT_PURCHASE_TYPE.ENTRUST_CENTER
|
||||
? ''
|
||||
@@ -2220,23 +2244,6 @@ const purchaseTypeDeptOptions = computed(() => {
|
||||
}));
|
||||
});
|
||||
|
||||
// 获取学校采购形式字典
|
||||
const getPurchaseModeSchoolDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('PURCHASE_MODE_SCHOOL');
|
||||
purchaseModeSchoolList.value =
|
||||
res.data && Array.isArray(res.data)
|
||||
? res.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code,
|
||||
}))
|
||||
: [];
|
||||
} catch (err) {
|
||||
purchaseModeSchoolList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 获取学校统一采购方式字典
|
||||
const getPurchaseTypeUnionDict = async () => {
|
||||
try {
|
||||
@@ -2808,7 +2815,6 @@ onMounted(async () => {
|
||||
getIsSpecialDict(),
|
||||
getPurchaseTypeDeptDict(),
|
||||
getPurchaseTypeDeptDelegationDict(),
|
||||
getPurchaseModeSchoolDict(),
|
||||
getPurchaseTypeUnionDict(),
|
||||
getBusinessDeptListData(),
|
||||
getSchoolLeaderListData(),
|
||||
|
||||
Reference in New Issue
Block a user