|
|
@ -42,7 +42,7 @@ |
|
|
|
:apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain" |
|
|
|
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="true" |
|
|
|
:isBusiness="false" |
|
|
|
@onChange="onChange" |
|
|
|
:tableAllSchemas="MoldInspectionDetail.allSchemas" |
|
|
|
:tableFormRules="MoldInspectionDetailRules" |
|
|
@ -72,6 +72,7 @@ |
|
|
|
:isSearchTableItem="true" |
|
|
|
:openFormCallBack="openFormCallBack" |
|
|
|
@detailOnChange="detailOnChange" |
|
|
|
:buttonControllFunction="buttonControllFunction" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
@ -88,6 +89,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' |
|
|
|
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' |
|
|
|
|
|
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
@ -184,7 +187,7 @@ const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 |
|
|
|
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
|
] |
|
|
@ -300,7 +303,32 @@ 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.filter(item => { |
|
|
|
return item.status == 1 |
|
|
|
}) |
|
|
|
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')) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const onChange = (field, cur, item) => { |
|
|
@ -495,6 +523,27 @@ const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
callback() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function buttonControllFunction(row, val) { |
|
|
|
if (val == 'delete') { |
|
|
|
return false |
|
|
|
} else if (val == 'edit') { |
|
|
|
if (row.status == 'COMPLETED') { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} else if(val == 'add') { |
|
|
|
if (row.status == 'COMPLETED') { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|