|
|
|
|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.MsRptPriceShipIndex = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.MsRptPriceShipIndex.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
//需求编号:SR2017062400004-2
|
|
|
Ext.extend(Shipping.MsRptPriceShipIndex, Ext.Panel, {
|
|
|
PageSize: 1000,
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
|
SelectedRecord: null,
|
|
|
sqlcontext: '',
|
|
|
strHeader: "",
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
this.formname = "formMsRptPriceShipIndex"; //ds6运价销售查询
|
|
|
|
|
|
//#region formSearch 下拉框信息加载
|
|
|
|
|
|
//启运港,国内港口
|
|
|
this.storeCodeLoaport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetCodeLoaportList' }
|
|
|
});
|
|
|
this.storeCodeLoaport.load();
|
|
|
this.comboxCodeLoaport = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '启运港',
|
|
|
store: this.storeCodeLoaport,
|
|
|
name: 'PORTLOADID',
|
|
|
valueField: 'VALUE',
|
|
|
displayField: 'CodeAndName',
|
|
|
forceSelection: true,
|
|
|
//matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//目的港,国外港口
|
|
|
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetCodeDisportList' }
|
|
|
});
|
|
|
this.storeCodeDisport.load();
|
|
|
this.comboxCodeDisport = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '目的港',
|
|
|
store: this.storeCodeDisport,
|
|
|
name: 'PORTDISCHARGEID',
|
|
|
valueField: 'VALUE',
|
|
|
displayField: 'CodeAndName',
|
|
|
forceSelection: true,
|
|
|
matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
},
|
|
|
'change': function (combo, records, eOpts, kk, hg) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//船公司
|
|
|
this.storeCrmClient = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetCrmClientList' }
|
|
|
});
|
|
|
this.storeCrmClient.load();
|
|
|
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '船公司',
|
|
|
store: this.storeCrmClient,
|
|
|
name: 'CARRIER',
|
|
|
valueField: 'NAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
forceSelection: true,
|
|
|
//matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//航线
|
|
|
this.storeCodeTrade = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetCodeTradeList' }
|
|
|
});
|
|
|
this.storeCodeTrade.load();
|
|
|
this.comboxCodeTrade = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '航线',
|
|
|
store: this.storeCodeTrade,
|
|
|
name: 'LANE',
|
|
|
valueField: 'NAME',
|
|
|
displayField: 'CodeAndName',
|
|
|
forceSelection: true,
|
|
|
//matchFieldWidth: false, //下拉款自适应宽度
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//周数
|
|
|
Ext.define('WeekModel', {
|
|
|
extend: 'Ext.data.Model',
|
|
|
fields: [{ name: 'Name', type: 'string'}]
|
|
|
});
|
|
|
var dataWeek = [{ "Name": "" }, { "Name": "1" }, { "Name": "2" }, { "Name": "3" }, { "Name": "4" }, { "Name": "5" }, { "Name": "6" }, { "Name": "7" }, { "Name": "8" }, { "Name": "9" }, { "Name": "10" }, { "Name": "11" }, { "Name": "12" }, { "Name": "13" }, { "Name": "14" }, { "Name": "15" }, { "Name": "16" }, { "Name": "17" }, { "Name": "18" }, { "Name": "19" }, { "Name": "20" }, { "Name": "21" }, { "Name": "22" }, { "Name": "23" }, { "Name": "24" }, { "Name": "25" }, { "Name": "26" }, { "Name": "27" }, { "Name": "28" }, { "Name": "29" }, { "Name": "30" }, { "Name": "31" }, { "Name": "32" }, { "Name": "33" }, { "Name": "34" }, { "Name": "35" }, { "Name": "36" }, { "Name": "37" }, { "Name": "38" }, { "Name": "39" }, { "Name": "40" }, { "Name": "41" }, { "Name": "42" }, { "Name": "43" }, { "Name": "44" }, { "Name": "45" }, { "Name": "46" }, { "Name": "47" }, { "Name": "48" }, { "Name": "49" }, { "Name": "50" }, { "Name": "51" }, { "Name": "52" }, { "Name": "53"}];
|
|
|
var storeWeek = Ext.create('Ext.data.Store', { model: 'WeekModel', data: dataWeek });
|
|
|
this.comboxWeek = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '周次',
|
|
|
forceSelection: true,
|
|
|
store: storeWeek,
|
|
|
id: 'Week',
|
|
|
name: 'Week',
|
|
|
width: 95,
|
|
|
labelAlign: 'right',
|
|
|
labelWidth: 30,
|
|
|
valueField: 'Name',
|
|
|
displayField: 'Name',
|
|
|
enableKeyEvents: true, //激活键盘事件
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region formSearch 查询面板
|
|
|
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: [this.comboxCodeLoaport, this.comboxCodeDisport
|
|
|
// , {
|
|
|
// fieldLabel: '目的港',
|
|
|
// name: 'PORTDISCHARGEID',
|
|
|
// enableKeyEvents: true, //激活键盘事件
|
|
|
// listeners: {
|
|
|
// scope: this,
|
|
|
// 'keyup': {
|
|
|
// fn: function (_field, e) {
|
|
|
// if (e.getKey() == 13) {
|
|
|
// this.onRefreshClick();
|
|
|
// }
|
|
|
// },
|
|
|
// scope: this
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
, this.comboxCARRIER, this.comboxCodeTrade, { xtype: 'hiddenfield', flex: 1}]//
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: '录入日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
editable: false,
|
|
|
name: 'LuRuDateBgn',
|
|
|
enableKeyEvents: true, //激活键盘事件
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: '至',
|
|
|
//labelWidth: 20,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
editable: false,
|
|
|
name: 'LuRuDateEnd',
|
|
|
enableKeyEvents: true, //激活键盘事件
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: '有效日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
editable: false,
|
|
|
name: 'YouXiaoDateEnd',
|
|
|
enableKeyEvents: true, //激活键盘事件
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: '年代',
|
|
|
xtype: 'monthfield',
|
|
|
editable: false,
|
|
|
id: 'YearDate',
|
|
|
name: 'YearDate',
|
|
|
format: 'Y',
|
|
|
//labelWidth: 30,
|
|
|
width: 130,
|
|
|
enableKeyEvents: true, //激活键盘事件
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'keyup': {
|
|
|
fn: function (_field, e) {
|
|
|
if (e.getKey() == 13) {
|
|
|
this.onRefreshClick();
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxWeek]
|
|
|
}]
|
|
|
}]//end items(fieldset 1)
|
|
|
});
|
|
|
//#endregion formSearch
|
|
|
|
|
|
//#region 定义数据集
|
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
|
pageSize: this.PageSize,
|
|
|
model: 'MsRptPriceShipModel',
|
|
|
remoteSort: true,
|
|
|
//autoLoad: false,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsRptPriceShip/GetDataList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 定义列
|
|
|
this.girdcolums = [{
|
|
|
sortable: false,
|
|
|
dataIndex: 'GID',
|
|
|
header: 'GID',
|
|
|
align: 'center',
|
|
|
hidden: true,
|
|
|
width: 0
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: 'isJiaSuo',
|
|
|
header: '加锁',
|
|
|
align: 'center',
|
|
|
width: 30,
|
|
|
renderer: function (value) {
|
|
|
if (value == '是') {
|
|
|
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
|
|
|
}
|
|
|
else {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: '运价编号',
|
|
|
header: '运价编号',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '航线',
|
|
|
header: '航线',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '船公司',
|
|
|
header: '船公司',
|
|
|
align: 'center',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '启运港',
|
|
|
header: '启运港',
|
|
|
align: 'center',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '目的港',
|
|
|
header: '目的港',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '开航时间',
|
|
|
header: '开航时间',
|
|
|
align: 'center',
|
|
|
width: 150
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '卖价说明',
|
|
|
header: '卖价说明',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '结关时间',
|
|
|
header: '结关时间',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '航行天数',
|
|
|
header: '航行天数',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '合约编号',
|
|
|
header: '合约编号',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '生效日期',
|
|
|
header: '生效日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '有效日期',
|
|
|
header: '有效日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '录入人',
|
|
|
header: '录入人',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '录入日期',
|
|
|
header: '录入日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '修改人',
|
|
|
header: '修改人',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '备注',
|
|
|
header: '备注',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '目的港中文',
|
|
|
header: '目的港中文',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '中转港',
|
|
|
header: '中转港',
|
|
|
align: 'center',
|
|
|
width: 150
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '周次',
|
|
|
header: '周次',
|
|
|
align: 'center',
|
|
|
width: 30
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '年代',
|
|
|
header: '年代',
|
|
|
align: 'center',
|
|
|
width: 50
|
|
|
}];
|
|
|
//#endregion
|
|
|
|
|
|
//#region 定义Grid
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
|
width: 30
|
|
|
});
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeList,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
|
enableHdMenu: false, //是否显示表格列的菜单
|
|
|
stripeRows: true, //斑马线效果
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
rowLines: true,
|
|
|
columnLines: true,
|
|
|
columns: this.girdcolums,
|
|
|
viewConfig: {
|
|
|
enableTextSelection: true, //允许复制数据
|
|
|
autoFill: true
|
|
|
},
|
|
|
bbar: Ext.create('Ext.PagingToolbar', {
|
|
|
pageSize: this.PageSize,
|
|
|
store: this.storeList,
|
|
|
displayInfo: true,
|
|
|
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
|
emptyMsg: "没有数据"
|
|
|
})
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 按钮工具条
|
|
|
this.CheckSaveQuery = new Ext.form.Checkbox({
|
|
|
fieldLabel: '记忆查询条件',
|
|
|
checked: true,
|
|
|
width: 120
|
|
|
});
|
|
|
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
border: false,
|
|
|
tbar: [{
|
|
|
text: "执行查询",
|
|
|
iconCls: "btnrefresh",
|
|
|
handler: function (button, event) {
|
|
|
this.onRefreshClick(button, event);
|
|
|
var isvisible = false;
|
|
|
var issavevalue = false;
|
|
|
if (this.CheckSaveQuery.checked) {
|
|
|
issavevalue = true
|
|
|
}
|
|
|
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: "重置条件",
|
|
|
iconCls: "btnreset",
|
|
|
handler: function (button, event) {
|
|
|
this.onClearSql(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
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
|
|
|
}, '-', this.CheckSaveQuery]
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 页面布局
|
|
|
this.panelTop = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
height: 95,
|
|
|
border: false,
|
|
|
items: [this.panelBtn, this.formSearch]
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
border: false,
|
|
|
items: [this.panelTop, this.gridList]
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 页面加载
|
|
|
//加载事件
|
|
|
this.InitData();
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
|
var sql = this.getCondition();
|
|
|
if (sql.toString() != "") {
|
|
|
Ext.apply(store.proxy.extraParams, { condition: sql });
|
|
|
}
|
|
|
}, this);
|
|
|
this.onRefreshClick();
|
|
|
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
|
|
|
//#endregion
|
|
|
}, //end initUIComponents
|
|
|
|
|
|
//#region 加载事件
|
|
|
InitData: function () {
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsRptPriceShip/GetData',
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (!result.Success) {
|
|
|
return;
|
|
|
}
|
|
|
data = result.data;
|
|
|
var arrtmp = data.toString().split("&");
|
|
|
var strYear = arrtmp[0].toString();
|
|
|
var strWeek = arrtmp[1].toString();
|
|
|
//
|
|
|
Ext.getCmp("YearDate").setValue(strYear);
|
|
|
Ext.getCmp("Week").setValue(strWeek);
|
|
|
}
|
|
|
},
|
|
|
async: false,
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 执行查询
|
|
|
onRefreshClick: function (button, event) {
|
|
|
Ext.Msg.wait('正在查询数据, 请稍侯..');
|
|
|
var sql = this.getCondition();
|
|
|
|
|
|
//#region 列
|
|
|
var zlcolumn = [{
|
|
|
sortable: false,
|
|
|
dataIndex: 'GID',
|
|
|
header: 'GID',
|
|
|
hidden: true,
|
|
|
align: 'center',
|
|
|
width: 0
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: 'isJiaSuo',
|
|
|
header: '加锁',
|
|
|
align: 'center',
|
|
|
width: 30,
|
|
|
renderer: function (value) {
|
|
|
if (value == '是') {
|
|
|
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
|
|
|
}
|
|
|
else {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
sortable: false,
|
|
|
dataIndex: '运价编号',
|
|
|
header: '运价编号',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '航线',
|
|
|
header: '航线',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '船公司',
|
|
|
header: '船公司',
|
|
|
align: 'center',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '启运港',
|
|
|
header: '启运港',
|
|
|
align: 'center',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '目的港',
|
|
|
header: '目的港',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
}];
|
|
|
|
|
|
var zlcolumn2 = [{
|
|
|
sortable: false,
|
|
|
dataIndex: '开航时间',
|
|
|
header: '开航时间',
|
|
|
align: 'center',
|
|
|
width: 150
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '卖价说明',
|
|
|
header: '卖价说明',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '结关时间',
|
|
|
header: '结关时间',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '航行天数',
|
|
|
header: '航行天数',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '合约编号',
|
|
|
header: '合约编号',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '生效日期',
|
|
|
header: '生效日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '有效日期',
|
|
|
header: '有效日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '录入人',
|
|
|
header: '录入人',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '录入日期',
|
|
|
header: '录入日期',
|
|
|
align: 'center',
|
|
|
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '修改人',
|
|
|
header: '修改人',
|
|
|
align: 'center',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '备注',
|
|
|
header: '备注',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '目的港中文',
|
|
|
header: '目的港中文',
|
|
|
align: 'center',
|
|
|
width: 200
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '中转港',
|
|
|
header: '中转港',
|
|
|
align: 'center',
|
|
|
width: 150
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '周次',
|
|
|
header: '周次',
|
|
|
align: 'center',
|
|
|
width: 30
|
|
|
},
|
|
|
{
|
|
|
sortable: false,
|
|
|
dataIndex: '年代',
|
|
|
header: '年代',
|
|
|
align: 'center',
|
|
|
width: 50
|
|
|
}];
|
|
|
//#endregion
|
|
|
|
|
|
//#region 取其他费用权限
|
|
|
var feeList;
|
|
|
this.storeFeeData = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetFeeName' }
|
|
|
});
|
|
|
this.storeFeeData.load({ params: {},
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
if (r.length != 0) {
|
|
|
feeList = r;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
async: false,
|
|
|
scope: this
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 取集装箱权限
|
|
|
var ctnList;
|
|
|
this.storeCtnData = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetCtn' }
|
|
|
});
|
|
|
this.storeCtnData.load({ params: {},
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
if (r.length != 0) {
|
|
|
ctnList = r;
|
|
|
|
|
|
//#region 取报价权限
|
|
|
this.storeMonthData = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'XiaLaKuangModel',
|
|
|
proxy: { url: '/MvcShipping/MsRptPriceShip/GetBaoJia' }
|
|
|
});
|
|
|
this.storeMonthData.load({ params: {},
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
//#region 列循环
|
|
|
if (r.length != 0) {
|
|
|
//#region 列循环_报价
|
|
|
for (j = 0; j < ctnList.length; j++) {
|
|
|
var ctn = ctnList[j];
|
|
|
var acolumn = [];
|
|
|
for (i = 0; i < r.length; i++) {
|
|
|
var memberyf = r[i];
|
|
|
acolumn.push({
|
|
|
dataIndex: memberyf.data.VALUE + ctn.data.VALUE,
|
|
|
header: memberyf.data.NAME,
|
|
|
align: 'right',
|
|
|
width: 60
|
|
|
});
|
|
|
this.strHeader += ",[" + memberyf.data.NAME + "]";
|
|
|
};
|
|
|
if (acolumn.length > 0) {
|
|
|
zlcolumn.push({
|
|
|
text: ctn.data.NAME,
|
|
|
columns: acolumn
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
//#endregion
|
|
|
|
|
|
//#region 列循环_其他费用
|
|
|
if (feeList != null) {
|
|
|
var acolumn2 = [];
|
|
|
for (i = 0; i < feeList.length; i++) {
|
|
|
var memberyf = feeList[i];
|
|
|
acolumn2.push({
|
|
|
dataIndex: memberyf.data.VALUE, //"列名"
|
|
|
header: memberyf.data.NAME, //"标题"
|
|
|
align: 'right',
|
|
|
width: 60
|
|
|
});
|
|
|
this.strHeader += ",[" + memberyf.data.NAME + "]";
|
|
|
};
|
|
|
if (acolumn2.length > 0) {
|
|
|
zlcolumn2.push({
|
|
|
text: "其他费用",
|
|
|
columns: acolumn2
|
|
|
});
|
|
|
for (var k in zlcolumn2) {
|
|
|
zlcolumn.push(zlcolumn2[k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//#endregion
|
|
|
}
|
|
|
//#endregion
|
|
|
|
|
|
this.gridList.reconfigure(this.storeList, zlcolumn);
|
|
|
this.sqlcontext = sql;
|
|
|
this.storeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, waitMsg: "正在查询数据...", scope: this });
|
|
|
|
|
|
Ext.Msg.hide();
|
|
|
}
|
|
|
},
|
|
|
async: false,
|
|
|
scope: this
|
|
|
});
|
|
|
//#endregion
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
async: false,
|
|
|
scope: this
|
|
|
});
|
|
|
//#endregion
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 查询条件
|
|
|
getCondition: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
if (!form.isValid()) {
|
|
|
Ext.Msg.alert('提示', '查询条件赋值错误,请检查!');
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
var sql = '';
|
|
|
|
|
|
var strPORTLOADID = form.findField('PORTLOADID').getValue();
|
|
|
if (strPORTLOADID != null) {
|
|
|
if (strPORTLOADID != "") {
|
|
|
sql = sql + getAndConSql(sql, strPORTLOADID, "[启运港]='" + strPORTLOADID.toString().trim() + "'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var strPORTDISCHARGEID = form.findField('PORTDISCHARGEID').getValue();
|
|
|
if (strPORTDISCHARGEID != null) {
|
|
|
if (strPORTDISCHARGEID != "") {
|
|
|
sql = sql + getAndConSql(sql, strPORTDISCHARGEID, "[目的港]='" + strPORTDISCHARGEID.toString().trim() + "'");
|
|
|
//sql = sql + getAndConSql(sql, strPORTDISCHARGEID, "[目的港] like '%" + strPORTDISCHARGEID.toString().trim() + "%'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var strCARRIER = form.findField('CARRIER').getValue();
|
|
|
if (strCARRIER != null) {
|
|
|
if (strCARRIER != "") {
|
|
|
sql = sql + getAndConSql(sql, strCARRIER, "[船公司]='" + strCARRIER.toString().trim() + "'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var strLANE = form.findField('LANE').getValue();
|
|
|
if (strLANE != null) {
|
|
|
if (strLANE != "") {
|
|
|
sql = sql + getAndConSql(sql, strLANE, "[航线]='" + strLANE.toString().trim() + "'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var strWeek = form.findField('Week').getValue();
|
|
|
if (strWeek != null) {
|
|
|
if (strWeek != "") {
|
|
|
sql = sql + getAndConSql(sql, strWeek, "[周次]='" + strWeek.toString().trim() + "'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var strYearDate = form.findField('YearDate').getRawValue();
|
|
|
if (strYearDate != null) {
|
|
|
if (strYearDate != "") {
|
|
|
sql = sql + getAndConSql(sql, strYearDate, "[年代]='" + strYearDate.toString().trim() + "'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var LuRuDatebgn = form.findField('LuRuDateBgn').getRawValue();
|
|
|
var LuRuDateEnd = form.findField('LuRuDateEnd').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, LuRuDatebgn, "[录入日期]>='" + LuRuDatebgn + "'");
|
|
|
sql = sql + getAndConSql(sql, LuRuDateEnd, "[录入日期]<='" + LuRuDateEnd + "'");
|
|
|
|
|
|
var YouXiaoDateEnd = form.findField('YouXiaoDateEnd').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, YouXiaoDateEnd, "[有效日期]<='" + YouXiaoDateEnd + "'");
|
|
|
|
|
|
return sql;
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 重置条件
|
|
|
onClearSql: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
form.reset();
|
|
|
this.InitData();
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 导出Excel
|
|
|
onExportClick: function (button, event) {
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在组织数据, 请稍侯...',
|
|
|
url: '/MvcShipping/MsRptPriceShip/GetDataListSQL',
|
|
|
params: {
|
|
|
condition: this.sqlcontext,
|
|
|
printstr: 'true'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var ddd = Ext.MessageBox.isVisible();
|
|
|
if (Ext.MessageBox.isVisible()) {
|
|
|
Ext.MessageBox.hide();
|
|
|
}
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var returnStr = jsonresult.data;
|
|
|
if (returnStr.toString() != "") {
|
|
|
var openSet = "height=1, width=400, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top=" + (screen.height - 200) / 2 + ",Left=" + (screen.width - 400) / 2;
|
|
|
var openType = "_blank";
|
|
|
var condition1 = escape(returnStr.toString());
|
|
|
var openUrl = "../../Reports/RptExport.aspx?handle=MsRptPriceShipIndex&formname=" + this.formname + "&condition1=" + condition1 + "&condition2=" + this.strHeader.toString();
|
|
|
window.open(openUrl, openType, openSet);
|
|
|
}
|
|
|
} 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 });
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//ExtJs 自带的导出当前页的excel导出函数
|
|
|
onExportClick2: function (button, event) {
|
|
|
GridExportExcelPage(this.gridList);
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
//#region 打印
|
|
|
Print: function () {
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在组织数据, 请稍侯...',
|
|
|
url: '/MvcShipping/MsRptPriceShip/GetDataListStr',
|
|
|
params: {
|
|
|
condition: this.sqlcontext,
|
|
|
printstr: 'true'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var ddd = Ext.MessageBox.isVisible();
|
|
|
if (Ext.MessageBox.isVisible()) {
|
|
|
Ext.MessageBox.hide();
|
|
|
}
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var returnStr = jsonresult.data;
|
|
|
var printType = 'MsRptPriceShipList';
|
|
|
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 });
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
//#endregion
|
|
|
|
|
|
OprationSwapJK: function () {
|
|
|
var ret = new Array();
|
|
|
ret[0] = this.OprationStatus;
|
|
|
ret[1] = this.storeList;
|
|
|
ret[2] = this.SelectedRecord;
|
|
|
return ret;
|
|
|
}
|
|
|
});
|