@ -25,6 +25,12 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
//this.bodyDel = [];
this . itemindex = 1 ;
var mainform = window . parent . panelEdit ;
if ( mainform ) {
this . MainEditRecord = mainform . editRecord ;
this . BsNo = this . MainEditRecord . get ( "BSNO" ) ;
}
this . StoreCargoid = Ext . create ( 'Ext.data.Store' , {
fields : [ 'ID' , 'NAME' ]
@ -380,58 +386,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ) ;
this . gridListCtn . addListener ( 'itemclick' , function ( dataview , record , item , index , e , b ) {
this . formDescriptionEdit . getForm ( ) . findField ( 'DESCRIPTION' ) . setValue ( record . data . DESCRIPTION ) ;
_this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . setDisabled ( false ) ;
this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . setValue ( record . data . CTN _ID ) ;
_this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . setDisabled ( true ) ;
} , this ) ;
_this = this ;
this . formDescriptionEdit = Ext . widget ( 'form' , {
title : '货物描述' ,
region : 'east' ,
width : 220 ,
frame : true ,
border : false ,
trackResetOnLoad : true ,
items : [ {
fieldLabel : 'GID' ,
name : 'GID' , hidden : true
} , {
fieldLabel : 'CTN_ID' ,
xtype : 'textfield' ,
name : 'CTN_ID' , hidden : true
} , {
xtype : 'textareafield' ,
grow : true , //字段是否自动伸展和收缩,默认为false
labelSeparator : '' , //标签分隔字符
name : 'DESCRIPTION' ,
height : 170 ,
anchor : '100%' ,
enableKeyEvents : true , //激活键盘事件
listeners : {
scope : this ,
'blur' : function blur ( combo , eOpts , obj ) {
_this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . setDisabled ( false ) ;
var CTN _ID = _this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . getValue ( ) ;
_this . formDescriptionEdit . getForm ( ) . findField ( 'CTN_ID' ) . setDisabled ( true ) ;
//var selections = this.gridList.getSelectionModel().getSelection();
//if (selections.length > 0) {
// selections[0].set('DESCRIPTION', combo.value);
//}
for ( i = 0 ; i < _this . storeBodyList . getCount ( ) ; i += 1 ) {
var memberyf = _this . storeBodyList . getAt ( i ) ;
if ( memberyf . data . CTN _ID == CTN _ID ) {
memberyf . data . DESCRIPTION = combo . value ;
}
} ;
_this . formDescriptionEdit . getForm ( ) . findField ( 'DESCRIPTION' )
. setValue ( combo . value . toUpperCase ( ) ) ;
}
//
}
} ]
} ) ;
//#endregion
@ -443,7 +400,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
// anchor:'50% 100%',
region : 'center' ,
frame : true ,
items : [ this . gridListCtn , this . formDescriptionEdit ]
items : [ this . gridListCtn ]
} ) ;
@ -779,6 +736,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this . formEdit . getForm ( ) . findField ( 'SHIPPERATTN' ) . setValue ( records [ 0 ] . data . ATTN ) ;
_this . formEdit . getForm ( ) . findField ( 'SHIPPERTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
_this . formEdit . getForm ( ) . findField ( 'SHIPPERCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formEdit . getForm ( ) . findField ( 'SHIPPERHOUSENO' ) . setValue ( records [ 0 ] . data . HOUSENO ) ;
_this . formEdit . getForm ( ) . findField ( 'SHIPPEREORI' ) . setValue ( records [ 0 ] . data . EORI ) ;
_this . formEdit . getForm ( ) . findField ( 'SHIPPERCORPTYPE' ) . setValue ( records [ 0 ] . data . CORPTYPE ) ;
}
}
@ -955,6 +915,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEEATTN' ) . setValue ( records [ 0 ] . data . ATTN ) ;
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEETEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEECOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEEHOUSENO' ) . setValue ( records [ 0 ] . data . HOUSENO ) ;
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEEEORI' ) . setValue ( records [ 0 ] . data . EORI ) ;
_this . formEdit . getForm ( ) . findField ( 'CONSIGNEECORPTYPE' ) . setValue ( records [ 0 ] . data . CORPTYPE ) ;
}
@ -1124,6 +1087,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYATTN' ) . setValue ( records [ 0 ] . data . ATTN ) ;
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYHOUSENO' ) . setValue ( records [ 0 ] . data . HOUSENO ) ;
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYEORI' ) . setValue ( records [ 0 ] . data . EORI ) ;
_this . formEdit . getForm ( ) . findField ( 'NOTIFYPARTYCORPTYPE' ) . setValue ( records [ 0 ] . data . CORPTYPE ) ;
}
}
}
@ -1309,13 +1275,20 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ,
select : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
_this . formcd . getForm ( ) . findField ( 'SELLERNAME' ) . setValue ( records [ 0 ] . data . NAME ) ;
_this . formcd . getForm ( ) . findField ( 'SELLERADDR1' ) . setValue ( records [ 0 ] . data . ADDRESS ) ;
_this . formcd . getForm ( ) . findField ( 'SELLERADDR2' ) . setValue ( records [ 0 ] . data . ADDRESS2 ) ;
_this . formcd . getForm ( ) . findField ( 'SELLERCITY' ) . setValue ( records [ 0 ] . data . CITY ) ;
_this . formcd . getForm ( ) . findField ( 'SELLERPROVINCE' ) . setValue ( records [ 0 ] . data . PROVINCE ) ;
_this . formcd . getForm ( ) . findField ( 'SELLERCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formcd . getForm ( ) . findField ( 'SELLEREMAIL' ) . setValue ( records [ 0 ] . data . POSTCODE ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERNAME' ) . setValue ( records [ 0 ] . data . NAME ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERADDR1' ) . setValue ( records [ 0 ] . data . ADDRESS ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERADDR2' ) . setValue ( records [ 0 ] . data . ADDRESS2 ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCITY' ) . setValue ( records [ 0 ] . data . CITY ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERPROVINCE' ) . setValue ( records [ 0 ] . data . PROVINCE ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERPOSTCODE' ) . setValue ( records [ 0 ] . data . POSTCODE ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERATTN' ) . setValue ( records [ 0 ] . data . ATTN ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERHOUSENO' ) . setValue ( records [ 0 ] . data . HOUSENO ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLEREORI' ) . setValue ( records [ 0 ] . data . EORI ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCORPTYPE' ) . setValue ( records [ 0 ] . data . CORPTYPE ) ;
}
}
@ -1366,6 +1339,26 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
handler : function ( ) {
_TempType = 'SE' ;
_this . winTempSaveShow . show ( ) ;
}
} , {
xtype : "button" ,
text : "复制发货人" ,
handler : function ( ) {
_this . formEdit . getForm ( ) . findField ( 'SELLERNAME' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERNAME' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERADDR1' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERADDR1' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERADDR2' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERADDR2' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCITY' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERCITY' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERPROVINCE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERPROVINCE' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCOUNTRY' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERCOUNTRY' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERPOSTCODE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERPOSTCODE' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERATTN' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERATTN' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERTEL' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERTEL' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERHOUSENO' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERHOUSENO' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLEREORI' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPEREORI' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'SELLERCORPTYPE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'SHIPPERCORPTYPE' ) . getValue ( ) ) ;
}
} ]
} , {
@ -1479,13 +1472,18 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ,
select : function ( combo , records , eOpts ) {
if ( records . length > 0 ) {
_this . formcd . getForm ( ) . findField ( 'BUYERNAME' ) . setValue ( records [ 0 ] . data . NAME ) ;
_this . formcd . getForm ( ) . findField ( 'BUYERADDR1' ) . setValue ( records [ 0 ] . data . ADDRESS ) ;
_this . formcd . getForm ( ) . findField ( 'BUYERADDR2' ) . setValue ( records [ 0 ] . data . ADDRESS2 ) ;
_this . formcd . getForm ( ) . findField ( 'BUYERCITY' ) . setValue ( records [ 0 ] . data . CITY ) ;
_this . formcd . getForm ( ) . findField ( 'BUYERPROVINCE' ) . setValue ( records [ 0 ] . data . PROVINCE ) ;
_this . formcd . getForm ( ) . findField ( 'BUYERCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formcd . getForm ( ) . findField ( 'BUYEREMAIL' ) . setValue ( records [ 0 ] . data . POSTCODE ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERNAME' ) . setValue ( records [ 0 ] . data . NAME ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERADDR1' ) . setValue ( records [ 0 ] . data . ADDRESS ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERADDR2' ) . setValue ( records [ 0 ] . data . ADDRESS2 ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCITY' ) . setValue ( records [ 0 ] . data . CITY ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERPROVINCE' ) . setValue ( records [ 0 ] . data . PROVINCE ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCOUNTRY' ) . setValue ( records [ 0 ] . data . COUNTRY ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYEREMAIL' ) . setValue ( records [ 0 ] . data . POSTCODE ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERATTN' ) . setValue ( records [ 0 ] . data . ATTN ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERTEL' ) . setValue ( records [ 0 ] . data . TEL ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERHOUSENO' ) . setValue ( records [ 0 ] . data . HOUSENO ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYEREORI' ) . setValue ( records [ 0 ] . data . EORI ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCORPTYPE' ) . setValue ( records [ 0 ] . data . CORPTYPE ) ;
}
}
@ -1535,6 +1533,26 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
handler : function ( ) {
_TempType = 'BY' ;
_this . winTempSaveShow . show ( ) ;
}
} , {
xtype : "button" ,
text : "复制收货人" ,
handler : function ( ) {
_this . formEdit . getForm ( ) . findField ( 'BUYERNAME' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEENAME' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERADDR1' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEADDR1' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERADDR2' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEADDR2' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCITY' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEECITY' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERPROVINCE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEPROVINCE' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCOUNTRY' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEECOUNTRY' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERPOSTCODE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEPOSTCODE' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERATTN' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEATTN' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERTEL' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEETEL' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERHOUSENO' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEHOUSENO' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYEREORI' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEEEORI' ) . getValue ( ) ) ;
_this . formEdit . getForm ( ) . findField ( 'BUYERCORPTYPE' ) . setValue ( _this . formEdit . getForm ( ) . findField ( 'CONSIGNEECORPTYPE' ) . getValue ( ) ) ;
}
} ]
} , {
@ -1616,129 +1634,6 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ) ;
//this.storeNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableStore', {
// model: 'DsShipping.ux.MsOpSeaeEdiTemplate',
// proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' }
//});
//// this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } });
//this.comboxNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '名称',
// store: this.storeNameSHIPTOPARTY,
// queryParam: 'DisplayName',
// queryMode: 'remote',
// flex: 0.5,
// name: 'SHIPTOPARTYNAME',
// valueField: 'NAME',
// displayField: 'NAME',
// listeners: {
// beforequery: function (e) {
// var combo = e.combo;
// if (!e.forceAll) {
// var value = e.query;
// value = value.toUpperCase();
// combo.store.filterBy(function (record, id) {
// var text = record.get(combo.displayField);
// text = text.toUpperCase();
// return (text.indexOf(value) != -1);
// });
// combo.expand();
// return false;
// }
// },
// select: function (combo, records, eOpts) {
// if (records.length > 0) {
// _this.formcd.getForm().findField('SHIPTOPARTYNAME').setValue(records[0].data.NAME);
// _this.formcd.getForm().findField('SHIPTOPARTYADDR1').setValue(records[0].data.ADDRESS);
// _this.formcd.getForm().findField('SHIPTOPARTYADDR2').setValue(records[0].data.ADDRESS2);
// _this.formcd.getForm().findField('SHIPTOPARTYCITY').setValue(records[0].data.CITY);
// _this.formcd.getForm().findField('SHIPTOPARTYPROVINCE').setValue(records[0].data.PROVINCE);
// _this.formcd.getForm().findField('SHIPTOPARTYCOUNTRY').setValue(records[0].data.COUNTRY);
// _this.formcd.getForm().findField('SHIPTOPARTYEMAIL').setValue(records[0].data.POSTCODE);
// }
// }
// }
//});
//this.panelSHIPTOPARTY = new Ext.Panel({
// title: '货物送达仓库',
// layout: "anchor",
// height: 145,
// flex: 1,
// frame: true,
// fieldDefaults: {
// margins: '2 2 2 2',
// labelAlign: 'right',
// labelWidth: 60,
// msgTarget: 'qtip'
// },
// items: [{
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{ xtype: 'hiddenfield' }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [this.comboxNameSHIPTOPARTY, {
// xtype: "button",
// text: "保存为模板",
// handler: function () {
// _TempType = 'ST';
// _this.winTempSaveShow.show();
// }
// }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{
// fieldLabel: '地址1',
// flex: 1,
// name: 'SHIPTOPARTYADDR1'
// }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{
// fieldLabel: '地址2',
// flex: 2,
// name: 'SHIPTOPARTYADDR2'
// }, {
// fieldLabel: '邮编',
// flex: 1,
// name: 'SHIPTOPARTYEMAIL'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [{
// fieldLabel: '城市',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYCITY'
// }, {
// fieldLabel: '省份代码',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYPROVINCE'
// }, {
// fieldLabel: '国家代码',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYCOUNTRY'
// }]
// }
// ]
//});
//#region 编辑formEdit 基本信息
this . formEdit = Ext . widget ( 'form' , {
@ -1820,75 +1715,56 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
this . panelBtn = new Ext . Panel ( {
region : "north" ,
tbar : [ {
id : 'btnE CopyNew',
id : 'btnE NS CopyNew',
text : "复制新建" ,
handler : function ( button , event ) {
var basicForm = this . form Head . getForm ( ) ;
var basicForm = this . form Edit . getForm ( ) ;
this . opStatus = 'add' ;
basicForm . findField ( ' BS NO') . setDisabled ( false ) ;
var field = basicForm . findField ( ' BS NO') ;
basicForm . findField ( ' MF NO') . setDisabled ( false ) ;
var field = basicForm . findField ( ' MF NO') ;
var BSNO = NewGuid ( ) ;
field . setValue ( BSNO ) ;
basicForm . findField ( 'BSNO' ) . setDisabled ( true ) ;
field = basicForm . findField ( 'ORDNO' ) ;
field . setValue ( '' ) ;
basicForm . findField ( 'MFNO' ) . setDisabled ( true ) ;
field = basicForm . findField ( 'INPUTBY' ) ;
field . setValue ( SHOWNAME ) ;
field = basicForm . findField ( 'ORSTATUS' ) ;
field . setValue ( '9' ) ;
field = basicForm . findField ( 'ORSTATUSREF' ) ;
field . setValue ( '录入状态' ) ;
field = basicForm . findField ( 'MBLNO' ) ;
field . setValue ( '' ) ;
this . panelFee . strBSNO = BSNO ;
for ( var j = 0 ; j < this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyList . getAt ( j ) ;
memberbody . set ( " ORD NO", '*' ) ;
memberbody . set ( "MFNO" , '*' ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . panelFee . storeDrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . panelFee . storeDrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "BsNo" , '*' ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . panelFee . storeCrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . panelFee . storeCrChFee . getAt ( j ) ;
memberbody . set ( "GId" , NewGuid ( ) ) ;
memberbody . set ( "BsNo" , '*' ) ;
for ( var j = 0 ; j < this . storeCargoList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeCargoList . getAt ( j ) ;
memberbody . set ( "MFNO" , '*' ) ;
memberbody . commit ( ) ;
} ;
this . GetEditStatus ( ) ;
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 == 'pnlmodSeaeOrderInfo' ) {
this . tabSeaepanel . setActiveTab ( i ) ;
}
}
}
}
this . tabSeaepanel . doLayout ( ) ;
this . panelOcr . hide ( ) ;
} ,
scope : this
} , {
id : 'btnE Save',
id : 'btnENSSave' ,
text : "保存" ,
iconCls : "btnsave" ,
handler : function ( button , event ) {
this . Save ( '0' ) ;
} ,
scope : this
} , {
id : 'btnENSNew' ,
text : '新增' ,
handler : function ( button , event ) {
this . LoadNewData ( ) ;
} ,
scope : this
} , '-' , {
id : 'btnBDelete' ,
text : '删除' ,
iconCls : "btnENSdelete" ,
handler : function ( button , event ) {
this . onDeleteClick ( button , event ) ;
} ,
scope : this
} ]
} ) ; //end 按钮Toolbar
//#endregion
@ -2016,6 +1892,12 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} )
} ) ;
this . gridList . addListener ( 'itemclick' , function ( dataview , record , item , index , e , b ) {
_this . editRecord = record ;
_this . OpStatus = 'edit' ;
_this . LoadData ( "edit" , "MFNO='" + record . data . MFNO + "'" ) ;
} , this ) ;
this . panellist = new Ext . Panel ( {
// title: '提单信息',
@ -2132,7 +2014,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
var condition = '' ;
_this = this ;
this . storeList . load ( {
params : { condition : "BSNO='" + this . BsNo + "' " } ,
params : { condition : "BSNO='" + this . BsNo + "' and EDITYPE='ENS' " } ,
callback : function ( r , options , success ) {
if ( success ) {
if ( this . storeList . getCount ( ) > 0 ) {
@ -2147,10 +2029,43 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ,
scope : this
} ) ;
_this . LoadMustBe ( ) ;
// _this.LoadMustBe();
} , //end InitData
LoadNewData : function ( ) {
Ext . Ajax . request ( {
waitMsg : Zi . LAN . ZhengZaiCaoZuoShuJu ,
url : '/MvcShipping/MsOpSeae/CreateCustomList' ,
params : {
BSNOS : this . BsNo ,
type : 'ENS' ,
editype : 'ENS'
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : Zi . LAN . TiShi ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
} else {
//Ext.Msg.hide();
this . InitData ( ) ;
}
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
} ,
LoadData : function ( opstatus , condition ) {
this . serialNo = 0 ;
//this.bodyDel = [];
@ -2161,7 +2076,8 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
url : '/MvcShipping/MsOpSeaeEdi/GetData' ,
params : {
handle : opstatus ,
condition : condition
condition : condition ,
bsno : this . BsNo
} ,
callback : function ( options , success , response ) {
if ( success ) {
@ -2178,8 +2094,6 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
data = result . data ;
this . formHead . getForm ( ) . reset ( ) ;
this . formHead . getForm ( ) . setValues ( data ) ;
this . formEdit . getForm ( ) . reset ( ) ;
this . formEdit . getForm ( ) . setValues ( data ) ;
@ -2192,6 +2106,38 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : Zi . LAN . ZhengZaiChaXunShuJu , //'正在查询主表数据...',
url : '/MvcShipping/MsOpSeae/GetAmsData' ,
params : {
condition : "BSNO='" + this . BsNo + "'"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : Zi . LAN . TiShi ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
}
data = result . data ;
this . formHead . getForm ( ) . reset ( ) ;
this . formHead . getForm ( ) . setValues ( data ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
if ( this . opStatus == 'edit' ) {
this . storeBodyList . load ( { params : { condition : condition } } ) ;
this . storeCargoList . load ( { params : { condition : condition } } ) ;
@ -2210,9 +2156,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
if ( ! basicForm . isValid ( ) ) {
return ;
}
if ( ! basicForm2 . isValid ( ) ) {
return ;
}
//
var bodydatas = [ ] ;
for ( var i = 0 ; i < this . storeBodyList . getCount ( ) ; i += 1 ) {
@ -2231,23 +2175,24 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} //
var jsonCargo = ConvertRecordsToJsonAll ( cargodatas ) ;
this . form Head . getForm ( ) . findField ( 'MFNO' ) . setDisabled ( false ) ;
this . form Edit . getForm ( ) . findField ( 'MFNO' ) . setDisabled ( false ) ;
var data = this . formHead . getForm ( ) . getValues ( false , false , false ) ;
var data2 = this . formEdit . getForm ( ) . getValues ( false , false , false ) ;
this . form Head . getForm ( ) . findField ( 'MFNO' ) . setDisabled ( true ) ;
this . form Edit . getForm ( ) . findField ( 'MFNO' ) . setDisabled ( true ) ;
//
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsOpSeaeEdi/Save ',
url : '/MvcShipping/MsOpSeaeEdi/Save ENS ',
scope : this ,
params : {
opstatus : this . opStatus ,
data : Ext . JSON . encode ( data ) ,
data2 : Ext . JSON . encode ( data2 ) ,
body : jsonBody ,
cargobody : jsonCargo
cargobody : jsonCargo ,
bsno : this . BsNo
} ,
callback : function ( options , success , response ) {
if ( success ) {
@ -2257,8 +2202,8 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
var returnData = jsonresult . Data ;
this . formEdit . getForm ( ) . reset ( ) ;
this . formEdit . getForm ( ) . setValues ( returnData ) ;
this . formHead . getForm ( ) . reset ( ) ;
this . formHead . getForm ( ) . setValues ( returnData ) ;
//this.formHead.getForm().reset();
//this.formHead.getForm().setValues(returnData);
//
if ( this . opStatus == 'add' ) {
@ -2278,7 +2223,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
}
if ( type == '0' ) {
this . opStatus = 'edit' ;
basicForm 2 . findField ( 'MFNO' ) . setDisabled ( true ) ;
basicForm . findField ( 'MFNO' ) . setDisabled ( true ) ;
for ( var j = 0 ; j < this . storeBodyList . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyList . getAt ( j ) ;
memberbody . set ( "MFNO" , this . editRecord . get ( 'MFNO' ) ) ;
@ -2756,7 +2701,65 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} ,
onDeleteClick : function ( button , event ) {
var selections = this . gridList . getSelectionModel ( ) . getSelection ( ) ;
if ( selections . length == 0 ) {
Ext . Msg . show ( { title : Zi . LAN . TiShi , msg : Zi . LAN . QingXianXuanZeYeWu , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
return ;
}
var record = selections [ 0 ] ;
//if (this.StoreOpRange.getCount() == 0) {
// Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
// return;
//} else {
// var inputby = record.data.INPUTBY;
// var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby);
// if (records.getCount() > 0) {
// } else {
// canedit = false;
// Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
// return;
// }
//}
Ext . MessageBox . confirm ( '提示' , '确实要删除此业务吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在删除....' ) ;
Ext . Ajax . request ( {
waitMsg : '正在删除....' ,
url : '/MvcShipping/MsOpSeaeEdi/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 ) ;
if ( this . storeList . getCount ( ) > 0 ) {
var member = this . storeList . getAt ( 0 ) ;
this . LoadData ( "edit" , "MFNO='" + member . data . MFNO + "'" ) ;
this . editRecord = member ;
}
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错!' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
success : function ( response , options ) { } ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
} ,
LoadInit : function ( ) {