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.

1109 lines
37 KiB
JavaScript

//恒成业务统计
Ext.namespace('Shipping');
Shipping.MsRptHcTotalIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptHcTotalIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptHcTotalIndex, Ext.Panel, {
PageSize: 2000,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=2',
bslistdrsortfield: '',
bslistdrsortdire: '',
bslistcrsortfield: '',
bslistcrsortdire: '',
feelistdrsortfield: '',
feelistdrsortdire: '',
feelistcrsortfield: '',
feelistcrsortdire: '',
salesumsortfield: '',
salesumsortdire: '',
custsumsortfield: '',
custsumsortdire: '',
vesselsumsortfield: '',
vesselsumsortdire: '',
initUIComponents: function () {
//定义数据集
this.formname = 'MsRptHcTotalIndex';
this.storeListCtn = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'OPLBNAME', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'BLCOUNT', type: 'number' },
{ name: 'AMENDCOUNT', type: 'number' },
{ name: 'CTN20', type: 'number' },
{ name: 'CTN40', type: 'number' },
{ name: 'CTN45', type: 'number' },
{ name: 'CBM', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'OPTTLSTR', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptHcTotal/CtnListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 170,
minValue: 0
})
//定义Grid
this.initgirdcolumsctn = [{
sortable: true,
dataIndex: 'OPLBNAME',
header: '业务类型',
width: 70
}, {
sortable: true,
dataIndex: 'SALE',
header: '业务员',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
}, {
sortable: true,
dataIndex: 'BLCOUNT',
header: '总票数',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'AMENDCOUNT',
header: '更改单票数',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OPTTLSTR',
header: '操作票数统计',
width: 220
}, {
sortable: true,
dataIndex: 'CTN20',
header: '20尺箱',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'CTN40',
header: '40尺箱',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'CTN45',
header: '45尺箱',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'CBM',
header: '拼箱尺码',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: '空运重量',
align: 'right',
width: 80
}
];
this.girdcolumsctn = DsTruck.GetGridPanel(USERID, this.formname + 'ctn', this.initgirdcolumsctn, 1);
this.gridListCtn = new Ext.grid.GridPanel({
store: this.storeListCtn,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolumsctn,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeListCtn,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
this.storeOpList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'OP', type: 'string' },
{ name: 'LOCAL1', type: 'number' },
{ name: 'LOCAL05', type: 'number' },
{ name: 'LOCAL02', type: 'number' },
{ name: 'LOCAL0', type: 'number' },
{ name: 'OTHER1', type: 'number' },
{ name: 'OTHER05', type: 'number' },
{ name: 'OTHER02', type: 'number' },
{ name: 'OTHER0', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptHcTotal/OpListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolumsop = [{
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 80
}, {
sortable: true,
dataIndex: 'LOCAL1',
header: '青岛1',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'LOCAL05',
header: '青岛0.5',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'LOCAL02',
header: '青岛0.2',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'LOCAL0',
header: '青岛0',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTHER1',
header: '外地1',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTHER05',
header: '外地0.5',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTHER02',
header: '外地0.2',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTHER0',
header: '外地0',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLCOUNT',
header: '合计',
align: 'right',
width: 80,
renderer: function (value, p, record) {
var amount = Add(Mul(record.data.LOCAL05, 0.5), Mul(record.data.LOCAL02, 0.2));
amount = Add(amount, record.data.LOCAL1);
var otamount = Add(Mul(record.data.OTHER05, 0.5), Mul(record.data.OTHER02, 0.2));
otamount = Add(otamount, record.data.OTHER1);
amount = Add(amount, otamount);
return amount;
}
}
];
this.girdcolumsop = DsTruck.GetGridPanel(USERID, this.formname + 'op', this.initgirdcolumsop, 1);
this.gridListOp = new Ext.grid.GridPanel({
store: this.storeOpList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolumsop,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeOpList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridListOp.addListener('sortchange', function (ct, column, direction, eOpts) {
this.opsumsortfield = column.dataIndex;
this.opsumsortdire = direction;
}, this);
this.storeTruckCustomList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'PORT', type: 'string' },
{ name: 'OPLBNAME', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'AMOUNT', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'TTLTEUQ', type: 'number' },
{ name: 'TTLTEUN', type: 'number' },
{ name: 'TTLTEUPR', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptHcTotal/TruckCustomListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.initgirdcolumstruck = [{
sortable: true,
dataIndex: 'PORT',
header: '地区',
width: 80
}, {
sortable: true,
dataIndex: 'OPLBNAME',
header: '业务类型',
width: 70
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 120
}, {
sortable: true,
dataIndex: 'TEU',
header: '数量',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLTEUPR',
header: '比例',
align: 'right',
width: 80,
renderer: function (value, p, record) {
var TTLTEU = record.data.TTLTEUQ;
if (record.data.PORT == '宁波')
TTLTEU = record.data.TTLTEUN;
var TEU = record.data.TEU;
if (TTLTEU != 0) {
var TTLTEUPR = Div(TEU, TTLTEU);
} else {
var TTLTEUPR = 0;
}
return TTLTEUPR;
}
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: '金额',
align: 'right',
width: 80
}
];
this.girdcolumstruck = DsTruck.GetGridPanel(USERID, this.formname + 'truck', this.initgirdcolumstruck, 1);
this.gridListTruck = new Ext.grid.GridPanel({
store: this.storeTruckCustomList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolumstruck,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeTruckCustomList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridListTruck.addListener('sortchange', function (ct, column, direction, eOpts) {
this.trucksumsortfield = column.dataIndex;
this.trucksumsortdire = direction;
}, this);
//#region formSearch
//#region formSearch枚举参照相关
_this = this;
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'north',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
Ext.define('SubComp', {
extend: 'Ext.data.Model',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'NAME', type: 'string' },
{ name: 'ENNAME', type: 'string' }
]
});
this.StoreSubComp = Ext.create('DsExt.ux.RefTableStore', {
model: 'SubComp',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCompanyEN' }
});
this.StoreSubComp.load({ params: { condition: ""} });
this.comboxSubComp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属公司',
store: this.StoreSubComp,
name: 'SUBCOMP',
valueField: 'GID',
displayField: 'NAME',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formSearch2 = Ext.widget('form', {
frame: true,
region: 'north',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh2Click();
}
}
}
}, {
fieldLabel: '到ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh2Click();
}
}
}
}, this.comboxSubComp, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefresh2Click(button, event);
},
scope: this
}, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//状态_业务状态
this.StoreCustType = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreCustType.add({ "OpLb": "车队" });
this.StoreCustType.add({ "OpLb": "报关行" });
this.comboxCustType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户类别',
store: this.StoreCustType,
forceSelection: true,
name: 'PS_CUSTTYPE',
value: '车队',
valueField: 'OpLb',
displayField: 'OpLb'
});
this.formSearch3 = Ext.widget('form', {
frame: true,
region: 'north',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh3Click();
}
}
}
}, {
fieldLabel: '到ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh3Click();
}
}
}
}, this.comboxCustType, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefresh3Click(button, event);
},
scope: this
}, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
_this = this;
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存列表",
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, { text: "刷新列表",
handler: function (button, event) {
_this.oninitGridClick(button, event);
}
}],
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelCtnSum = new Ext.Panel({
title: '箱型箱量',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.formSearch, this.gridListCtn]
});
this.panelOpSum = new Ext.Panel({
title: '票数考核',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.formSearch2, this.gridListOp]
});
this.panelTruckSum = new Ext.Panel({
title: '派车报关统计',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.formSearch3, this.gridListTruck]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelCtnSum,
this.panelOpSum,
this.panelTruckSum
]
});
Ext.apply(this, {
items: [this.panelTop, this.tabpanel]
});
this.storeListCtn.on('beforeload', function (store) {
var form = this.formSearch.getForm();
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
Ext.apply(store.proxy.extraParams, { bgnetd: etdDate_Min, endetd: etdDate_Max });
}, this);
this.storeOpList.on('beforeload', function (store) {
var sql = '';
var form = this.formSearch2.getForm();
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'");
var SUBCOMP = form.findField('SUBCOMP').getValue();
sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'");
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.storeTruckCustomList.on('beforeload', function (store) {
var sql = '';
var form = this.formSearch3.getForm();
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " ETD<='" + etdDate_Max + " 23:59:59'");
var PS_CUSTTYPE = form.findField('PS_CUSTTYPE').getValue();
sql = sql + getAndConSql(sql, PS_CUSTTYPE, " F.CUSTOMERTYPE='" + PS_CUSTTYPE + "' ");
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
}, //end initUIComponents
onRefreshClick: function (button, event) {
var form = this.formSearch.getForm();
var expDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
var expDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
if (expDate_Min == '' || expDate_Min == null || expDate_Min == undefined) {
Ext.Msg.alert('提示', '开始业务日期不能为空!');
return;
}
if (expDate_Max == '' || expDate_Max == null || expDate_Max == undefined) {
Ext.Msg.alert('提示', '结束业务日期不能为空!');
return;
}
var expDate_Mindate = form.findField('PS_ETDDATEBGN').getValue();
var expDate_Maxdate = form.findField('PS_ETDDATEEND').getValue();
if (expDate_Mindate > expDate_Maxdate) {
Ext.Msg.alert('提示', '业务开始日期不能大于结束日期!');
return;
}
this.PageSize = this.Pagenum.getValue();
this.storeListCtn.load({
params: { start: 0, limit: this.PageSize, bgnetd: expDate_Min, endetd: expDate_Max },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefresh2Click: function (button, event) {
var sql = '';
var form = this.formSearch2.getForm();
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'");
var SUBCOMP = form.findField('SUBCOMP').getValue();
sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'");
this.PageSize = this.Pagenum.getValue();
this.storeOpList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefresh3Click: function (button, event) {
var sql = '';
var form = this.formSearch3.getForm();
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " ETD<='" + etdDate_Max + " 23:59:59'");
var PS_CUSTTYPE = form.findField('PS_CUSTTYPE').getValue();
sql = sql + getAndConSql(sql, PS_CUSTTYPE, " F.CUSTOMERTYPE='" + PS_CUSTTYPE + "' ");
this.PageSize = this.Pagenum.getValue();
this.storeTruckCustomList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectedRecord.data.BSNO;
ret[4] = "MsRptOpProfitIndex";
return ret;
},
onSaveGridClick: function (button, event) {
if (this.tabpanel.getActiveTab() == this.panelCtnSum) {
this.girdcolumsctn = DsTruck.SaveGridPanel(USERID, this.formname + 'ctn', this.gridListCtn.columns, this.girdcolumsctn, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelOpSum) {
this.girdcolumsop = DsTruck.SaveGridPanel(USERID, this.formname + 'op', this.gridListOp.columns, this.girdcolumsop, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelTruckSum) {
this.girdcolumstruck = DsTruck.SaveGridPanel(USERID, this.formname + 'truck', this.gridListTruck.columns, this.girdcolumstruck, 1, true);
}
},
oninitGridClick: function (button, event) {
if (this.tabpanel.getActiveTab() == this.panelCtnSum) {
this.gridListCtn.reconfigure(this.storeListCtn, this.initgirdcolumsop);
this.girdcolumsctn = DsTruck.SaveGridPanel(USERID, this.formname + 'ctn', this.gridListCtn.columns, this.initgirdcolumsctn, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelOpSum) {
this.gridListOp.reconfigure(this.storeOpList, this.initgirdcolumscr);
this.girdcolumsop = DsTruck.SaveGridPanel(USERID, this.formname + 'op', this.gridListOp.columns, this.initgirdcolumsop, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelTruckSum) {
this.gridListTruck.reconfigure(this.storeTruckCustomList, this.initgirdcolumssale);
this.girdcolumstruck = DsTruck.SaveGridPanel(USERID, this.formname + 'truck', this.gridListTruck.columns, this.initgirdcolumstruck, 1, true);
}
},
onExportClick: function (button, event) {
_this = this;
if (this.tabpanel.getActiveTab() == this.panelCtnSum) {
GridExportExcelPage(this.gridListCtn);
} else if (this.tabpanel.getActiveTab() == this.panelOpSum) {
GridExportExcelPage(this.gridListOp);
} else if (this.tabpanel.getActiveTab() == this.panelTruckSum) {
GridExportExcelPage(this.gridListTruck);
}
},
Print: function () {
_this = this;
if (this.tabpanel.getActiveTab() == this.panelCtnSum) {
if (this.storeListCtn.getCount() == 0) {
return;
}
var sortstr = '';
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsRptHcTotal/CtnListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: Drsql,
printstr: 'true',
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var printType = 'MSRPTHCTOTALLISTCTN';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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
});
}
}
});
} else if (this.tabpanel.getActiveTab() == this.panelOpSum) {
if (this.storeOpList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsHcInvTotal/OpListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: Crsql,
printstr: 'true',
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var printType = 'MSRPTHCTOTALLISTOP';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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
});
}
}
});
} else if (this.tabpanel.activeTab == this.panelTruckSum) {
if (this.storeTruckCustomList.getCount() == 0) {
return;
}
var sortstr = '';
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsRptHcTotal/TruckCustomListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
printstr: 'true',
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.Data;
var printType = 'MSRPTHCTOTALTRUCK';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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
});
}
}
});
}
}
});