Browse Source

单体出厂检验

master
王宇飞 2 months ago
parent
commit
806474150d
  1. 46
      src/views/battery/monomer/index.vue
  2. 5
      src/views/battery/monomer/monomer.data.ts

46
src/views/battery/monomer/index.vue

@ -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'))

5
src/views/battery/monomer/monomer.data.ts

@ -18,6 +18,11 @@ export const Monomer = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.BATTERY_TYPE, dictType: DICT_TYPE.BATTERY_TYPE,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
form:{
componentProps:{
disabled:true
}
},
tableForm: { tableForm: {
type: 'Select' type: 'Select'
} }

Loading…
Cancel
Save