Browse Source

修复测试bug

master
ljlong_2630 7 months ago
parent
commit
ec56db6ba4
  1. 25
      src/views/eam/basic/deviceMoldItemsHistory/deviceMoldItemsHistory.data.ts
  2. 43
      src/views/eam/device/devicemaintenancejob/index.vue
  3. 36
      src/views/eam/mold/moldmaintenancejob/index.vue

25
src/views/eam/basic/deviceMoldItemsHistory/deviceMoldItemsHistory.data.ts

@ -1,6 +1,8 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
const operatTypeList = getStrDictOptions(DICT_TYPE.SYSTEM_OPERATE_TYPE).filter(item => { const operatTypeList = getStrDictOptions(DICT_TYPE.SYSTEM_OPERATE_TYPE).filter(item => {
return (item.value == '2' || item.value == '3' || item.value == '4') return (item.value == '2' || item.value == '3' || item.value == '4')
}) })
@ -127,6 +129,28 @@ export const DeviceMoldItemsHistory = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '操作人',
field: 'creator',
sort: 'custom',
isForm: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
table: {
width: 170
},
},
{
label: '操作时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{ {
label: '操作类型', label: '操作类型',
field: 'operatType', field: 'operatType',
@ -149,6 +173,7 @@ export const DeviceMoldItemsHistory = useCrudSchemas(reactive<CrudSchema[]>([
}, },
} }
}, },
{ {
label: '操作备注', label: '操作备注',
field: 'remark', field: 'remark',

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

@ -354,6 +354,10 @@ const judgeIsTheClass = (row) => {
} }
} }
const judgeIsTheFactory = (row) => {
return userStore.userSelfInfo.deptId == row.factoryAreaNumber
}
const judgeIsTheClassEngineer = (row) => { const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => { const rolesOk = userStore.roles.find(item => {
@ -371,16 +375,6 @@ const judgeIsTheClassEngineer = (row) => {
} }
const judgeIsTheClassEngineerAndApply = (row,type) => { const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'DEVICE') {
return item === 'device_class_Engineer_role';
} else if (row.type == 'TECH') {
return item === 'tech_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
// //
if (row.status === 'COMPLETED' && type == 'CONFIRM') { if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer // COMPLETEDrequestNumberdeclarer
@ -389,10 +383,28 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
}else{ }else{
return false return false
} }
}else if(row.status === 'COMPLETED' && type == 'VERIFY'){
if(row.requestNumber == null || row.requestNumber == ''){
//
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) return true
}
} else if (row.status === 'APPLYPASS' && type == 'VERIFY') { } else if (row.status === 'APPLYPASS' && type == 'VERIFY') {
// APPLYPASStrue //
// const rolesOk = userStore.roles.find(item => {
return true; if (row.type == 'DEVICE') {
return item == 'device_class_Engineer_role'
}else if (row.type == 'TECH') {
return item == 'tech_class_Engineer_role'
}
})
if(rolesOk) return true
} }
// COMPLETEDAPPLYPASSCOMPLETEDfalse // COMPLETEDAPPLYPASSCOMPLETEDfalse
@ -417,6 +429,7 @@ const judgeIsTheClassWorker = (row) => {
} }
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc()) }), // defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc()) }), //
@ -469,7 +482,7 @@ const butttondata = (row) => {
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row) && judgeIsTheFactory(row)
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
@ -480,7 +493,7 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row)
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({

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

@ -351,6 +351,10 @@ const judgeIsTheClass = (row) => {
} }
} }
const judgeIsTheFactory = (row) => {
return userStore.userSelfInfo.deptId == row.factoryAreaNumber
}
const judgeIsTheClassEngineer = (row) => { const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => { const rolesOk = userStore.roles.find(item => {
if (row.type == 'MOLD') { if (row.type == 'MOLD') {
@ -436,7 +440,7 @@ const butttondata = (row) => {
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row) && judgeIsTheFactory(row)
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
@ -447,7 +451,7 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row)
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
@ -1138,14 +1142,6 @@ const validateRow = (row) => {
const judgeIsTheClassEngineerAndApply = (row,type) => { const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'MOLD') {
return item === 'mold_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
// //
if (row.status === 'COMPLETED' && type == 'CONFIRM') { if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer // COMPLETEDrequestNumberdeclarer
@ -1154,10 +1150,24 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
}else{ }else{
return false return false
} }
}else if(row.status === 'COMPLETED' && type == 'VERIFY') {
if(row.requestNumber == null || row.requestNumber == ''){
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'MOLD') {
return item === 'mold_class_Engineer_role';
}
});
if(rolesOk) return true
}
}else if (row.status === 'APPLYPASS' && type == 'VERIFY') { }else if (row.status === 'APPLYPASS' && type == 'VERIFY') {
// APPLYPASStrue //
// const rolesOk = userStore.roles.some(item => {
return true; if (row.type == 'MOLD') {
return item === 'mold_class_Engineer_role';
}
});
if(rolesOk) return true
} }
// COMPLETEDAPPLYPASSCOMPLETEDfalse // COMPLETEDAPPLYPASSCOMPLETEDfalse

Loading…
Cancel
Save