define(function (require, exports, module) { let BaseBiz = require('apps/rht/base/rhtBiz'); let rhtComm = require('apps/rht/comm/rhtComm'); let Service = require('./lbl2601service'); /** * 控制按钮的可用 * @param opCode 按钮编码 * @return [description] */ function Biz(vm) { //继承第一步,构造继承 BaseBiz.call(this, vm); vm.remark = '' } //继承第二步,方法继承 inherits(Biz, BaseBiz); Biz.prototype.initCompleted = function () { this.super('initCompleted'); let self = this; self.dsMaster.defaultOrder='LblClsCode'; }; //按钮事件控制 Biz.prototype.doOp = function (opCode) { if (opCode == 'prnformat') { this.onprnformat(); } }; Biz.prototype.beforeAdd = function () { self = this; let ret = Service.getSlideMenuData("actExecute", "CheckClassCount", "", "", "", "", ""); if (ret.result !== 1) { Store.messager.err(ret.message); return false; } return this.super('beforeAdd'); }; Biz.prototype.beforeDelete = function () { self = this; let curRow = this.dsMaster.currentRow; if (curRow) { if (curRow.IsSysSet==='1'){ Store.messager.tip('系统预置分类,不允许删除。'); return false; } let ret = Service.getSlideMenuData("actExecute", "LblFindInPrnFormat", curRow.LblClsCode, "", "", "", "", ""); if (ret.result !== 1) { Store.messager.tip(ret.message); return false; } } return this.super('beforeDelete'); }; //保存前校验 Biz.prototype.beforeSave = function () { let curRow = this.dsMaster.currentRow; if (curRow) { let ret = Service.getSlideMenuData("actExecute", "LblClassSaveCheck", curRow.LblClsCode, curRow.LblClsName, "", "", "", ""); if (ret.result !== 1) { Store.messager.tip(ret.message); return false; } } return this.super('beforeSave'); } return Biz; });