Ext.namespace('Shipping'); var ModArr = [{ '0': '标准版' }, { '1': '总账模块' }, { '2': '提单管理模块' }, { '3': '凭证接口' }, { '4': '销售订舱' }, { '5': '运价管理' }, { '6': '陆运管理' }, { '7': '集装箱管理' }, { '8': '进口贸易' }, { '9': '仓储管理' }, { '10': 'OA' }, { '11': 'CRM' }]; Shipping.MainForm = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MainForm.superclass.constructor.call(this); }; /** * 打开窗体 * @param {any} typeName */ function openDialog(typeName) { switch (typeName) { case "message": var openSet = "height=500, width=900, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 500) / 2 + ",Left= " + (screen.width - 900) / 2; var openType = "_blank"; var openUrl = "../message/message.aspx?post=1"; window.open(openUrl, openType, openSet); break; case "announce": //如果已打开 var openSet = "height=500, width=900, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 500) / 2 + ",Left= " + (screen.width - 900) / 2; var openType = "_blank"; var openUrl = "../message/SysAnnounceClient.aspx"; window.open(openUrl, openType, openSet); break; } } /** * 打开消息 * @param {any} msg * @param {any} msgtype * @param {any} url */ function openmsg(msg, msgtype, url) { var eBody = Ext.getBody(); var msgWinConfig = { width: 300, height: 200 }; var msgWin = new Ext.Window({ resizable: false, title: '消息提示', alwaysOnTop: true, bodyStyle: "background-color:#FFFfff;padding:15px 5px 0", html: "" + msg + "", x: eBody.getWidth() - msgWinConfig.width, y: eBody.getHeight(), width: msgWinConfig.width, height: msgWinConfig.height, shadow: false, items: [], listeners: { beforeclose: function () { var win = this; win.flyOut(); return false; } }, flyIn: function () { var myWin = this; myWin.show(); myWin.getEl().shift({ x: eBody.getWidth() - myWin.getWidth(), y: eBody.getHeight() - myWin.getHeight(), opacity: 10, easing: 'easeOut', duration: 30 }); myWin.isFlyIn = true; setTimeout(function () { myWin.flyOut(); }, 10000); }, flyOut: function () { var myWin = this; myWin.getEl().shift({ y: eBody.getHeight() }); myWin.isFlyIn = false; }, autoPosition: function () { if (this.isFlyIn) this.flyIn(); else this.flyOut(); } }); msgWin.flyIn(); } function about() { Ext.Ajax.request({ url: '/Softmng/Home/About', callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); var value = result.Message.split('|')[1]; var msg = []; if (value !== "") { value = value.split(',').sort(function (a, b) { return a - b; }); for (var i = 0; i < value.length; i++) { msg.push(CommonJson.GetOptionValue(value[i], ModArr)); } } Ext.Msg.show({ title: '关于', msg: '软件版本:' + result.Message.split('|')[0] + '
版本功能:' + msg.join(',') + '
限制人数:' + result.Message.split('|')[2], icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, scope: this }); } Ext.define('StoreStatusModel', { extend: 'Ext.data.Model', idProperty: 'GID', fields: [ { name: 'GID', type: 'string' }, { name: 'STORENAME', type: 'string' }, { name: 'TABLENAME', type: 'string' }, { name: 'DISPLAYFIELD', type: 'string' }, { name: 'VALUEFIELD', type: 'string' }, { name: 'CONDITION', type: 'string' }, { name: 'MODIFIEDTIME', type: 'string' } ] }); Ext.define('StoreModel', { extend: 'Ext.data.Model', idProperty: 'GID', fields: [ { name: 'GID', type: 'string' }, { name: 'GVALUE', type: 'string' }, { name: 'GVALUE2', type: 'string' } ] }); Ext.extend(Shipping.MainForm, Ext.Panel, { initUIComponents: function () { _this = this; //#region 框架结构 Ext.define('DsShipping.ux.ModuleModel', { extend: 'Ext.data.Model', fields: [ { name: 'id', type: 'string' }, { name: 'NAME', type: 'string' }, { name: 'DESCRIPTION', type: 'string' }, { name: 'MODULEURL', type: 'string' }, { name: 'SORT', type: 'number' }, { name: 'PARENTID', type: 'string' }, { name: 'PARENTNAME', type: 'string' }, { name: 'TYPE', type: 'number' }, { name: 'leaf', type: 'bool' }, { name: 'expanded', type: 'bool' } ] }); Ext.define('DsExt.ux.RefTableStore', { extend: 'Ext.data.Store', constructor: function (config) { var proxy = { type: 'ajax', url: config.proxy.url, reader: { root: 'data' } }; config.proxy = proxy; this.callParent([config]); } }); this.msgBox = Ext.create('Ext.window.MessageBox', { id: "msgBox", autoScroll: true }); this.htmlArray = [ '
以下模块已被禁用,请重新分配权限申请更多人数以继续使用

' ]; this.loadcount = 0; //#region 有注册 this.storeModuTree = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.ModuleModel', proxy: { url: '/MvcShipping/MsBaseInfo/GetProModuTreeList' }, listeners: { load: function () { _this.htmlArray.push(''); _this.htmlArray.push(''); _this.htmlArray.push('
序号模块编码模块名称已分配人数限制人数
'); try { var rawData = this.getProxy().getReader().rawData; if (rawData.message !== "查询成功!") { var list = eval(rawData.message); for (var i = 0; i < list.length; i++) { _this.htmlArray.splice(_this.htmlArray.length - 2, 0, '' + (_this.htmlArray.length - 3) + '' + list[i].Code + '' + list[i].Name + '' + list[i].yTimes + '' + list[i].aTimes + ''); } } } catch (e) { console.warn(e.message); } } } }); this.storeModuTree.load({ params: { condition: "" }, callback: function (r, options, success) { if (success) { if (this.storeModuTree.getCount() > 0) { for (var j = 0; j < this.storeModuTree.getCount(); j += 1) { var member = this.storeModuTree.getAt(j); var pid = member.data.id; var treestore = new Ext.data.TreeStore({ model: 'DsShipping.ux.ModuleModel', nodeParam: 'PARENTID', proxy: { type: 'ajax', url: '/MvcShipping/MsBaseInfo/GetProParentModuTreeList', reader: { id: 'id', root: 'data', totalProperty: 'totalCount' } }, listeners: { load: function () { try { _this.loadcount++; var rawData = this.getProxy().getReader().rawData; if (rawData.message !== "查询成功!") { var list = eval(rawData.message); for (var i = 0; i < list.length; i++) { _this.htmlArray.splice(_this.htmlArray.length - 2, 0, '' + (_this.htmlArray.length - 3) + '' + list[i].Code + '' + list[i].Name + '' + list[i].yTimes + '' + list[i].aTimes + ''); } } } catch (e) { console.warn(e.message); } if (_this.htmlArray.length > 4 && _this.loadcount >= _this.storeModuTree.getCount()) { if (Ext.getCmp("msgBox").html !== undefined) _this.msgBox.update(_this.htmlArray.join('')); else _this.msgBox.show({ title: '提示', msg: _this.htmlArray.join(''), icon: Ext.window.MessageBox.INFO, buttons: Ext.Msg.OK, closable: true, height: 300, minWidth: 500 }); //重置内容 _this.htmlArray = [ '
以下模块已被禁用,请重新分配权限申请更多人数以继续使用

' ]; _this.htmlArray.push(''); _this.htmlArray.push(''); _this.htmlArray.push('
序号模块编码模块名称已分配人数限制人数
'); } } }, autoLoad: true, root: { name: '根节点', expanded: true, id: pid } }); var tabtree = new Ext.tree.Panel({ region: 'west', title: "" + member.data.DESCRIPTION + "", split: true, width: 180, margins: '0 0 0 0', store: treestore, collapsible: true, rootVisible: false, hideHeaders: true, animate: false, lines: false, useArrows: true, columns: [ { xtype: 'treecolumn', text: '模块名称', width: 178, dataIndex: 'DESCRIPTION' } ], listeners: { scope: this, 'itemclick': function (view, record, item, index, e, eOpts) { _this.clicktree(record); /* if (record.data.MODULEURL == '#') return; var finded = false; var children = _this.MainCenter.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { if (children.items[i].id) { if (children.items[i].id == 'pnl' + record.data.NAME) { _this.MainCenter.setActiveTab(i); finded = true; } } } } if (finded == false) { var paneltabitems = new Ext.Panel({ id: 'pnl' + record.data.NAME, layout: "fit", region: "center", autoScroll: true, frame: false, closable: true, title: record.data.PARENTNAME + '-' + record.data.DESCRIPTION, html: ' ' }); this.MainCenter.add(paneltabitems); this.MainCenter.setActiveTab(paneltabitems); this.MainCenter.doLayout(); } */ } } }); _this.topleft.add(tabtree); }; } //alert('loadok'); } }, scope: this }); /**/ //#endregion //#region 无注册 /* this.storeModuTree = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.ModuleModel', proxy: { url: '/MvcShipping/MsBaseInfo/GetProModuTreeList' } }); _this = this; this.storeModuTree.load({ params: { condition: "" }, callback: function (r, options, success) { if (success) { if (this.storeModuTree.getCount() > 0) { for (var j = 0; j < this.storeModuTree.getCount(); j += 1) { var member = this.storeModuTree.getAt(j); var pid = member.data.id; var treestore = new Ext.data.TreeStore({ model: 'DsShipping.ux.ModuleModel', nodeParam: 'PARENTID', proxy: { type: 'ajax', url: '/MvcShipping/MsBaseInfo/GetProParentModuTreeList', reader: { id: 'id', root: 'data', totalProperty: 'totalCount' } }, autoLoad: true, root: { name: '根节点', expanded: true, id: pid } }); var tabtree = new Ext.tree.Panel({ region: 'west', title: "" + member.data.DESCRIPTION + "", split: true, width: 180, margins: '0 0 0 0', store: treestore, collapsible: true, rootVisible: false, hideHeaders: true, animate: false, lines: false, useArrows: true, columns: [{ xtype: 'treecolumn', text: '模块名称', width: 178, dataIndex: 'DESCRIPTION' }], listeners: { scope: this, 'itemclick': function (view, record, item, index, e, eOpts) { if (record.data.MODULEURL == '#') return; var finded = false; var children = _this.MainCenter.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { if (children.items[i].id) { if (children.items[i].id == 'pnl' + record.data.NAME) { _this.MainCenter.setActiveTab(i); finded = true; } } } } if (finded == false) { var paneltabitems = new Ext.Panel({ id: 'pnl' + record.data.NAME, layout: "fit", region: "center", autoScroll: true, frame: false, closable: true, bodyStyle: { //background: 'rgba(0, 0, 0, 1) none repeat scroll 0 0 !important' }, title: record.data.PARENTNAME + '-' + record.data.DESCRIPTION, html: ' ' }); this.MainCenter.add(paneltabitems); this.MainCenter.setActiveTab(paneltabitems); this.MainCenter.doLayout(); } } } }); _this.topleft.add(tabtree); } } else { //无意义 xxxx = 1; } } }, scope: this }); /**/ //#endregion this.topleft = Ext.create('Ext.panel.Panel', { title: "功能菜单", layout: "accordion", //设置为手风琴布局 layoutConfig: { animate: true }, width: 180, minWidth: 90, region: "west", //设置方位 split: true, collapsible: true }); this.Mainpanel = new Ext.Panel({ title: '首页', region: 'center', iconCls: "img_main", animate: true, autoScroll: true, html: "", //layout: { // type: 'table', // columns: 4 //}, //bodyStyle: { // background: // 'url(TruckMng/Content/Images/LogonLog.jpg);background-repeat: no-repeat;background-attachment: fixed; background-size:50% 50%; background-position: 100% 100%', // padding: '0px' //}, //loader: { // url: '/SoftMng/Home/Index', // scripts: true, // autoLoad:true //}, frame: true }); this.MainCenter = new Ext.TabPanel({ activeTab: 0, autoWidth: true, id: 'MainCenter', border: true, frame: false, region: 'center', enableTabScroll: true, items: [ this.Mainpanel ] }); this.topPart = new Ext.Panel({ html: "东胜物流信息管理系统", region: 'north', layout: { type: 'hbox', pack: 'end', align: 'middle' }, margins: '0 0 5 0', height: 45, bodyStyle: { background: 'url(../../images/masthead.jpg) center', padding: '5px' }, defaults: { anchor: '99%', color: '#FFFFFF', labelStyle: "font-size:'24px'" }, items: [ // { // xtype: 'button', // text: '我的收藏', // height: 40, // icon: "../../images/yellow-folder-open.png" // , // arrowAlign: 'bottom', // padding:'5 5 3 10', // style:'color:#FFFFFF;', // scale: 'large', // menu:[ // { text: '添加到收藏', iconCls: "btnadd", // handler: function (button, event) { // }, // scope: this // }, // {text: 'Item 2'}, // {text: 'Item 3'}, // {text: 'Item 4'} // ] // }, // { // xtype: 'label', // id: 'mycollect', // html: "我的收藏", // height: 40, // padding: '5 5 0 10', // style: 'color:#FFFFFF;', // scale: 'large' // }, // { // xtype: 'label', // id: 'header-content', // padding: '8 0 3 0', //// text: '我的收藏<', // html: "                ", // height: 40, // style: 'color:#FFFFFF;', // scale: 'large' // }, { xtype: 'label', html: "用户名:" + SHOWNAME + "(" + COMPANYNAME + ")        ", height: 40, padding: '5 5 3 10', style: 'color:#FFFFFF;', scale: 'large' }, { xtype: 'label', id: 'dvMessage', padding: '5 5 3 10', html: "我的消息(0/0)    ", height: 40 }, { xtype: 'label', padding: '5 5 3 10', html: "    下载    ", height: 40 }, { xtype: 'label', padding: '5 5 3 10', html: "    关于    ", height: 40 }, { xtype: 'label', padding: '5 5 3 10', html: "[退出]", height: 40 } ] }); Ext.apply(this, { items: [this.topPart, this.topleft, this.MainCenter] }); //#endregion //#region 刷新消息 等 var task = { //Ext的定时器,每隔2秒刷新store。 run: function () { Ext.Ajax.request({ url: '/MvcShipping/MsBaseInfo/GetMessageStr', callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { return; } else { var messagestr = result.data; var dvMessage = Ext.getCmp('dvMessage'); // dvMessage.setText(messagestr); dvMessage.update( "" + messagestr + "    "); } } }, scope: this }); }, interval: 20000 }; Ext.TaskManager.start(task); //启动定时器 Ext.define('SysMessage', { extend: 'Ext.data.Model', fields: [ { name: 'GID', type: 'string' }, { name: 'NAME', type: 'string' }, { name: 'DESCRIPTION', type: 'string' }, { name: 'ISREAD', type: 'bool' }, { name: 'MESSAGECONTENT', type: 'string' }, { name: 'TASKURL', type: 'string' }, { name: 'TASKID', type: 'string' }, { name: 'RECVTYPE', type: 'string' }, { name: 'ISSEND', type: 'string' } ] }); //Notification.requestPermission(function (perm) { // if (perm == "granted") { // this.storeSysMessage = Ext.create('DsExt.ux.RefTableStore', // { // model: 'SysMessage', // proxy: { url: '/MvcShipping/MsBaseInfo/GetMessageList' } // }); // var _main = this; // var taskMessage = { //Ext的定时器,每隔2秒刷新store。 // run: function () { // _main.storeSysMessage.load({ // params: { optype: "" }, // callback: function (r, options, success) { // if (success) { // if (_main.storeSysMessage.getCount() > 0) { // for (var j = 0; j < _main.storeSysMessage.getCount(); j += 1) { // var member = _main.storeSysMessage.getAt(j); // var notification = new Notification("东胜消息提醒:", // { // dir: "auto", // lang: "hi", // tag: member.data.GID, // vibrate: [200, 100, 200], // icon: "../../images/提醒.ico", // body: member.data.MESSAGECONTENT // }); // } // } // } // } // }); // }, // interval: 2000 // }; // Ext.TaskManager.start(taskMessage); //启动定时器 // }start //}); Ext.define('DsShipping.ux.UserMainModule', { extend: 'Ext.data.Model', fields: [ { name: 'GID', type: 'string' }, { name: 'MODULEID', type: 'string' }, { name: 'MODULENAME', type: 'string' }, { name: 'MODULETITLE', type: 'string' }, { name: 'MODULEURL', type: 'string' }, { name: 'SORT', type: 'number' }, { name: 'MODULEWIDTH', type: 'number' }, { name: 'ISSYS', type: 'bool' } ] }); this.storeModuUser = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserMainModule', proxy: { url: '/MvcShipping/MsMainForm/GetUserDataList' } }); this.storeModuUser.load({ params: { condition: "" }, callback: function (r, options, success) { if (success) { if (this.storeModuUser.getCount() > 0) { for (var j = 0; j < this.storeModuUser.getCount(); j += 1) { var member = this.storeModuUser.getAt(j); var pid = member.data.id; var paneltabitems = new Ext.Panel({ layout: "fit", region: "center", autoScroll: true, frame: true, width: member.data.MODULEWIDTH, height: 350, closable: true, title: member.data.MODULETITLE, html: ' ' }); this.Mainpanel.add(paneltabitems); }; } } }, scope: this }); // #endregion //#region 定时刷新公共数据store _this = this; var modname = 'StoreModel'; var modurl = '/CommMng/BasicDataRef/getPubStore'; this.storeStoreStatus_Curr = Ext.create('DsExt.ux.RefTableStore', { model: 'StoreStatusModel', proxy: { url: '/CommMng/BasicDataRef/GetTableStatusList' } }); this.storeStoreStatus = Ext.create('DsExt.ux.RefTableStore', { model: 'StoreStatusModel', proxy: { url: '/CommMng/BasicDataRef/GetTableStatusList' } }); //委托单位 this.PubStore_InfoClient_ISCONTROLLER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } }); this.PubStore_InfoClient_ISCONTROLLER_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } }); this.PubStore_CustomerAll = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomSimpleList' } }); this.PubStore_OPSEAE_YARD = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); this.PubStore_OPSEAE_YARD_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); //所有往来单位 this.PubStore_INFOCLIENT_ALL = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); this.PubStore_INFOCLIENT_ALL_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); //船公司 this.PubStore_INFOCLIENT_CARRIER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); this.PubStore_INFOCLIENT_CARRIER_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: modurl } }); //海运出口 较多字段内容 this.PubStore_OPSEAE_CUST_ISCONTROLLER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/getPubExtendStore' } }); this.PubStore_OPSEAE_CUST_ISCONTROLLER_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/getPubExtendStore' } }); //进口贸易 贸易商 isagent=1 存在的理由是进口贸易部分场合需要RCVMODE字段 this.PubStore_Seller = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: modurl } }); this.PubStore_Seller_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: modurl } }); this.PubStore_Buyer = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: modurl } }); this.PubStore_Buyer_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: modurl } }); this.PubStore_HSCODE = Ext.create('DsExt.ux.RefTableStore', { model: 'CargoTax', proxy: { url: modurl } }); this.PubStore_HSCODE_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'CargoTax', proxy: { url: modurl } }); this.PubStore_CIQCODE = Ext.create('DsExt.ux.RefTableStore', { model: 'CargociqRef', proxy: { url: modurl } }); this.PubStore_CIQCODE_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'CargociqRef', proxy: { url: modurl } }); //往来单位财务信息 this.PubStore_INFOCLIENT_INV = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomInvRefModel', proxy: { url: modurl } }); this.PubStore_INFOCLIENT_INV_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomInvRefModel', proxy: { url: modurl } }); //起运港 装货港 国内港口 this.PubStore_CODE_PORTLOAD = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeLoadportModel', proxy: { url: modurl } //{ url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' } }); this.PubStore_CODE_PORTLOAD_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeLoadportModel', proxy: { url: modurl } //{ url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' } }); //国际港口(进口装货港、出口卸货港) this.PubStore_CODE_PORTDISCHARGE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: modurl }//{ url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); this.PubStore_CODE_PORTDISCHARGE_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: modurl }//{ url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //费用名称 this.PubStore_CODE_FEE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.FeeTypeRefModel', proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefListNew' } }); this.PubStore_CODE_FEE_BEFORE = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.FeeTypeRefModel', proxy: { url: modurl }//{ url: '/MvcShipping/MsChFee/GetFeeTypeRefListNew' } }); _this.LoadPubStore("PubStore_CustomerAll"); this.PubStore_FORWARDER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' } }); _this.LoadPubStore("FORWARDER"); this.PubStore_SeaFee = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.FeeTypeRefModel', proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' } }); _this.LoadPubStore("PubStore_SeaFee"); this.PubStore_Shipper = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' } }); _this.LoadPubStore("PubStore_Shipper"); _this.LoadPubStore("INFOCLIENT_ISCONTROLLER"); this.PubStore_CodeGoodsList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeGoodsModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' } }); this.PubStore_CodeGoodsList.load(); this.PubStore_CODE_FEE.load(); ////_this.LoadPubStore("INFOCLIENT_ALL"); //window.storeCustomerAll = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsShipping.ux.CustomRefModel', // proxy: { url: '/CommMng/BasicDataRef/GetCustomSimpleList' } //}); //window.storeCustomerAll.load(); ////var StoreStatusTask = { //Ext的定时器,每隔30秒刷新store。 //// run: function () { //_this.storeStoreStatus.load({ // params: { condition: "" }, // callback: function (r, options, success) { // if (success) { // if (_this.storeStoreStatus.getCount() > 0) { // for (var i = 0; i < _this.storeStoreStatus.getCount(); i++) { // var recored = _this.storeStoreStatus.getAt(i); // var haverecord = false; // var STORENAME = recored.get("STORENAME"); // var StoreCurrTime = recored.get("MODIFIEDTIME"); // //jsonArray.push(record.get('ORGID')); // for (var j = 0; j < _this.storeStoreStatus_Curr.getCount(); j++) { // var CurrRec = _this.storeStoreStatus_Curr.getAt(j); // //jsonArray.push(record.get('ORGID')); // if (STORENAME == CurrRec.get("STORENAME")) { // haverecord = true; // if (StoreCurrTime != CurrRec.get("MODIFIEDTIME")) { // var delaytime = 120;// // CurrRec.set("MODIFIEDTIME", recored.get("MODIFIEDTIME")); // _delay = parseInt(Math.random() * delaytime * 1000); // setTimeout(function () { // _this.LoadPubStore(STORENAME); // }, _delay); // } // } // } // if (!haverecord) { // _this.storeStoreStatus_Curr.add(recored); // _this.LoadPubStore(STORENAME); // } // } // } // } // }, // scope: this //}); //// }, //// interval: 10000 ////}; ////Ext.TaskManager.start(StoreStatusTask); //启动定时器 /**/ //#endregion } //end initUIComponents , LoadPubStore: function (STORENAME) { _this = this; if (STORENAME == "PubStore_CustomerAll") { this.PubStore_CustomerAll.load({ params: { }, callback: function (options, success, response) { //_this.PubStore_InfoClient_ISCONTROLLER.loadData(_this.PubStore_InfoClient_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "FORWARDER") { this.PubStore_FORWARDER.load({ params: { condition: "ISBOOKING='1'" }, callback: function (options, success, response) { //_this.PubStore_InfoClient_ISCONTROLLER.loadData(_this.PubStore_InfoClient_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "PubStore_SeaFee") { this.PubStore_SeaFee.load({ params: { condition: " ISSEA='1' " }, callback: function (options, success, response) { //_this.PubStore_InfoClient_ISCONTROLLER.loadData(_this.PubStore_InfoClient_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "PubStore_Shipper") { this.PubStore_Shipper.load({ params: { condition: " shippertype=2 " }, callback: function (options, success, response) { //_this.PubStore_InfoClient_ISCONTROLLER.loadData(_this.PubStore_InfoClient_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "INFOCLIENT_ISCONTROLLER") { this.PubStore_InfoClient_ISCONTROLLER_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_InfoClient_ISCONTROLLER.loadData(_this.PubStore_InfoClient_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "INFOCLIENT_ALL") { this.PubStore_INFOCLIENT_ALL_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_INFOCLIENT_ALL.loadData(_this.PubStore_INFOCLIENT_ALL_BEFORE.data.items); } }); } if (STORENAME == "OPSEAE_CUST_ISCONTROLLER") { this.PubStore_OPSEAE_CUST_ISCONTROLLER_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_OPSEAE_CUST_ISCONTROLLER.loadData(_this.PubStore_OPSEAE_CUST_ISCONTROLLER_BEFORE.data.items); } }); } if (STORENAME == "INFOCLIENT_CARRIER") { this.PubStore_INFOCLIENT_CARRIER_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_INFOCLIENT_CARRIER.loadData(_this.PubStore_INFOCLIENT_CARRIER_BEFORE.data.items); } }); } if (STORENAME == "OPSEAE_YARD") { this.PubStore_OPSEAE_YARD_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_OPSEAE_YARD.loadData(_this.PubStore_OPSEAE_YARD_BEFORE.data.items); } }); } if (STORENAME == "IMPORT_SELLER") { this.PubStore_Seller_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_Seller.loadData(_this.PubStore_Seller_BEFORE.data.items); } }); } if (STORENAME == "IMPORT_BUYER") { this.PubStore_Buyer_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_Buyer.loadData(_this.PubStore_Buyer_BEFORE.data.items); } }); } if (STORENAME == "HSCODE") { this.PubStore_HSCODE_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_HSCODE.loadData(_this.PubStore_HSCODE_BEFORE.data.items); } }); } if (STORENAME == "CIQCODE") { this.PubStore_CIQCODE_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_CIQCODE.loadData(_this.PubStore_CIQCODE_BEFORE.data.items); } }); } //INFOCLIENT_INV if (STORENAME == "INFOCLIENT_INV") { this.PubStore_INFOCLIENT_INV_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_INFOCLIENT_INV.loadData(_this.PubStore_INFOCLIENT_INV_BEFORE.data.items); } }); } if (STORENAME == "CODE_PORTLOAD") { this.PubStore_CODE_PORTLOAD_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_CODE_PORTLOAD.loadData(_this.PubStore_CODE_PORTLOAD_BEFORE.data.items); } }); } if (STORENAME == "CODE_PORTDISCHARGE") { this.PubStore_CODE_PORTDISCHARGE_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_CODE_PORTDISCHARGE.loadData(_this.PubStore_CODE_PORTDISCHARGE_BEFORE.data.items); } }); } if (STORENAME == "CODE_FEE") { this.PubStore_CODE_FEE_BEFORE.load({ params: { STORENAME: STORENAME }, callback: function (options, success, response) { _this.PubStore_CODE_FEE.loadData(_this.PubStore_CODE_FEE_BEFORE.data.items); } }); } } , GetPubStore: function (STORENAME) { var result = ""; if (STORENAME == "PubStore_CustomerAll") { result = this.PubStore_CustomerAll; } if (STORENAME == "FORWARDER") { result = this.PubStore_FORWARDER; } if (STORENAME == "PubStore_SeaFee") { result = this.PubStore_SeaFee; } if (STORENAME == "PubStore_Shipper") { result = this.PubStore_Shipper; } if (STORENAME == "INFOCLIENT_ISCONTROLLER") { result = this.PubStore_InfoClient_ISCONTROLLER; } if (STORENAME == "INFOCLIENT_ALL") { result = this.PubStore_INFOCLIENT_ALL; } if (STORENAME == "OPSEAE_CUST_ISCONTROLLER") { result = this.PubStore_OPSEAE_CUST_ISCONTROLLER; } if (STORENAME == "INFOCLIENT_CARRIER") { result = this.PubStore_INFOCLIENT_CARRIER; } if (STORENAME == "IMPORT_SELLER") { result = this.PubStore_Seller; } if (STORENAME == "IMPORT_BUYER") { result = this.PubStore_Buyer; } if (STORENAME == "HSCODE") { result = this.PubStore_HSCODE; } if (STORENAME == "CIQCODE") { result = this.PubStore_CIQCODE; } if (STORENAME == "INFOCLIENT_INV") { result = this.PubStore_INFOCLIENT_INV; } if (STORENAME == "CODE_PORTLOAD") { result = this.PubStore_CODE_PORTLOAD; } if (STORENAME == "CODE_PORTDISCHARGE") { result = this.PubStore_CODE_PORTDISCHARGE; } if (STORENAME == "OPSEAE_YARD") { result = this.PubStore_OPSEAE_YARD; } if (STORENAME == "CODE_FEE") { result = this.PubStore_CODE_FEE; } if (STORENAME == "CodeGoodsList") { result = this.PubStore_CodeGoodsList; } return result; //if ((result != "") && (result.getCount() == 0) ) { // setTimeout(function () { // return this.GetPubStore(STORENAME, 1); // }, 3000); //} else { // return result; //} } , clicktree: function (record) { if (record.data.MODULEURL == '#') return; var finded = false; var children = this.MainCenter.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { if (children.items[i].id) { if (children.items[i].id == 'pnl' + record.data.NAME) { this.MainCenter.setActiveTab(i); finded = true; } } } } if (finded == false) { var paneltabitems = new Ext.Panel({ id: 'pnl' + record.data.NAME, layout: "fit", region: "center", autoScroll: true, frame: false, closable: true, title: record.data.PARENTNAME + '-' + record.data.DESCRIPTION, html: ' ' }); this.MainCenter.add(paneltabitems); this.MainCenter.setActiveTab(paneltabitems); this.MainCenter.doLayout(); } } }); function exit() { //var aa = window.child.location; //var bb = aa; //myFrame.window.functionName() }