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.

57 lines
1.7 KiB

define(function (require, exports, module) {
let BaseBiz = require('apps/rht/base/rhtBiz');
//引入业务服务
let Service = require('./stk180616service');
function Biz(vm) {
//继承第一步,构造继承
BaseBiz.call(this, vm);
}
//继承第二步,方法继承
inherits(Biz, BaseBiz);
//控制主界面按钮状态
Biz.prototype.getOpEnabled = function (opCode) {
let isOk = this.super('getOpEnabled', opCode);
if (!isOk) return false;
let curRow = this.dsMaster.currentRow;
if (opCode == 'accs') {
let JzDate = curRow ? TypeUtil.toString(curRow['JzDate']) : '';
if (!curRow)
return false;
if (JzDate !== '')
return false;
}
return true;
};
//按钮事件控制
Biz.prototype.doOp = function (opCode) {
let self = this;
if (opCode == 'accs') {
this.onaccs(self);
}
};
//记账事件处理
Biz.prototype.onaccs = function (self) {
let dsrow = self.dsMaster.currentRow;
let BillNo = dsrow ? TypeUtil.toString(dsrow['BillNo']) : '';
if (BillNo.length > 0){
let ret= Service.getSlideMenuData("actExecute","onaccs",BillNo,'1821','','','');
if (ret.result !== 1) {
Store.messager.err(ret.message);
return false;
}
else{
Store.messager.tip('记账成功!');
//刷新当前行
self.dsMaster.updateRow();
}
}
return true;
};
return Biz;
});