|
@ -390,53 +390,12 @@ 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') { |
|
|
|
|
|
// 先判断角色是否满足条件 |
|
|
|
|
|
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 |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
return false; |
|
|
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 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({ hasPermi:'eam:device-maintenance-job-main:create'}), // 新增 |
|
|
defaultButtons.defaultAddBtn({ hasPermi:'eam:device-maintenance-job-main:create'}), // 新增 |
|
@ -492,7 +451,7 @@ const butttondata = (row) => { |
|
|
defaultButtons.acceptOrderBtn({ |
|
|
defaultButtons.acceptOrderBtn({ |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClick', |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClick', |
|
|
hide: !( |
|
|
hide: !( |
|
|
row.status == 'PENDING' && judgeIsTheClass(row) && judgeIsTheFactory(row) |
|
|
row.status == 'PENDING' && judgeIsTheFactory(row) |
|
|
) |
|
|
) |
|
|
}), // 接单 |
|
|
}), // 接单 |
|
|
defaultButtons.turnOrderBtn({ |
|
|
defaultButtons.turnOrderBtn({ |
|
@ -1151,7 +1110,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
if (operatRecord.value.type == 'TECH') { |
|
|
if (operatRecord.value.type == 'TECH') { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'maintenances') { |
|
|
if (item.field == 'maintenances') { |
|
|
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(response => { |
|
|
selecUserByType({ classType: 'TECH', factoryAreaNumber: operatRecord.value.factoryAreaNumber, flag: null }).then(response => { |
|
|
item.componentProps.options = response |
|
|
item.componentProps.options = response |
|
|
callback(); |
|
|
callback(); |
|
|
}); |
|
|
}); |
|
@ -1160,7 +1119,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
} else if (operatRecord.value.type == 'DEVICE') { |
|
|
} else if (operatRecord.value.type == 'DEVICE') { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'maintenances') { |
|
|
if (item.field == 'maintenances') { |
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(response => { |
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: operatRecord.value.factoryAreaNumber, flag: null }).then(response => { |
|
|
item.componentProps.options = response |
|
|
item.componentProps.options = response |
|
|
callback(); |
|
|
callback(); |
|
|
}); |
|
|
}); |
|
@ -1169,7 +1128,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
} else if (operatRecord.value.type == 'MOLD') { |
|
|
} else if (operatRecord.value.type == 'MOLD') { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'maintenances') { |
|
|
if (item.field == 'maintenances') { |
|
|
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(response => { |
|
|
selecUserByType({ classType: 'MOLD', factoryAreaNumber: operatRecord.value.factoryAreaNumber, flag: null }).then(response => { |
|
|
item.componentProps.options = response |
|
|
item.componentProps.options = response |
|
|
callback(); |
|
|
callback(); |
|
|
}); |
|
|
}); |
|
|