Browse Source

批量删除

yaoyu 1 year ago
parent
commit
80048203db
1 changed files with 19 additions and 10 deletions
  1. 19 10
      mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderDeleteAction.java

+ 19 - 10
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderDeleteAction.java

@@ -19,17 +19,26 @@ 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();
+//		
+//		if (null != s && s[selectedRow] != null){
+//			OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
+//			if (headvo.getBillstatus()!=IBillStatus.FREE){
+//				throw new ValidationException("非自由态单据不允许删除");
+//		    }
+//		}
+		HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getDeleteData();
+		if(s != null) {
+			for (int i = 0; i < s.length; i++) {
+				OrderMainVO headvo = (OrderMainVO) s[i].getParentVO();
+				if (headvo.getBillstatus()!=IBillStatus.FREE){
+					throw new ValidationException("非自由态单据不允许删除");
+			    }
+			}
+		}
 		
-		//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();
 	}
 }