dst.defineClass("com.dst.slms.contractmange.salecontract.saleContractEdit", dst.framework.coreBillBaseEdit, {
	initalizeDOM:function(){
		com.dst.slms.contractmange.salecontract.saleContractEdit.superClass.initalizeDOM.call(this);
	},
	saleContractTaxE_editChange:function(datagridTarget,target,index,field,newValue,oldValue){
		//获取编辑行数据
		var v = {};
		if(field=='taxConAmt'||field=='taxRate'){
			var rows = datagridTarget.datagrid('getRows');
			var dxrow = rows[index];
			dxrow[field]=newValue;
			var dxtaxConAmt =dxrow["taxConAmt"]==undefined?0:dxrow["taxConAmt"];
			var dxtax =dxrow["taxRate"]==undefined?0:dxrow["taxRate"].taxRate;
			v["noTaxConAmt"]=dxtaxConAmt-(dxtaxConAmt*dxtax)/100
			v["taxAmt"]=(dxtaxConAmt*dxtax)/100
			//更新行数据
			datagridTarget.datagrid("updateRow",{index:index,row:v});
			var taxConAmtall=0;
			var noTaxConAmtall=0;
			var taxAmtall=0;
			var taxall=0;
			for (var v = 0; v < rows.length; v++) {
				var row = rows[v];
				var taxConAmt =row["taxConAmt"]==undefined?0:row["taxConAmt"];
				var noTaxConAmt =row["noTaxConAmt"]==undefined?0:row["noTaxConAmt"];
				var taxAmt =row["taxAmt"]==undefined?0:row["taxAmt"];
				var tax =row["taxRate"]==undefined?0:row["taxRate"].taxRate;
				taxConAmtall=Number(taxConAmtall)+Number(taxConAmt);
				noTaxConAmtall=Number(noTaxConAmtall)+Number(noTaxConAmt);
				taxAmtall=Number(taxAmtall)+Number(taxAmt);
				taxall=Number(taxall)+Number(tax);
			}
			$("#taxConAmt").numberbox("setValue", taxConAmtall);
			$("#tax").numberbox("setValue", taxall/(rows.length));
			$("#notaxConAmt").numberbox("setValue", noTaxConAmtall);
			$("#taxAmt").numberbox("setValue", taxAmtall);
		}

	},
});