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.
864 lines
33 KiB
JavaScript
864 lines
33 KiB
JavaScript
Ext.namespace('Shipping');
|
|
|
|
Shipping.MsOpCtnBsCardFeeSumIndex = function (config) {
|
|
Ext.applyIf(this, config);
|
|
this.initUIComponents();
|
|
window.Shipping.MsOpCtnBsCardFeeSumIndex.superclass.constructor.call(this);
|
|
};
|
|
|
|
Ext.extend(Shipping.MsOpCtnBsCardFeeSumIndex, Ext.Panel, {
|
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
SelectedRecord: null,
|
|
sqlcontext: '',
|
|
PageSize: 100,
|
|
sortfield: '',
|
|
sortdire: '',
|
|
initUIComponents: function () {
|
|
|
|
this.formname = "MsOpCtnBsCardFeeSumIndex"; //页面名称
|
|
|
|
//定义数据集
|
|
|
|
|
|
this.storeCtnList = null;
|
|
|
|
//定义Grid
|
|
this.girdcolums = [{
|
|
sortable: true,
|
|
dataIndex: 'CTNNO',
|
|
text: '箱号',
|
|
width: 100
|
|
}];
|
|
|
|
|
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
width: 30
|
|
});
|
|
|
|
this.Pagenum = Ext.create('Ext.form.field.Number', {
|
|
name: 'bottles',
|
|
fieldLabel: '每页记录数',
|
|
labelAlign: 'right',
|
|
value: this.PageSize,
|
|
maxValue: 100000,
|
|
width: 170,
|
|
minValue: 0,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
|
|
|
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
_this = this;
|
|
//定义Grid
|
|
this.gridListCtn = new Ext.grid.GridPanel({
|
|
store: this.storeCtnList,
|
|
enableHdMenu: false,
|
|
region: 'center',
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
trackMouseOver: true,
|
|
disableSelection: false,
|
|
selModel: this.GridCheckBoxModel,
|
|
columns: this.girdcolums
|
|
|
|
,
|
|
// paging bar on the bottom
|
|
bbar: [Ext.create('Ext.PagingToolbar', {
|
|
store: this.storeCtnList,
|
|
displayInfo: true,
|
|
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
emptyMsg: "没有数据"
|
|
}), this.Pagenum]
|
|
});
|
|
|
|
|
|
this.gridListCtn.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
|
|
this.SelectedRecord = record;
|
|
this.OprationStatus = 'edit';
|
|
|
|
DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusEdit', record.data.GID);
|
|
}, this);
|
|
|
|
this.storeSumList = null;
|
|
this.girdcolumssum = [];
|
|
this.GridCheckBoxSumModel = Ext.create('Ext.selection.CheckboxModel');
|
|
_this = this;
|
|
//定义Grid
|
|
this.gridListSum= new Ext.grid.GridPanel({
|
|
store: this.storeSumList,
|
|
enableHdMenu: false,
|
|
region: 'center',
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
trackMouseOver: true,
|
|
disableSelection: false,
|
|
selModel: this.GridCheckBoxSumModel,
|
|
columns: this.girdcolumssum,
|
|
// paging bar on the bottom
|
|
bbar: [Ext.create('Ext.PagingToolbar', {
|
|
store: this.storeSumList,
|
|
displayInfo: true,
|
|
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
emptyMsg: "没有数据"
|
|
})]
|
|
});
|
|
|
|
|
|
|
|
// this.gridList.columns[1] = new Ext.grid.RowNumberer();
|
|
|
|
//#region formSearch 查询面板
|
|
_this = this;
|
|
|
|
//客户加载_委托单位
|
|
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
|
|
});
|
|
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
//委托单位
|
|
_this = this;
|
|
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '委托单位',
|
|
store: this.storeCustCode,
|
|
forceSelection: true,
|
|
name: 'CUSTOMERNAME',
|
|
valueField: 'CustName',
|
|
displayField: 'CodeAndName',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
this.StoreDateType = Ext.create('Ext.data.Store', {
|
|
fields: ['ID', 'NAME']
|
|
});
|
|
this.StoreDateType.add({ "ID": "CNT", "NAME": "提箱日期" });
|
|
this.StoreDateType.add({ "ID": "ETD", "NAME": "开船日期" });
|
|
|
|
this.comboxDateType = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '周期计算',
|
|
store: this.StoreDateType,
|
|
forceSelection: true,
|
|
name: 'DATETYPE',
|
|
value:'ETD',
|
|
valueField: 'ID',
|
|
displayField: 'NAME',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.storeListGood = Ext.create('Ext.data.Store', {
|
|
model: 'MsCodeMSDS',
|
|
remoteSort: true,
|
|
proxy: {
|
|
type: 'ajax',
|
|
url: '/MvcContainer/MsCodeMSDS/GetDataListRm',
|
|
reader: {
|
|
id: 'GID',
|
|
root: 'data',
|
|
totalProperty: 'totalCount'
|
|
}
|
|
}
|
|
});
|
|
//this.storeListGood.load({ params: { start: 0, limit: 20000, condition: "" } });
|
|
this.comboxGoods = Ext.create('DsExt.ux.RefTableCombox', {
|
|
store: this.storeListGood,
|
|
fieldLabel: '品名',
|
|
queryMode: 'remote',
|
|
minChars: 0,
|
|
queryParam: 'CODENAME',
|
|
// forceSelection: true,
|
|
name: 'GOODSNAME',
|
|
valueField: 'CHEMICALCGOODSNAME',
|
|
displayField: 'GOODNAMEANDCNAME',
|
|
listeners: {
|
|
keyup: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.CodeDisportModel',
|
|
autoLoad: true,
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
|
|
});
|
|
|
|
this.storeCodeDisport3 = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'DsShipping.ux.CodeDisportModel',
|
|
autoLoad: true,
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
|
|
});
|
|
|
|
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '目的港',
|
|
store: this.storeCodeDisport,
|
|
queryMode: 'remote',
|
|
minChars: 1,
|
|
queryParam: 'CODENAME',
|
|
name: 'DESTPORT',
|
|
valueField: 'PORT',
|
|
displayField: 'PORT'
|
|
});
|
|
|
|
|
|
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '起运港',
|
|
store: this.storeCodeDisport3,
|
|
queryMode: 'remote',
|
|
minChars: 1,
|
|
queryParam: 'CODENAME',
|
|
name: 'PORTLOAD',
|
|
valueField: 'PORT',
|
|
displayField: 'PORT'
|
|
});
|
|
|
|
|
|
this.formSearch = Ext.widget('form', {
|
|
frame: true,
|
|
region: 'center',
|
|
bodyPadding: 5,
|
|
fieldDefaults: {
|
|
margins: '2 2 2 2',
|
|
labelAlign: 'right',
|
|
flex: 1,
|
|
labelWidth: 60,
|
|
msgTarget: 'qtip'
|
|
},
|
|
|
|
|
|
items: [{//fieldset 1
|
|
xtype: 'container',
|
|
defaultType: 'textfield',
|
|
layout: 'anchor',
|
|
defaults: {
|
|
anchor: '100%'
|
|
},
|
|
items: [{
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '箱号',
|
|
name: 'CTNNO',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '编号',
|
|
name: 'BSNO',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, this.comboxCustCode, {
|
|
fieldLabel: '开船日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'ETDbgn',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '到',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'ETDend',
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, this.comboxPORTLOAD, {
|
|
xtype: 'button',
|
|
width: 90,
|
|
text: "执行查询",
|
|
iconCls: "btnrefresh",
|
|
handler: function (button, event) {
|
|
this.onRefreshClick(button, event);
|
|
},
|
|
scope: this
|
|
}]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [this.comboxGoods,{
|
|
fieldLabel: '前循环',
|
|
name: 'BEFORENUM',
|
|
value:0,
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
fieldLabel: '后循环',
|
|
name: 'AFTERNUM',
|
|
value: 0,
|
|
enableKeyEvents: true,
|
|
listeners: {
|
|
specialkey: function (field, e) {
|
|
if (e.getKey() == e.ENTER) {
|
|
_this.onRefreshClick();
|
|
}
|
|
}
|
|
}
|
|
}, this.comboxDateType, this.comboxPORTDISCHARGE, { xtype: 'hiddenfield' }, {
|
|
xtype: 'button',
|
|
width: 90,
|
|
text: "高级查询",
|
|
iconCls: "btnmore",
|
|
handler: function (button, event) {
|
|
var sql = this.getCondition();
|
|
var winAccess = new Shipping.DsQuery({
|
|
|
|
});
|
|
winAccess.StoreList = this.storeCtnList;
|
|
winAccess.formname = this.formname;
|
|
winAccess.condition = sql;
|
|
winAccess.show();
|
|
return;
|
|
},
|
|
scope: this
|
|
}]
|
|
}
|
|
|
|
]//end items(fieldset 1)
|
|
}]//end root items
|
|
});
|
|
//#endregion formSearch
|
|
|
|
//查询工具条
|
|
this.panelBtn = new Ext.Panel({
|
|
region: "north",
|
|
tbar: [
|
|
|
|
{
|
|
text: "执行查询",
|
|
iconCls: "btnrefresh",
|
|
handler: function (button, event) {
|
|
this.onRefreshClick(button, event);
|
|
},
|
|
scope: this
|
|
},
|
|
{
|
|
text: "重置条件",
|
|
iconCls: "btnreset",
|
|
handler: function (button, event) {
|
|
},
|
|
scope: this
|
|
}, '-',
|
|
{
|
|
text: "打印",
|
|
iconCls: 'btnprint',
|
|
menu: [
|
|
{ text: "全部",
|
|
handler: function (menu, event) {
|
|
_this.Print();
|
|
}
|
|
}],
|
|
|
|
scope: this
|
|
}, '-', {
|
|
text: "导出Excel",
|
|
id: "btnExportExcel",
|
|
iconCls: 'btnexportexcel',
|
|
handler: function (button, event) {
|
|
this.onExportClick(button, event);
|
|
},
|
|
scope: this
|
|
}
|
|
]
|
|
});
|
|
this.panelCtn = new Ext.Panel({
|
|
title: '明细',
|
|
layout: "border",
|
|
region: 'center',
|
|
margin: '0 0',
|
|
frame: true,
|
|
items: [this.gridListCtn]
|
|
});
|
|
|
|
this.panelSum = new Ext.Panel({
|
|
title: '合 计',
|
|
layout: "border",
|
|
region: 'center',
|
|
margin: '0 0',
|
|
frame: true,
|
|
items: [this.gridListSum]
|
|
});
|
|
|
|
this.tabpanel = new Ext.TabPanel
|
|
({
|
|
activeTab: 0,
|
|
autoWidth: true,
|
|
border: false,
|
|
frame: false,
|
|
region: 'center',
|
|
id: "TabPanelID",
|
|
enableTabScroll: true,
|
|
items:
|
|
[
|
|
this.panelSum,
|
|
this.panelCtn
|
|
]
|
|
});
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
layout: "border",
|
|
region: "north",
|
|
height: 100,
|
|
items: [this.formSearch, this.panelBtn]
|
|
});
|
|
|
|
Ext.apply(this, {
|
|
items: [this.panelTop, this.tabpanel]
|
|
});
|
|
|
|
this.sqlcontext ='';
|
|
|
|
|
|
//this.onRefreshClick();
|
|
|
|
}, //end initUIComponents
|
|
InitGrid: function (beforenum, afternum) {
|
|
|
|
_this = this;
|
|
this.girdcolums = [{
|
|
dataIndex: 'CTNNO',
|
|
sortable: true,
|
|
text: '箱号',
|
|
align: 'right',
|
|
width: 80
|
|
}];
|
|
this.girdcolumssum = [];
|
|
var Ctnfield = [
|
|
{ name: 'CTNNO', type: 'string'},
|
|
{ name: 'CTNGID', type: 'string' }
|
|
];
|
|
var Sumfield = [
|
|
|
|
];
|
|
let linenum = Add(Add(beforenum, afternum,0),1,0);
|
|
|
|
for (let i = 1; i <= linenum; i++) {
|
|
Ctnfield.push({ name: 'LINES' + i.toString(), type: 'string' });
|
|
Ctnfield.push({ name: 'CTNNUM' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'GXFUSDDR' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'XSFDRTTLINUSD' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'HDFDR' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'OTDRTTLINUSD' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'TTLCRINUSD' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'PROFITINUSD' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'CYCLE_DAY' + i.toString(), type: 'number' });
|
|
Ctnfield.push({ name: 'DAYPROFITINUSD' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'LINES' + i.toString(), type: 'string' });
|
|
Sumfield.push({ name: 'CTNNUM' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'GXFUSDDR' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'XSFDRTTLINUSD' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'HDFDR' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'OTDRTTLINUSD' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'TTLCRINUSD' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'PROFITINUSD' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'CYCLE_DAY' + i.toString(), type: 'number' });
|
|
Sumfield.push({ name: 'DAYPROFITINUSD' + i.toString(), type: 'number' });
|
|
var column={
|
|
text: i.toString()+'程',
|
|
dataIndex: 'ZLINE' + i.toString(),
|
|
columns: [{
|
|
dataIndex: 'LINES' + i.toString(),
|
|
sortable: true,
|
|
text: '路径',
|
|
align: 'left',
|
|
width: 160
|
|
},{
|
|
dataIndex: 'CTNNUM' + i.toString(),
|
|
sortable: true,
|
|
text: '箱量',
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'GXFUSDDR' + i.toString(),
|
|
sortable: true,
|
|
text: '罐箱收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'XSFDRTTLINUSD' + i.toString(),
|
|
sortable: true,
|
|
text: '超期箱使费收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'HDFDR' + i.toString(),
|
|
sortable: true,
|
|
text: '换单费收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'OTDRTTLINUSD' + i.toString(),
|
|
sortable: true,
|
|
text: '其他收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'TTLCRINUSD' + i.toString(),
|
|
sortable: true,
|
|
text: '成本',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'PROFITINUSD' + i.toString(),
|
|
sortable: true,
|
|
text: '总租金收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}, {
|
|
dataIndex: 'DAYPROFITINUSD' + i.toString(),
|
|
sortable: true,
|
|
text: '日租金收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 80
|
|
}
|
|
]
|
|
};
|
|
this.girdcolums.push(column);
|
|
this.girdcolumssum.push(column);
|
|
}
|
|
var column = {
|
|
dataIndex: 'TTLDAYPROFITINUSD',
|
|
sortable: true,
|
|
text: '合计日租金收入',
|
|
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
|
|
align: 'right',
|
|
width: 100
|
|
};
|
|
this.girdcolums.push(column);
|
|
this.girdcolumssum.push(column);
|
|
|
|
Ctnfield.push({ name: 'TTLDAYPROFITINUSD', type: 'number' });
|
|
Sumfield.push({ name: 'TTLDAYPROFITINUSD', type: 'number' });
|
|
|
|
|
|
Ext.define('ctnmodel', {
|
|
extend: 'Ext.data.Model',
|
|
fields: Ctnfield
|
|
});
|
|
|
|
this.storeCtnList = Ext.create('Ext.data.Store', {
|
|
pageSize: this.PageSize,
|
|
model: 'ctnmodel',
|
|
remoteSort: true,
|
|
proxy: {
|
|
type: 'ajax',
|
|
url: '/MvcContainer/MsOpCtnBsCard/GetDataFeeSumList',
|
|
reader: {
|
|
root: 'data',
|
|
totalProperty: 'totalCount'
|
|
}
|
|
}
|
|
});
|
|
|
|
Ext.define('summodel', {
|
|
extend: 'Ext.data.Model',
|
|
fields: Sumfield
|
|
});
|
|
|
|
this.storeSumList = Ext.create('Ext.data.Store', {
|
|
pageSize: this.PageSize,
|
|
model: 'summodel',
|
|
remoteSort: true,
|
|
proxy: {
|
|
type: 'ajax',
|
|
url: '/MvcContainer/MsOpCtnBsCard/GetDataFeeSum',
|
|
reader: {
|
|
root: 'data',
|
|
totalProperty: 'totalCount'
|
|
}
|
|
}
|
|
});
|
|
|
|
this.gridListCtn.reconfigure(this.storeCtnList, this.girdcolums);
|
|
this.gridListSum.reconfigure(this.storeSumList, this.girdcolumssum);
|
|
|
|
this.storeCtnList.on('beforeload', function (store) {
|
|
var datetype = this.formSearch.getForm().findField('DATETYPE').getValue();
|
|
var beforenum = this.formSearch.getForm().findField('BEFORENUM').getValue();
|
|
var afternum = this.formSearch.getForm().findField('AFTERNUM').getValue();
|
|
var sql = this.sqlcontext;
|
|
Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum });
|
|
}, this);
|
|
|
|
|
|
this.storeSumList.on('beforeload', function (store) {
|
|
var datetype = this.formSearch.getForm().findField('DATETYPE').getValue();
|
|
var beforenum = this.formSearch.getForm().findField('BEFORENUM').getValue();
|
|
var afternum = this.formSearch.getForm().findField('AFTERNUM').getValue();
|
|
var sql = this.sqlcontext;
|
|
Ext.apply(store.proxy.extraParams, { condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum });
|
|
}, this);
|
|
|
|
|
|
|
|
|
|
},
|
|
onRefreshClick: function (button, event) {
|
|
var sql = this.getCondition();
|
|
this.sqlcontext = sql;
|
|
var beforenum = this.formSearch.getForm().findField('BEFORENUM').getValue();
|
|
var afternum = this.formSearch.getForm().findField('AFTERNUM').getValue();
|
|
this.InitGrid(beforenum, afternum);
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
|
this.storeCtnList.pageSize = this.PageSize;
|
|
var datetype = this.formSearch.getForm().findField('DATETYPE').getValue();
|
|
this.storeCtnList.load({
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum },
|
|
waitMsg: "正在查询数据...",
|
|
scope: this
|
|
});
|
|
this.storeSumList.load({
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum },
|
|
waitMsg: "正在查询数据...",
|
|
scope: this
|
|
});
|
|
},
|
|
|
|
onDsQuery: function () {
|
|
var sql = this.sqlcontext;
|
|
var datetype = this.formSearch.getForm().findField('DATETYPE').getValue();
|
|
var beforenum = this.formSearch.getForm().findField('BEFORENUM').getValue();
|
|
var afternum = this.formSearch.getForm().findField('AFTERNUM').getValue();
|
|
this.PageSize = this.Pagenum.getValue();
|
|
this.storeCtnList.pageSize = this.PageSize;
|
|
this.storeCtnList.load({
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum },
|
|
waitMsg: "正在查询数据...",
|
|
scope: this
|
|
});
|
|
this.storeSumList.load({
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, datetype: datetype, beforenum: beforenum, afternum: afternum },
|
|
waitMsg: "正在查询数据...",
|
|
scope: this
|
|
});
|
|
},
|
|
|
|
|
|
|
|
getCondition: function () {
|
|
var form = this.formSearch.getForm();
|
|
if (!form.isValid()) {
|
|
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
|
|
return '';
|
|
}
|
|
|
|
var sql = '';
|
|
|
|
|
|
var BSNO = form.findField('BSNO').getValue();
|
|
sql = sql + getAndConSql(sql, BSNO, " (b.BSNO like '%" + BSNO + "%' or b.CUSTNO like '%" + BSNO + "%' or b.I_CUSTNO like '%" + BSNO + "%' or b.MBLNO like '%" + BSNO + "%' ) ");
|
|
|
|
var CTNNO = form.findField('CTNNO').getValue();
|
|
sql = sql + getAndConSql(sql, CTNNO, "b.CTNNO like '%" + CTNNO + "%'");
|
|
|
|
var GOODSNAME = form.findField('GOODSNAME').getValue();
|
|
sql = sql + getAndConSql(sql, GOODSNAME, "b.GOODSNAME='" + GOODSNAME + "'");
|
|
|
|
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
|
|
sql = sql + getAndConSql(sql, CUSTOMERNAME, "b.CUSTOMERNAME='" + CUSTOMERNAME + "'");
|
|
|
|
var expDateBgn = form.findField('ETDbgn').getRawValue();
|
|
sql = sql + getAndConSql(sql, expDateBgn, "b.ETD>='" + expDateBgn + "'");
|
|
|
|
var expDateEnd = form.findField('ETDend').getRawValue();
|
|
sql = sql + getAndConSql(sql, expDateEnd, "b.ETD<='" + expDateEnd + " 23:59:59'");
|
|
|
|
|
|
|
|
var PORTLOAD = form.findField('PORTLOAD').getValue();
|
|
sql = sql + getAndConSql(sql, PORTLOAD, "b.PORTLOAD='" + PORTLOAD + "'");
|
|
|
|
var DESTPORT = form.findField('DESTPORT').getValue();
|
|
sql = sql + getAndConSql(sql, DESTPORT, "b.DESTPORT='" + DESTPORT + "'");
|
|
|
|
return sql;
|
|
},
|
|
OprationSwap: function () {
|
|
var ret = new Array();
|
|
ret[0] = this.OprationStatus;
|
|
ret[1] = this.storeCtnList;
|
|
ret[2] = this.SelectedRecord;
|
|
|
|
return ret;
|
|
},
|
|
|
|
onExportClick: function (button, event) {
|
|
|
|
_this = this;
|
|
|
|
grid2Excel(this.gridListSum,'配货航线单循');
|
|
|
|
|
|
|
|
},
|
|
Print: function () {
|
|
|
|
_this = this;
|
|
if (this.storeCtnList.getCount() == 0) {
|
|
return;
|
|
}
|
|
|
|
var bsno = '11111';
|
|
|
|
var datetype = this.formSearch.getForm().findField('DATETYPE').getValue();
|
|
var beforenum = this.formSearch.getForm().findField('BEFORENUM').getValue();
|
|
var afternum = this.formSearch.getForm().findField('AFTERNUM').getValue();
|
|
var sortstr = '';
|
|
|
|
Ext.Msg.wait('正在组织数据, 请稍侯..');
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在组织数据...',
|
|
url: '/MvcContainer/MsOpCtnBsCard/GetDataFeeSum',
|
|
scope: this,
|
|
params: {
|
|
condition: _this.sqlcontext,
|
|
printstr: 'true',
|
|
datetype: datetype,
|
|
sort: sortstr,
|
|
beforenum: beforenum,
|
|
afternum: afternum
|
|
},
|
|
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 = 'MSOPCTNBSCARDPRSUM';
|
|
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
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
PrintSelect: function () {
|
|
|
|
_this = this;
|
|
if (this.storeCtnList.getCount() == 0) {
|
|
return;
|
|
}
|
|
var selectedRecords = [];
|
|
var storeadd = null;
|
|
selectedRecords = this.GridCheckBoxModel.selected.items;
|
|
|
|
|
|
if (selectedRecords.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
|
|
var sortstr = 'INPUTTIME ';
|
|
|
|
if (this.sortfield != '' && this.sortdire != '') {
|
|
|
|
sortstr = this.sortfield + ' ' + this.sortdire;
|
|
}
|
|
|
|
var feeGidSql = '';
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
var record = selectedRecords[i];
|
|
var feeGId = "'" + record.get('GID') + "'";
|
|
if (feeGidSql == '') {
|
|
feeGidSql = feeGId;
|
|
} else {
|
|
feeGidSql = feeGidSql + "," + feeGId;
|
|
}
|
|
};
|
|
|
|
var bsno = '11111';
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
if (selections.length != 0) {
|
|
var record = selections[0];
|
|
bsno = record.data.GID;
|
|
}
|
|
|
|
var printType = 'MSOPCTNBSCARDPRSELECT';
|
|
var sql1 = "select * from op_ctnbscard WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
|
|
var sql2 = "select * from op_ctnbscard where GID='" + bsno + "'";
|
|
var sql3 = "";
|
|
var sql4 = "";
|
|
var sql5 = "";
|
|
var sql6 = "";
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
}
|
|
|
|
});
|
|
|
|
|