yaoyu il y a 11 mois
Parent
commit
f04747f483

+ 9 - 6
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderApproveAction.java

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

+ 6 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderDeleteAction.java

@@ -19,16 +19,17 @@ public class OrderDeleteAction extends DeleteAction {
 	public void execute() throws Exception {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		
-		int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
+		//int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		
-		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
 		
-		if (null != s && s[selectedRow] != null){
-			OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
+		//if (null != s && s[selectedRow] != null){
+			//OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
+			OrderMainVO headvo = (OrderMainVO) this.getSelection(mainMgrPanel).getParentVO();
 			if (headvo.getBillstatus()!=IBillStatus.FREE){
 				throw new ValidationException("非自由态单据不允许删除");
 		    }
-		}
+		//}
 		super.execute();
 	}
 }

+ 6 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderEditAction.java

@@ -20,14 +20,15 @@ public class OrderEditAction extends BrowseFromListToCardAction{
 
 	public void execute() throws Exception {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
-		int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
-		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
-		if (null !=s && s[selectedRow] != null){
-			OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
+		//int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
+		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
+		//if (null !=s && s[selectedRow] != null){
+			//OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
+			OrderMainVO headvo = (OrderMainVO) this.getSelection(mainMgrPanel).getParentVO();
 			if (headvo.getBillstatus() != IBillStatus.FREE){
 				throw new ValidationException("非自由态单据不可编辑");
 			}
-		}
+		//}
 		
 		super.execute();
 		

+ 7 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderUnApproveAction.java

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