dst.defineClass("com.dst.slms.contractmange.receipt.receiptEdit", dst.framework.coreBillBaseEdit, {
	initalizeDOM:function(){
		com.dst.slms.contractmange.receipt.receiptEdit.superClass.initalizeDOM.call(this);
	},
	contract_onDataChange(newValue,oldValue){
		var conId = $('#contract').textbox('getBizValue').id;
		dst.remoteCall({
			method : "getContractMes",
			async:true,  
			url: "receiptController",
			param : {conId:conId},
			success : function(data, textStatus) {
				debugger;
				$("#contractNum").textbox("setValue", data.data.contractNum);
				$("#conDate").datebox("setValue", data.data.conDate);
				$("#conAmt").numberbox("setValue", data.data.conAmt);
				if(data.data.partA==null){
					$("#partA").textbox("setBizValue","");
				}else{
					$("#partA").textbox("setBizValue",data.data.partA);
				}
				if(data.data.supplier==null){
					$("#supplier").textbox("setBizValue","");
				}else{
					$("#supplier").textbox("setBizValue",data.data.supplier);
				}
				if(data.data.kjcontract==null){
					$("#kjcontract").textbox("setBizValue","");
				}else{
					$("#kjcontract").textbox("setBizValue",data.data.kjcontract);
				}
				if(data.data.contractType==null){
					$("#contractType").textbox("setBizValue","");
				}else{
					$("#contractType").textbox("setBizValue",data.data.contractType);
				}
			}
		});
	},
	receiptE1_editChange:function(datagridTarget,target,index,field,newValue,oldValue){
		//获取编辑行数据
		debugger;
		var row = datagridTarget.datagrid('getRows')[index];
		row[field]=newValue;
		var fs=0;
		if(field=='score'||field=='weight'){
			var rows = datagridTarget.datagrid('getRows');
			for (var v = 0; v < rows.length; v++) {
				var row = rows[v];
				var score =row["score"]==undefined?0:row["score"];
				var weight =row["weight"]==undefined?0:row["weight"];
				var fs= Number(fs)+(Number(score)* Number(weight))/Number(100);
			}
			if(fs>=90){
				$("#result").combobox("setValue", "90");
			}else if(fs>=60){
				$("#result").combobox("setValue", "60");
			}else{
				$("#result").combobox("setValue","0" );
			}
			$("#score").numberbox("setValue", fs);
		}
		//更新行数据
//		datagridTarget.datagrid("updateRow",{index:index,row:v});
	},

});