You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1335 lines
56 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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:
"<span style='font-size: medium'><strong><span><span><span style='color: #ff0000'><a style=\"text-decoration:none;\" onclick=\"" +
"\" style=\"text-decoration:none;\">" +
msg +
"</a></span></span></span></strong></span>",
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] + '<br/>版本功能:' + msg.join(',') + '<br/>限制人数:' + 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 = [
'<h6>以下模块已被禁用,请<span style="color:#B22222">重新分配权限</span>或<span style="color:#B22222">申请更多人数</span>以继续使用</h6><hr/><table cellspacing="0" cellpadding="0" border="1" style="width:470px;text-align:center"><thead><tr><td>序号</td><td>模块编码</td><td>模块名称</td><td>已分配人数</td><td>限制人数</td></tr></thead>'
];
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('<tbody>');
_this.htmlArray.push('</tbody>');
_this.htmlArray.push('</table>');
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,
'<tr><td>' +
(_this.htmlArray.length - 3) +
'</td><td>' +
list[i].Code +
'</td><td>' +
list[i].Name +
'</td><td>' +
list[i].yTimes +
'</td><td>' +
list[i].aTimes +
'</td></tr>');
}
}
} 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,
'<tr><td>' +
(_this.htmlArray.length - 3) +
'</td><td>' +
list[i].Code +
'</td><td>' +
list[i].Name +
'</td><td>' +
list[i].yTimes +
'</td><td>' +
list[i].aTimes +
'</td></tr>');
}
}
}
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 = [
'<h6>以下模块已被禁用,请<span style="color:#B22222">重新分配权限</span>或<span style="color:#B22222">申请更多人数</span>以继续使用</h6><hr/><table cellspacing="0" cellpadding="0" border="1" style="width:470px;text-align:center"><thead><tr><td>序号</td><td>模块编码</td><td>模块名称</td><td>已分配人数</td><td>限制人数</td></tr></thead>'
];
_this.htmlArray.push('<tbody>');
_this.htmlArray.push('</tbody>');
_this.htmlArray.push('</table>');
}
}
},
autoLoad: true,
root: {
name: '根节点',
expanded: true,
id: pid
}
});
var tabtree = new Ext.tree.Panel({
region: 'west',
title: "<a><b><font color='#105cb6'>" + member.data.DESCRIPTION + "</font></b></a>",
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:
' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' +
record.data.MODULEURL +
'"> </iframe>'
});
this.MainCenter.add(paneltabitems);
this.MainCenter.setActiveTab(paneltabitems);
this.MainCenter.doLayout();
}
*/
}
}
});
_this.topleft.add(tabtree);
};
}
}
},
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: "<a><b><font color='#105cb6'>" + member.data.DESCRIPTION + "</font></b></a>",
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: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record.data.MODULEURL + '"> </iframe>'
});
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: Zi.LAN.MENU,
layout: "accordion", //设置为手风琴布局
layoutConfig: {
animate: true
},
width: 180,
minWidth: 90,
region: "west", //设置方位
split: true,
collapsible: true
});
this.Mainpanel = new Ext.Panel({
title: Zi.LAN.HOMEPAGE,
region: 'center',
iconCls: "img_main",
animate: true,
autoScroll: true,
html: "<iframe id='main' name='main' scrolling='auto' frameborder='0' width='100%' height='100%' src='/SoftMng/Home/Index'></iframe>",
//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
});
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/CommMng/BasicDataRef/GetDSWMSLoginInfo',
scope: this,
async: false,
params: {},
callback: function (options, success, response) {
if (success) {
//Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (jsonresult.Message) {
//获取companycode
//http://localhost:8100/login+ '?companycode=' + COMPANYCODE + '&codename=' + CODENAME + '&pwd=' + PASSWORD
var _src = jsonresult.Message + "&pwd=" + jsonresult.Data;
_this.DSWMSLogin = new Ext.Panel({
title: '仓储登陆',
region: 'center',
iconCls: "img_main",
animate: true,
autoScroll: true,
html: "<iframe id='main' name='main' scrolling='auto' frameborder='0' width='100%' height='100%' src='" + _src +"'></iframe>",
frame: true
});
_this.MainHide = new Ext.TabPanel({
activeTab: 0,
hidden:true,
autoWidth: true,
id: 'MainHide',
border: true,
frame: false,
region: 'center',
enableTabScroll: true,
items:
[
_this.DSWMSLogin
]
});
}
//var returnData = jsonresult.Data;
//this.storeList.load({ params: { condition: "" }, waitMsg: "正在刷新数据...", scope: this });
} else {
//Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
//不登陆仓储首页
}
} else {
//Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
//多数客户的正常登陆首页
}
}
});
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: "<a><b><font color='#FFFFFF' size=5>" + Zi.LAN.DONGSHENGSFOT+"</font></b></a>",
region: 'north',
layout: {
type: 'hbox',
pack: 'end',
align: 'middle'
},
margins: '0 0 5 0',
height: 45,
bodyStyle: {
// background: 'url(../../images/masthead.jpg) center',
background: 'url(../../images/masthead.jpg) left',
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: "<a href=\"javascript:void(0)\" style=\"color:#FFFFFF;text-decoration:none;\" "
// + "style=\"color:#FFFFFF;text-decoration:none;\">我的收藏</a>",
// height: 40,
// padding: '5 5 0 10',
// style: 'color:#FFFFFF;',
// scale: 'large'
// },
// {
// xtype: 'label',
// id: 'header-content',
// padding: '8 0 3 0',
//// text: '我的收藏<',
// html: "<img src='../../images/sort_desc.gif'></img>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
// height: 40,
// style: 'color:#FFFFFF;',
// scale: 'large'
// },
{
xtype: 'label',
html: Zi.LAN.USERNAME + SHOWNAME + "(" + COMPANYNAME + ")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
height: 40,
padding: '5 5 3 10',
style: 'color:#FFFFFF;',
scale: 'large'
},
{
xtype: 'label',
id: 'dvMessage',
padding: '5 5 3 10',
html:
"<a href=\"javascript:void(0)\" style=\"color:#FFFFFF;text-decoration:none;\" onclick=\"openDialog('message')" +
"\" style=\"color:#FFFFFF;text-decoration:none;\">" + Zi.LAN.WODEXIAOXI+"(0/0)</a>&nbsp;&nbsp;&nbsp;&nbsp",
height: 40
},
{
xtype: 'label',
padding: '5 5 3 10',
html:
"&nbsp;&nbsp;&nbsp;&nbsp<a href=\"javascript:void(0)\" onclick=\"window.open('tools/download.aspx','_blank','height=180, width=380, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no')" +
"\" style=\"color:#FFFFFF;text-decoration:none; \">" + Zi.LAN.XIAZAI +"</a>&nbsp;&nbsp;&nbsp;&nbsp",
height: 40
},
{
xtype: 'label',
padding: '5 5 3 10',
html: "&nbsp;&nbsp;&nbsp;&nbsp<a href=\"javascript:void(0)\" onclick=\"about()\" style=\"color:#FFFFFF;text-decoration:none; \">" + Zi.LAN.GUANYU +"</a>&nbsp;&nbsp;&nbsp;&nbsp",
height: 40
},
{
xtype: 'label',
padding: '5 5 3 10',
html: "<a href=\"../SignOn/Logout.aspx\" style=\"color:#FFFFFF;text-decoration:none;\">" + Zi.LAN.TUICHU+"</a>",
height: 40
}
]
});
if (!this.MainHide) {
this.MainHide = new Ext.TabPanel({
activeTab: 0,
hidden: true,
autoWidth: true,
id: 'MainHide',
border: true,
frame: false,
region: 'center',
enableTabScroll: true,
items:
[]
});
}
Ext.apply(this,
{
items: [this.topPart, this.topleft, this.MainCenter, this.MainHide]
});
//#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);
messagestr = messagestr.replace("我的消息", Zi.LAN.WODEXIAOXI);
dvMessage.update(
"<a href=\"javascript:void(0)\" style=\"color:#FFFFFF;text-decoration:none;\" onclick=\"openDialog('message')" +
"\" style=\"color:#FFFFFF;text-decoration:none;\">" +
messagestr +
"</a>&nbsp;&nbsp;&nbsp;&nbsp");
}
}
},
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: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' +
member.data.MODULEURL +
'"> </iframe>'
});
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: modname,
proxy: { url: modurl }
});
this.PubStore_InfoClient_ISCONTROLLER_BEFORE = Ext.create('DsExt.ux.RefTableStore', {
model: modname,
proxy: { url: modurl }
});
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: modurl }//{ 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.PubStore_OpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.PubStore_OpCode.load();
//this.LoadPubStore("INFOCLIENT_ISCONTROLLER");
////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 == "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 == "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 == "OpCode") {
result = this.PubStore_OpCode;
}
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:
' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' +
record.data.MODULEURL +
'"> </iframe>'
});
this.MainCenter.add(paneltabitems);
this.MainCenter.setActiveTab(paneltabitems);
this.MainCenter.doLayout();
}
}
});
function exit() {
//var aa = window.child.location;
//var bb = aa;
//myFrame.window.functionName()
}