/** * 复制权限按钮弹框文件 * @description [description] * @version 1.0 * @author yangjinhua */ define(function(require, exports, module) { let Window = require('system/views/pages/window'); let tpl = require('text!apps/rht/etp/etp0607/Tran.tpl'); let service = require('./etp0607service'); let rhtComm = require('../../comm/rhtComm'); let fOrgCode; /** * [复制权限弹框] * @param {[type]} dsData 角色表数据源,用于对角色ComBox进行赋值 */ function Tran(orgCode, etpCode, etpAttribute) { this.options = { title: "转化", content: tpl, width: 250, height: 153, modal: true, closed: true, closable: true, draggable: true, maximizable: false, resizable: false, data: null } this.orgCode = orgCode; this.etpCode = etpCode; this.etpAttribute = etpAttribute; Window.call(this, this.options); } inherits(Tran, Window); Tran.prototype.init = function() { } //执行windows窗体上自定义按钮事件 Tran.prototype.customerize = function() { let self = this; //确定按钮事件 this.getElement('.btnOk').on('click', function(event) { let newAttribute = $("input[name='switch']:checked").val(); if(!newAttribute) { return false; } if(newAttribute == self.etpAttribute) { Store.messager.err('已经是' + (self.etpAttribute=='1' ? '配送' : '批发') + '客户,不需要转化!'); return false; } if (!Store.confirm("您确定要转化吗?")) { return false; } ret = service.EtpCustomerTurn(self.orgCode, self.etpCode, newAttribute); if (ret.result != 1) { Store.messager.err('转化出错:' + ret.message); return false; } Store.messager.tip('转化成功!'); if (self.callback) { self.callback(); } self.close(); }); //取消按钮事件 this.getElement('.btnCancel').on('click', function(event) { self.close(); }); } return Tran; })