diff --git a/src/api/purchase/purchasingrequisition.ts b/src/api/purchase/purchasingrequisition.ts index 71eaf34..406200d 100644 --- a/src/api/purchase/purchasingrequisition.ts +++ b/src/api/purchase/purchasingrequisition.ts @@ -252,12 +252,13 @@ export function searchTeachers(keyword: string) { * @param id 采购申请ID * @param representorTeacherNo 指定采购代表人(单人,用户ID或工号) * @param representors 部门多人由系统抽取(多人,用户ID或工号逗号分隔) + * @param identity 身份:purchase_rep-采购代表,judge-评委 */ -export function saveRepresentor(id: number, representorTeacherNo?: string, representors?: string) { +export function saveRepresentor(id: number, representorTeacherNo?: string, representors?: string, identity?: string) { return request({ - url: '/purchase/purchasingapply/saveRepresentor', + url: '/purchase/purchasingapply/save-representor', method: 'post', - data: { id, representorTeacherNo, representors } + data: { id, representorTeacherNo, representors, representorType: identity } }); } diff --git a/src/views/purchase/purchasingrequisition/accept/AcceptBatchForm.vue b/src/views/purchase/purchasingrequisition/accept/AcceptBatchForm.vue index 2a5487b..3557846 100644 --- a/src/views/purchase/purchasingrequisition/accept/AcceptBatchForm.vue +++ b/src/views/purchase/purchasingrequisition/accept/AcceptBatchForm.vue @@ -18,7 +18,7 @@ - + 下载{{ lyysTemplateLabel }} diff --git a/src/views/purchase/purchasingrequisition/add.vue b/src/views/purchase/purchasingrequisition/add.vue index 84cc148..e05121c 100644 --- a/src/views/purchase/purchasingrequisition/add.vue +++ b/src/views/purchase/purchasingrequisition/add.vue @@ -1035,9 +1035,17 @@ const isPurchaseCenter = ref(false); /** 流程嵌入时:采购中心审核节点放开所有字段编辑;非采购中心节点只读 */ function flowFieldDisabled(_key: string) { if (isFlowEmbed.value && isPurchaseCenter.value) return false; + if (isFlowEmbed.value && isApplicant.value) return false; return !!isFlowEmbed.value; } +/** 当前用户是否为申请人(在流程中可编辑) */ +const isApplicant = computed(() => { + if (!dataForm.createUser) return false; + const currentUser = Session.getUser() || {}; + return dataForm.createUser === currentUser.userId || dataForm.createUser === currentUser.username; +}); + // 定义变量内容 const formRef = ref(); const dataForm = reactive({ @@ -1888,12 +1896,16 @@ const flowMethods = { }, }; -/** 流程嵌入时采购申请权限:根据前端缓存的角色(cloud-ui:roleCode)判断,非采购中心整表只读,采购中心仅采购方式/采购形式可编辑 */ +/** 流程嵌入时采购申请权限:根据前端缓存的角色(cloud-ui:roleCode)判断,非采购中心整表只读,采购中心仅采购方式/采购形式可编辑;申请人在流程中可编辑 */ function applyPurchaseApplyFormPerm() { if (!isFlowEmbed.value) return; const roleCode = Session.getRoleCode() || ''; isPurchaseCenter.value = roleCode === PURCHASE_CENTER_ROLE_CODE; - flowFormDisabled.value = !isPurchaseCenter.value; + if (isApplicant.value) { + flowFormDisabled.value = false; + } else { + flowFormDisabled.value = !isPurchaseCenter.value; + } } /** 流程嵌入时的“保存”回调:校验后调用 editObj,并通知流程已保存 */ diff --git a/src/views/purchase/purchasingrequisition/index.vue b/src/views/purchase/purchasingrequisition/index.vue index 38c2c56..a69e7be 100644 --- a/src/views/purchase/purchasingrequisition/index.vue +++ b/src/views/purchase/purchasingrequisition/index.vue @@ -185,6 +185,22 @@ - + + + +