EAS BOS表点击事件的详解

 

 

平常开发时常涉及到一些表的点击事件,如双击字段时处理什么逻辑,三击表时根据ID打开界面什么。

1:添加表的点击事件。

 

 

 

 

2:

 

	/**
	 * 表的单击事件
	 */
	@Override
	protected void kDTable1_tableClicked(KDTMouseEvent e) throws Exception {
		super.kDTable1_tableClicked(e);
		//点击次数   点击某列
		if(e.getClickCount() >= 3){
			int index = kDTable1.getSelectManager().getActiveRowIndex();
			if(index!=0){
				String id=kDTable1.getCell(index, "id").getValue().toString();
				//不同ID打开对应界面
				openWindow(this,id);
			}
		}
		
	}
	
	
	/**
	 * 停止编辑表事件
	 */
	@Override
	protected void kDTable1_editStopped(KDTEditEvent e) throws Exception {
		super.kDTable1_editStopped(e);
		int rowIndex= e.getRowIndex();
		int colIndex = e.getColIndex();
		if(e.getColIndex()==kDTable1.getColumnIndex("updateCost")){
			IRow row = kDTable1.getRow(rowIndex);
			if (UIRuleUtil.isNotNull(row.getCell("updateCost").getValue())) {
				// "unitActualCost","actualCost","FTABLENAME","FENTRYID","FISREWORK","BASEUNITACTUALCOST"
					if(!"0".equals(row.getCell("updateCost").getValue().toString())){
						BigDecimal amount=new BigDecimal(row.getCell("updateCost").getValue().toString());
						BigDecimal qty=new BigDecimal(row.getCell("qty").getValue().toString());
						BigDecimal actualCost=amount.multiply(qty);
						row.getCell("unitActualCost").setValue(amount);
						row.getCell("actualCost").setValue(actualCost);
					}else{
						row.getCell("unitActualCost").setValue(BigDecimal.ZERO);
						row.getCell("actualCost").setValue(BigDecimal.ZERO);
					}
			}
		}
	}
	
	/**
	 * 
	 * @Title: openWindow 
	 * @Description: TODO(根据异常单界面ID打开对应界面) 
	 * @return void 返回类型 
	 * @throws
	 */
	private void openWindow(CoreUI parentUI,String id) {
		HashMap<String, String> map=new HashMap<String, String>();
		Class clazz=null;
		String bosType = new ObjectUuidPK(id).getObjectType().toString();
		if(bosType.equals(new PurInWarehsBillInfo().getBOSType().toString())){
			clazz=PurInWarehsBillEditUI.class;
		}else if(bosType.equals(new ManufactureRecBillInfo().getBOSType().toString())){
			clazz=ManufactureRecBillEditUI.class;
		}else if(bosType.equals(new OtherInWarehsBillInfo().getBOSType().toString())){
			clazz=OtherInWarehsBillEditUI.class;
		}else if(bosType.equals(new MoveInWarehsBillInfo().getBOSType().toString())){
			clazz=MoveInWarehsBillEditUI.class;
		}else if(bosType.equals(new MaterialReqBillInfo().getBOSType().toString())){
			clazz=MaterialReqBillEditUI.class;
		}else if(bosType.equals(new SaleIssueBillInfo().getBOSType().toString())){
			clazz=SaleIssueBillEditUI.class;
		}else if(bosType.equals(new MoveIssueBillInfo().getBOSType().toString())){
			clazz=MoveIssueBillEditUI.class;
		}else if(bosType.equals(new OtherIssueBillInfo().getBOSType().toString())){
			clazz=OtherIssueBillEditUI.class;
		}
		map.put("ID", id);
		try {
			CAUIHelper.openDialog(this, clazz, map, OprtState.VIEW);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	
	

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值