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