From 889bac1b5d6902f4f161153cc29cd63d3f8cdadd Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Thu, 19 Jun 2025 16:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9D=90=E6=96=99=E5=91=98=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/lease/out.js | 18 + src/router/index.js | 14 + .../receive-apply/business-details.vue | 58 ++- .../countersign/config/config-data.vue | 2 +- .../material/lease/materialConfirm/index.vue | 394 ++++++++++++++++++ 5 files changed, 472 insertions(+), 14 deletions(-) create mode 100644 src/views/material/lease/materialConfirm/index.vue diff --git a/src/api/lease/out.js b/src/api/lease/out.js index e6c8e520..7a9bb63f 100644 --- a/src/api/lease/out.js +++ b/src/api/lease/out.js @@ -1,5 +1,14 @@ import request from '@/utils/request' +// 材料员确认-列表 +export function getCompleteOutTaskList(query) { + return request({ + url: '/material/lease_apply_info/getCompleteOutTaskList', + method: 'get', + params: query + }) +} + //领料出库-列表 export function getListLeaseOut(query) { return request({ @@ -71,3 +80,12 @@ export function submitNumOut(data) { data: data }) } + +// 材料员确认 +export function confirmMaterial(data) { + return request({ + url: '/material/lease_apply_info/confirmMaterial', + method: 'post', + data: data + }) +} diff --git a/src/router/index.js b/src/router/index.js index e3dac50e..341750e1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -98,6 +98,20 @@ export const constantRoutes = [ // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ + { + path: '/material/lease/materialConfirm', + component: Layout, + hidden: false, + //permissions: ['material:lease:list'], + children: [ + { + path: 'index', + component: () => import('@/views/material/lease/materialConfirm/index'), + name: 'MaterialConfirm', + meta: { title: '材料员确认', activeMenu: '/material/lease/outBound' } + } + ] + }, { path: '/system/user-auth', component: Layout, diff --git a/src/views/business-examine/receive-apply/business-details.vue b/src/views/business-examine/receive-apply/business-details.vue index 54afd6a2..8b777401 100644 --- a/src/views/business-examine/receive-apply/business-details.vue +++ b/src/views/business-examine/receive-apply/business-details.vue @@ -162,34 +162,58 @@ export default { // 通过 或 驳回 async onHandleAuditing(type) { // 组装参数 - const currentAuditing = this.auditingList.filter(e => e.configValues.includes(this.userId)) // 获取当前审核的节点 - const currentIndex = this.auditingList.findIndex(e => e.configValues.includes(this.userId)) // 获取当前的索引 + // 1. 先找出当前用户有权限的所有节点 + const userAuthorizedNodes = this.auditingList.filter(e => e.configValues && e.configValues.includes(this.userId)); - const { recordId, id, typeId, isAccept } = currentAuditing[0] + if (userAuthorizedNodes.length === 0) { + this.$modal.msgError('未查询到您的审核权限!') + return + } + + // 2. 根据当前节点状态找出应该审核的节点 + // 优先找待审核的节点(isAccept === 0) + let currentNode = userAuthorizedNodes.find(node => node.isAccept === 0); + + // 如果没有待审核的节点,则使用第一个有权限的节点 + if (!currentNode) { + currentNode = userAuthorizedNodes[0]; + } + + console.log('当前审核节点:', currentNode); + + const { recordId, id, typeId, isAccept } = currentNode; // if (isAccept != 0) { // this.$modal.msgError('当前已审核,不可重复审核') // return // } + Object.assign(this.auditingParams, { typeId, recordId, nodeId: id - }) - this.auditingParams.isAccept = type - if (currentIndex !== this.auditingList.length - 1) { - this.auditingParams.nextNodeId = this.auditingList[currentIndex + 1].id + }); + + this.auditingParams.isAccept = type; + + // 找出当前节点在审核列表中的索引 + const currentIndex = this.auditingList.findIndex(e => e.id === id); + + if (currentIndex !== -1 && currentIndex !== this.auditingList.length - 1) { + this.auditingParams.nextNodeId = this.auditingList[currentIndex + 1].id; } - const res = await submitAuditingApi(this.auditingParams) - console.log(res, '提交结果') + console.log('提交的审核参数:', this.auditingParams); + + const res = await submitAuditingApi(this.auditingParams); + console.log(res, '提交结果'); if (res.code === 200) { - this.$modal.msgSuccess('审核成功') + this.$modal.msgSuccess('审核成功'); setTimeout(() => { - const obj = { path: '/business-examine/receive-apply' } - this.$tab.closeOpenPage(obj) - }, 500) + const obj = { path: '/business-examine/receive-apply' }; + this.$tab.closeOpenPage(obj); + }, 500); } }, @@ -202,6 +226,14 @@ export default { const { rows: result } = await getAuditingDetailsApi({ taskId }) this.auditingList = result + + console.log('审核列表数据:', this.auditingList) + console.log('当前用户ID:', this.userId) + console.log('审核权限检查:', this.auditingList.map(item => ({ + nodeName: item.nodeName, + configValues: item.configValues, + hasPermission: item.configValues && item.configValues.includes(this.userId) + }))) } } } diff --git a/src/views/material/countersign/config/config-data.vue b/src/views/material/countersign/config/config-data.vue index cbdd18b5..787429b4 100644 --- a/src/views/material/countersign/config/config-data.vue +++ b/src/views/material/countersign/config/config-data.vue @@ -214,7 +214,7 @@ export default { nodeSort: '', // 流程顺序 nodeSignType: 1, // 会签类型 nodeSignConfig: 1, // 审核人员类型 - configValues: '', // 审核人员类型 + configValues: '', // 审核人员 configValuesList: [], roleIds: '' }, diff --git a/src/views/material/lease/materialConfirm/index.vue b/src/views/material/lease/materialConfirm/index.vue new file mode 100644 index 00000000..34bd4819 --- /dev/null +++ b/src/views/material/lease/materialConfirm/index.vue @@ -0,0 +1,394 @@ + + + + \ No newline at end of file