define(function (require, exports, module) { //引入业务类基类 let BaseBiz = require('apps/rht/base/rhtBiz'); let rhtService = require('../../base/rhtService'); let rhtComm = require('apps/rht/comm/rhtComm'); //引入业务服务 let Service = require('./cnt070106service'); /** * 定义业务类对象 * @param vm 界面相关ViewModule */ function Biz(vm) { //继承第一步,构造继承 BaseBiz.call(this, vm); } //继承第二步,方法继承 inherits(Biz, BaseBiz); Biz.prototype.initCompleted = function () { this.super('initCompleted'); this.dsMaster.setServerBiz('cn.qdhezheng.rht.app.cnt.cnt070106.PreProcess'); } // Biz.prototype.beforeDataSrcSearch = function (dataSrc, params) { // let self = this; // self.setServerBiz('cn.qdhezheng.rht.app.cnt.cnt070106.PreProcess'); // }; //保存前校验 Biz.prototype.beforeSave = function () { let self = this; let orgCode = TypeUtil.toString(this.dsMaster.currentRow.OrgCode); let pluId = TypeUtil.toString(this.dsMaster.currentRow.PluID); let actRes= Service.AddLxKcCtl(orgCode, pluId, '0'); if (actRes.result !== 1) { Store.messager.err('保存失败!' + actRes.message); return false; }else { Store.messager.tip('保存成功!'); } // 存储过程中已经保存了,所以终止后面的程序 //self.setState('browser'); //return false; return this.super('beforeSave'); }; /** * 删除前询问,通常进行一些删除前校验操作 * 默认操作会提示‘确定删除?’询问 * @return {Boolean,String} 返回操作是否被允许,只有false时,才会不允许执行,其他则作为提示询问用户 * */ Biz.prototype.beforeDelete = function () { let self = this; let curRow = this.dsMaster.currentRow; Store.messager.confirm("确定删除吗?", function (isOK) { if(isOK) { let orgCode = TypeUtil.toString(curRow.OrgCode); let pluId = TypeUtil.toString(curRow.PluID); let actRes= Service.AddLxKcCtl(orgCode, pluId, '1'); if (actRes.result !== 1) { Store.messager.err('删除失败!' + actRes.message); }else { Store.messager.tip('删除成功!'); self.opRouter('refresh'); } } } ); // 存储过程中已经删除,中断后续操作 return false; }; return Biz; });