|
|
//押箱管理
|
|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.Booking_SIIndex = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.Booking_SIIndex.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
Ext.extend(Shipping.Booking_SIIndex, Ext.Panel, {
|
|
|
PageSize: 50,
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
|
SelectedRecord: null,
|
|
|
sqlcontext: '1=2',
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
this.formname = "Booking_SIIndex";
|
|
|
|
|
|
this.sqlcontext = '1=2';
|
|
|
|
|
|
/////////////////////////////////////////
|
|
|
//#region 主列表
|
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
|
pageSize: this.PageSize,
|
|
|
model: 'Booking_SImb',
|
|
|
remoteSort: false,
|
|
|
//groupField: 'GroupDate',
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
//url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL',
|
|
|
url: '/MvcShipping/BookingConfirm/GetBooking_SIList',
|
|
|
//this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL';
|
|
|
reader: {
|
|
|
id: 'SINO',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.column = [
|
|
|
{
|
|
|
sortable: true,hidden:true,
|
|
|
dataIndex: 'SINO',
|
|
|
header: '提单确认编号',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true, hidden: true,
|
|
|
dataIndex: 'ORDNO',
|
|
|
header: '订舱编号',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ORDERNO',
|
|
|
header: Zi.LAN.ORDERNO,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,hidden:true,
|
|
|
dataIndex: 'BSNO',
|
|
|
header: '业务编号',
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BSSTATUS',
|
|
|
header: Zi.LAN.SIBSSTATUSREF,
|
|
|
width: 80,
|
|
|
renderer: function (value, meta, record) {
|
|
|
return record.get("BSSTATUSREF");
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SUBMITDATE',
|
|
|
header: Zi.LAN.SUBMITDATE,
|
|
|
width: 140
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BSDATE',
|
|
|
header: Zi.LAN.BSDATE,
|
|
|
width: 140
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'MBLNO',
|
|
|
header: Zi.LAN.MBLNO ,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex:Zi.LAN.MBLNO,
|
|
|
header: Zi.LAN.HBLNO,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CONTRACTNO',
|
|
|
header: Zi.LAN.CONTRACTNO,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SERVICECONTRACTNO',
|
|
|
header: Zi.LAN.SERVICECONTRACTNO,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHIPPERID',
|
|
|
header: Zi.LAN.SHIPPERID,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CONSIGNEEID',
|
|
|
header: Zi.LAN.CONSIGNEEID,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'NOTIFYPARTYID',
|
|
|
header: Zi.LAN.NOTIFYPARTYID,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHIPPER',
|
|
|
header: Zi.LAN.SHIPPER,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CONSIGNEE',
|
|
|
header: Zi.LAN.CONSIGNEE,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'NOTIFYPARTY',
|
|
|
header: Zi.LAN.NOTIFYPARTY,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'YARD',
|
|
|
header: Zi.LAN.YARD,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'VESSEL',
|
|
|
header: Zi.LAN.VESSEL,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'VOYNO',
|
|
|
header: Zi.LAN.VOYNO,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ETD',
|
|
|
header: Zi.LAN.ETD2,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PLACERECEIPT',
|
|
|
header: Zi.LAN.PLACERECEIPTID,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTLOAD',
|
|
|
header: Zi.LAN.PORTLOAD,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTDISCHARGE',
|
|
|
header: Zi.LAN.PORTDISCHARGE,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PLACEDELIVERY',
|
|
|
header: Zi.LAN.PLACEDELIVERY,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'DESTINATION',
|
|
|
header: Zi.LAN.DESTINATION,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'NOBILL',
|
|
|
header: Zi.LAN.NOBILL,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'COPYNOBILL',
|
|
|
header: Zi.LAN.COPYNOBILL,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ISSUETYPE',
|
|
|
header: Zi.LAN.ISSUETYPE,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ISSUEDATE',
|
|
|
header: Zi.LAN.ISSUEDATE,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BLFRT',
|
|
|
header: Zi.LAN.BLFRT,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PREPARDAT',
|
|
|
header: Zi.LAN.PREPARDAT,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SERVICE',
|
|
|
header: Zi.LAN.SERVICE,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PKGS',
|
|
|
header: Zi.LAN.zPKGS,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'KINDPKGS',
|
|
|
header: Zi.LAN.KINDPKGS,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'KGS',
|
|
|
header: Zi.LAN.KGS2,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CBM',
|
|
|
header: Zi.LAN.zCBM,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CNTRTOTAL',
|
|
|
header: Zi.LAN.CNTRTOTAL2,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'INPUTBY',
|
|
|
header: Zi.LAN.INPUTBY2,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CARRIER',
|
|
|
header: Zi.LAN.CARRIER,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CARGOID',
|
|
|
header: Zi.LAN.CARGOID,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'CUSTNO',
|
|
|
header: Zi.LAN.SERVICECONTRACTNO,
|
|
|
width: 120
|
|
|
}
|
|
|
];
|
|
|
|
|
|
this.Pagenum = Ext.create('Ext.form.field.Number', {
|
|
|
name: 'bottles',
|
|
|
fieldLabel: Zi.LAN.bottles, //'每页记录数',
|
|
|
labelAlign: 'right',
|
|
|
value: this.PageSize,
|
|
|
maxValue: 100000,
|
|
|
width: 180,
|
|
|
minValue: 0,
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.Pagenum = Ext.create('Ext.form.field.Number', {
|
|
|
name: 'bottles',
|
|
|
fieldLabel: Zi.LAN.bottles, //'每页记录数',
|
|
|
labelAlign: 'right',
|
|
|
value: this.PageSize,
|
|
|
maxValue: 100000,
|
|
|
width: 180,
|
|
|
minValue: 0,
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
|
|
|
clicksToEdit: 1
|
|
|
});
|
|
|
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
|
width: 40
|
|
|
});
|
|
|
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
|
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeList,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
selModel: this.GridCheckBoxModel,
|
|
|
|
|
|
//selModel: this.MainCB,
|
|
|
columns: this.column,
|
|
|
plugins: [
|
|
|
//this.cellEditing
|
|
|
],
|
|
|
features: [{
|
|
|
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
|
|
|
}],
|
|
|
/*features: [{
|
|
|
id: 'group',
|
|
|
ftype: 'grouping',
|
|
|
groupHeaderTpl: '{name}',
|
|
|
hideGroupedHeader: true,
|
|
|
enableGroupingMenu: true
|
|
|
}],*/
|
|
|
viewConfig: {
|
|
|
enableTextSelection: true, //允许复制数据
|
|
|
autoFill: true,
|
|
|
getRowClass: function (record, rowIndex, rowParams, store) {
|
|
|
//var YXSTATE = record.get('YXSTATE');
|
|
|
//return Shipping.GetAuditClass(BLSTATUS);
|
|
|
}
|
|
|
},
|
|
|
bbar: [Ext.create('Ext.PagingToolbar', {
|
|
|
store: this.storeList,
|
|
|
displayInfo: true,
|
|
|
displayMsg: Zi.LAN.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
|
emptyMsg: Zi.LAN.emptyMsg//'没有数据'
|
|
|
}), this.Pagenum]
|
|
|
});
|
|
|
|
|
|
/////////////以下部分为获取存储的gridpanel显示样式
|
|
|
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column);
|
|
|
//使用者id,表名 ,中间column数组
|
|
|
this.column.unshift(new Ext.grid.RowNumberer());
|
|
|
this.gridList.reconfigure(this.storeList, this.column);
|
|
|
////////////////////////////
|
|
|
|
|
|
|
|
|
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
|
|
|
// alert('0....' + dataview.toString() + ',' + record.toString() + ',' + item.toString() + ',' + index.toString() + ',' + e.toString() + ',' + b.toString());
|
|
|
this.SelectedRecord = record;
|
|
|
this.OprationStatus = 'edit';
|
|
|
DsOpenEditWin('/MvcShipping/BookingConfirm/Edit_SI', "提单确认");
|
|
|
}, this);
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
//#region formSearch
|
|
|
|
|
|
//#region formSearch枚举参照相关
|
|
|
|
|
|
//客户
|
|
|
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
|
|
|
});
|
|
|
this.storeCustCode.load({ params: { condition: "" } });
|
|
|
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: Zi.LAN.CUSTOMERNAME,
|
|
|
store: this.storeCustCode,
|
|
|
//queryMode: 'remote',
|
|
|
minChars: 1,
|
|
|
//queryParam: 'CODENAME',
|
|
|
name: 'CUSTOMERNAME',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName'
|
|
|
//,allowBlank: false
|
|
|
});
|
|
|
|
|
|
this.comboxBSSTATUS = getEnumcombox({
|
|
|
LABEL: Zi.LAN.SIBSSTATUSREF ,
|
|
|
NAME: 'BSSTATUS',
|
|
|
FLEX: 1,
|
|
|
value: "Submit",
|
|
|
enumTypeId: 82002
|
|
|
});
|
|
|
//#endregion
|
|
|
_this = this;
|
|
|
this.formSearch = Ext.widget('form', {
|
|
|
frame: true,
|
|
|
region: 'center',
|
|
|
bodyPadding: 5,
|
|
|
fieldDefaults: {
|
|
|
margins: '2 2 2 2',
|
|
|
labelAlign: 'right',
|
|
|
flex: 1,
|
|
|
labelWidth: 85,
|
|
|
msgTarget: 'qtip'
|
|
|
},
|
|
|
|
|
|
items: [
|
|
|
{//fieldset 1
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'anchor',
|
|
|
defaults: {
|
|
|
anchor: '100%'
|
|
|
},
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.MBLNO,
|
|
|
//labelWidth: 110,
|
|
|
name: 'MBLNO',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.ORDERNO,
|
|
|
//labelWidth: 110,
|
|
|
name: 'ORDERNO',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
this.comboxCustCode,
|
|
|
this.comboxBSSTATUS,
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.BSDATE_BGN,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'BSDATE_BGN',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.BSDATE_END,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'BSDATE_END',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.ETD2,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETD_BGN',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.ETDend,
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETD_END',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
{
|
|
|
fieldLabel: Zi.LAN.CONTRACTNO,
|
|
|
//labelWidth: 110,
|
|
|
name: 'CONTRACTNO',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: Zi.LAN.SERVICECONTRACTNO,
|
|
|
//labelWidth: 110,
|
|
|
name: 'CUSTNO',
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
, { xtype: 'hiddenfield' }
|
|
|
]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [
|
|
|
|
|
|
]
|
|
|
}
|
|
|
]//end items(fieldset 1)
|
|
|
}//end fieldset 1
|
|
|
]//end root items
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
//#endregion formSearch
|
|
|
|
|
|
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
region: "north",
|
|
|
tbar: [
|
|
|
{
|
|
|
text: Zi.LAN.btnrefresh,
|
|
|
iconCls: "btnrefresh",
|
|
|
handler: function (button, event) {
|
|
|
this.onRefreshClick(button, event);
|
|
|
saveQuerySetting(this.formname, this.formSearch, true, true);
|
|
|
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.btnreset, //"确认修改",
|
|
|
minWidth: 70,
|
|
|
iconCls: "btnreset",
|
|
|
handler: function () {
|
|
|
var form = _this.formSearch.getForm();
|
|
|
form.reset();
|
|
|
}
|
|
|
}, '-', {
|
|
|
text: Zi.LAN.ListExpExcel,
|
|
|
id: "btnExportExcel",
|
|
|
iconCls: 'btnexportexcel',
|
|
|
handler: function (button, event) {
|
|
|
this.onExportClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.btnprint, id: "print",
|
|
|
tooltip: 'print',
|
|
|
handler: function (button, event) {
|
|
|
//this.PushState("30011");
|
|
|
this.Print();
|
|
|
},
|
|
|
scope: this
|
|
|
}, /*{
|
|
|
id: "btnFeeAuditReject",
|
|
|
text: '驳回提交费用业务',
|
|
|
tooltip: '驳回提交费用业务',
|
|
|
iconCls: "btnrefuse",
|
|
|
handler: function (button, event) {
|
|
|
this.onAuditRefuseClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
},*/
|
|
|
{
|
|
|
text: Zi.LAN.btntest,
|
|
|
id: "btntest",
|
|
|
handler: function (button, event) {
|
|
|
var formname = this.formname;
|
|
|
var tempcolumns = this.gridList.columns;
|
|
|
DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false);
|
|
|
},
|
|
|
scope: this
|
|
|
}
|
|
|
//,this.CB_EditMode
|
|
|
]
|
|
|
});
|
|
|
|
|
|
//#region 布局
|
|
|
this.panelTop = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
height: 100,
|
|
|
items: [this.formSearch, this.panelBtn]
|
|
|
});
|
|
|
|
|
|
this.panelMain = new Ext.Panel({
|
|
|
//title: '',
|
|
|
layout: "border",
|
|
|
region: 'center',
|
|
|
height: 600,
|
|
|
margin: '1 2',
|
|
|
split: true,
|
|
|
items: [this.gridList]
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
items: [this.panelTop, this.panelMain]
|
|
|
});
|
|
|
//#endregion
|
|
|
|
|
|
//#region 以下集中绑定事件
|
|
|
|
|
|
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
var sql = this.getCondition();
|
|
|
this.sqlcontext = sql;
|
|
|
//Ext.apply(store.proxy.extraParams, { condition: sql });
|
|
|
}, this);
|
|
|
|
|
|
//#endregion
|
|
|
this.LoadInitData();
|
|
|
|
|
|
}, //end initUIComponents
|
|
|
LoadInitData: function () {
|
|
|
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
|
|
|
|
|
|
sql = " BSSTATUS = 'Submit' ";
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onAuditRefuseClick: function (button, event) {
|
|
|
|
|
|
var sql = " A.GID in (select bsno from ch_fee where FEESTATUS=6)";
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
onRefreshClick: function (button, event) {
|
|
|
//if (!this.checkSearchCondition())
|
|
|
// return;
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
var sql = this.getCondition();
|
|
|
this.sqlcontext = sql;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
//}
|
|
|
},
|
|
|
|
|
|
onDsQuery: function (button, event) {
|
|
|
|
|
|
var sql = this.sqlcontext;
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
//}
|
|
|
},
|
|
|
|
|
|
onRefreshClick_Add: function (button, event) {
|
|
|
if (!this.checkSearchCondition())
|
|
|
return;
|
|
|
|
|
|
var sql = this.getCondition_Add();
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
//}
|
|
|
},
|
|
|
onDeleteClick: function (button, event) {
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var record = selections[0];
|
|
|
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait('正在删除数据...');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在删除数据...',
|
|
|
url: '/MvcShipping/MsOp_YAXIANG/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: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) {
|
|
|
},
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
}, //onDeleteClick
|
|
|
getCondition: function () {
|
|
|
|
|
|
var form = this.formSearch.getForm();
|
|
|
var sql = '';
|
|
|
|
|
|
//20170309 增加逻辑
|
|
|
//
|
|
|
//只能看到“”
|
|
|
|
|
|
var MBLNO = form.findField('MBLNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, MBLNO, " mblno like '%" + MBLNO + "%' ");
|
|
|
|
|
|
var ORDERNO = form.findField('ORDERNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, ORDERNO, " ORDERNO like '%" + ORDERNO + "%' ");
|
|
|
|
|
|
var BSSTATUS = form.findField('BSSTATUS').getValue();
|
|
|
sql = sql + getAndConSql(sql, BSSTATUS, " BSSTATUS = '" + BSSTATUS + "' ");
|
|
|
|
|
|
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
|
|
|
sql = sql + getAndConSql(sql, CUSTOMERNAME, " OP_SEAE_SI.USERID in(select GID from sys_user where INFO_CLIENT like '%" + CUSTOMERNAME + "%') ");
|
|
|
|
|
|
var BSDATE_BGN = form.findField('BSDATE_BGN').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, BSDATE_BGN, " (select max(optime) from OP_LOG where billno=ORDNO and JsonValue like '%\"BSSTATUS\":\"Submit\"%')>='" + BSDATE_BGN + "'");
|
|
|
|
|
|
var BSDATE_END = form.findField('BSDATE_END').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, BSDATE_END, " (select max(optime) from OP_LOG where billno=ORDNO and JsonValue like '%\"BSSTATUS\":\"Submit\"%')<='" + BSDATE_END + " 23:59:59'");
|
|
|
|
|
|
var ETD_BGN = form.findField('ETD_BGN').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETD_BGN, " ETD>='" + ETD_BGN + "'");
|
|
|
|
|
|
var ETD_END = form.findField('ETD_END').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETD_END, " ETD<='" + ETD_END + " 23:59:59'");
|
|
|
|
|
|
|
|
|
var CONTRACTNO = form.findField('CONTRACTNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, CONTRACTNO, " CONTRACTNO like '%" + CONTRACTNO + "%' ");
|
|
|
|
|
|
var CUSTNO = form.findField('CUSTNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, CUSTNO, " CUSTNO like '%" + CUSTNO + "%' ");
|
|
|
|
|
|
|
|
|
|
|
|
return sql;
|
|
|
},
|
|
|
|
|
|
OprationSwap: function () {
|
|
|
var ret = new Array();
|
|
|
ret[0] = this.OprationStatus;
|
|
|
ret[1] = this.storeList;
|
|
|
ret[2] = this.SelectedRecord;
|
|
|
if (this.OprationStatus == "add") {
|
|
|
ret[3] = "";
|
|
|
} else {
|
|
|
ret[3] = this.SelectedRecord.data.YXNO;
|
|
|
}
|
|
|
|
|
|
//将押箱单位列表带过
|
|
|
ret[4] = this.storeCustCode;
|
|
|
return ret;
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onAddClick: function (button, event) {
|
|
|
|
|
|
this.OprationStatus = 'add';
|
|
|
DsOpenEditWin("/MvcShipping/MsOp_YAXIANG/Edit", "新建押箱单", "700", "1100");
|
|
|
|
|
|
} //onDeleteClick
|
|
|
|
|
|
, PushState: function (execution) {
|
|
|
|
|
|
var selectedRecords = this.gridList.selModel.getSelection();
|
|
|
Ext.MessageBox.confirm('提示', '确定吗?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
|
|
|
var Bodydatas = [];
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var rec = selectedRecords[i];
|
|
|
Bodydatas.push(rec);
|
|
|
}
|
|
|
var jsonBody = ConvertRecordsToJsonAll(Bodydatas);
|
|
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在保存数据...',
|
|
|
url: '/MvcShipping/MsOp_YAXIANG/PushState_List',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
dataList: jsonBody,
|
|
|
Execution: execution
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
|
|
|
this.onRefreshClick();
|
|
|
|
|
|
} else {
|
|
|
Ext.Msg.show({
|
|
|
title: '请重试',
|
|
|
msg: jsonresult.Message,
|
|
|
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
}, this);
|
|
|
|
|
|
}
|
|
|
|
|
|
, Submit: function () {
|
|
|
this.Audit('SubmitAudit');
|
|
|
}
|
|
|
, SubmitBack: function () {
|
|
|
this.Audit('SubmitAuditBack');
|
|
|
}
|
|
|
|
|
|
, Audit: function (AuditType) {
|
|
|
|
|
|
var selectedRecords = this.gridList.selModel.getSelection();
|
|
|
Ext.MessageBox.confirm('提示', '确定吗?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
|
|
|
var Bodydatas = [];
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var rec = selectedRecords[i];
|
|
|
Bodydatas.push(rec);
|
|
|
}
|
|
|
var jsonBody = ConvertRecordsToJsonAll(Bodydatas);
|
|
|
|
|
|
//var Head = "[" + Ext.JSON.encode(this.Editdata) + "]";
|
|
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在保存数据...',
|
|
|
url: '/MvcShipping/MsOp_YAXIANG/' + AuditType,
|
|
|
scope: this,
|
|
|
params: {
|
|
|
dataList: jsonBody
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
|
|
|
condition = "YXNO='" + this.editRecord.get('YXNO') + "'";
|
|
|
|
|
|
this.LoadData(this.opStatus, condition);
|
|
|
|
|
|
} 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
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
,
|
|
|
//#region 打印
|
|
|
Print: function () {
|
|
|
var selectedRecords = this.gridList.selModel.getSelection();
|
|
|
var YXNOList = "";
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var rec = selectedRecords[i];
|
|
|
if (!isNullorEmpty(YXNOList)) YXNOList += "','";
|
|
|
YXNOList += rec.get("YXNO");
|
|
|
}
|
|
|
|
|
|
var printType = 'MSOP_YAXIANG';
|
|
|
var sql1 = "";
|
|
|
var sql2 = "";
|
|
|
var sql3 = "";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
url: '/MvcShipping/MsOp_YAXIANG/GetPrintSql',
|
|
|
params: {
|
|
|
printname: "Print1",
|
|
|
YXNOList: "'" + YXNOList + "'"
|
|
|
},
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
//this.Editdata = result.data;
|
|
|
//this.LoadInit(data);
|
|
|
|
|
|
sql1 = result.Data.sql1;
|
|
|
sql2 = result.Data.sql2;
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
} else {
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
//#endregion
|
|
|
});
|
|
|
|
|
|
|