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.

1079 lines
34 KiB
JavaScript

//欠费统计
Ext.namespace('Shipping');
Shipping.MsRptVesselVoyIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptVesselVoyIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptVesselVoyIndex, 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 = 'MsRptVesselVoyIndex';
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
this.storeListDr = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'BLCOUNT', type: 'number' },
{ name: 'PKGS', type: 'number' },
{ name: 'CBM', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'CNTR1', type: 'number' },
{ name: 'CNTR2', type: 'number' },
{ name: 'CNTR3', type: 'number' },
{ name: 'CNTR4', type: 'number' },
{ name: 'CNTR5', type: 'number' },
{ name: 'CNTR6', type: 'number' },
{ name: 'CNTR7', type: 'number' },
{ name: 'CNTR8', type: 'number' },
{ name: 'CNTR9', type: 'number' },
{ name: 'CNTR10', type: 'number' },
{ name: 'OTCNTR', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptVesselVoy/VesselListData',
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.initgirdcolumsdr = [{
sortable: true,
dataIndex: 'VESSEL',
text: '船名',
width: 160
}, {
sortable: true,
dataIndex: 'VOYNO',
text: '航次',
width: 70
}, {
sortable: true,
dataIndex: 'ETD',
text: '开船日期',
width: 70
}, {
sortable: true,
dataIndex: 'PORTLOAD',
text: '装货港',
width: 150
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
text: '卸货港',
width: 150
}, {
sortable: true,
dataIndex: 'BLCOUNT',
text: '票数',
width: 80
}, {
sortable: true,
dataIndex: 'TEU',
text: 'TEU',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
text: '件数',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
text: 'KGS',
width: 80
}, {
sortable: true,
dataIndex: 'CBM',
text: '尺码',
width: 80
}, {
sortable: true,
dataIndex: 'NETWEIGHT',
text: '净重',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSNAME',
text: '品名',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'CNTR1',
text: '箱型1',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR2',
text: '箱型2',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR3',
text: '箱型3',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR4',
text: '箱型4',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR5',
text: '箱型5',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR6',
text: '箱型6',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR7',
text: '箱型7',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR8',
text: '箱型8',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR9',
text: '箱型9',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR10',
text: '箱型10',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'OTCNTR',
text: '其他箱型',
width: 60
}
];
this.girdcolumsdr = DsTruck.GetGridPanel(USERID, this.formname , this.initgirdcolumsdr, 1);
this.gridListDr = new Ext.grid.GridPanel({
store: this.storeListDr,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolumsdr,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeListDr,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
this.gridListDr.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
}, this);
this.gridListDr.addListener('sortchange', function (ct, column, direction, eOpts) {
this.bslistdrsortfield = column.dataIndex;
this.bslistdrsortdire = direction;
}, this);
//#region formSearch
//#region formSearch枚举参照相关
_this = this;
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务类型',
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输类型',
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCust = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCust.load({ params: { condition: ""} });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '结算客户',
store: this.storeCust,
// forceSelection: true,
name: 'CUSTNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//国内港口(出口装货港、进口卸货港)
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
});
this.storeCodeLoadport.load();
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港',
store: this.storeCodeLoadport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
displayField: 'CodeAndName',
matchFieldWidth: false
//
});
//状态_业务状态
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load({ params: { condition: ""} });
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船 名',
store: this.storeVoyVeg,
valueField: 'VESSEL',
flex: 1.5,
name: 'PS_VESSEL',
displayField: 'VESSEL',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
fields: [
{ name: 'CUSTOMER', type: 'string' },
{ name: 'ENTERPID', type: 'string' }
],
proxy: { url: '/MvcShipping/MsOpApply/GetENTERPLIST' }
});
this.storeEnterpCode.load();
this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '经营单位',
store: this.storeEnterpCode,
name: 'PS_ENTERP',
valueField: 'CUSTOMER',
displayField: 'CUSTOMER',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
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();
}
}
}
});
//#endregion
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.comboxCustCode, this.comboxOpLb, this.comboxPORTDISCHARGE, this.comboxOp, this.comboxSalesCode, this.comboxSubComp
]
}, {
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();
}
}
}
}, {
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '至',
xtype: 'monthfield',
name: 'PS_ACCDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxVoyVeg, {
fieldLabel: '航次',
labelWidth: 40,
flex: 0.5,
name: 'PS_VOYNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '记忆查询条件',
checked: true,
width: 120
});
_this = this;
this.SearchBtn = new Ext.Button({
text: '隐藏查询',
handler: function () {
if (_this.SearchBtn.text == '隐藏查询') {
_this.panelSearch.hide();
_this.SearchBtn.setText("显示查询");
} else {
_this.panelSearch.show();
_this.SearchBtn.setText("隐藏查询");
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
id: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == '隐藏查询')
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
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.SearchBtn, {
xtype: 'button',
width: 90,
text: "清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, this.CheckSaveQuery, '-', {
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.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 80,
items: [this.formSearch]
});
this.panelBodyChFee = new Ext.Panel({
title: '船名航次合计',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.gridListDr]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelBodyChFee
]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.tabpanel]
});
this.storeListDr.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.storectndisp.load({ params: { condition: "" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
_this.InitGrid(_this.initgirdcolumsdr, _this.gridListDr, _this.storeListDr);
}
}
},
scope: this
});
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
}, //end initUIComponents
InitGrid: function (grid, thgridList, thstoreList) {
var agirdcolums = grid;
for (i = 0; i < this.storectndisp.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = this.storectndisp.getAt(i);
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'CNTR1') {
if (memberyf.data.CNT1 != '' && memberyf.data.CNT1 != null) {
agirdcolums[j].text = memberyf.data.CNT1;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR2') {
if (memberyf.data.CNT2 != '' && memberyf.data.CNT2 != null) {
agirdcolums[j].text = memberyf.data.CNT2;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR3') {
if (memberyf.data.CNT3 != '' && memberyf.data.CNT3 != null) {
agirdcolums[j].text = memberyf.data.CNT3;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR4') {
if (memberyf.data.CNT4 != '' && memberyf.data.CNT4 != null) {
agirdcolums[j].text = memberyf.data.CNT4;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR5') {
if (memberyf.data.CNT5 != '' && memberyf.data.CNT5 != null) {
agirdcolums[j].header = memberyf.data.CNT5;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR6') {
if (memberyf.data.CNT6 != '' && memberyf.data.CNT6 != null) {
agirdcolums[j].text = memberyf.data.CNT6;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR7') {
if (memberyf.data.CNT7 != '' && memberyf.data.CNT7 != null) {
agirdcolums[j].text = memberyf.data.CNT7;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR8') {
if (memberyf.data.CNT8 != '' && memberyf.data.CNT8 != null) {
agirdcolums[j].text = memberyf.data.CNT8;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR9') {
if (memberyf.data.CNT9 != '' && memberyf.data.CNT9 != null) {
agirdcolums[j].text = memberyf.data.CNT9;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR10') {
if (memberyf.data.CNT10 != '' && memberyf.data.CNT10 != null) {
agirdcolums[j].text = memberyf.data.CNT10;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
}
};
thgridList.reconfigure(thstoreList, agirdcolums);
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
this.PageSize = this.Pagenum.getValue();
this.sqlcontext = sql;
this.storeListDr.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
getCondition: function () {
var form = this.formSearch.getForm();
var data = this.formSearch.getForm().getValues(false, false, false);
var sql = '';
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
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 accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, " (B.PORTDISCHARGE like '%" + PORTDISCHARGE + "%' or B.PORTLOAD like '%" + PORTDISCHARGE + "%')");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
var VESSEL = form.findField('PS_VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'");
var VOYNO = form.findField('PS_VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'");
var SUBCOMP = form.findField('SUBCOMP').getValue();
sql = sql + getAndConSql(sql, SUBCOMP, "B.CORPID='" + SUBCOMP + "'");
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
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] = "MsRptNoTotalIndex";
return ret;
},
onSaveGridClick: function (button, event) {
this.girdcolumsdr = DsTruck.SaveGridPanel(USERID, this.formname , this.gridListDr.columns, this.girdcolumsdr, 1, true);
},
oninitGridClick: function (button, event) {
this.gridListDr.reconfigure(this.storeListDr, this.initgirdcolumsdr);
this.girdcolumsdr = DsTruck.SaveGridPanel(USERID, this.formname, this.gridListDr.columns, this.initgirdcolumsdr, 1, true);
},
onExportClick: function (button, event) {
_this = this;
GridExportExcelPage(this.gridListDr);
},
Print: function () {
var sql = this.getCondition();
_this = this;
if (this.storeListDr.getCount() == 0) {
return;
}
var sortstr = '';
if (this.bslistdrsortfield != '' && this.bslistdrsortdire != '') {
sortstr = this.bslistdrsortfield + ' ' + this.bslistdrsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsRptVesselVoy/VesselListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: sql,
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 = 'MsRptVesselVoyLIST';
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
});
}
}
});
}
});