define(function (require, exports, module) { let BaseWindow = require('system/views/pages/window'); let ProgressWindow = require('system/views/pages/progressbarwindow/progressbarwindow'); let tpl = require('text!./multiwindowdel.tpl'); let tempdata=null; let isinit='0'; function Window(args) { this.options = { title: '结账历史查询', content: tpl, width: 872, height: 600, modal: true, closed: false, closable: false, minimizable: false, maximizable: false, collapsible: false, resizable: false, data: null } this.args = args; tempdata = args.data; this.completed = args.completed $.extend(this.options, args.opts || {}); BaseWindow.call(this, this.options); this.dsMaster = new DataSource({ funcCode: this.args.biz.dsMaster.funcCode, funcObjCode: this.args.uiObjCode, isMultiPage: '1' }); this.dsMaster.setServerBiz(args.serverBiz); _.extend(this.dsMaster.fixQuery, args.fixQuery); if (_.isArray(args.exists) && args.exists.length > 0) { let keys = Object.keys(args.exists[0]); let values = []; for (let k = 0; k < args.exists.length; k++) { let value = ''; for (let i = 0; i < keys.length; i++) { value = value + '#' + args.exists[k][keys[i]]; } ; values.push(value); } ; this.dsMaster.on('onCollectChanged', function (ds) { if (ds.rows.length == 0) { return; } for (let i = ds.rows.length - 1; i >= 0; i--) { let row = ds.rows[i]; let str = ''; for (let j = 0; j < keys.length; j++) { let key = keys[j]; str = str + '#' + row[key]; } ; if (values.indexOf(str) > -1) { ds.removeRow(row); continue; } } ; }); } } inherits(Window, BaseWindow); Window.prototype.init = function () { let self = this; isinit='0'; let pluginParams = { plugin: 'funcQueryProjectPlugin', sync: true, pluginData: { funcCode: self.args.biz.dsMaster.funcCode } }; let resultData = Store.services.executeplugin(pluginParams); //注册表格 let mainGrid = { opts: { editable: false, pageSize: 50, showCheckColumn: false }, data: this.dsMaster } this.register('grid', 'grid_main', mainGrid); //注册查询面板 let queryArgs = { source: this.dsMaster, data: resultData, actions: { querySchemeChanged: function () { self.customerize(self.$container, 1); } } } this.register('querypanel', 'query_main', queryArgs); } Window.prototype.doOp = function (opCode) { let self = this let isHandled = false; switch (opCode) { case 'ok': let rows = []; if (this.dsMaster.rows != null){ for (let i = 0; i < this.dsMaster.rows.length; i++) { let row = this.dsMaster.rows[i]; if (row.$is_sel) { rows.push((row)); } } } let _args = {}; _args.data = rows; _args.sync = this.args.sync || true; _args.iterator = this.args.itreator; _args.completed = function() { self.completed && self.completed(rows) } let pWindow = new ProgressWindow(_args); this.close(); pWindow.open(); this.ok(); break; case 'refresh': this.dsMaster.defaultOrder = 'RptDate desc'; this.dsMaster.search(); //self.dsMaster.loadRows(tempdata); break; case 'del': Store.messager.confirm('确认要删除选中数据?', function (r) { if (r) { let temps=self.dsMaster.getSelectedRows(); for (i=0;i