|
|
@ -357,10 +357,6 @@ const judgeIsTheClass = (row) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const judgeIsTheFactory = (row) => { |
|
|
|
return userStore.userSelfInfo.deptId == row.factoryAreaNumber |
|
|
|
} |
|
|
|
|
|
|
|
const judgeIsTheClassEngineer = (row) => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
if (row.type == 'MOLD') { |
|
|
@ -392,8 +388,8 @@ const judgeIsTheClassWorker = (row) => { |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({ hasPermi:'eam:mold-maintenance-job-main:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-maintenance-job-main:import'}), |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-maintenance-job-main:export'}), |
|
|
|
// defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-maintenance-job-main:import'}), |
|
|
|
// defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-maintenance-job-main:export'}), |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
@ -449,7 +445,7 @@ const butttondata = (row) => { |
|
|
|
defaultButtons.acceptOrderBtn({ |
|
|
|
hasPermi:'eam:mold-maintenance-job-main:orderClick', |
|
|
|
hide: !( |
|
|
|
row.status == 'PENDING' && judgeIsTheFactory(row) |
|
|
|
row.status == 'PENDING' |
|
|
|
) |
|
|
|
}), // 接单 |
|
|
|
defaultButtons.turnOrderBtn({ |
|
|
@ -463,7 +459,7 @@ const butttondata = (row) => { |
|
|
|
defaultButtons.verifyOrderBtn({ |
|
|
|
hasPermi:'eam:mold-maintenance-job-main:orderClickVerify', |
|
|
|
hide: !( |
|
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row) |
|
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') |
|
|
|
) |
|
|
|
}), // 验证 |
|
|
|
defaultButtons.finishOrderBtn({ |
|
|
@ -1163,21 +1159,24 @@ const validateRow = (row) => { |
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
|
// 根据不同的状态进行判断 |
|
|
|
if (row.status === 'COMPLETED') { |
|
|
|
if (row.status === 'COMPLETED' && type == 'CONFIRM') { |
|
|
|
// COMPLETED状态下,需要额外判断requestNumber和declarer |
|
|
|
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){ |
|
|
|
return true |
|
|
|
}else{ |
|
|
|
return false |
|
|
|
} |
|
|
|
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){ |
|
|
|
return true |
|
|
|
}else if(row.requestNumber == null || row.requestNumber == ''){ |
|
|
|
if(row.status === 'COMPLETED' && type == 'VERIFY'){ |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|