|
|
@ -81,7 +81,7 @@ |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitFormSec" |
|
|
|
@success="submitForm" |
|
|
|
@success="submitFormSec" |
|
|
|
:isSearchTableItem="true" |
|
|
|
/> |
|
|
|
|
|
|
@ -148,7 +148,7 @@ import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
|
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' |
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|
|
|
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') |
|
|
|
|
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
|
defineOptions({ name: 'MoldMaintenanceMain' }) |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
@ -408,9 +408,14 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
|
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
await MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { |
|
|
|
MoldMaintenanceMain.allSchemas.formSchema.find(item => { |
|
|
|
return item.field === 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
@ -679,6 +684,9 @@ const openFormSec = async (type: string, row?: any) => { |
|
|
|
}).componentProps.disabled = false |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
}).componentProps.disabled = true |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = true |
|
|
|
await MoldAccountsApi.getMoldAccountsNoPage({}) |
|
|
|
.then(res => { |
|
|
@ -740,6 +748,9 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
formRefSec.setValues(setV) |
|
|
|
} |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = false |
|
|
|
} |
|
|
|
if (field == 'turnType') { |
|
|
|
if (cur == '0') { |
|
|
@ -755,7 +766,10 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
}).componentProps.disabled = false |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
}).componentProps.disabled = true |
|
|
|
}).componentProps.disabled = true |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = true |
|
|
|
} else if (cur == '1') { |
|
|
|
const setV = {} |
|
|
|
setV['deviceNumber'] = newRow.value.deviceNumber |
|
|
@ -769,7 +783,10 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
}).componentProps.disabled = true |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
}).componentProps.disabled = false |
|
|
|
}).componentProps.disabled = false |
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'maintenance' |
|
|
|
}).componentProps.disabled = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -789,25 +806,17 @@ const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitFormSec = async (formType, data) => { |
|
|
|
data.subList = tableData.value.map((item) => { |
|
|
|
return { |
|
|
|
describes: item.describes, |
|
|
|
describes1: item.describes1, |
|
|
|
itemNumbers: item.itemNumbers, |
|
|
|
maintenances: item.maintenances.join(','), |
|
|
|
workOut: item.workOut, |
|
|
|
factoryAreaNumber: newRow.value.factoryAreaNumber, |
|
|
|
} |
|
|
|
}) // 拼接子表数据参数 |
|
|
|
const data1 = { |
|
|
|
status: data.turnType, |
|
|
|
deviceNumber: data.deviceNumber, |
|
|
|
type: data.type, |
|
|
|
maintenance: data.maintenance, |
|
|
|
id: data.id |
|
|
|
} |
|
|
|
console.log(data.subList) |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await DeviceMaintenanceMainApi.updateDeviceMaintenanceMain(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
await MoldMaintenanceMainApi.orderTurnTo(data1) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
formRefSec.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
getList() |
|
|
|