define(function (require, exports, module) { //引入业务类基类 let BaseBiz = require('apps/rht/base/rhtBiz'); //引入业务服务 let service = require('./sys01030801service'); /** * 定义业务类对象 * @param vm 界面相关ViewModule */ function Biz(vm) { //继承第一步,构造继承 BaseBiz.call(this, vm); } //继承第二步,方法继承 inherits(Biz, BaseBiz); Biz.prototype.beforeEdit = function () { let currentRow = this.dsMaster.currentRow; let lvlType = TypeUtil.toString(currentRow['LvlType']); let tableName = ''; if(lvlType == '0') { tableName = 'tOrgDept'; }else if(lvlType == '1') { tableName = 'tCatCategory'; }else if(lvlType == '2') { tableName = 'tStoCw'; }else if(lvlType == '3') { tableName = 'tBasArea'; }else if(lvlType == '5') { tableName = 'tAccKM'; }else { Store.messager.err('未知级别类型,不能编辑!'); return false; } let ret = service.ControlCodeRule(tableName); if(ret.result != 1) { Store.messager.err(ret.message); return false; } return this.super('beforeEdit'); } Biz.prototype.afterEdit = function () { let masterAdapter = this.view.vm['ep_dsMaster']; let currentRow = this.dsMaster.currentRow; let lvlType = TypeUtil.toString(currentRow['LvlType']); if(lvlType == '2') { masterAdapter.setEditorEditable('IsUsed', false); } return this.super('beforeEdit'); } //保存前数据判断 Biz.prototype.beforeSave = function () { let curRow = this.dsMaster.currentRow; return this.super('beforeSave'); } return Biz; });