|
|
@ -70,8 +70,7 @@ |
|
|
|
:detailValidate="detailValidate" |
|
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
|
:isSearchTableItem="true" |
|
|
|
:openFormCallBack="openFormCallBack" |
|
|
|
@detailOnChange="detailOnChange" |
|
|
|
@openFormCallBack="openFormCallBack" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
@ -189,7 +188,7 @@ const butttondata = (row) => { |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
|
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
|
defaultButtons.maintenanceOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
|
] |
|
|
|
} |
|
|
@ -198,8 +197,8 @@ const butttondata = (row) => { |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'mainInspectionOrder') { // 检修 |
|
|
|
openDetail(row, '代码', row.number) |
|
|
|
} else if (val == 'maintenanceOrder') { // 检修 |
|
|
|
handleMaintenanceOrder(row) |
|
|
|
} else if (val == 'finishOrder') { // 完成 |
|
|
|
handleFinishOrder(row) |
|
|
|
} |
|
|
@ -313,32 +312,6 @@ function handleMaintenanceOrder(row) { |
|
|
|
} |
|
|
|
|
|
|
|
function handleFinishOrder(row) { |
|
|
|
let param = { |
|
|
|
masterId : row.id |
|
|
|
} |
|
|
|
DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param |
|
|
|
).then(response => { |
|
|
|
if (response != null) { |
|
|
|
if (response.list.length == 0) { |
|
|
|
message.error(t('请先填写并完成检修明细内容!')) |
|
|
|
} else { |
|
|
|
let unFinishedList = response.list.filters(item => { |
|
|
|
return item.status == 0 |
|
|
|
}) |
|
|
|
if (unFinishedList != null && unFinishedList.length > 0) { |
|
|
|
message.error(t('请先完成各检修明细内容!')) |
|
|
|
return |
|
|
|
} else { |
|
|
|
DeviceInspectionMainApi.finishInspection(row.id).then(res => { |
|
|
|
message.success(t('common.finishSuccess')) |
|
|
|
getList() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.error(t('common.finishFail')) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -387,26 +360,16 @@ const detailOpenForm = (type, row) => { |
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
|
const detailValidate = (data) => { |
|
|
|
// return true; |
|
|
|
return true; |
|
|
|
let tag = false; |
|
|
|
// if (data.qty <= 0) { |
|
|
|
// message.warning('数量必须大于0') |
|
|
|
// tag = false; |
|
|
|
// return tag; |
|
|
|
// } else { |
|
|
|
// tag = true; |
|
|
|
// return tag; |
|
|
|
// } |
|
|
|
let req = DeviceInspectionDetailRules.uncompleted?.find(item => { |
|
|
|
return item.required == true |
|
|
|
}) |
|
|
|
if (req !== undefined) { |
|
|
|
tag = false |
|
|
|
message.warning('需填入未完成原因') |
|
|
|
if (data.qty <= 0) { |
|
|
|
message.warning('数量必须大于0') |
|
|
|
tag = false; |
|
|
|
return tag; |
|
|
|
} else { |
|
|
|
tag = true |
|
|
|
tag = true; |
|
|
|
return tag; |
|
|
|
} |
|
|
|
return tag |
|
|
|
} |
|
|
|
// 子表提交 |
|
|
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
|
|
@ -414,14 +377,12 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => |
|
|
|
try { |
|
|
|
let data1 = { |
|
|
|
id: data.id, |
|
|
|
number: data.number, |
|
|
|
masterId: data.masterId, |
|
|
|
number: data.maintenanceNumber, |
|
|
|
siteId: data.siteId, |
|
|
|
available: data.available, |
|
|
|
concurrencyStamp: data.concurrencyStamp, |
|
|
|
name: data.name, |
|
|
|
peoples: data.peoples, |
|
|
|
status: data.status, |
|
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
|
actualMinutes: data.actualMinutes, |
|
|
|
chargePeoples: data.chargePeoples.join(','), |
|
|
@ -497,41 +458,6 @@ const submitForm = async (formType, data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function detailOnChange(field, cur, item) { |
|
|
|
if (field == 'status') { |
|
|
|
if (cur == '1') { |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
|
DeviceInspectionDetailRules.uncompleted = [required] |
|
|
|
} else { |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
delete DeviceInspectionDetailRules.uncompleted; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
if (row == undefined || row == null) { |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
delete DeviceInspectionDetailRules.uncompleted; |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' |
|
|
|
} else { |
|
|
|
if (row.status == '1') { |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
|
DeviceInspectionDetailRules.uncompleted = [required] |
|
|
|
} else { |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
delete DeviceInspectionDetailRules.uncompleted; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
callback() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|