|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.MsOpSubSeaeImportAIndex = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.MsOpSubSeaeImportAIndex.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
Ext.extend(Shipping.MsOpSubSeaeImportAIndex, Ext.Panel, {
|
|
|
PageSize: 100,
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
|
SelectedRecord: null,
|
|
|
isShowAdvancedQuery: 0, //是否显示高级查询面板
|
|
|
IsAudit: false,
|
|
|
BillType: 1,
|
|
|
sqlcontext: '',
|
|
|
OrType:1,
|
|
|
|
|
|
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
this.formname = "formMsOpSubSeaeImportAIndex"; //页面名称
|
|
|
//定义数据集
|
|
|
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CtnDispModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
|
|
|
});
|
|
|
|
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
|
pageSize: this.PageSize,
|
|
|
model: 'MsSubSeaOrderModel',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/GetDataList',
|
|
|
reader: {
|
|
|
id: 'BSNO',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
//#region List列表显示信息
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
|
width: 30
|
|
|
});
|
|
|
|
|
|
this.girdcolums = [{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BSNO',
|
|
|
header: 'BSNO',
|
|
|
width: 0
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SPCHARGE',
|
|
|
header: 'SPECIAL CHARGE',
|
|
|
renderer: function (value, p, record) {
|
|
|
if (value == true) {
|
|
|
return "YES"
|
|
|
} else { return "NO" }
|
|
|
},
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
id: '',
|
|
|
dataIndex: 'DRFEESTATUS',
|
|
|
header: 'DRFEESTATUS', //'应收费用',
|
|
|
align: 'center',
|
|
|
width: 60,
|
|
|
renderer: function (value, meta) {
|
|
|
|
|
|
if (value == '审核通过') {
|
|
|
meta.tdCls = 'feestatus_pass';
|
|
|
} else if (value == '录入状态') {
|
|
|
|
|
|
} else if (value == '提交审核') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '部分结算') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '结算完毕') {
|
|
|
meta.tdCls = 'feestatus_settle';
|
|
|
} else if (value == '未录入') {
|
|
|
} else if (value == '部分结算') {
|
|
|
meta.tdCls = 'feestatus_settle';
|
|
|
} else if (value == '部分审核') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '部分提交') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '驳回提交') {
|
|
|
meta.tdCls = 'feestatus_nopass';
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
id: '',
|
|
|
dataIndex: 'CRFEESTATUS',
|
|
|
header: 'CRFEESTATUS', //'应付费用',
|
|
|
align: 'center',
|
|
|
width: 60,
|
|
|
renderer: function (value, meta) {
|
|
|
|
|
|
if (value == '审核通过') {
|
|
|
meta.tdCls = 'feestatus_pass';
|
|
|
} else if (value == '录入状态') {
|
|
|
|
|
|
} else if (value == '提交审核') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '部分结算') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '结算完毕') {
|
|
|
meta.tdCls = 'feestatus_settle';
|
|
|
} else if (value == '未录入') {
|
|
|
} else if (value == '部分结算') {
|
|
|
meta.tdCls = 'feestatus_settle';
|
|
|
} else if (value == '部分审核') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '部分提交') {
|
|
|
meta.tdCls = 'feestatus_refer';
|
|
|
} else if (value == '驳回提交') {
|
|
|
meta.tdCls = 'feestatus_nopass';
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'MBLNO',
|
|
|
header: 'MBLNO',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ETD',
|
|
|
header: 'ETD',
|
|
|
width: 90
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BLFRT',
|
|
|
header: 'BLFRT',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CARGOID',
|
|
|
header: 'CARGO',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'GOODSNAME',
|
|
|
header: 'GOODS NAME',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PKGS',
|
|
|
header: 'PKGS',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'KGS',
|
|
|
header: 'KGS',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CNTRTOTAL',
|
|
|
header: 'CNTR',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'INPUTBY',
|
|
|
header: 'INPUTBY',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'VESSEL',
|
|
|
header: 'VESSEL',
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'VOYNO',
|
|
|
header: 'VOYNO',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTLOAD',
|
|
|
header: 'PORTLOAD',
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTDISCHARGE',
|
|
|
header: 'PORTDISCHARGE',
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'KINDPKGS',
|
|
|
header: 'KINDPKGS',
|
|
|
width: 60
|
|
|
}];
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
|
//定义Grid
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeList,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
selModel: this.GridCheckBoxModel,
|
|
|
loadMask: { msg: "Loading,Wait..." },
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
viewConfig: {
|
|
|
autoFill: true,
|
|
|
getRowClass: function (record, rowIndex, rowParams, store) {
|
|
|
var Status = record.get('SPCHARGE');
|
|
|
if (Status == true) {
|
|
|
return 'feestatus_nopass';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
|
|
|
listeners: {
|
|
|
cellclick: function (thisTab, record, item, index, e, eOpts) {
|
|
|
if (index == 10) {//设置按钮列
|
|
|
// alert('用户编号=' + this.getStore().getAt(rowIndex).data.usercode);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
columns: this.girdcolums,
|
|
|
// paging bar on the bottom
|
|
|
bbar: Ext.create('Ext.PagingToolbar', {
|
|
|
store: this.storeList,
|
|
|
displayInfo: true,
|
|
|
displayMsg: 'Display {0} - {1}Record/Total {2}Records',
|
|
|
emptyMsg: "NO DATA"
|
|
|
})
|
|
|
});
|
|
|
|
|
|
/////////////以下部分为获取存储的gridpanel显示样式
|
|
|
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
|
|
|
this.gridList.reconfigure(this.storeList, this.girdcolums);
|
|
|
//this.gridList.columns[0] = new Ext.grid.RowNumberer();
|
|
|
////////////////////////////////////////////////
|
|
|
|
|
|
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
|
|
|
this.SelectedRecord = record;
|
|
|
this.OprationStatus = 'edit';
|
|
|
DsOpenEditWin('/MvcShipping/MsOpSubSeaOrder/EditAgentExport');
|
|
|
// window.open('/MvcShipping/MsOpSubSeaOrder/EditAgentExport', "ORDERA EDIT", 'width=1200,height=' + (window.screen.availHeight - 55) + ',top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
|
|
|
this.girdcolums.unshift(new Ext.grid.RowNumberer());
|
|
|
this.gridList.reconfigure(this.storeList, this.girdcolums);
|
|
|
|
|
|
|
|
|
//国际港口(进口装货港、出口卸货港)
|
|
|
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeDisportModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
|
|
|
});
|
|
|
this.storeCodeDisport.load();
|
|
|
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: 'PORTLOAD',
|
|
|
store: this.storeCodeDisport,
|
|
|
forceSelection: true,
|
|
|
name: 'PORTLOAD',
|
|
|
valueField: 'PORT',
|
|
|
displayField: 'PORT'
|
|
|
});
|
|
|
|
|
|
//国内港口(出口装货港、进口卸货港)
|
|
|
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeDisportModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
|
|
|
});
|
|
|
this.storeCodeLoadport.load();
|
|
|
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: 'PORTDISCHARGE',
|
|
|
store: this.storeCodeLoadport,
|
|
|
forceSelection: true,
|
|
|
name: 'PORTDISCHARGE',
|
|
|
valueField: 'PORT',
|
|
|
displayField: 'PORT'
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
//#region formSearch 查询面板
|
|
|
|
|
|
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: 'VESSEL',
|
|
|
store: this.storeVoyVeg,
|
|
|
name: 'VESSEL',
|
|
|
valueField: 'VESSEL',
|
|
|
flex: 2,
|
|
|
displayField: 'VESSEL'
|
|
|
});
|
|
|
this.formSearch = Ext.widget('form', {
|
|
|
frame: true,
|
|
|
region: 'center',
|
|
|
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: 'MBLNO',
|
|
|
name: 'MblNo'
|
|
|
}, this.comboxVoyVeg, {
|
|
|
fieldLabel: 'VOYNO',
|
|
|
name: 'VOYNO'
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxPORTLOAD, this.comboxPORTDISCHARGE, {
|
|
|
fieldLabel: 'ETD',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETDbgn'
|
|
|
}, {
|
|
|
fieldLabel: 'TO',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETDend'
|
|
|
}]
|
|
|
}]//end items(fieldset 1)
|
|
|
}]//end root items
|
|
|
});
|
|
|
//#endregion formSearch
|
|
|
|
|
|
|
|
|
|
|
|
//按钮工具条
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
region: "north",
|
|
|
tbar: [ {
|
|
|
text: "Query",
|
|
|
iconCls: "btnrefresh",
|
|
|
handler: function (button, event) {
|
|
|
this.onRefreshClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: "Reset",
|
|
|
iconCls: "btnreset",
|
|
|
handler: function (button, event) {
|
|
|
this.onClearSql(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: "Arrival Notice",
|
|
|
handler: function (button, event) {
|
|
|
this.OprationStatus = 'edit';
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Please Select The BILL!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.SelectedRecord = selections[0];
|
|
|
DsOpenEditWin('/MvcShipping/MsOpSubSeaOrder/EditArrival');
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-',
|
|
|
{
|
|
|
text: "Print",
|
|
|
iconCls: 'btnprint',
|
|
|
menu: [
|
|
|
{
|
|
|
text: "Print All",
|
|
|
handler: function (menu, event) {
|
|
|
_this.Print();
|
|
|
}
|
|
|
}, {
|
|
|
text: "Print Select",
|
|
|
handler: function (menu, event) {
|
|
|
_this.PrintSelect();
|
|
|
}
|
|
|
}],
|
|
|
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: "Batch fee Add",
|
|
|
handler: function (button, event) {
|
|
|
this.onPiLiangAddFeeTemplate();
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: "Batch Edit", //"业务批量修改",
|
|
|
handler: function (menu, event) {
|
|
|
_this.winModifyShow.show();
|
|
|
}
|
|
|
}, '-', {
|
|
|
text: "Save Display List",
|
|
|
id: "btntest",
|
|
|
menu: [
|
|
|
{
|
|
|
text: "Save",
|
|
|
handler: function (button, event) {
|
|
|
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
|
|
|
}
|
|
|
}, {
|
|
|
text: "Init..",
|
|
|
handler: function (menu, event) {
|
|
|
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
|
|
|
}
|
|
|
}],
|
|
|
scope: this
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
height: 100,
|
|
|
items: [this.panelBtn, this.formSearch]
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
items: [this.panelTop, this.gridList]
|
|
|
});
|
|
|
|
|
|
|
|
|
this.onRefreshClick();
|
|
|
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
|
var sql = this.getCondition();
|
|
|
Ext.apply(store.proxy.extraParams, { condition: sql, billtype: this.BillType, ortype: this.OrType });
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
this.StoreOfficeAddr = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'MsSubSeaOrderYard',
|
|
|
proxy: { url: '/MvcShipping/MsOpSubSeaOrder/GetArrivalYardList' }
|
|
|
});
|
|
|
this.StoreOfficeAddr.load({ params: { condition: "" } });
|
|
|
|
|
|
this.comboxOfficeAddr = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
store: this.StoreOfficeAddr,
|
|
|
name: 'OFFICEADDRID',
|
|
|
fieldLabel: '搬入場所',
|
|
|
valueField: 'YARDCODE',
|
|
|
displayField: 'YARDCODE',
|
|
|
listeners: {
|
|
|
scope: this,
|
|
|
'select': function (combo, records, eOpts) {
|
|
|
if (records.length > 0) {
|
|
|
var selectrecords = DsStoreQueryBy(this.StoreOfficeAddr, 'YARDCODE', combo.value);
|
|
|
if (selectrecords.getCount() > 0) {
|
|
|
var selectdata = selectrecords.getAt(0).data;
|
|
|
this.formModify.getForm().findField('OFFICEADDR').setValue(selectdata.DESCRIP);
|
|
|
} else {
|
|
|
this.formModify.getForm().findField('OFFICEADDR').setValue('');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.formModify = Ext.widget('form', {
|
|
|
region: 'north',
|
|
|
frame: true,
|
|
|
bodyPadding: 5,
|
|
|
fieldDefaults: {
|
|
|
margins: '2 2 2 2',
|
|
|
labelAlign: 'right',
|
|
|
flex: 1,
|
|
|
labelWidth: 70,
|
|
|
msgTarget: 'qtip'
|
|
|
},
|
|
|
|
|
|
items: [
|
|
|
{//fieldset 1
|
|
|
xtype: 'fieldset',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'anchor',
|
|
|
defaults: {
|
|
|
anchor: '100%'
|
|
|
},
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [ {
|
|
|
fieldLabel: '美元汇率',
|
|
|
name: 'GROSSWEIGHT'
|
|
|
}, {
|
|
|
fieldLabel: 'ETA',
|
|
|
format: 'Y-m-d',
|
|
|
flex: 1,
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETA'
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'anchor',
|
|
|
flex: 1,
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
this.comboxOfficeAddr,
|
|
|
{
|
|
|
xtype: 'textareafield',
|
|
|
fieldLabel: '  ',
|
|
|
grow: true,
|
|
|
height: 50,
|
|
|
name: 'OFFICEADDR',
|
|
|
anchor: '100%'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]//end items(fieldset 1)
|
|
|
}//end fieldset 1
|
|
|
]//end root items
|
|
|
}); //end this.formEdit
|
|
|
me = this;
|
|
|
|
|
|
|
|
|
this.winModifyShow = Ext.create('Ext.window.Window', {
|
|
|
title: "批量修改",
|
|
|
width: 820,
|
|
|
//height : 120,
|
|
|
//plain : true,
|
|
|
iconCls: "addicon",
|
|
|
resizable: false,
|
|
|
// 是否可以拖动
|
|
|
// draggable:false,
|
|
|
collapsible: true, // 允许缩放条
|
|
|
closeAction: 'close',
|
|
|
closable: true,
|
|
|
modal: 'true',
|
|
|
buttonAlign: "center",
|
|
|
bodyStyle: "padding:0 0 0 0",
|
|
|
items: [this.formModify],
|
|
|
buttons: [{
|
|
|
text: "确认修改",
|
|
|
minWidth: 70,
|
|
|
handler: function () {
|
|
|
|
|
|
me.onModifyClick()
|
|
|
|
|
|
|
|
|
}
|
|
|
}, {
|
|
|
text: "关闭",
|
|
|
minWidth: 70,
|
|
|
handler: function () {
|
|
|
me.winModifyShow.close();
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
}, //end initUIComponents
|
|
|
|
|
|
|
|
|
|
|
|
onRefreshClick: function (button, event) {
|
|
|
//var girdcolums = this.gridList.getColumnMode();
|
|
|
var sql = this.getCondition();
|
|
|
this.sqlcontext = sql;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: this.BillType, ortype: this.OrType },
|
|
|
waitMsg: "Data being queried...",
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onDeleteClick: function (button, event) {
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Please Select The BILL!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var record = selections[0];
|
|
|
|
|
|
|
|
|
if (record.data.ORSTATUS == '0') {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: "The BILL Is Posted,Can't Delete !", icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ext.MessageBox.confirm('Prompt', 'Sure To Delete This Record?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait('Deleting...');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: 'Deleting...',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/Delete',
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(record.data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
this.storeList.remove(record);
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: 'Error', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: 'The Server Response Error, Please Try Again', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) { },
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
},
|
|
|
|
|
|
onSubmitAuditClick: function () {
|
|
|
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Please Select Need Post The BILL!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var record = selections[0];
|
|
|
|
|
|
|
|
|
if (record.data.ORSTATUS != '9' && record.data.ORSTATUS != '2') {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: "The BILL Is Posted,Can't Post!", icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
Ext.MessageBox.confirm('Prompt', 'Sure To Post This Record?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait('POSTING...');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: 'POSTING...',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/SubmitAudit',
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(record.data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
_this.onRefreshClick();
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Post Successful!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: 'Error', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: 'The Server Response Error, Please Try Again', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) {
|
|
|
},
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
|
|
|
},
|
|
|
|
|
|
onSubmitAuditBackClick: function () {
|
|
|
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Please Select Need Cancel Post The BILL!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var record = selections[0];
|
|
|
|
|
|
|
|
|
if (record.data.ORSTATUS != '1') {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: "The BILL Is Posted,Can't Post!", icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
Ext.MessageBox.confirm('Prompt', 'Sure To Cancel Post This Record?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait('Cancel Posting...');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: 'Cancel Posting...',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/SubmitAuditBack',
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(record.data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
_this.onRefreshClick();
|
|
|
Ext.Msg.show({ title: 'Prompt', msg: 'Cancel Post Successful!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: 'Error', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: 'Warning', msg: 'The Server Response Error, Please Try Again', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) {
|
|
|
},
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
|
|
|
},
|
|
|
|
|
|
onModifyClick: function (menu, event) {
|
|
|
|
|
|
var GidStr = '';
|
|
|
var records = this.GridCheckBoxModel.selected.items;
|
|
|
if (records.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
var bodyAddDatas = [];
|
|
|
for (var i = 0; i < records.length; i++) {
|
|
|
var rec = records[i];
|
|
|
bodyAddDatas.push(rec);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
var data = this.formModify.getForm().getValues();
|
|
|
|
|
|
_this = this;
|
|
|
if (bodyAddDatas.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '没有要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在更新...',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/modify',
|
|
|
params: {
|
|
|
data: jsonbodyAddDatas,
|
|
|
modifydata: Ext.JSON.encode(data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
if (!result.Success) {
|
|
|
Ext.Msg.show({
|
|
|
title: '提示',
|
|
|
msg: result.Message,
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
buttons: Ext.Msg.OK
|
|
|
});
|
|
|
return;
|
|
|
} else {
|
|
|
|
|
|
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
_this.onRefreshClick();
|
|
|
_this.winModifyShow.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
}
|
|
|
|
|
|
},
|
|
|
onPiLiangAddFeeTemplate: function () {
|
|
|
|
|
|
var selections = this.GridCheckBoxModel.selected.items;
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要更新的业务!
|
|
|
return;
|
|
|
}
|
|
|
var BSNOStr = '';
|
|
|
for (var i = 0; i < selections.length; i++) {
|
|
|
var rec = selections[i];
|
|
|
var BSNO = "'" + rec.data.ORDNO + "'";
|
|
|
if (BSNOStr == '')
|
|
|
BSNOStr = BSNO;
|
|
|
else {
|
|
|
|
|
|
BSNOStr = BSNOStr + ',' + BSNO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (BSNOStr == '') {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoGengXinDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectbsno = " ORDNO IN (" + BSNOStr + ")";
|
|
|
|
|
|
window.open('/MvcShipping/MsOpSubSeaOrder/AddFeePLIndex', "PILIANGADDFEE", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
onClearSql: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
form.reset();
|
|
|
}, //onDeleteClick
|
|
|
|
|
|
getCondition: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
if (!form.isValid() ) {
|
|
|
Ext.Msg.alert('prompt', 'Query Conditions Assignment Errors,Pls Check。');
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
var sql = '';
|
|
|
|
|
|
//#region formSearch 查询面板
|
|
|
//编号包括(主提单号)
|
|
|
var MblNo = form.findField('MblNo').getValue();
|
|
|
sql = sql + getAndConSql(sql, MblNo, "(MBLNO like '%" + MblNo + "%' )");
|
|
|
|
|
|
|
|
|
//到港日期
|
|
|
var ETDbgn = form.findField('ETDbgn').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETDbgn, "ETD >='" + ETDbgn + "'");
|
|
|
var ETDend = form.findField('ETDend').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETDend, "ETD <='" + ETDend + "'");
|
|
|
|
|
|
|
|
|
|
|
|
// //牌号
|
|
|
// var CNTRTOTAL = form.findField('CNTRTOTAL').getValue();
|
|
|
// sql = sql + getAndConSql(sql, CNTRTOTAL, "CNTRTOTAL like '%" + CNTRTOTAL + "%'");
|
|
|
|
|
|
|
|
|
//装货港
|
|
|
var PORTLOAD = form.findField('PORTLOAD').getValue();
|
|
|
sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD like '%" + PORTLOAD + "%'");
|
|
|
|
|
|
//卸货港
|
|
|
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
|
|
|
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE like '%" + PORTDISCHARGE + "%'");
|
|
|
|
|
|
//船名
|
|
|
var VESSEL = form.findField('VESSEL').getValue();
|
|
|
sql = sql + getAndConSql(sql, VESSEL, "VESSEL like '%" + VESSEL + "%'");
|
|
|
|
|
|
//航次
|
|
|
var VOYNO = form.findField('VOYNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, VOYNO, "VOYNO like '%" + VOYNO + "%'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sql;
|
|
|
},
|
|
|
|
|
|
setIsShowAdvancedQuery: function () {
|
|
|
if (this.isShowAdvancedQuery == 0) {
|
|
|
this.panelSearch.show();
|
|
|
this.isShowAdvancedQuery = 1;
|
|
|
} else {
|
|
|
this.panelSearch.hide();
|
|
|
this.isShowAdvancedQuery = 0;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
OprationSwap: function () {
|
|
|
var ret = new Array();
|
|
|
ret[0] = this.OprationStatus;
|
|
|
ret[1] = this.storeList;
|
|
|
ret[2] = this.SelectedRecord;
|
|
|
ret[3] = this.IsAudit;
|
|
|
ret[4] = this.BillType;
|
|
|
ret[5] = this.OrType;
|
|
|
ret[6] =this.selectbsno
|
|
|
return ret;
|
|
|
},
|
|
|
|
|
|
|
|
|
Print: function () {
|
|
|
|
|
|
_this = this;
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Ext.Msg.wait('正在组织数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在组织数据...',
|
|
|
url: '/MvcShipping/MsOpSubSeaOrder/GetDataListStr',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
condition: _this.sqlcontext,
|
|
|
billtype: _this.BillType,
|
|
|
ortype: _this.OrType
|
|
|
},
|
|
|
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 = 'MSSEAORDERLLIST';
|
|
|
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.storeList.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 feeGidSql = '';
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var record = selectedRecords[i];
|
|
|
var feeGId = "'" + record.get('ORDNO') + "'";
|
|
|
if (feeGidSql == '') {
|
|
|
feeGidSql = feeGId;
|
|
|
} else {
|
|
|
feeGidSql = feeGidSql + "," + feeGId;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var printType = 'MSSEAORDERLISTSELECT';
|
|
|
var sql1 = "select * from op_sub_seaorder WHERE ORDNO IN (" + feeGidSql + ") ORDER BY BSDATE desc ";
|
|
|
var sql2 = "";
|
|
|
var sql3 = "";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|