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.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeCtnEdi/MsCodeCtnEdiIndex.js

2135 lines
79 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsCodeCtnEdiIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsCodeCtnEdiIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsCodeCtnEdiIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
initUIComponents: function () {
//#region 集装箱
this.storeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCtn.load();
//船公司
this.comboxCTN = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCtn,
forceSelection: true,
name: 'CTN',
valueField: 'CTN',
displayField: 'CTN'
});
this.storeEdiType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeEdiType.load({ params: { enumTypeId: 97012} });
this.comboxEdiName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeEdiType,
fieldLabel: 'EDI类别',
forceSelection: true,
name: 'EDINAME',
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
this.comboxEdiType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeEdiType,
forceSelection: true,
name: 'EDINAME',
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
this.storeList = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '箱型',
width: 160,
editor: this.comboxCTN
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}
]
});
//#endregion
//#region 客户
this.storeListCust = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetCustList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCustomerNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustomerNameRef.load({ params: { condition: ""} });
this.comboxCustomerNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRef,
forceSelection: true,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.gridListCustCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListCust = new Ext.grid.GridPanel({
store: this.storeListCust,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCustCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '客户名称',
width: 160,
editor: this.comboxCustomerNameRef
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}
]
});
//#endregion
//#region 包装
this.storeListPkgs = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetPkgsList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodePackageModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
});
this.storeCodePackage.load();
this.comboxKINDPKGS = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCodePackage,
valueField: 'PKGS',
displayField: 'PKGS'
});
this.gridListPkgsCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListPkgs = new Ext.grid.GridPanel({
store: this.storeListPkgs,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListPkgsCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '包装名称',
width: 160,
editor: this.comboxKINDPKGS
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}
]
});
//#endregion
//#region 运输条款
this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeServiceModel',
//model: 'CODE_SERVICE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeServiceList' }
});
this.storeSERVICE.load({ params: { condition: ""} });
this.comboxSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '运输条款',
store: this.storeSERVICE,
forceSelection: true,
name: 'SERVICE',
valueField: 'SERVICE',
displayField: 'SERVICE'
});
//
this.storeListSERVICE = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetSERVICEList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListSERVICECellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListSERVICE = new Ext.grid.GridPanel({
store: this.storeListSERVICE,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListSERVICECellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '运输条款',
width: 160,
editor: this.comboxSERVICE
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 港口
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.storeCodeDisport.load({ params: { condition: "" } });
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '港口',
store: this.storeCodeDisport,
forceSelection: true,
name: 'PORTDISCHARGE',
queryMode: 'remote',
minChars: 1,
queryParam: 'PORT',
valueField: 'PORT',
displayField: 'PORT',
allowBlank: false,
matchFieldWidth: false, //下拉款自适应宽度
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selections = this.gridListPORTDISCHARGE.getSelectionModel().getSelection(); //获得选中的项
selections[0].set("PORTID", records[0].data.EDICODE.toString());
}
}
}
});
//
this.storeListPORTDISCHARGE = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetPORTDISCHARGEList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListPORTDISCHARGECellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListPORTDISCHARGE = new Ext.grid.GridPanel({
store: this.storeListPORTDISCHARGE,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListPORTDISCHARGECellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'PORTID',
header: '港口代码',
width: 60
}, {
sortable: true,
dataIndex: 'CTN',
header: '港口',
width: 160,
editor: this.comboxPORTDISCHARGE
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 包装
this.storeListVessel = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetVesselList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load();
this.comboxVESSEL = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeVoyVeg,
valueField: 'VESSEL',
displayField: 'VESSEL'
});
this.gridListVesselCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListVessel= new Ext.grid.GridPanel({
store: this.storeListVessel,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListVesselCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '船名',
width: 160,
editor: this.comboxVESSEL
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}
]
});
//#endregion
//#region AFR信息客户暂时无此需求了因此屏蔽不再往下做了
/*
this.storeListAFR = Ext.create('Ext.data.Store', {
model: 'MsCodeAFREdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetAFRList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListAFRCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListAFR = new Ext.grid.GridPanel({
store: this.storeListAFR,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListAFRCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CustName',
header: '客户名称',
width: 160,
editor: this.comboxCustomerNameRef
}]
});
*/
//#endregion
//#region 运输条款
Ext.define('CODE_BLTYPE', {
extend: 'Ext.data.Model',
idProperty: 'BLTYPE',
fields: [
{ name: 'BLTYPE', type: 'string' }
]
});
this.storeISSUETYPE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_BLTYPE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeBLTYPEList' }
});
this.storeISSUETYPE.load({ params: { condition: "" } });
this.comboxISSUETYPE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeISSUETYPE,
forceSelection: true,
name: 'ISSUETYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE'
});
//
this.storeListISSUETYPE = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetISSUETYPEList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListISSUETYPECellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListISSUETYPE = new Ext.grid.GridPanel({
store: this.storeListISSUETYPE,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListISSUETYPECellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '签单方式',
width: 160,
editor: this.comboxISSUETYPE
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 费用名称
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefListNew' }
});
this.storeFeeNameRef.load();
this.comboxFeeNameRef = Ext.create('DsExt.ux.DCombox', {
store: this.storeFeeNameRef,
minChars: 1,
matchFieldWidth: false,
//queryParam: 'Name',
lazyRender: false,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
//
this.storeListFeeName = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetFeeNameList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListFeeNameCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListFeeName = new Ext.grid.GridPanel({
store: this.storeListFeeName,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListFeeNameCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '费用名称',
width: 160,
editor: this.comboxFeeNameRef
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 260,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 包装
this.storeListReeferf = Ext.create('Ext.data.Store', {
model: 'MsCodeCtnEdi',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeCtnEdi/GetReeferfList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListReeferfCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
//定义Grid
this.gridListReeferf = new Ext.grid.GridPanel({
store: this.storeListReeferf,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListReeferfCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTN',
header: '通风量',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'EDINAME',
header: 'EDI类别',
width: 100,
editor: this.comboxEdiType,
renderer: function (value, p, record) {
return record.data.EDINAMEREF;
}
}, {
sortable: true,
dataIndex: 'EDICODE',
header: 'EDI代码',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}
]
});
//#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: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxEdiName, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//#region 查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "新增",
iconCls: "btnadd",
handler: function (button, event) {
this.addDetail();
},
scope: this
}, {
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.onPostDetailClick(button, event);
},
scope: this
}, '-', {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, '-', {
text: "引入基本信息",
handler: function (button, event) {
this.onAddDefaultClick();
},
scope: this
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 80,
items: [this.formSearch, this.panelBtn]
});
this.panelCtn = new Ext.Panel({
layout: "border",
title: '集装箱箱型',
id: 'pnlctn',
region: "center",
items: [this.gridList]
});
this.panelCust = new Ext.Panel({
layout: "border",
title: '往来单位',
id: 'pnlcust',
region: "center",
items: [this.gridListCust]
});
this.panelPkgs = new Ext.Panel({
layout: "border",
title: '包装',
id: 'pnlpkgs',
region: "center",
items: [this.gridListPkgs]
});
this.panelSERVICE = new Ext.Panel({
layout: "border",
title: '运输条款',
id: 'pnlSERVICE',
region: "center",
items: [this.gridListSERVICE]
});
this.panelPORTDISCHARGE = new Ext.Panel({
layout: "border",
title: '港口',
id: 'pnlPORTDISCHARGE',
region: "center",
items: [this.gridListPORTDISCHARGE]
});
this.panelVESSEL = new Ext.Panel({
layout: "border",
title: '船名',
id: 'pnlVESSEL',
region: "center",
items: [this.gridListVessel]
});
this.panelISSUETYPE = new Ext.Panel({
layout: "border",
title: '签单方式',
id: 'pnlISSUETYPE',
region: "center",
items: [this.gridListISSUETYPE]
});
this.panelFeeName = new Ext.Panel({
layout: "border",
title: '费用名称',
id: 'pnlFeeName',
region: "center",
items: [this.gridListFeeName]
});
this.panelReeferf = new Ext.Panel({
layout: "border",
title: '通风量',
id: 'pnlReeferf',
region: "center",
items: [this.gridListReeferf]
});
this.MainCenter = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
enableTabScroll: true,
items:
[
this.panelCtn, this.panelCust, this.panelPkgs, this.panelSERVICE, this.panelPORTDISCHARGE, this.panelVESSEL, this.panelISSUETYPE, this.panelFeeName, this.panelReeferf
]
});
Ext.apply(this, {
items: [this.panelTop, this.MainCenter]
});
//#endregion
//#region 加载数据
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridList.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListCust.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListCust.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListPkgs.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListPkgs.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListSERVICE.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListSERVICE.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListPORTDISCHARGE.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListPORTDISCHARGE.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListVessel.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListVessel.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListISSUETYPE.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListISSUETYPE.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.storeListReeferf.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridListReeferf.on('edit', function (editor, e, eOpts) {
this.gridListAfterEdit(editor, e, eOpts);
}, this);
this.onRefreshClick();
//#endregion
}, //end initUIComponents
//#region 查询
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListCust.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListPkgs.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListSERVICE.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListPORTDISCHARGE.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListVessel.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListISSUETYPE.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListFeeName.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListFeeName.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListReeferf.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var sEDINAME = form.findField('EDINAME').getValue();
sql = sql + getAndConSql(sql, sEDINAME, "EDINAME like '%" + sEDINAME + "%'");
return sql;
},
//#endregion
//#region 新增
addDetail: function () {
//var newSerialno = DsGetNewSerialNo(this.storeBodyList, this.serialNo);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: '',
REMARK: ''
});
if (this.MainCenter.activeTab.id == 'pnlctn') {
this.storeList.add(record);
var n = this.storeList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlcust') {
this.storeListCust.add(record);
var n = this.storeListCust.getCount();
this.gridListCustCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlpkgs') {
this.storeListPkgs.add(record);
var n = this.storeListPkgs.getCount();
this.gridListPkgsCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlSERVICE') {
this.storeListSERVICE.add(record);
var n = this.storeListSERVICE.getCount();
this.gridListSERVICECellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlPORTDISCHARGE') {
this.storeListPORTDISCHARGE.add(record);
var n = this.storeListPORTDISCHARGE.getCount();
this.gridListPORTDISCHARGECellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlVESSEL') {
this.storeListVessel.add(record);
var n = this.storeListVessel.getCount();
this.gridListVesselCellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlISSUETYPE') {
this.storeListISSUETYPE.add(record);
var n = this.storeListISSUETYPE.getCount();
this.gridListISSUETYPECellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlFeeName') {
this.storeListFeeName.add(record);
var n = this.storeListFeeName.getCount();
this.gridListFeeNameCellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlReeferf') {
this.storeListReeferf.add(record);
var n = this.storeListReeferf.getCount();
this.gridListReeferfCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
},
//#endregion
//#region 引入基本信息
onAddDefaultClick: function () {
if (this.MainCenter.activeTab.id == 'pnlctn') {
for (i = 0; i < this.storeCtn.getCount(); i += 1) {
var memberyf = this.storeCtn.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.CTN,
REMARK: ''
});
this.storeList.add(record);
}
var n = this.storeList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlcust') {
this.storeListCust.add(record);
var n = this.storeListCust.getCount();
this.gridListCustCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlpkgs') {
for (i = 0; i < this.storeCodePackage.getCount(); i += 1) {
var memberyf = this.storeCodePackage.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.PKGS,
REMARK: ''
});
this.storeListPkgs.add(record);
}
var n = this.storeListPkgs.getCount();
this.gridListPkgsCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlSERVICE') {
for (i = 0; i < this.storeSERVICE.getCount(); i += 1) {
var memberyf = this.storeSERVICE.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.SERVICE,
REMARK: ''
});
this.storeListSERVICE.add(record);
}
var n = this.storeListSERVICE.getCount();
this.gridListSERVICECellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
else if (this.MainCenter.activeTab.id == 'pnlPORTDISCHARGE') {
for (i = 0; i < this.storePORTDISCHARGE.getCount(); i += 1) {
var memberyf = this.storePORTDISCHARGE.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.PORT,
REMARK: ''
});
this.storeListPORTDISCHARGE.add(record);
}
var n = this.storeListPORTDISCHARGE.getCount();
this.gridListPORTDISCHARGECellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlVESSEL') {
for (i = 0; i < this.storeVoyVeg.getCount(); i += 1) {
var memberyf = this.storeVoyVeg.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.VESSEL,
REMARK: ''
});
this.storeListVessel.add(record);
}
var n = this.storeListVessel.getCount();
this.gridListVesselCellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlISSUETYPE') {
for (i = 0; i < this.storeISSUETYPE.getCount(); i += 1) {
var memberyf = this.storeISSUETYPE.getAt(i);
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: memberyf.data.VESSEL,
REMARK: ''
});
this.storeListISSUETYPE.add(record);
}
var n = this.storeListISSUETYPE.getCount();
this.gridListISSUETYPECellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlFeeName') {
for (i = 0; i < this.storeFeeName.getCount(); i += 1) {
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN:'',
REMARK: ''
});
this.storeListFeeName.add(record);
}
var n = this.storeListFeeName.getCount();
this.gridListFeeNameCellEditing.startEditByPosition({ row: n - 1, column: 1 });
} else if (this.MainCenter.activeTab.id == 'pnlReeferf') {
for (i = 0; i < this.storeFeeName.getCount(); i += 1) {
var record = Ext.create('MsCodeCtnEdi', {
GID: '*',
EDICODE: '',
EDINAME: '',
CTN: '',
REMARK: ''
});
this.storeListReeferf.add(record);
}
var n = this.storeListReeferf.getCount();
this.gridListReeferfCellEditing.startEditByPosition({ row: n - 1, column: 1 });
}
},
//#endregion
//#region 保存
onPostDetailClick: function (button, event) {
if (this.MainCenter.activeTab.id == 'pnlctn') {
this.onPostCtnDetailClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlcust') {
this.onPostCustDetailClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlpkgs') {
this.onPostDetailPkgsClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlSERVICE') {
this.onPostDetailSERVICEClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlPORTDISCHARGE') {
this.onPostDetailPORTDISCHARGEClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlVESSEL') {
this.onPostDetailVesselClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlISSUETYPE') {
this.onPostDetailISSUETYPEClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlFeeName') {
this.onPostDetailFeeNameClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlReeferf') {
this.onPostDetailReeferfClick(button, event);
}
},
onPostCtnDetailClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeList.getCount(); i += 1) {
var memberyf = this.storeList.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostCustDetailClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListCust.getCount(); i += 1) {
var memberyf = this.storeListCust.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveCustDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailPkgsClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListPkgs.getCount(); i += 1) {
var memberyf = this.storeListPkgs.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SavePkgsDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailSERVICEClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListSERVICE.getCount(); i += 1) {
var memberyf = this.storeListSERVICE.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveSERVICEDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
});
}, //end save
onPostDetailPORTDISCHARGEClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListPORTDISCHARGE.getCount(); i += 1) {
var memberyf = this.storeListPORTDISCHARGE.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SavePORTDISCHARGEDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
});
},
onPostDetailVesselClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListVessel.getCount(); i += 1) {
var memberyf = this.storeListVessel.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveVesselDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailISSUETYPEClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListISSUETYPE.getCount(); i += 1) {
var memberyf = this.storeListISSUETYPE.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveISSUETYPEDetail',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailFeeNameClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListFeeName.getCount(); i += 1) {
var memberyf = this.storeListFeeName.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveFeeName',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailReeferfClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeListReeferf.getCount(); i += 1) {
var memberyf = this.storeListReeferf.getAt(i);
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas);
_thisfee = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsCodeCtnEdi/SaveReeferf',
scope: this,
params: {
body: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
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 });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
//#endregion
//#region 删除
onDeleteClick: function (button, event) {
if (this.MainCenter.activeTab.id == 'pnlctn') {
this.onDeleteCtnClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlcust') {
this.onDeleteCustClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlpkgs') {
this.onDeletePkgsClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlSERVICE') {
this.onDeleteSERVICEClick(button, event);
}
else if (this.MainCenter.activeTab.id == 'pnlPORTDISCHARGE') {
this.onDeletePORTDISCHARGEClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlVESSEL') {
this.onDeleteVesselClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlISSUETYPE') {
this.onDeleteISSUETYPEClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlFeeName') {
this.onDeleteFeeNameClick(button, event);
} else if (this.MainCenter.activeTab.id == 'pnlReeferf') {
this.onDeleteReeferfClick(button, event);
}
},
onDeleteCtnClick: 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/MsCodeCtnEdi/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 });
Ext.Msg.hide();
}
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
onDeleteCustClick: function (button, event) {
var selections = this.gridListCust.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/MsCodeCtnEdi/DeleteCust',
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.storeListCust.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
onDeletePkgsClick: function (button, event) {
var selections = this.gridListPkgs.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/MsCodeCtnEdi/DeletePkgs',
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.storeListPkgs.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeleteSERVICEClick: function (button, event) {
var selections = this.gridListSERVICE.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/MsCodeCtnEdi/DeleteSERVICE',
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.storeListSERVICE.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeletePORTDISCHARGEClick: function (button, event) {
var selections = this.gridListPORTDISCHARGE.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/MsCodeCtnEdi/DeletePORTDISCHARGE',
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.storeListPORTDISCHARGE.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeleteVesselClick: function (button, event) {
var selections = this.gridListVessel.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/MsCodeCtnEdi/DeleteVessel',
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.storeListVessel.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeleteISSUETYPEClick: function (button, event) {
var selections = this.gridListISSUETYPE.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/MsCodeCtnEdi/DeleteISSUETYPE',
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.storeListISSUETYPE.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeleteFeeNameClick: function (button, event) {
var selections = this.gridListFeeName.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/MsCodeCtnEdi/DeleteFeeName',
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.storeListFeeName.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
onDeleteReeferfClick: function (button, event) {
var selections = this.gridListReeferf.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/MsCodeCtnEdi/DeleteReeferf',
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.storeListReeferf.remove(record);
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
Ext.Msg.hide();
}
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
});
}
}, this);
}, //onDeleteClick
//#endregion
//#region 修改
gridListAfterEdit: function (editor, e, eOpts) {
if (e.value == e.originalValue) return;
if (e.field == 'EDINAME') {
var selectrecords = DsStoreQueryBy(this.storeEdiType, 'EnumValueId', e.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
e.record.set('EDINAMEREF', selectdata.EnumValueName);
} else {
e.record.set('EDINAMEREF', '');
}
}
},
//#endregion
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
}
//
});