学校统一采购
-
+
{{ 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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-