Browse Source

BUG修改

yaoyu 1 năm trước cách đây
mục cha
commit
60340745d6

+ 8 - 6
xc/cg/src/client/u8c/ui/mytest/action/DemandApproveAction.java

@@ -27,17 +27,19 @@ public class DemandApproveAction extends AbstractAction{
 	@Override
 	public void execute() throws Exception {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
-		int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
-		HRAggVO[] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
-		if (null != s && s[selectedRow] != null){
-			DemandVO headvo = (DemandVO) s[selectedRow].getParentVO();
+		//int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
+		HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
+		//HRAggVO[] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+		//if (null != s && s[selectedRow] != null){
+			//DemandVO headvo = (DemandVO) s[selectedRow].getParentVO();
+		DemandVO headvo = (DemandVO) s[0].getParentVO();
 			if (headvo.getBillstatus() != IBillStatus.FREE){
 				throw new ValidationException("非自由态单据不允许审批");
 			}
 			headvo.setBillstatus(IBillStatus.CHECKPASS);
 			headvo.setApprove(PubEnv.getPk_user());
-		}
-		((DemandDataModel)this.frameUI.getDataModel()).execApprove(s[selectedRow]);
+		//}
+		((DemandDataModel)this.frameUI.getDataModel()).execApprove(s[0]);
 		getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
 		
 	}

+ 19 - 8
xc/cg/src/client/u8c/ui/mytest/action/DemandDeleteAction.java

@@ -19,16 +19,27 @@ public class DemandDeleteAction extends DeleteAction{
 	public void execute() throws Exception {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		
-		int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
+//		int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
+//		
+//		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+//		
+//		if (null != s && s[selectedRow] != null){
+//			DemandVO cta = (DemandVO) s[selectedRow].getParentVO();
+//			if (cta.getBillstatus()!=IBillStatus.FREE){
+//				throw new ValidationException("非编写状态不能删除。");
+//		    }
+//		}
+		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getDeleteData();
+		if(s != null) {
+			for (int i = 0; i < s.length; i++) {
+				DemandVO cta = (DemandVO) s[i].getParentVO();
+				if (cta.getBillstatus()!=IBillStatus.FREE){
+					throw new ValidationException("非编写状态不能删除。");
+			    }
+			}
+		}
 		
-		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
 		
-		if (null != s && s[selectedRow] != null){
-			DemandVO cta = (DemandVO) s[selectedRow].getParentVO();
-			if (cta.getBillstatus()!=IBillStatus.FREE){
-				throw new ValidationException("非编写状态不能删除。");
-		    }
-		}
 		super.execute();
 	}
 	

+ 6 - 5
xc/cg/src/client/u8c/ui/mytest/action/DemandEditAction.java

@@ -22,18 +22,19 @@ public class DemandEditAction extends BrowseFromListToCardAction{
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		
 		// 获取选中行
-		int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
+		//int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
 		
 		// 获取界面聚合vos
-		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
 		
-		if (null !=s && s[selectedRow] != null){
+		//if (null !=s && s[selectedRow] != null){
 			// 主表vo
-			DemandVO cta = (DemandVO) s[selectedRow].getParentVO();
+			//DemandVO cta = (DemandVO) s[selectedRow].getParentVO();
+			DemandVO cta = (DemandVO) this.getSelection(mainMgrPanel).getParentVO();
 			if (cta.getBillstatus() != IBillStatus.FREE){
 				throw new ValidationException("非编写状态不能修改。");
 			}
-		}
+		//}
 		
 		super.execute();
 		

+ 8 - 6
xc/cg/src/client/u8c/ui/mytest/action/DemandUnApproveAction.java

@@ -26,17 +26,19 @@ public class DemandUnApproveAction extends AbstractAction{
 	@Override
 	public void execute() throws Exception {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
-		int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
-		HRAggVO[] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
-		if (null != s && s[selectedRow] != null){
-			DemandVO headvo = (DemandVO) s[selectedRow].getParentVO();
+		//int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
+		HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
+		//HRAggVO[] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+		//if (null != s && s[selectedRow] != null){\
+		DemandVO headvo = (DemandVO) s[0].getParentVO();
+			//DemandVO headvo = (DemandVO) s[selectedRow].getParentVO();
 			if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
 				throw new ValidationException("非审批态单据不允许取消审批");
 			}
 			headvo.setBillstatus(IBillStatus.FREE);
 			headvo.setApprove("");
-		}
-		((DemandDataModel)this.frameUI.getDataModel()).execApprove(s[selectedRow]);
+		//}
+		((DemandDataModel)this.frameUI.getDataModel()).execApprove(s[0]);
 		getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
 	}