|
楼主 |
发表于 2017-6-14 16:34:20
|
显示全部楼层
本帖最后由 棒棒糖 于 2017-6-14 16:37 编辑
目前还有个问题 Model.prototype.modelLoad = function(event){
$(".close").click(function(){
if(confirm("是否保存输入信息")){
this.btnSaveClick();
}
})
};点击确定后想调用保存的方法,结果报错this.btnSaveClick is not a function
/**
*保存点击事件
*/
Model.prototype.btnSaveClick = function(event){
this.saveOperate(event);
this.owner.send({"operateFlag":"refreshData"});
var contractData = this.comp("contractData");
contractData.refreshData();
var contractName = contractData.getValueByID("fContractName",contractID);
var fCtrAmount = contractData.getValueByID("fCtrAmount",contractID);
var fCompletionRate = contractData.getValueByID("fCompletionRate",contractID);
if(fCompletionRate){
fCompletionRate = fCompletionRate + "%";
}else if(fCompletionRate == "0"){
fCompletionRate = "0%";
}
this.showTile(contractName,fCtrAmount,fCompletionRate);
};
/**
*保存操作
*/
Model.prototype.saveOperate = function(event){
var dialogData = this.comp("dialogData");
var total = 0;
//计算合同收/付款总金额
dialogData.each(function(param){
var fPaymentsTotal = param.row.val('fPaymentsTotal');
total += fPaymentsTotal;
});
//判断收/付款金额是否超过合同金额
var params = new biz.Request.ActionParam();
params.setString('rowID', contractID);
params.setString('contractTotal',total);
var result = Geoway.X5.Utils.doSendRequest(params,"checkContractSum",this.getContext());
if(result){
alert("合同金额大于收付款金额");
return;
}
if(dialogData.saveData()){
alert("保存成功");
this.updateContractInfo(contractID,total);
};
// dialogData.saveData({
// onSuccess : function(event){
// alert("保存成功");
// }
// });
};
|
|