diff --git a/WEB-INF/src/com/mms/wzkc/thd/MMSThdManageForm.java b/WEB-INF/src/com/mms/wzkc/thd/MMSThdManageForm.java index ad7d8e6..0ff2980 100644 --- a/WEB-INF/src/com/mms/wzkc/thd/MMSThdManageForm.java +++ b/WEB-INF/src/com/mms/wzkc/thd/MMSThdManageForm.java @@ -1,15 +1,14 @@ package com.mms.wzkc.thd; import java.sql.Timestamp; - import com.mms.model.MMStkModel; import com.mms.service.MMStkService; import com.report.design.basic.ReportDesignUtil.PrintFlag; +import com.report.model.MMSThdPrintModel; +import com.report.service.MMSThdPrintService; import com.util.CreateBillNo; import com.util.MainUtil; import com.util.SnowIdUtils; -import com.report.model.MMSThdPrintModel; -import com.report.service.MMSThdPrintService; import com.wat.component.DxDataCheckBox; import com.wat.component.DxDataDateTimePick; import com.wat.component.DxLabel; @@ -415,7 +414,7 @@ public class MMSThdManageForm extends WatWebForm { } } - private boolean hasno(){ + private boolean hasno(boolean towc){ DxNormalDataManager mmsthddao=DaoCreator.getNormalDao(this,"mmsthddao"); String dptid=mmsthddao.getColumnValueAsString("DPTID"); String djh=mmsthddao.getColumnValueAsString("DJH"); @@ -437,22 +436,23 @@ public class MMSThdManageForm extends WatWebForm { popgrid3.setFocus(); return true; } - - for(int i = 0;i < dbgrid1.getRowCount();i++) { - String sl=dbgrid1.getColumnValueAsString(i,"SL"); - String kysl=dbgrid1.getColumnValueAsString(i,"KYSL"); - if(!Delphi.isNullString(sl) && (!Delphi.isInteger(sl) || Double.parseDouble(MathUtil.subtract(sl, 0))<=0)){ - setLabelShow("第("+(i+1)+")行退库数量只能是大于零的整数"); - dbgrid1.setFocus(i, "SL"); - return true; - } - - if(Double.parseDouble(MathUtil.subtract(kysl, sl))<0){ - setLabelShow("第("+(i+1)+")行退库数量不能大于入库数量"); - dbgrid1.setFocus(i, "SL"); - return true; - } - } + if (towc) { + for(int i = 0;i < dbgrid1.getRowCount();i++) { + String sl=dbgrid1.getColumnValueAsString(i,"SL"); + String kysl=dbgrid1.getColumnValueAsString(i,"KYSL"); + if(!Delphi.isNullString(sl) && (!Delphi.isInteger(sl) || Double.parseDouble(MathUtil.subtract(sl, 0))<=0)){ + setLabelShow("第("+(i+1)+")行退库数量只能是大于零的整数"); + dbgrid1.setFocus(i, "SL"); + return true; + } + + if(Double.parseDouble(MathUtil.subtract(kysl, sl))<0){ + setLabelShow("第("+(i+1)+")行退库数量不能大于入库数量"); + dbgrid1.setFocus(i, "SL"); + return true; + } + } + } if(Delphi.isNullString(djh)){ djh=CreateBillNo.getWatSequenceBillNo("MMSTHDZD", MainUtil.getCurCompanyID()); if(Delphi.isNullString(djh)) { @@ -468,7 +468,7 @@ public class MMSThdManageForm extends WatWebForm { } private void panelBar1saveAction(){ - if(hasno()) { + if(hasno(true)) { return; } @@ -495,7 +495,8 @@ public class MMSThdManageForm extends WatWebForm { private void wcAction(boolean towc){ - if(hasno()) return; + String companyid=MainUtil.getCurCompanyID(); + if(hasno(towc)) return; DxNormalDataManager mmsthddao=DaoCreator.getNormalDao(this,"mmsthddao"); MMStkModel model = new MMStkModel(); model.setCompanyId(MainUtil.getCurCompanyID()); @@ -516,6 +517,7 @@ public class MMSThdManageForm extends WatWebForm { setLabelShow("提示:取消完成成功!"); this.setWinParams("flag", "1"); } + dbgrid1.reload(new Object[]{companyid,dbgrid1.getColumnValueAsString(0,"DJH")}); setEnabled(); }else{ if(towc){