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/MsOpSeae/MsOpSeaeDuiView.js

2928 lines
112 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.MsOpSeaeDuiView = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSeaeDuiView.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSeaeDuiView, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
editRecord: null,
Editdata: null,
stroplb: '海运出口',
ParentWin: null,
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
this.itemindex = 1;
this.initloaddata = 0;
// this.bsno = getUrlParam('bsno');
// this.HSGID = getUrlParam('HSGID');
//#region 信息加载
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
Ext.define('MsOpSeaeISExcel', {
extend: 'Ext.data.Model',
idProperty: 'BSNO',
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'ISSHIPPER', type: 'boolean' },
{ name: 'ISCONSIGNEE', type: 'boolean' },
{ name: 'ISNOTIFYPARTY', type: 'boolean' },
{ name: 'ISETD', type: 'boolean' },
{ name: 'ISETA', type: 'boolean' },
{ name: 'ISVESSEL', type: 'boolean' },
{ name: 'ISVOYNO', type: 'boolean' },
{ name: 'ISPORTLOAD', type: 'boolean' },
{ name: 'ISPORTDISCHARGE', type: 'boolean' },
{ name: 'ISDESTINATION', type: 'boolean' },
{ name: 'ISPLACEDELIVERY', type: 'boolean' },
{ name: 'ISSERVICE', type: 'boolean' },
{ name: 'ISISSUETYPE', type: 'boolean' },
{ name: 'ISNOBILL', type: 'boolean' },
{ name: 'ISISSUEDATE', type: 'boolean' }, //箱皮重
{name: 'ISISSUEPLACE', type: 'boolean' },
{ name: 'ISBLFRT', type: 'boolean' },
{ name: 'ISPREPARDAT', type: 'boolean' },
{ name: 'ISHSCODE', type: 'boolean' },
{ name: 'ISPAYABLEAT', type: 'boolean' },
{ name: 'ISMARKS', type: 'boolean' },
{ name: 'ISDESCRIPTION', type: 'boolean' },
{ name: 'ISPKGS', type: 'boolean' },
{ name: 'ISKINDPKGS', type: 'boolean' },
{ name: 'ISKGS', type: 'boolean' },
{ name: 'ISCBM', type: 'boolean' },
{ name: 'ISTOTALNO', type: 'boolean' },
{ name: 'ISREMARK', type: 'boolean' }
]
});
//键值维护表_装运方式
this.StoreBLTYPE = Ext.create('Ext.data.Store', {
fields: ['BLTYPE']
});
this.StoreBLTYPE.add({ "BLTYPE": "整箱" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱主票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱分票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱单票" });
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装运方式',
store: this.StoreBLTYPE,
name: 'BLTYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE',
value: '整箱',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == "拼箱单票" || combo.value == "拼箱分票") {
if (this.storeBodyList.getCount() > 0) {
combo.setValue(combo.originalValue);
alert("拼箱单票、拼箱分票是不允许添加集装箱信息的,因此请先删除集装箱信息!");
return;
}
else {
this.panelBodyCtn.hide();
}
}
else {
this.panelBodyCtn.show();
}
}
}
}
});
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCodeGoodsList,
labelWidth: 250,
name: 'GOODSNAME',
valueField: 'GOODNAME',
displayField: 'CodeAndName'
});
//件数包装
this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodePackageModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
});
//件数包装_集装箱列表中的下拉框加载
this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '件数包装',
store: this.storeCodePackage,
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS'
});
//箱型_集装箱列表中的下拉框加载
this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCodeCtn.load();
this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '箱型',
store: this.storeCodeCtn,
name: 'CTNALL',
valueField: 'CTN',
displayField: 'CTN'
});
this.StoreStlName = Ext.create('Ext.data.Store', {
fields: ['STLNAME']
});
this.StoreStlName.add({ "STLNAME": "票结" });
this.StoreStlName.add({ "STLNAME": "半月结" });
this.StoreStlName.add({ "STLNAME": "月结" });
this.StoreStlName.add({ "STLNAME": "周结" });
this.comboxStlName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreStlName,
fieldLabel: '结算方式',
name: 'STLNAME',
valueField: 'STLNAME',
displayField: 'STLNAME'
});
//#endregion
//#region 编辑formHead 基本信息
this.formHead = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
// collapsed: false,
// collapsible: true,
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: 'INPUTBY',
name: 'INPUTBY', hidden: true
}, {
fieldLabel: '业务锁定',
disabled: true,
readOnly: true,
name: 'BSSTATUSREF'
}, {
fieldLabel: '费用锁定',
readOnly: true,
disabled: true,
name: 'FEESTATUSREF'
}, {
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'ACCDATE'
}, {
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
}, {
fieldLabel: '业务来源',
readOnly: true,
name: 'BSSOURCE'
}, {
fieldLabel: '来源明细',
readOnly: true,
name: 'BSSOURCEDETAIL'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号',
allowBlank: true,
name: 'CUSTNO'
}, {
fieldLabel: '主提单号',
name: 'MBLNO'
}, {
fieldLabel: '分提单号',
name: 'HBLNO'
}, { fieldLabel: '操作',
readOnly: true,
name: 'OP'
}, { fieldLabel: '揽货人',
readOnly: true,
name: 'SALE'
}, {
fieldLabel: '单证',
readOnly: true,
flex: 0.5,
name: 'DOC'
}, {
fieldLabel: '客服',
readOnly: true,
flex: 0.5,
name: 'CUSTSERVICE'
}]
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//#region 集装箱-数据集
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBodyList',
reader: {
id: 'BsNo,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'CTNCODE',
header: '序号',
width: 30
}, {
dataIndex: 'CTNALL',
header: '箱型',
width: 65,
editor: this.comboxCTNALL
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 60,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
}
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true
}
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70,
editor: this.comboxKINDPKGS_CTN
}, {
dataIndex: 'KGS',
header: '重量',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'REMARK',
header: '备注',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}]
});
//#endregion
//#region 数据集
this.panelBodyCtn = new Ext.Panel({
// title: '集装箱信息',
layout: "border",
height: 170,
//margin: '5 10',
frame: true,
items: [this.gridList]
});
this.panelBodyDr = new Ext.Panel({
title: '危险品信息',
layout: "border",
//hidden: true,
height: 60,
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品等级',
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: '危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
fieldLabel: '危险品页号',
flex: 1,
labelWidth: 70,
name: 'DPAGE'
}, {
fieldLabel: '危险品标签',
flex: 1,
labelWidth: 70,
name: 'DLABEL'
}, {
fieldLabel: '危险品联系人',
flex: 1,
labelWidth: 90,
name: 'LINKMAN'
}]
}]
});
this.StoreTemp = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreTemp.add({ "ID": "C", "NAME": "C摄氏" });
this.StoreTemp.add({ "ID": "F", "NAME": "F华氏" });
this.comboxTemp = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreTemp,
fieldLabel: '温度单位',
name: 'TEMPID',
valueField: 'ID',
displayField: 'NAME'
});
this.panelBodyRf = new Ext.Panel({
title: '冻柜信息',
layout: "border",
//hidden: true,
height: 60,
//margin: '5 10',
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET'
}, this.comboxTemp, {
fieldLabel: '最低温度',
name: 'TEMPMIN'
}, {
fieldLabel: '最高温度',
name: 'TEMPMAX'
}]
}]
});
//付费方式
this.storeFrt = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_FRT',
proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' }
});
this.storeFrt.load({ params: { condition: ""} });
this.comboxBLFRT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '付费方式',
store: this.storeFrt,
name: 'BLFRT',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == "FREIGHT PREPAID") {
var portload = this.formEdit.getForm().findField('PORTLOAD').getValue();
var portloadid = this.formEdit.getForm().findField('PORTLOADID').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue(portload);
this.formEdit.getForm().findField('PAYABLEAT').setValue('');
this.formEdit.getForm().findField('ISSUEPLACE').setValue(portload);
this.formEdit.getForm().findField('ISSUEPLACEID').setValue(portloadid);
} else if (combo.value == "FREIGHT COLLECT") {
var PORTDISCHARGE = this.formEdit.getForm().findField('PORTDISCHARGE').getValue();
var PORTDISCHARGEID = this.formEdit.getForm().findField('PORTDISCHARGEID').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue('');
this.formEdit.getForm().findField('PAYABLEAT').setValue(PORTDISCHARGE);
this.formEdit.getForm().findField('ISSUEPLACE').setValue(PORTDISCHARGE);
this.formEdit.getForm().findField('ISSUEPLACEOD').setValue(PORTDISCHARGEID);
}
}
}
}
});
this.panelBodyDr2 = new Ext.Panel({
title: '危险品信息',
layout: "border",
hidden: true,
height: 60,
width: 1200,
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品等级',
flex: 1,
labelWidth: 70,
name: 'DCLASS'
}, {
fieldLabel: '危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO'
}, {
fieldLabel: '危险品页号',
flex: 1,
labelWidth: 70,
name: 'DPAGE'
}, {
fieldLabel: '危险品标签',
flex: 1,
labelWidth: 70,
name: 'DLABEL'
}, {
fieldLabel: '危险品联系人',
flex: 1,
labelWidth: 90,
name: 'LINKMAN'
}]
}]
});
this.comboxTemp2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreTemp,
fieldLabel: '温度单位',
name: 'TEMPID',
valueField: 'ID',
displayField: 'NAME'
});
this.panelBodyRf2 = new Ext.Panel({
title: '冻柜信息',
layout: "border",
hidden: true,
height: 60,
//margin: '5 10',
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET'
}, this.comboxTemp2, {
fieldLabel: '最低温度',
name: 'TEMPMIN'
}, {
fieldLabel: '最高温度',
name: 'TEMPMAX'
}]
}]
});
this.formCargoShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [this.panelBodyDr2, this.panelBodyRf2]//end root items
});
me = this;
this.winCargoShow = Ext.create('Ext.window.Window', {
iconCls: "addicon",
width: 800,
height: 130,
resizable: false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formCargoShow],
buttons: [{
text: "确定",
minWidth: 70,
handler: function () {
me.formEdit.getForm().findField('DCLASS').setValue(me.formCargoShow.getForm().findField('DCLASS').getValue())
me.formEdit.getForm().findField('DUNNO').setValue(me.formCargoShow.getForm().findField('DUNNO').getValue())
me.formEdit.getForm().findField('DPAGE').setValue(me.formCargoShow.getForm().findField('DPAGE').getValue())
me.formEdit.getForm().findField('DLABEL').setValue(me.formCargoShow.getForm().findField('DLABEL').getValue())
me.formEdit.getForm().findField('LINKMAN').setValue(me.formCargoShow.getForm().findField('LINKMAN').getValue())
me.formEdit.getForm().findField('REEFERF').setValue(me.formCargoShow.getForm().findField('REEFERF').getValue())
me.formEdit.getForm().findField('TEMPSET').setValue(me.formCargoShow.getForm().findField('TEMPSET').getValue())
me.formEdit.getForm().findField('TEMPID').setValue(me.formCargoShow.getForm().findField('TEMPID').getValue())
me.formEdit.getForm().findField('TEMPMAX').setValue(me.formCargoShow.getForm().findField('TEMPMAX').getValue())
me.formEdit.getForm().findField('TEMPMIN').setValue(me.formCargoShow.getForm().findField('TEMPMIN').getValue())
var CARGOID = me.formEdit.getForm().findField('CARGOID').getValue();
if (CARGOID == 'R') {
me.panelBodyDr.setVisible(false);
me.panelBodyRf.setVisible(true);
} else if (CARGOID == 'D') {
me.panelBodyDr.setVisible(true);
me.panelBodyRf.setVisible(false);
} else {
me.panelBodyDr.setVisible(false);
me.panelBodyRf.setVisible(false);
}
me.winCargoShow.close();
}
}]
});
this.StoreCargoid = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreCargoid.add({ "ID": "S", "NAME": "S普通货" });
this.StoreCargoid.add({ "ID": "R", "NAME": "R冻柜" });
this.StoreCargoid.add({ "ID": "D", "NAME": "D危险品" });
this.StoreCargoid.add({ "ID": "O", "NAME": "O超限箱" });
this.comboxCargoid = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCargoid,
fieldLabel: "<a><font color='#FF0000'>货物标示</font></a>",
name: 'CARGOID',
valueField: 'ID',
displayField: 'NAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == 'R') {
this.panelBodyDr2.setVisible(false);
this.panelBodyRf2.setVisible(true);
this.winCargoShow.width = 800;
this.winCargoShow.show();
} else if (combo.value == 'D') {
this.panelBodyDr2.setVisible(true);
this.panelBodyRf2.setVisible(false);
this.winCargoShow.width = 1200;
this.winCargoShow.show();
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
}
}
}
}
});
this.StoreTranStatus = Ext.create('Ext.data.Store', {
fields: ['CODE', 'STATUS']
});
this.StoreTranStatus.add({ "CODE": "C", "STATUS": "出运" });
this.StoreTranStatus.add({ "CODE": "W", "STATUS": "未出运" });
this.StoreTranStatus.add({ "CODE": "T", "STATUS": "退载" });
this.comboxTranStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '出运状态',
store: this.StoreTranStatus,
name: 'TRANSTATUS',
valueField: 'CODE',
displayField: 'STATUS'
});
//#endregion
//#region 编辑formEdit 基本信息
this.formEdit = Ext.widget('form', {
region: 'west',
title: '委托信息',
width: 700,
frame: true,
autoScroll: true,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '96%'
},
items: [{
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'SHIPPER',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'CONSIGNEE',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 80,
name: 'NOTIFYPARTY',
anchor: '100%'
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '开船日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETD'
}, {
fieldLabel: '预抵日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETA'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '船名',
flex: 2,
name: 'VESSEL'
}, {
fieldLabel: '航次',
flex: 1,
name: 'VOYNO'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '装货港',
name: 'PORTLOAD'
}, {
fieldLabel: '卸货港',
name: 'PORTDISCHARGE'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '目的地',
name: 'DESTINATION'
}, {
fieldLabel: '交货地',
name: 'PLACEDELIVERY'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '收货地',
name: 'PLACERECEIPT'
}, {
fieldLabel: '运输条款',
name: 'SERVICE'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '签单方式',
name: 'ISSUETYPE'
}, {
fieldLabel: '提单份数',
name: 'NOBILL'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '签单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ISSUEDATE'
}, {
fieldLabel: '签单地点',
name: 'ISSUEPLACE'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [this.comboxBLFRT, {
fieldLabel: '预付地点',
name: 'PREPARDAT'
}, {
fieldLabel: '到付地点',
name: 'PAYABLEAT'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [this.comboxCargoid, {
fieldLabel: 'HS编码',
name: 'HSCODE'
}]
}
]
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
defaults: {
anchor: '99%'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>唛头</html>'
}, {
xtype: 'textareafield',
grow: true,
height: 150,
name: 'MARKS',
anchor: '100%'
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 3,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp货描</html>'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelSeparator: '',
labelWidth: 20,
height: 150,
name: 'DESCRIPTION',
anchor: '100%'
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp备注</html>'
}, {
xtype: 'textareafield',
grow: true,
height: 150,
name: 'REMARK',
anchor: '100%'
}
]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数',
name: 'PKGS'
}, {
fieldLabel: '包装',
name: 'KINDPKGS'
}, {
fieldLabel: '毛重',
name: 'KGS'
}, {
fieldLabel: '尺码',
name: 'CBM'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数大写',
name: 'TOTALNO'
}]
}, this.panelBodyDr, this.panelBodyRf, this.panelBodyCtn]
}
]
}); //end this.formEdit
//#endregion
//#region 编辑formEdit 基本信息
this.storeCtnList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
});
//明细表表格
this.gridListCtnCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridListCtn = new Ext.grid.GridPanel({
store: this.storeCtnList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCtnCellEditing],
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'CTNCODE',
header: '序号',
width: 30
}, {
dataIndex: 'CTNALL',
header: '箱型',
width: 65
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 60
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70
}, {
dataIndex: 'KGS',
header: '重量',
width: 60
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60
}, {
dataIndex: 'REMARK',
header: '备注',
width: 150
}]
});
//#region 数据集
this.panelCtn = new Ext.Panel({
// title: '集装箱信息',
region: "south",
layout: "border",
height: 170,
//margin: '5 10',
frame: true,
items: [{
fieldLabel: "", //'是否多品名',
labelWidth: 0,
width: 40,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISCTN'
},this.gridListCtn]
});
//#endregion
this.formEditExcel = Ext.widget('form', {
region: 'center',
frame: true,
title: '引入提单信息',
bodyPadding: 5,
layout: 'anchor',
autoScroll: true,
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '业务编号',
name: 'BSNO', hidden: true
}, {
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: '发货人',
labelWidth: 45,
height: 80,
name: 'SHIPPER',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '收货人',
labelWidth: 45,
height: 80,
name: 'CONSIGNEE',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '通知人',
labelWidth: 45,
height: 80,
name: 'NOTIFYPARTY',
anchor: '100%'
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISSHIPPER'
}, {
fieldLabel: '开船日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETD'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISETD'
}, {
fieldLabel: '预抵日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'ETA'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISETA'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '船名',
flex: 2,
name: 'VESSEL'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISVESSEL'
}, {
fieldLabel: '航次',
flex: 1,
name: 'VOYNO'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISVOYNO'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '装货港',
name: 'PORTLOAD'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPORTLOAD'
}, {
fieldLabel: '卸货港',
name: 'PORTDISCHARGE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPORTDISCHARGE'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISCONSIGNEE'
}, {
fieldLabel: '目的地',
name: 'DESTINATION'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDESTINATION'
}, {
fieldLabel: '交货地',
name: 'PLACEDELIVERY'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPLACEDELIVERY'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '运输条款',
name: 'SERVICE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISSERVICE'
}, {
fieldLabel: '集装箱',
name: 'CNTRTOTAL'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '签单方式',
name: 'ISSUETYPE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISISSUETYPE'
}, {
fieldLabel: '提单份数',
name: 'NOBILL'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISNOBILL'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '签单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ISSUEDATE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISISSUEDATE'
}, {
fieldLabel: '签单地点',
name: 'ISSUEPLACE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISISSUEPLACE'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISNOTIFYPARTY'
}, {
fieldLabel: '付费方式',
name: 'BLFRT'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISBLFRT'
}, {
fieldLabel: '预付地点',
name: 'PREPARDAT'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPREPARDAT'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: 'HS编码',
name: 'HSCODE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISHSCODE'
}, {
fieldLabel: '到付地点',
name: 'PAYABLEAT'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPAYABLEAT'
}]
}
]
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
defaults: {
anchor: '99%'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>唛头 </html>'
}, {
xtype: 'textareafield',
grow: true,
height: 150,
name: 'MARKS',
anchor: '100%'
}
]
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISMARKS'
}, {
xtype: 'container',
layout: 'anchor',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbsp品名</html>'
}]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelSeparator: '',
labelWidth: 20,
height: 150,
name: 'DESCRIPTION',
anchor: '100%'
}]
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDESCRIPTION'
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp第二通知人</html>'
}, {
xtype: 'textareafield',
grow: true,
height: 150,
name: 'MNOTIFYPARTY',
anchor: '100%'
}
]
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISMNOTIFYPARTY'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数',
name: 'PKGS'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISPKGS'
}, {
fieldLabel: '包装',
name: 'KINDPKGS'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISKINDPKGS'
}, {
fieldLabel: '毛重',
name: 'KGS'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISKGS'
}, {
fieldLabel: '尺码',
name: 'CBM'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISCBM'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISREEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISTEMPSET'
}, {
fieldLabel: '温度单位',
name: 'TEMPID'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISTEMPID'
}, {
fieldLabel: '最低温度',
name: 'TEMPMIN'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISTEMPMIN'
}, {
fieldLabel: '最高温度',
name: 'TEMPMAX'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISTEMPMAX'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '危险品等级',
name: 'DCLASS'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDCLASS'
}, {
fieldLabel: '危险品编号',
name: 'DUNNO'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDUNNO'
}, {
fieldLabel: '危险品页号',
name: 'DPAGE'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDPAGE'
}, {
fieldLabel: '危险品标签',
name: 'DLABEL'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISDLABEL'
}, {
fieldLabel: '危险品联系人',
labelWidth: 80,
name: 'LINKMAN'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.1,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISLINKMAN'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数大写',
name: 'TOTALNO'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISTOTALNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: '备 注',
height: 40,
name: 'REMARK',
anchor: '100%'
}, {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISREMARK'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: "", //'是否多品名',
labelWidth: 0,
flex: 0.02,
inputValue: true,
xtype: 'checkboxfield',
name: 'ISCTN'
}]
}, this.panelCtn ]
}
]
}); //end this.formEdit
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
}, {
text: "引入并关闭",
handler: function (button, event) {
this.SaveImpExcel();
},
scope: this
}, '-', {
text: "打印",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
//#region 框架结构
//#endregion
this.panelpage = new Ext.Panel({
// title: '委托详细信息',
layout: "border",
region: 'center',
animate: true,
//enableTabScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEdit, this.formEditExcel]
});
Ext.apply(this, {
items: [this.panelBtn, this.formHead, this.panelpage]
});
//#endregion
// this.LoadInitData();
//#region 其他
this.InitData();
//绑定事件
this.gridList.on('edit', function (editor, e, eOpts) {
this.gridAfterEdit(editor, e, eOpts);
}, this);
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
var condition = '';
_thisView = this;
this.ParentWin = window.parent.opener.panelIndex;
if (this.ParentWin) {
var ret = this.ParentWin.OprationSwapDui();
EXCELDATA = ret[0];
BILLDATA = ret[1];
CTNDATA = ret[2];
this.formHead.getForm().reset();
this.formHead.getForm().setValues(BILLDATA);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(BILLDATA);
this.formEditExcel.getForm().reset();
this.formEditExcel.getForm().setValues(EXCELDATA);
var condition = "BSNO='" + BILLDATA.BSNO + "'";
this.storeBodyList.load({ params: { condition: condition} });
if (BILLDATA.SHIPPER != EXCELDATA.SHIPPER && EXCELDATA.SHIPPER != '') {
var headfield = this.formEditExcel.getForm().findField('SHIPPER');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISSHIPPER').setValue(true);
}
if (BILLDATA.CONSIGNEE != EXCELDATA.CONSIGNEE && EXCELDATA.CONSIGNEE != '') {
var headfield = this.formEditExcel.getForm().findField('CONSIGNEE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISCONSIGNEE').setValue(true);
}
if (BILLDATA.NOTIFYPARTY != EXCELDATA.NOTIFYPARTY && EXCELDATA.NOTIFYPARTY != '') {
var headfield = this.formEditExcel.getForm().findField('NOTIFYPARTY');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISNOTIFYPARTY').setValue(true);
}
if (BILLDATA.ETD != EXCELDATA.ETD && EXCELDATA.ETD != '' && EXCELDATA.ETD != null) {
var headfield = this.formEditExcel.getForm().findField('ETD');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISETD').setValue(true);
}
if (BILLDATA.ETA != EXCELDATA.ETA && EXCELDATA.ETA != '' && EXCELDATA.ETA != null) {
var headfield = this.formEditExcel.getForm().findField('ETA');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISETA').setValue(true);
}
if (BILLDATA.VESSEL != EXCELDATA.VESSEL && EXCELDATA.VESSEL != '') {
var headfield = this.formEditExcel.getForm().findField('VESSEL');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISVESSEL').setValue(true);
}
if (BILLDATA.VOYNO != EXCELDATA.VOYNO && EXCELDATA.VOYNO != '') {
var headfield = this.formEditExcel.getForm().findField('VOYNO');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISVOYNO').setValue(true);
}
if (BILLDATA.PORTLOAD != EXCELDATA.PORTLOAD && EXCELDATA.PORTLOAD != '') {
var headfield = this.formEditExcel.getForm().findField('PORTLOAD');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISPORTLOAD').setValue(true);
}
if (BILLDATA.PORTDISCHARGE != EXCELDATA.PORTDISCHARGE && EXCELDATA.PORTDISCHARGE != '') {
var headfield = this.formEditExcel.getForm().findField('PORTDISCHARGE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISPORTDISCHARGE').setValue(true);
}
if (BILLDATA.DESTINATION != EXCELDATA.DESTINATION && EXCELDATA.DESTINATION != '') {
var headfield = this.formEditExcel.getForm().findField('DESTINATION');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDESTINATION').setValue(true);
}
if (BILLDATA.PLACEDELIVERY != EXCELDATA.PLACEDELIVERY && EXCELDATA.PLACEDELIVERY != '') {
var headfield = this.formEditExcel.getForm().findField('PLACEDELIVERY');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISPLACEDELIVERY').setValue(true);
}
if (BILLDATA.SERVICE != EXCELDATA.SERVICE && EXCELDATA.SERVICE != '') {
var headfield = this.formEditExcel.getForm().findField('SERVICE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISSERVICE').setValue(true);
}
if (BILLDATA.ISSUETYPE != EXCELDATA.ISSUETYPE && EXCELDATA.ISSUETYPE != '') {
var headfield = this.formEditExcel.getForm().findField('ISSUETYPE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISISSUETYPE').setValue(true);
}
if (BILLDATA.NOBILL != EXCELDATA.NOBILL && EXCELDATA.NOBILL != '') {
var headfield = this.formEditExcel.getForm().findField('NOBILL');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISNOBILL').setValue(true);
}
if (BILLDATA.ISSUEDATE != EXCELDATA.ISSUEDATE && EXCELDATA.ISSUEDATE != '' && EXCELDATA.ISSUEDATE != null) {
var headfield = this.formEditExcel.getForm().findField('ISSUEDATE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISISSUEDATE').setValue(true);
}
if (BILLDATA.ISSUEPLACE != EXCELDATA.ISSUEPLACE && EXCELDATA.ISSUEPLACE != '') {
var headfield = this.formEditExcel.getForm().findField('ISSUEPLACE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISISSUEPLACE').setValue(true);
}
if (BILLDATA.BLFRT != EXCELDATA.BLFRT && EXCELDATA.BLFRT != '') {
var headfield = this.formEditExcel.getForm().findField('BLFRT');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISBLFRT').setValue(true);
}
if (BILLDATA.PREPARDAT != EXCELDATA.PREPARDAT && EXCELDATA.PREPARDAT != '') {
var headfield = this.formEditExcel.getForm().findField('PREPARDAT');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISPREPARDAT').setValue(true);
}
if (BILLDATA.HSCODE != EXCELDATA.HSCODE && EXCELDATA.HSCODE != '') {
var headfield = this.formEditExcel.getForm().findField('HSCODE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISHSCODE').setValue(true);
}
if (BILLDATA.PAYABLEAT != EXCELDATA.PAYABLEAT && EXCELDATA.PAYABLEAT != '') {
var headfield = this.formEditExcel.getForm().findField('PAYABLEAT');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FF0000' });
this.formEditExcel.getForm().findField('ISPAYABLEAT').setValue(true);
}
if (BILLDATA.MARKS != EXCELDATA.MARKS && EXCELDATA.MARKS != '') {
var headfield = this.formEditExcel.getForm().findField('MARKS');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISMARKS').setValue(true);
}
if (BILLDATA.DESCRIPTION != EXCELDATA.DESCRIPTION && EXCELDATA.DESCRIPTION != '') {
var headfield = this.formEditExcel.getForm().findField('DESCRIPTION');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDESCRIPTION').setValue(true);
}
if (BILLDATA.PKGS != EXCELDATA.PKGS && EXCELDATA.PKGS != '') {
var headfield = this.formEditExcel.getForm().findField('PKGS');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISPKGS').setValue(true);
}
if (BILLDATA.KGS != EXCELDATA.KGS && EXCELDATA.KGS != '') {
if (parseFloat(BILLDATA.KGS) != parseFloat(EXCELDATA.KGS)) {
var headfield = this.formEditExcel.getForm().findField('KGS');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISKGS').setValue(true);
}
}
if (BILLDATA.KINDPKGS != EXCELDATA.KINDPKGS && EXCELDATA.KINDPKGS != '') {
var headfield = this.formEditExcel.getForm().findField('KINDPKGS');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISKINDPKGS').setValue(true);
}
if (BILLDATA.CBM != EXCELDATA.CBM && EXCELDATA.CBM != '') {
var headfield = this.formEditExcel.getForm().findField('CBM');
if (parseFloat(BILLDATA.CBM) != parseFloat(EXCELDATA.CBM)) {
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISCBM').setValue(true);
}
}
if (BILLDATA.TOTALNO != EXCELDATA.TOTALNO && EXCELDATA.TOTALNO != '') {
var headfield = this.formEditExcel.getForm().findField('TOTALNO');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISTOTALNO').setValue(true);
}
if (BILLDATA.REMARK != EXCELDATA.REMARK && EXCELDATA.REMARK != '') {
var headfield = this.formEditExcel.getForm().findField('REMARK');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISREMARK').setValue(true);
}
//if (BILLDATA.REEFERF != EXCELDATA.REEFERF && EXCELDATA.REEFERF != '') {
// var headfield = this.formEditExcel.getForm().findField('REEFERF');
// if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
// this.formEditExcel.getForm().findField('ISREEFERF').setValue(true);
//}
//if (BILLDATA.TEMPSET != EXCELDATA.TEMPSET && EXCELDATA.TEMPSET != '') {
// var headfield = this.formEditExcel.getForm().findField('TEMPSET');
// if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
// this.formEditExcel.getForm().findField('ISTEMPSET').setValue(true);
//}
//if (BILLDATA.TEMPID != EXCELDATA.TEMPID && EXCELDATA.TEMPID != '') {
// var headfield = this.formEditExcel.getForm().findField('TEMPID');
// if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
// this.formEditExcel.getForm().findField('ISTEMPID').setValue(true);
//}
//if (BILLDATA.TEMPMIN != EXCELDATA.TEMPMIN && EXCELDATA.TEMPMIN != '') {
// var headfield = this.formEditExcel.getForm().findField('TEMPMIN');
// if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
// this.formEditExcel.getForm().findField('ISTEMPMIN').setValue(true);
//}
//if (BILLDATA.TEMPMAX != EXCELDATA.TEMPMAX && EXCELDATA.TEMPMAX != '') {
// var headfield = this.formEditExcel.getForm().findField('TEMPMAX');
// if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
// this.formEditExcel.getForm().findField('ISTEMPMAX').setValue(true);
//}
if (BILLDATA.DCLASS != EXCELDATA.DCLASS && EXCELDATA.DCLASS != '') {
var headfield = this.formEditExcel.getForm().findField('DCLASS');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDCLASS').setValue(true);
}
if (BILLDATA.DUNNO != EXCELDATA.DUNNO && EXCELDATA.DUNNO != '') {
var headfield = this.formEditExcel.getForm().findField('DUNNO');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDUNNO').setValue(true);
}
if (BILLDATA.DPAGE != EXCELDATA.DPAGE && EXCELDATA.DPAGE != '') {
var headfield = this.formEditExcel.getForm().findField('DPAGE');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDPAGE').setValue(true);
}
if (BILLDATA.DLABEL != EXCELDATA.DLABEL && EXCELDATA.DLABEL != '') {
var headfield = this.formEditExcel.getForm().findField('DLABEL');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISDLABEL').setValue(true);
}
if (BILLDATA.LINKMAN != EXCELDATA.LINKMAN && EXCELDATA.LINKMAN != '') {
var headfield = this.formEditExcel.getForm().findField('LINKMAN');
if (headfield != NaN && headfield != null) headfield.setFieldStyle({ background: '#FFB6C1' });
this.formEditExcel.getForm().findField('ISLINKMAN').setValue(true);
}
this.formEditExcel.getForm().findField('ISCTN').setValue(true);
this.formEditExcel.getForm().findField('ISMNOTIFYPARTY').setValue(true);
this.storeCtnList.loadData(CTNDATA)
}
}, //end InitData
LoadData: function (condition) {
this.serialNo = 0;
//this.bodyDel = [];
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/GetData',
params: {
handle: 'edit',
condition: condition
},
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;
}
data = result.data;
var editp = Ext.create('MsOpSeaeModel', data);
this.editRecord = editp;
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
var billno = '*';
var gid = '*';
this.storeBodyList.load({ params: { condition: condition} });
}, // end LoadDate
//#endregion
//#region 集装箱按钮事件
onAddDetailClick: function (button, event) {
this.addDetail();
}, //end onAddDetailClick
onDelDetailClick: function (button, event) {
this.deleteDetail();
}, //onDelDetailClick
onUpDetailClick: function (button, event) {
this.UpDetail();
}, //end onAddDetailClick
gridAfterEdit: function (editor, e, eOpts) {
if (e.field == 'PKGS' || e.field == 'KGS' || e.field == 'CBM') {
this.setAllTotal();
if (e.field == 'KGS') {
var KGS = this.formEdit.getForm().findField('KGS').getValue();
this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS');
}
if (e.field == 'CBM') {
var CBM = this.formEdit.getForm().findField('CBM').getValue();
this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM');
}
if (e.field == 'PKGS') {
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
}
} else if (e.field == 'KINDPKGS') {
var KINDPKGS = e.record.data['KINDPKGS'];
this.setHeadFieldValue('KINDPKGS', KINDPKGS);
var PKGS = this.formEdit.getForm().findField('PKGS').getValue();
this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS);
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.');
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
if (memberbody.data.KINDPKGS == "" || memberbody.data.KINDPKGS == NaN || memberbody.data.KINDPKGS == null) {
memberbody.set("KINDPKGS", KINDPKGS);
memberbody.commit();
}
};
}
},
setHeadFieldValue: function (fieldName, value) {
var field = this.formEdit.getForm().findField(fieldName);
field.setValue(value);
},
//#endregion
//#region
//#endregion
//#region 转换成大写字符
onUpCaseClick: function (menu, event) {
this.formEdit.getForm().findField('SHIPPER').setValue(this.formEdit.getForm().findField('SHIPPER').getValue().toUpperCase());
this.formEdit.getForm().findField('CONSIGNEE').setValue(this.formEdit.getForm().findField('CONSIGNEE').getValue().toUpperCase());
this.formEdit.getForm().findField('NOTIFYPARTY').setValue(this.formEdit.getForm().findField('NOTIFYPARTY').getValue().toUpperCase());
this.formEdit.getForm().findField('AGENT').setValue(this.formEdit.getForm().findField('AGENT').getValue().toUpperCase());
this.formEdit.getForm().findField('MARKS').setValue(this.formEdit.getForm().findField('MARKS').getValue().toUpperCase());
this.formEdit.getForm().findField('DESCRIPTION').setValue(this.formEdit.getForm().findField('DESCRIPTION').getValue().toUpperCase());
},
//#endregion
//#region 保存报关
SaveImpExcel: function () {
var data = this.formEditExcel.getForm().getValues(false, false, false);
var bodydatas = [];
for (var i = 0; i < this.storeCtnList.getCount(); i += 1) {
var member = this.storeCtnList.getAt(i);
bodydatas.push(member);
}
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
Ext.Msg.wait('正在生成数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在生成数据...',
url: '/MvcShipping/MsOpSeae/SaveImpSi',
scope: this,
params: {
data: Ext.JSON.encode(data),
ctndata: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
window.close();
} 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 舱单状态
onCustomStatusClick: function (menu, event) {
var bsno = this.formHead.getForm().findField('BSNO').getValue();
var mblno = this.formHead.getForm().findField('MBLNO').getValue()
if (mblno == "") {
return;
}
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/Get56CDCSTATUSList',
params: {
mblno: mblno,
bsno: bsno
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1000,
height: 480,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
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
},
//#endregion
//#region 场站查询
onGETYARDClick: function (button, event) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var MBLNO = this.formHead.getForm().findField('MBLNO').getValue();
var YARD = this.formEdit.getForm().findField('YARD').getValue();
if (MBLNO == "" || YARD == "") {
Ext.Msg.show({ title: '提示', msg: '提单号和场站不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetyardctnList',
params: {
bs: BSNO,
mblno: MBLNO,
yard: YARD,
isweb: true
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
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
}
},
//#endregion
//#region QQCT单票查询
onQQCTBILLClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '提单号不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQQCTBILL',
params: {
mblno: mblno,
bsno: ''
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
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
}
},
//#endregion
//#region QQCTU单票查询
onQQCTUBILLClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '提单号不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQQCTUBILL',
params: {
mblno: mblno,
bsno: ''
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
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
}
},
//#endregion
//#region 单船查询
onGETQDVESSELClick: function (button, event) {
var vessel = this.formEdit.getForm().findField('VESSEL').getValue();
var voyno = this.formEdit.getForm().findField('VOYNO').getValue();
if (vessel == "") {
Ext.Msg.show({ title: '提示', msg: '船名不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.wait('正在提取数据...');
Ext.Ajax.request({
waitMsg: '正在提取数据...',
url: '/MvcShipping/MsOpSeae/GetQDVESSEL',
params: {
vessel: vessel,
voyno: voyno
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusdata = jsonresult.data;
var boxitems = "";
formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 460,
// border: false,
bodyPadding: 0,
html: jsonresult.data
});
me = this;
winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
// closeAction: 'hide',
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
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
}
},
//#endregion
//#region 烟台港箱动态
onYanTaiYardStatusClick: function (button, event) {
var mblno = this.formHead.getForm().findField('MBLNO').getValue();
if (mblno == "") {
Ext.Msg.show({ title: '提示', msg: '没有要刷新查看的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var yantaiyardview = new Shipping.YantaiYardView({
});
yantaiyardview.mblno = mblno;
yantaiyardview.show();
return;
}
},
//#endregion
//#region 编辑时按钮等的状态
GetEditStatus: function () {
var canedit = false;
//var bsStatus = this.formHead.getForm().findField('BSSTATUS').getValue();
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
var inputby = this.formHead.getForm().findField('INPUTBY').getValue();
var op = this.formHead.getForm().findField('OP').getValue();
_thisView = this;
if (BSSTATUS == '锁定') {
canedit = false;
this.setSaveBtnStatus(canedit);
} else {
this.StoreOpRange.load({ params: { optype: "modOrderManagement" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var records = DsStoreQueryBy(_thisView.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
canedit = true;
} else {
var recordins = DsStoreQueryBy(_thisView.StoreOpRange, 'OPID', inputby);
if (recordins.getCount() > 0) {
canedit = true;
} else {
canedit = false;
}
}
} else { canedit = false; }
_thisView.setSaveBtnStatus(canedit);
}
}
});
}
_thisView = this;
Ext.Ajax.request({
waitMsg: '正在查询委托编号状态...',
url: '/MvcShipping/MsBaseInfo/GetRuleEdit',
params: {
rulename: '委托编号',
ruletype: '1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
var custno = _thisView.formHead.getForm().findField('CUSTNO');
custno.setReadOnly(true);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '正在查询委托编号状态...',
url: '/MvcShipping/MsBaseInfo/GetRuleEdit',
params: {
rulename: '分提单号',
ruletype: '1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
var hblno = _thisView.formHead.getForm().findField('HBLNO');
hblno.setReadOnly(true);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
GetStringNum: function (str) {
var num = 0;
if (str == null || str == '') return num;
if (str.length == 0) return num;
var if_find = false;
var str_num = '';
for (var i = 0; i < str.length; i += 1) {
var member = str.substr(i, 1);
if ((member == '0') || (member == '1') || (member == '2') || (member == '3')
|| (member == '4') || (member == '5') || (member == '6') || (member == '7')
|| (member == '8') || (member == '9') || (member == '.') || (member == '-')) {
if (!if_find) {
str_num = str_num + member;
}
} else {
if_find = true;
}
}
return str_num;
},
setSaveBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
var btnEAddDetail = Ext.getCmp('btnadddetail');
var btnEDeleteDetail = Ext.getCmp('btndeldetail');
var btnEUpDetail = Ext.getCmp('btnadddetail2');
if (enable) {
btnESave.enable();
btnESaveAndClose.enable();
btnESaveAndNew.enable();
btnEAddDetail.enable();
btnEDeleteDetail.enable();
btnEUpDetail.enable();
} else {
btnESave.disable();
btnESaveAndClose.disable();
btnESaveAndNew.disable();
btnEAddDetail.disable();
btnEDeleteDetail.disable();
btnEUpDetail.disable();
}
},
//#endregion
//#region 打印
Print: function () {
var basicForm = this.formHead.getForm();
var billNo = basicForm.findField('BSNO').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var printType = 'MSOPSEAE';
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + billNo + "'";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//#endregion
PrevRecord: function () {
var modifystr = this.getIsModify();
if (modifystr != "") {
Ext.Msg.show({ title: '警告', msg: modifystr + '未保存,如果离开此页,将丢失未保存的更改 ', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var j = this.StoreList.indexOf(this.editRecord);
if (j == 0) {
Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
if (j == this.StoreList.count) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodNewOpSeaeInfo') {
} else {
children.items[i].close();
}
}
}
}
this.tabSeaepanel.doLayout();
j = j - 1;
this.editRecord = this.StoreList.getAt(j);
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
this.LoadData(this.opStatus, condition);
},
NextRecord: function () {
var modifystr = this.getIsModify();
if (modifystr != "") {
Ext.Msg.show({ title: '警告', msg: modifystr + '未保存,如果离开此页,将丢失未保存的更改 ', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var j = this.StoreList.indexOf(this.editRecord);
if (j == (this.StoreList.count - 1)) {
Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodNewOpSeaeInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabSeaepanel.doLayout();
j = j + 1;
this.editRecord = this.StoreList.getAt(j);
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
this.LoadData(this.opStatus, condition);
},
getIsModify: function () {
var feepanel = Ext.getCmp('pnlmodSeaeAllFee');
if (feepanel != NaN && feepanel != null) {
var feemodify = feepanel.panelFee.getModifyStatus();
if (feemodify) {
return '费用信息';
}
}
var feeamendpanel = Ext.getCmp('pnlmodSeaeAmendFee');
if (feeamendpanel != NaN && feeamendpanel != null) {
var feemodify = feeamendpanel.panelFee.getModifyStatus();
if (feemodify) {
return '更改单信息';
}
}
var drmodify = this.storeBodyList.getModifiedRecords();
if (panelEdit.formEdit.getForm().isDirty() == true || panelEdit.formHead.getForm().isDirty() == true || panelEdit.formEDI.getForm().isDirty() == true || drmodify.length != 0) {
return '业务信息';
}
else return '';
}
});