diff --git a/src/flow/components/handle-job/handle.vue b/src/flow/components/handle-job/handle.vue index d96fc86..cfe1c61 100644 --- a/src/flow/components/handle-job/handle.vue +++ b/src/flow/components/handle-job/handle.vue @@ -529,11 +529,11 @@ if (elTabs) { let find = elTabs.find(f => f.isSave !== true); // 这里测试流程,临时屏蔽判断 todo - // if (find) useMessage().info(find.formName + ' 未保存') - // else { + if (find) useMessage().info(find.formName + ' 未保存') + else { methods.timeoutLoading() btnMethods.onHandleJob(jobBtn) - // } + } return } methods.timeoutLoading() diff --git a/src/views/finance/purchasingrequisition/add.vue b/src/views/finance/purchasingrequisition/add.vue index c18e145..809b66d 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -27,7 +27,8 @@ + clearable + :disabled="flowFieldDisabled('projectName')" /> @@ -38,7 +39,8 @@ placeholder="请选择填报日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" - style="width: 100%" /> + style="width: 100%" + :disabled="flowFieldDisabled('applyDate')" /> @@ -49,7 +51,8 @@ v-model="dataForm.fundSource" placeholder="请选择资金来源" clearable - style="width: 100%"> + style="width: 100%" + :disabled="flowFieldDisabled('fundSource')"> + style="width: 100%" + :disabled="flowFieldDisabled('budget')" /> @@ -80,7 +84,8 @@ v-model="dataForm.isCentralized" placeholder="请选择是否集采" clearable - style="width: 100%"> + style="width: 100%" + :disabled="flowFieldDisabled('isCentralized')"> + style="width: 100%" + :disabled="flowFieldDisabled('isSpecial')"> @@ -138,7 +145,8 @@ :maxlength="1000" show-word-limit placeholder="请输入采购内容(限制1000字)" - clearable /> + clearable + :disabled="flowFieldDisabled('projectContent')" /> @@ -147,7 +155,7 @@ v-model="dataForm.purchaseType" placeholder="请选择采购方式" clearable - :disabled="isAutoSelectPurchaseType" + :disabled="(isFlowEmbed && isPurchaseCenter) ? false : isAutoSelectPurchaseType" style="width: 100%"> - + 下载商务洽谈表模版 - + 下载市场采购纪要模版 - + - + 下载《部门采购询价模版》模版 @@ -199,7 +207,7 @@ " > - + @@ -207,25 +215,25 @@ - + 下载《服务商城项目需求模板(直选)》模版 - + 下载《服务商城项目需求模板(公开比选)》模版 - + 下载《表1:需求模板》模版 - + @@ -239,98 +247,99 @@ --> - + 下载《服务商城项目需求模板(邀请比选)》模版 - + 下载《服务商城项目需求模板(公开比选)》模版 - +
支持上传zip格式的压缩包文件
- +
学校统一采购
- + {{ item.label }} - + + - + - + - + - + 下载《项目可行性论证报告模板.doc》 - + - + - + 下载《单一来源论专家证附件.docx》 - + - + 下载《进口产品申请及专家论证意见表.doc》 - + - + @@ -338,7 +347,7 @@ @@ -346,32 +355,32 @@ - + - +
支持上传zip格式的压缩包文件
@@ -387,7 +396,8 @@ type="textarea" :rows="2" placeholder="请输入备注" - clearable /> + clearable + :disabled="flowFieldDisabled('remark')" />
@@ -484,8 +494,12 @@ 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'; +import { Session } from '/@/utils/storage'; import * as orderVue from '/@/api/order/order-key-vue'; +/** 采购中心角色编码:审批时仅该角色可编辑采购方式/采购形式 */ +const PURCHASE_CENTER_ROLE_CODE = 'PURCHASE_CENTER'; + // 兼容流程 dynamic-link 引用:接收 currJob / currElTab,并支持 handleJob 事件 const props = defineProps({ currJob: { type: Object, default: null }, @@ -534,6 +548,14 @@ const pageTitle = computed(() => { const flowFormDisabled = ref(false); const flowSubmitDisabled = ref(false); +/** 流程嵌入时当前节点是否为采购中心(仅采购中心可编辑采购方式/采购形式) */ +const isPurchaseCenter = ref(false); + +/** 流程嵌入且为采购中心时,除采购方式/采购形式外其余字段均只读 */ +function flowFieldDisabled(key: string) { + return isFlowEmbed.value && isPurchaseCenter.value && !['purchaseType', 'purchaseMode'].includes(key); +} + // 定义变量内容 const formRef = ref(); const currentStep = ref(0); @@ -866,8 +888,14 @@ const isAutoSelectPurchaseTypeUnion = computed(() => { return budget >= 50000 && budget < 400000 && isSpecialServiceCategory.value; }); -// 监听品目编码和预算金额变化,自动设置采购方式 -watch([() => dataForm.categoryCode, () => dataForm.budget], () => { +// 监听品目编码、预算金额及采购类型变化,自动设置/清空采购方式 +watch([() => dataForm.categoryCode, () => dataForm.budget, () => isDeptPurchase.value, () => isFlowEmbed.value], () => { + // 学校统一采购申请阶段:采购方式隐藏,由审批环节采购中心补充,此处不自动写入且清空已有值 + if (!isDeptPurchase.value && !isFlowEmbed.value) { + dataForm.purchaseType = ''; + return; + } + // 部门自行采购:自动设置网上商城 if (isAutoSelectPurchaseType.value && isDeptPurchase.value) { const onlineMallOption = purchaseTypeDeptList.value.find(item => item.value === DEPT_PURCHASE_TYPE.ONLINE_MALL); @@ -876,8 +904,8 @@ watch([() => dataForm.categoryCode, () => dataForm.budget], () => { } } - // 学校统一采购:自动设置网上商城采购方式 - if (isAutoSelectPurchaseTypeUnion.value && !isDeptPurchase.value) { + // 学校统一采购审批阶段:自动设置网上商城采购方式 + if (isAutoSelectPurchaseTypeUnion.value && !isDeptPurchase.value && isFlowEmbed.value) { const onlineMallOption = purchaseTypeUnionList.value.find(item => item.value === UNION_PURCHASE_TYPE.ONLINE_MALL); if (onlineMallOption && dataForm.purchaseType !== onlineMallOption.value) { dataForm.purchaseType = onlineMallOption.value; @@ -1168,6 +1196,14 @@ const flowMethods = { }, }; +/** 流程嵌入时采购申请权限:根据前端缓存的角色(cloud-ui:roleCode)判断,非采购中心整表只读,采购中心仅采购方式/采购形式可编辑 */ +function applyPurchaseApplyFormPerm() { + if (!isFlowEmbed.value) return; + const roleCode = Session.getRoleCode() || ''; + isPurchaseCenter.value = roleCode === PURCHASE_CENTER_ROLE_CODE; + flowFormDisabled.value = !isPurchaseCenter.value; +} + /** 流程嵌入时的“保存”回调:校验后调用 editObj,并通知流程已保存 */ async function flowSubmitForm() { if (loading.value) return; @@ -1484,6 +1520,11 @@ const handleSubmit = async () => { ...dataForm, }; + // 学校统一采购申请阶段:采购方式由审批环节补充,提交时不写入 + if (!isFlowEmbed.value && !isDeptPurchase.value) { + submitData.purchaseType = ''; + } + // 处理所有文件字段 - 收集所有文件ID到fileIds数组中 const fileFields = [ 'businessNegotiationTable', 'marketPurchaseMinutes', 'onlineMallMaterials', 'inquiryTemplate', @@ -1560,6 +1601,11 @@ const handleTempStore = async () => { ...dataForm, }; + // 学校统一采购申请阶段:采购方式由审批环节补充,暂存时不写入 + if (!isFlowEmbed.value && !isDeptPurchase.value) { + submitData.purchaseType = ''; + } + // 处理所有文件字段 - 收集所有文件ID到fileIds数组中 const fileFields = [ 'businessNegotiationTable', 'marketPurchaseMinutes', 'onlineMallMaterials', 'inquiryTemplate', @@ -1691,6 +1737,7 @@ onMounted(async () => { if (isFlowEmbed.value && props.currJob && props.currElTab?.id) { orderVue.currElTabIsExist(props.currJob, props.currElTab.id); await orderVue.currElTabIsView(flowMethods, props.currJob, props.currElTab.id, flowSubmitForm); + applyPurchaseApplyFormPerm(); } // 新增模式下设置默认值(只有在没有 id 的情况下才设置) diff --git a/src/views/purchase/apply/flow.vue b/src/views/purchase/apply/flow.vue deleted file mode 100644 index 2519e0b..0000000 --- a/src/views/purchase/apply/flow.vue +++ /dev/null @@ -1,225 +0,0 @@ - - - - -