Browse Source

修复测试bug

master
ljlong_2630 8 months ago
parent
commit
337211da6d
  1. 2
      src/views/eam/device/deviceinspectionjob/index.vue
  2. 18
      src/views/eam/device/devicemaintainjob/index.vue
  3. 56
      src/views/eam/device/devicemaintenancejob/index.vue
  4. 4
      src/views/eam/mold/moldinspectionjob/index.vue
  5. 17
      src/views/eam/mold/moldmaintainjob/index.vue
  6. 55
      src/views/eam/mold/moldmaintenancejob/index.vue

2
src/views/eam/device/deviceinspectionjob/index.vue

@ -146,7 +146,7 @@ const judgeHasAddFunc = () => {
const rolesOk = userStore.roles.find(item => { 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' 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 return true
} else { } else {
return false return false

18
src/views/eam/device/devicemaintainjob/index.vue

@ -225,7 +225,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ // defaultButtons.turnOrderBtn({
@ -497,6 +497,22 @@ onMounted(async () => {
importTemplateData.templateUrl = await DeviceMaintainOrderMainApi.importTemplate() 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) { function buttonControllFunction(row, val) {
if (val == 'delete') { if (val == 'delete') {
return false return false

56
src/views/eam/device/devicemaintenancejob/index.vue

@ -232,7 +232,53 @@ const judgeHasAddFunc = () => {
const rolesOk = userStore.roles.find(item => { 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' 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 return true
} else { } else {
return false 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.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails)
}), // }), //
defaultButtons.repairBtn({ defaultButtons.repairBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails)
}), // }), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0)

4
src/views/eam/mold/moldinspectionjob/index.vue

@ -146,9 +146,9 @@ const { getList, setSearchParams } = tableMethods
const judgeHasAddFunc = () => { const judgeHasAddFunc = () => {
const rolesOk = userStore.roles.find(item => { 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 return true
} else { } else {
return false return false

17
src/views/eam/mold/moldmaintainjob/index.vue

@ -226,7 +226,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ // 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 () => { onMounted(async () => {

55
src/views/eam/mold/moldmaintenancejob/index.vue

@ -234,9 +234,54 @@ const { getList, setSearchParams } = tableMethods
const judgeHasAddFunc = () => { const judgeHasAddFunc = () => {
const rolesOk = userStore.roles.find(item => { 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 return true
} else { } else {
return false 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.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance)) }), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && row.status == 'PENDING' && judgeIsTheClass(row)
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker')
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
@ -314,8 +358,7 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' && row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({

Loading…
Cancel
Save