You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
3.7 KiB
142 lines
3.7 KiB
4 years ago
|
|
||
|
|
||
|
define(function (require, exports, module) {
|
||
|
let Window = require('system/views/pages/window');
|
||
|
let tpl = require('text!./mdyhinf.tpl');
|
||
|
let rhtComm = require('../../comm/rhtComm');
|
||
|
//let Service = require('apps/rht/cou/cou190201/cou190201service');
|
||
|
|
||
|
function MdYhInf(args) {
|
||
|
this.options = {
|
||
|
title: '门店要货信息',
|
||
|
content: tpl,
|
||
|
width: 800,
|
||
|
height: 536,
|
||
|
modal: true,
|
||
|
closed: true,
|
||
|
closable: true,
|
||
|
minimizable: false,
|
||
|
maximizable: false,
|
||
|
collapsible: false,
|
||
|
resizable: false,
|
||
|
data: null
|
||
|
}
|
||
|
|
||
|
this.args = args;
|
||
|
Window.call(this, this.options);
|
||
|
|
||
|
let uiObjCode = this.args.uiObjCode;
|
||
|
this.dsMaster = new DataSource({
|
||
|
funcCode: this.args.funcCode,
|
||
|
funcObjCode: uiObjCode,
|
||
|
isMultiPage: '1'
|
||
|
});
|
||
|
|
||
|
this.dsMaster.setServerBiz(args.serverBiz)
|
||
|
_.extend(this.dsMaster.fixQuery, args.fixQuery);
|
||
|
}
|
||
|
|
||
|
inherits(MdYhInf, Window);
|
||
|
|
||
|
MdYhInf.prototype.init = function () {
|
||
|
let self = this;
|
||
|
let mainGrid = {
|
||
|
opts: {
|
||
|
editable: false,
|
||
|
pageSize: 50,
|
||
|
enablePager: self.args.enablePager || false,
|
||
|
showCheckColumn: false
|
||
|
},
|
||
|
data: this.dsMaster,
|
||
|
actions: {
|
||
|
onDblClick: function (e, args) {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
let mainToolBar = {
|
||
|
opts: {},
|
||
|
data: [{
|
||
|
opCode: 'close',
|
||
|
caption: '关闭',
|
||
|
parentOp: '',
|
||
|
opClass: 'close'
|
||
|
}, {
|
||
|
opCode: 'refresh',
|
||
|
caption: '刷新',
|
||
|
parentOp: '',
|
||
|
opClass: 'refresh'
|
||
|
}],
|
||
|
actions: {
|
||
|
click: function (opCode) {
|
||
|
self.doOp(opCode);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
this.register('grid', 'grid_main', mainGrid);
|
||
|
this.register('toolbar', 'toolbar_main', mainToolBar);
|
||
|
};
|
||
|
|
||
|
MdYhInf.prototype.doOp = function (opCode) {
|
||
|
switch (opCode) {
|
||
|
case 'close':
|
||
|
this.close();
|
||
|
break;
|
||
|
case 'refresh':
|
||
|
this.refresh();
|
||
|
break;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
MdYhInf.prototype.refresh = function () {
|
||
|
let self = this;
|
||
|
|
||
|
//表参照专用,表参照相关约束
|
||
|
this.dsMaster.state = {
|
||
|
yhDate: self.$yhDate.textbox('getValue'),
|
||
|
psZq: self.$psZq.combobox('getValue'),
|
||
|
}
|
||
|
this.dsMaster.search();
|
||
|
};
|
||
|
|
||
|
MdYhInf.prototype.customerize = function ($container) {
|
||
|
if (this.args.autoRefresh) {
|
||
|
this.refresh();
|
||
|
}
|
||
|
|
||
|
this.$yhDate = this.getElement('.yh-date')
|
||
|
this.$psZq = this.getElement('.ps-zq')
|
||
|
|
||
|
// 加载选项
|
||
|
this.$yhDate.datebox({
|
||
|
value: rhtComm.GetServerDate(0)
|
||
|
})
|
||
|
|
||
|
this.$psZq.checkbox({
|
||
|
checked: true
|
||
|
})
|
||
|
};
|
||
|
|
||
|
MdYhInf.prototype.open = function () {
|
||
|
let self = this;
|
||
|
let code = this.dsMaster.uiObjCode;
|
||
|
let post_data = {
|
||
|
funcCode: self.args.biz.getFuncCode(),
|
||
|
uiObjCodes: code
|
||
|
}
|
||
|
|
||
|
Store.services.getUiObjSchema(post_data, function (isOk, data) {
|
||
|
if (isOk) {
|
||
|
self.dsMaster.initUIObj(data[code]);
|
||
|
self.dsMaster.isShowSelCol = true
|
||
|
self.dsMaster.funcCode = self.args.biz.getFuncCode();
|
||
|
Window.prototype.open.call(self);
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
|
||
|
return MdYhInf;
|
||
|
}
|
||
|
);
|