From 337211da6df0b968ca137a41dbacb05aac4f43d5 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Thu, 21 Mar 2024 13:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/device/deviceinspectionjob/index.vue | 2 +- .../eam/device/devicemaintainjob/index.vue | 18 +++++- .../eam/device/devicemaintenancejob/index.vue | 56 +++++++++++++++++-- .../eam/mold/moldinspectionjob/index.vue | 4 +- src/views/eam/mold/moldmaintainjob/index.vue | 17 +++++- .../eam/mold/moldmaintenancejob/index.vue | 55 ++++++++++++++++-- 6 files changed, 136 insertions(+), 16 deletions(-) diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index d719ef2..e669415 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -146,7 +146,7 @@ const judgeHasAddFunc = () => { const rolesOk = userStore.roles.find(item => { return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' || item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' }) - if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + if (rolesOk != undefined && rolesOk != null) { return true } else { return false diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index ec353f4..bb74b5b 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -225,7 +225,7 @@ const butttondata = (row) => { defaultButtons.acceptOrderBtn({ hide: !( - row.status == 'PENDING' + row.status == 'PENDING' && judgeIsTheClass(row) ) }), // 接单 // defaultButtons.turnOrderBtn({ @@ -497,6 +497,22 @@ onMounted(async () => { importTemplateData.templateUrl = await DeviceMaintainOrderMainApi.importTemplate() }) + +const judgeIsTheClass = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + function buttonControllFunction(row, val) { if (val == 'delete') { return false diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 1df9aa0..e76f1e2 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -232,7 +232,53 @@ const judgeHasAddFunc = () => { const rolesOk = userStore.roles.find(item => { return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' || item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' }) - if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const judgeIsTheClass = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + + +const judgeIsTheClassEngineer = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const judgeIsTheClassWorker = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { return true } else { return false @@ -288,22 +334,22 @@ const butttondata = (row) => { defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance) )}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( - row.status == 'PENDING' + row.status == 'PENDING' && judgeIsTheClass(row) ) }), // 接单 defaultButtons.turnOrderBtn({ - hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails) }), // 转办 defaultButtons.repairBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 维修 defaultButtons.verifyOrderBtn({ hide: !( - row.status == 'COMPLETED' + row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) ) }), // 验证 defaultButtons.finishOrderBtn({ - hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) }), // 完成 defaultButtons.pictureBtn({ hide: !(row.filePathList != null && row.filePathList.length > 0) diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 2098968..b2e48e4 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -146,9 +146,9 @@ const { getList, setSearchParams } = tableMethods const judgeHasAddFunc = () => { const rolesOk = userStore.roles.find(item => { - return item == 'mold_class_worker_role' || item == 'mold_class_worker_role' + return item == 'mold_class_worker_role' || item == 'mold_class_Engineer_role' }) - if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + if (rolesOk != undefined && rolesOk != null) { return true } else { return false diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index 22dccfb..89861ae 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -226,7 +226,7 @@ const butttondata = (row) => { defaultButtons.acceptOrderBtn({ hide: !( - row.status == 'PENDING' + row.status == 'PENDING' && judgeIsTheClass(row) ) }), // 接单 // defaultButtons.turnOrderBtn({ @@ -563,6 +563,21 @@ function isReceiver(orderPerson) { } +const judgeIsTheClass = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + /** 初始化 **/ onMounted(async () => { diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index 7092fa9..baf6558 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -234,9 +234,54 @@ const { getList, setSearchParams } = tableMethods const judgeHasAddFunc = () => { const rolesOk = userStore.roles.find(item => { - return item == 'mold_class_worker_role' || item == 'mold_class_worker_role' + return item == 'mold_class_worker_role' || item == 'mold_class_Engineer_role' }) - if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const judgeIsTheClass = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const judgeIsTheClassEngineer = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_Engineer_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_Engineer_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const judgeIsTheClassWorker = (row) => { + const rolesOk = userStore.roles.find(item => { + if (row.type == 'DEVICE') { + return item == 'device_class_worker_role' + }else if (row.type == 'TECH') { + return item == 'tech_class_worker_role' + } + }) + if (rolesOk != undefined && rolesOk != null) { return true } else { return false @@ -302,8 +347,7 @@ const butttondata = (row) => { defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance)) }), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( - row.status == 'PENDING' && - userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker') + row.status == 'PENDING' && judgeIsTheClass(row) ) }), // 接单 defaultButtons.turnOrderBtn({ @@ -314,8 +358,7 @@ const butttondata = (row) => { }), // 维修 defaultButtons.verifyOrderBtn({ hide: !( - row.status == 'COMPLETED' && - userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer') + row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) ) }), // 验证 defaultButtons.finishOrderBtn({