You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.4 KiB
111 lines
3.4 KiB
4 years ago
|
|
||
|
define(function (require, exports, module) {
|
||
|
//引入业务类基类
|
||
|
let BaseBiz = require('apps/rht/base/rhtBiz');
|
||
|
|
||
|
//引入业务服务
|
||
|
let Service = require('./pri10020103service');
|
||
|
|
||
|
/**
|
||
|
* 定义业务类对象
|
||
|
* @param vm 界面相关ViewModule
|
||
|
*/
|
||
|
function Biz(vm) {
|
||
|
//继承第一步,构造继承
|
||
|
BaseBiz.call(this, vm);
|
||
|
}
|
||
|
|
||
|
//继承第二步,方法继承
|
||
|
inherits(Biz, BaseBiz);
|
||
|
|
||
|
/**
|
||
|
* @description 数据发生变化时调用
|
||
|
* @param dataSrc 数据集
|
||
|
* @param dr 数据行
|
||
|
* @param dc 数据列
|
||
|
*/
|
||
|
Biz.prototype.fieldChanged = function (dataSrc, dr, dc) {
|
||
|
let self = this;
|
||
|
let currentRow = self.dsMaster.currentRow;
|
||
|
if (currentRow === null) return false;
|
||
|
if (dataSrc.uiObjCode === this.dsDetail.uiObjCode) {
|
||
|
switch (dc.fieldName) {
|
||
|
case 'JgZcCode':
|
||
|
this.fieldChangedJgZcCode(dataSrc, dr, dc);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
this.super('fieldChanged');
|
||
|
};
|
||
|
//JgZcCode 字段变化执行事件
|
||
|
Biz.prototype.fieldChangedJgZcCode = function (dataSrc, dr, dc) {
|
||
|
let OrgCode = TypeUtil.toString(dr['OrgCode']);
|
||
|
let JgZcCode = TypeUtil.toString(dr['JgZcCode']);
|
||
|
if (JgZcCode.length > 0){
|
||
|
let ret= Service.getSlideMenuData("DoOnDetailCalcRule","JgZcCode",JgZcCode,OrgCode,"","","");
|
||
|
if (ret.result !== 1) {
|
||
|
dr.setColumnError('PluCode', '查询政策信息失败!'+ret.message);
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
};
|
||
|
/*
|
||
|
//按钮事件控制
|
||
|
Biz.prototype.doOp = function (opCode) {
|
||
|
let self = this;
|
||
|
if (opCode == 'edit') {
|
||
|
let ds = self.dsMaster;
|
||
|
this.onreview(self, ds);
|
||
|
}
|
||
|
};
|
||
|
//手调按钮事件
|
||
|
Biz.prototype.onreview = function (biz, ds) {
|
||
|
let dsrow=ds.currentRow;
|
||
|
let BillNo = dsrow ? TypeUtil.toString(dsrow['BillNo']) : '';
|
||
|
let ret= Service.getSlideMenuData("actExecute","onreview",BillNo,PluID);
|
||
|
if (ret.result === 1) {
|
||
|
biz.dsMaster.updateRow();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Store.messager.err("记账失败!"+ret.message);
|
||
|
return false;
|
||
|
}
|
||
|
return true;
|
||
|
};
|
||
|
*/
|
||
|
//控制主界面按钮状态
|
||
|
Biz.prototype.getOpEnabled = function (opCode) {
|
||
|
let isOk = this.super('getOpEnabled', opCode);
|
||
|
if (!isOk) return false;
|
||
|
let curRow = this.dsMaster.currentRow;
|
||
|
|
||
|
if (opCode == 'edit') {
|
||
|
let OrgCode = curRow ? TypeUtil.toString(curRow['OrgCode']) : '';
|
||
|
if (!curRow)
|
||
|
return false;
|
||
|
|
||
|
if (OrgCode != Store.logOn.orgCode)
|
||
|
return false;
|
||
|
}
|
||
|
if (opCode == 'delete') {
|
||
|
let OrgCode = curRow ? TypeUtil.toString(curRow['OrgCode']) : '';
|
||
|
if (!curRow)
|
||
|
return false;
|
||
|
|
||
|
if (OrgCode != Store.logOn.orgCode)
|
||
|
return false;
|
||
|
}
|
||
|
if (opCode == 'acc') {
|
||
|
let OrgCode = curRow ? TypeUtil.toString(curRow['OrgCode']) : '';
|
||
|
if (!curRow)
|
||
|
return false;
|
||
|
|
||
|
if (OrgCode != Store.logOn.orgCode)
|
||
|
return false;
|
||
|
}
|
||
|
return true;
|
||
|
};
|
||
|
return Biz;
|
||
|
});
|