diff --git a/src/views/battery/cellDevice/cellDevice.data.ts b/src/views/battery/cellDevice/cellDevice.data.ts index 221395d..0e357f0 100644 --- a/src/views/battery/cellDevice/cellDevice.data.ts +++ b/src/views/battery/cellDevice/cellDevice.data.ts @@ -3,6 +3,14 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const CellDeviceRules = reactive({ + oneInjectPreCpk: [required], + twoInjectPreCpk: [required], + posCoatDenCpk: [required], + negCoatDenCpk: [required], + posRollThickCpk: [required], + negRollThickCpk: [required], + oneInjectCpk: [required], + finalInjectRetenCpk: [required], }) export const CellDevice = useCrudSchemas(reactive([ diff --git a/src/views/battery/monomer/index.vue b/src/views/battery/monomer/index.vue index ed28d30..ee6b133 100644 --- a/src/views/battery/monomer/index.vue +++ b/src/views/battery/monomer/index.vue @@ -349,10 +349,10 @@ const openForm = async (type: string, row?: any) => { } - if(type == 'create'&&isStatic.value){ - let defaultRow = await MonomerApi.getMonomer(1) - row = defaultRow - } + // if(type == 'create'&&isStatic.value){ + // let defaultRow = await MonomerApi.getMonomer(1) + // row = defaultRow + // } if(row){ // 设备 tableDataDevice.value = row.cellDeviceList @@ -400,7 +400,64 @@ const formsSuccess = async (formType,data) => { data.cellProdList= tableDataProd.value // 单体直通率 data.cellPassList= tableDataPass.value - if (formType === 'create'&&!isStatic.value) { + + + const validateFormDevice = await tableFormDeviceRef.value.validateForm() + if (!validateFormDevice) { + if(tableDataDevice.value.length==0){ + message.warning('请填写单体产线设备明细') + return + } + return + } + + const validateFormEnv = await tableFormEnvRef.value.validateForm() + if (!validateFormEnv) { + if(tableDataEnv.value.length==0){ + message.warning('请填写单体产线环境明细') + return + } + return + } + + + const validateFormPlate = await tableFormPlateRef.value.validateForm() + if (!validateFormPlate) { + if(tableDataPlate.value.length==0){ + message.warning('请填写单体极片明细') + return + } + return + } + + + const validateFormCore = await tableFormCoreRef.value.validateForm() + if (!validateFormCore) { + if(tableDataCore.value.length==0){ + message.warning('请填写单体卷芯或叠芯明细') + return + } + return + } + const validateFormProd = await tableFormProdRef.value.validateForm() + if (!validateFormProd) { + if(tableDataProd.value.length==0){ + message.warning('请填写单体产品明细') + return + } + return + } + + const validateFormPass = await tableFormPassRef.value.validateForm() + if (!validateFormPass) { + if(tableDataPass.value.length==0){ + message.warning('请填写单体直通率明细') + return + } + return + } + + if (formType === 'create') { await MonomerApi.createMonomer(data) message.success(t('common.createSuccess')) } else {