|
@ -70,7 +70,8 @@ |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
:isSearchTableItem="true" |
|
|
:isSearchTableItem="true" |
|
|
@openFormCallBack="openFormCallBack" |
|
|
:openFormCallBack="openFormCallBack" |
|
|
|
|
|
@detailOnChange="detailOnChange" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -188,7 +189,7 @@ const butttondata = (row) => { |
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 |
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
defaultButtons.maintenanceOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
@ -197,8 +198,8 @@ const butttondata = (row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'maintenanceOrder') { // 检修 |
|
|
} else if (val == 'mainInspectionOrder') { // 检修 |
|
|
handleMaintenanceOrder(row) |
|
|
openDetail(row, '代码', row.number) |
|
|
} else if (val == 'finishOrder') { // 完成 |
|
|
} else if (val == 'finishOrder') { // 完成 |
|
|
handleFinishOrder(row) |
|
|
handleFinishOrder(row) |
|
|
} |
|
|
} |
|
@ -312,6 +313,32 @@ function handleMaintenanceOrder(row) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleFinishOrder(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')) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -360,16 +387,26 @@ const detailOpenForm = (type, row) => { |
|
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
// 子表新增/编辑校验 |
|
|
const detailValidate = (data) => { |
|
|
const detailValidate = (data) => { |
|
|
return true; |
|
|
// return true; |
|
|
let tag = false; |
|
|
let tag = false; |
|
|
if (data.qty <= 0) { |
|
|
// if (data.qty <= 0) { |
|
|
message.warning('数量必须大于0') |
|
|
// message.warning('数量必须大于0') |
|
|
tag = false; |
|
|
// tag = false; |
|
|
return tag; |
|
|
// return tag; |
|
|
|
|
|
// } else { |
|
|
|
|
|
// tag = true; |
|
|
|
|
|
// return tag; |
|
|
|
|
|
// } |
|
|
|
|
|
let req = DeviceInspectionDetailRules.uncompleted?.find(item => { |
|
|
|
|
|
return item.required == true |
|
|
|
|
|
}) |
|
|
|
|
|
if (req !== undefined) { |
|
|
|
|
|
tag = false |
|
|
|
|
|
message.warning('需填入未完成原因') |
|
|
} else { |
|
|
} else { |
|
|
tag = true; |
|
|
tag = true |
|
|
return tag; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
return tag |
|
|
} |
|
|
} |
|
|
// 子表提交 |
|
|
// 子表提交 |
|
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
|
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
|
@ -377,12 +414,14 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => |
|
|
try { |
|
|
try { |
|
|
let data1 = { |
|
|
let data1 = { |
|
|
id: data.id, |
|
|
id: data.id, |
|
|
number: data.maintenanceNumber, |
|
|
number: data.number, |
|
|
|
|
|
masterId: data.masterId, |
|
|
siteId: data.siteId, |
|
|
siteId: data.siteId, |
|
|
available: data.available, |
|
|
available: data.available, |
|
|
concurrencyStamp: data.concurrencyStamp, |
|
|
concurrencyStamp: data.concurrencyStamp, |
|
|
name: data.name, |
|
|
name: data.name, |
|
|
peoples: data.peoples, |
|
|
peoples: data.peoples, |
|
|
|
|
|
status: data.status, |
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
actualMinutes: data.actualMinutes, |
|
|
actualMinutes: data.actualMinutes, |
|
|
chargePeoples: data.chargePeoples.join(','), |
|
|
chargePeoples: data.chargePeoples.join(','), |
|
@ -458,6 +497,41 @@ 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 () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|