|
@ -316,8 +316,29 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
if(type == 'update'){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(type == 'create'&&tableObject.tableList.length>0){ |
|
|
|
|
|
if(isStatic.value){ |
|
|
|
|
|
// 静态 |
|
|
|
|
|
Monomer.allSchemas.formSchema.forEach(item=>{ |
|
|
|
|
|
if(item.field=='type'){ |
|
|
|
|
|
item.value = 'static' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
let defaultRow = await MonomerApi.getMonomer(1) |
|
|
|
|
|
row = defaultRow |
|
|
|
|
|
}else{ |
|
|
|
|
|
// 动态 |
|
|
|
|
|
Monomer.allSchemas.formSchema.forEach(item=>{ |
|
|
|
|
|
if(item.field=='type'){ |
|
|
|
|
|
item.value = 'moving' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(row){ |
|
|
// 设备 |
|
|
// 设备 |
|
|
tableDataDevice.value = row.cellDeviceList |
|
|
tableDataDevice.value = row.cellDeviceList |
|
|
// 环境 |
|
|
// 环境 |
|
@ -344,15 +365,6 @@ const openForm = (type: string, row?: any) => { |
|
|
// 单体直通率 |
|
|
// 单体直通率 |
|
|
tableDataPass.value = [] |
|
|
tableDataPass.value = [] |
|
|
} |
|
|
} |
|
|
if(tableObject.tableList.length>0){ |
|
|
|
|
|
if(isStatic.value){ |
|
|
|
|
|
// 静态 |
|
|
|
|
|
row = tableObject.tableList.find(item=>item.type == 'static') |
|
|
|
|
|
}else{ |
|
|
|
|
|
// 动态 |
|
|
|
|
|
row = tableObject.tableList.find(item=>item.type == 'moving') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -369,6 +381,18 @@ const formsSuccess = async (formType,data) => { |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
// 设备 |
|
|
|
|
|
data.cellDeviceList= tableDataDevice.value |
|
|
|
|
|
// 环境 |
|
|
|
|
|
data.cellEnvList= tableDataEnv.value |
|
|
|
|
|
// 单体极片 |
|
|
|
|
|
data.cellPassList= tableDataPlate.value |
|
|
|
|
|
// 单体卷芯或叠芯 |
|
|
|
|
|
data.cellCoreList= tableDataCore.value |
|
|
|
|
|
// 单体产品 |
|
|
|
|
|
data.cellProdList= tableDataProd.value |
|
|
|
|
|
// 单体直通率 |
|
|
|
|
|
data.cellPassList= tableDataPass.value |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await MonomerApi.createMonomer(data) |
|
|
await MonomerApi.createMonomer(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|