|
|
@ -91,6 +91,8 @@ 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 * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' |
|
|
|
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' |
|
|
|
|
|
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
@ -196,7 +198,7 @@ const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 |
|
|
|
// defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 |
|
|
|
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
|
] |
|
|
@ -215,8 +217,32 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
const res = await MoldInspectionMainApi.getMoldInspectionMainNoPage() |
|
|
|
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) |
|
|
|
const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') |
|
|
|
const newMoldList = moldList.filter(item => { |
|
|
|
let flag = true |
|
|
|
res.forEach(element => { |
|
|
|
if (item.number == element.deviceNumber && element.status != 'COMPLETED' && element.status != 'VERIFIED' && element.status != 'REJECTED') { |
|
|
|
flag = false |
|
|
|
} |
|
|
|
}) |
|
|
|
return flag |
|
|
|
}) |
|
|
|
const newRepairList = repairList.filter(item => { |
|
|
|
let flag = false |
|
|
|
newMoldList.forEach(element => { |
|
|
|
if (item.number == element.number) { |
|
|
|
flag = true |
|
|
|
} |
|
|
|
}) |
|
|
|
return flag |
|
|
|
}) |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = newMoldList |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'maintenanceNumber').componentProps.options = newRepairList |
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|