@ -165,100 +165,144 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
plugins : [ this . gridListCellEditing ] ,
selModel : this . CtnGridCheckBoxModel ,
selType : 'cellmodel' ,
columns : [ {
sortable : true ,
dataIndex : 'CTN_ID' ,
header : 'CTN_ID' , //'编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'BSNO' ,
header : 'BSNO' , //'业务编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'MFNO' ,
header : 'MFNO' , //'业务编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'SENDGID' ,
header : 'SENDGID' , //'业务编号',
hidden : true ,
width : 0
} ,
{
dataIndex : 'CTNALL' ,
header : '箱型' , //'箱型',
width : 65 ,
editor : this . comboxCTNALL
} , {
dataIndex : 'CNTRNO' ,
header : '箱号' , //'箱号',
width : 100 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
columns : [
{
sortable : true ,
dataIndex : 'CTN_ID' ,
header : 'CTN_ID' , //'编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'BSNO' ,
header : 'BSNO' , //'业务编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'MFNO' ,
header : 'MFNO' , //'业务编号',
hidden : true ,
width : 0
} , {
sortable : true ,
dataIndex : 'SENDGID' ,
header : 'SENDGID' , //'业务编号',
hidden : true ,
width : 0
} ,
renderer : function ( value , cellmeta ) {
return value . trim ( ) ;
}
} , {
dataIndex : 'SEALNO' ,
header : '封号' , //'封号',
width : 100 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'KGS' ,
header : '毛重' , //'重量',
width : 80 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'TAREWEIGHT' ,
header : '箱皮重' , //'箱皮重',
width : 80 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'WEIGHTYPE' ,
header : '称重方式' , //'称重方式',
width : 80 ,
editor : this . comboxWEIGHTYPE
} , {
dataIndex : 'VGMKGS' ,
header : 'VGM重量' , //'参考重量',
width : 80 ,
renderer : function ( value , meta , record ) {
return Add ( record . data . KGS , record . data . TAREWEIGHT ) ;
{
dataIndex : 'CTNALL' ,
header : '箱型' , //'箱型',
width : 50 ,
editor : this . comboxCTNALL
} , {
dataIndex : 'CNTRNO' ,
header : '箱号' , //'箱号',
width : 100 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
} ,
renderer : function ( value , cellmeta ) {
return value . trim ( ) ;
}
} , {
dataIndex : 'SEALNO' ,
header : '封号' , //'封号',
width : 100 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'KGS' ,
header : '毛重' , //'重量',
width : 65 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'TAREWEIGHT' ,
header : '箱皮重' , //'箱皮重',
width : 65 ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true
}
} , {
dataIndex : 'WEIGHTYPE' ,
header : '称重方式' , //'称重方式',
width : 60 ,
editor : this . comboxWEIGHTYPE
} , {
dataIndex : 'VGMKGS' ,
header : 'VGM重量' , //'参考重量',
width : 65 ,
renderer : function ( value , meta , record ) {
return Add ( record . data . KGS , record . data . TAREWEIGHT ) ;
}
} , {
dataIndex : 'WEIGHDATE' ,
header : '称重时间' , //'箱皮重',
width : 80 ,
renderer : Ext . util . Format . dateRenderer ( 'Y-m-d' ) ,
editor : {
xtype : 'datefield' ,
format : 'Y-m-d' ,
selectOnFocus : true
}
} , {
dataIndex : 'YARD' ,
header : '场站' , //'箱状态',
width : 100 ,
editor : this . comboxYARD
} ]
}
} , {
dataIndex : 'WEIGHDATE' ,
header : '称重时间' , //'箱皮重',
width : 70 ,
renderer : Ext . util . Format . dateRenderer ( 'Y-m-d' ) ,
editor : {
xtype : 'datefield' ,
format : 'Y-m-d' ,
selectOnFocus : true
}
} , {
dataIndex : 'YARD' ,
header : '场站' , //'箱状态',
width : 100 ,
editor : this . comboxYARD
} , {
sortable : true ,
dataIndex : 'carrierSendFlag' ,
header : '船公司发送' ,
width : 70 ,
renderer : function ( value , meta ) {
if ( value == '-1' ) {
return "失败" ;
} else if ( value == '0' ) {
return "未发" ;
} else if ( value == '1' ) {
return "发送成功" ;
} else {
return ""
}
}
} , {
sortable : true ,
dataIndex : 'ygtSendFlag' ,
header : '云港通发送' ,
width : 70 ,
renderer : function ( value , meta ) {
if ( value == '-1' ) {
return "失败" ;
} else if ( value == '0' ) {
return "未发" ;
} else if ( value == '1' ) {
return "发送成功" ;
} else {
return ""
}
}
} ] ,
tbar : [
{
text : '删除明细' , //'删除明细',
tooltip : '注意已发送成功的箱无法删除' , //'删除明细',
iconCls : "btndeletedetail" ,
handler : function ( button , event ) {
this . OnDelCtn ( button , event , 1 ) ;
} ,
scope : this
} ]
} ) ;
this . panelBodyCtn = new Ext . Panel ( {
@ -302,31 +346,37 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [
{
fieldLabel : '提单号' ,
xtype : 'label' ,
id : "MBLNOLabel" ,
flex : 1.1 , margins : '0'
} ,
{
fieldLabel : '发送状态' ,
id : "VGMSTATUS" ,
flex : 0.4 ,
//hidden: true,
html : "" ,
flex : 1 .4,
hidden : true ,
html : " <a><b></b></a> ",
}
,
{
xtype : 'checkboxgroup' ,
flex : 2 ,
flex : 1.6 ,
fieldLabel : '发送方' , //'文件功能',
items : [ {
xtype : "checkbox" , //checkbox控件
name : "ISCARRIER" ,
boxLabel : "" ,
fieldLabel : "船公司" ,
labelWidth : 50 ,
labelWidth : 4 5,
inputValue : true , //选中的值
uncheckedValue : false , //未选中的值
checked : true //绘制时的选中状态
} , {
xtype : "checkbox" , //checkbox控件
name : "ISYGT" ,
labelWidth : 50 ,
labelWidth : 4 5,
boxLabel : "" ,
fieldLabel : "云港通" ,
inputValue : true , //选中的值
@ -339,17 +389,20 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, { xtype : 'hiddenfield' , flex : 0.6 } ,
{
xtype : 'radiogroup' ,
flex : 2 ,
flex : 1.4 ,
labelWidth : 60 ,
fieldLabel : '操作类型' , //'文件功能',
id : 'vGMFILEROLE' ,
defaults : { flex : 1 } ,
layout : 'hbox' ,
items : [ {
labelWidth : 45 ,
boxLabel : "新增" , //'原始',
name : 'FILEROLE' ,
inputValue : '9' ,
checked : true
} , {
labelWidth : 45 ,
boxLabel : "修改" , //'更新',
name : 'FILEROLE' ,
inputValue : '5'
@ -375,7 +428,18 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
} , {
fieldLabel : 'BSNO' ,
name : 'BSNO' , flex : 0 , hidden : true , margins : '0'
}
} , {
fieldLabel : 'MBLNO' ,
name : 'MBLNO' , flex : 0 , hidden : true , margins : '0'
}
, {
fieldLabel : 'MFNO' ,
name : 'MFNO' , flex : 0 , hidden : true , margins : '0'
}
, {
fieldLabel : 'VGMSTATUS' ,
name : 'VGMSTATUS' , flex : 0 , hidden : true , margins : '0'
}
//, {
// fieldLabel: 'ISCARRIER',
@ -390,9 +454,6 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, {
fieldLabel : 'SENDTYPE' ,
name : 'SENDTYPE' , flex : 0 , hidden : true , margins : '0'
} , {
fieldLabel : 'MBLNO' ,
name : 'MBLNO' , flex : 0 , hidden : true , margins : '0'
} , {
fieldLabel : '船名' ,
name : 'VESSEL'
@ -581,6 +642,28 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, '-' ,
//
{
text : "刷新" , //
minWidth : 70 ,
handler : function ( ) {
_this . OnRefreshCtn ( ) ;
}
} ,
{
text : "保存" , //
minWidth : 70 ,
handler : function ( ) {
var cgFILEROLE = Ext . getCmp ( 'vGMFILEROLE' ) ;
var FILEROLE = cgFILEROLE . getValue ( ) ;
var ISCARRIER = _this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . getValue ( ) ;
var ISYGT = _this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . getValue ( ) ;
_this . onSaveVGM ( ISCARRIER , ISYGT , FILEROLE . FILEROLE , false ) ;
}
} , '-' ,
{
text : "发送VGM" , //"生成并发送VGM报文",
minWidth : 70 ,
@ -590,7 +673,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var ISCARRIER = _this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . getValue ( ) ;
var ISYGT = _this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . getValue ( ) ;
_this . onS end VGM( ISCARRIER , ISYGT , FILEROLE . FILEROLE ) ;
_this . onS av eVGM( ISCARRIER , ISYGT , FILEROLE . FILEROLE , true ) ;
}
}
@ -612,7 +695,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
this . panelTop = new Ext . Panel ( {
layout : "border" ,
region : "north" ,
height : 3 9 0,
height : 3 8 0,
items : [ this . formEdit , this . panelBtn ]
} ) ;
@ -719,7 +802,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
bodyStyle : "padding:0 0 0 0" ,
items : [ this . formVGMShow ] ,
buttons : [ {
text : "发送VGM ", //"生成并发送VGM报文",
text : "发送VGM _del ", //"生成并发送VGM报文",
minWidth : 70 ,
handler : function ( ) {
var cgFILEROLE = Ext . getCmp ( 'vGMFILEROLE' ) ;
@ -730,13 +813,13 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
_this . onSendVGM ( ISCARRIER , ISYGT , FILEROLE . FILEROLE ) ;
}
} , {
text : "获取链接 ",
text : "获取链接 _del ",
handler : function ( button , event ) {
_this . GetVgmLink ( ) ;
} ,
scope : this
} , '-' , {
text : "关闭 ", //"关闭",
text : "关闭 _Del ", //"关闭",
minWidth : 70 ,
handler : function ( ) {
_this . winVGMShow . close ( ) ;
@ -744,6 +827,15 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
} ]
} ) ;
//#endregion
this . storeCtnList . on ( 'beforeload' , function ( store ) {
var condition = "BSNO='" + this . bsno + "'" ;
Ext . apply ( store . proxy . extraParams , { condition : condition } ) ;
} , this ) ;
//绑定查询窗体
parentWin = window . parent . opener . panelEdit ;
@ -774,11 +866,16 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
LoadData : function ( bsno ) {
this . formEdit . getForm ( ) . reset ( ) ;
if ( ! this . MeditRecord . data . LOADPORT ) {
this . MeditRecord . data . LOADPORT = this . MeditRecord . data . PORTLOAD ;
if ( this . MeditRecord . data . PORTLOADID ) {
this . MeditRecord . data . LOADPORT = this . MeditRecord . data . PORTLOADID ;
this . storeMATOU . load ( { params : { enumTypeId : 96304 , sCondition : "EnumValueName_2='" + this . MeditRecord . data . PORTLOADID + "'" } } ) ;
}
this . formEdit . getForm ( ) . setValues ( this . MeditRecord . data ) ;
Ext . getCmp ( "MBLNOLabel" ) . setText ( "提单号:" + this . MeditRecord . data . MBLNO ) ;
//for (var j = 0; j < this.MStoreList.getCount(); j += 1) {
// var memberbody = this.MStoreList.getAt(j);
@ -819,8 +916,10 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var data = result . data ;
if ( data . MBLNO ) {
Ext . getCmp ( "MBLNOLabel" ) . setText ( "" + data . MBLNO ) ;
}
if ( data . BSNO ) {
data . VGM _TIME = data . VGM _TIME . replace ( " 0:00:00" , "" ) ;
@ -885,7 +984,9 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
params : { condition : "bsno='" + this . bsno + "'" } ,
callback : function ( options , success , response ) {
if ( _this . storeCtnList . getCount ( ) == 0 ) {
if ( _this . storeCtnList . getCount ( ) == 0 )
{
//没有获取到已保存的箱信息 从海运出口箱信息中获取
for ( var j = 0 ; j < _this . MStoreList . getCount ( ) ; j += 1 ) {
var memberbody = _this . MStoreList . getAt ( j ) ;
@ -902,17 +1003,62 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
WEIGHDATE : memberbody . data . WEIGHDATE
} ) ;
_this . storeCtnList . add ( record ) ;
} ;
//var testGrid = Ext.getCmp('testGrid');
var records = _this . gridList . getStore ( ) . getRange ( ) ;
var selectModel = _this . gridList . getSelectionModel ( ) ;
for ( var i = 0 ; i < records . length ; i ++ ) {
var record = records [ i ] ;
selectModel . select ( record , true ) ;
//if (selectModel.isSelected(record)) {
// selectModel.deselect(record);
//} else {
// selectModel.select(record, true);
//}
}
//for (var j = 0; j < _this.MStoreList.getCount(); j += 1) {
// _this.gridList.getSelectionModel().select(j);
//};
} else {
//for (var j = 0; j < _this.storeCtnList.getCount(); j += 1) {
// var memberbody = _this.storeCtnList.getAt(j);
// if (memberbody.data.carrierSendFlag != 1 || memberbody.data.ygtSendFlag != 1) {
// _this.gridList.getSelectionModel().select(j);
// }
//};
var records = _this . gridList . getStore ( ) . getRange ( ) ;
var selectModel = _this . gridList . getSelectionModel ( ) ;
for ( var i = 0 ; i < records . length ; i ++ ) {
var record = records [ i ] ;
if ( record . data . carrierSendFlag != 1 || record . data . ygtSendFlag != 1 ) {
selectModel . select ( record , true ) ;
} else {
selectModel . deselect ( record ) ;
}
//if (selectModel.isSelected(record)) {
// selectModel.deselect(record);
//} else {
// selectModel.select(record, true);
//}
}
}
}
} ) ;
} , // end LoadDate
} // end LoadDate
onSendVGM : function ( ISCARRIER , ISYGT , FILEROLE ) {
, onSendVGM : function ( ISCARRIER , ISYGT , FILEROLE ) {
var basicForm = this . formEdit . getForm ( ) ;
if ( ! basicForm . isValid ( ) ) {
@ -929,12 +1075,22 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var data = this . formEdit . getForm ( ) . getValues ( false , false , false ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( true ) ;
var bodyctndatas = [ ] ;
for ( var i = 0 ; i < this . storeCtnList . getCount ( ) ; i += 1 ) {
var member = this . storeCtnList . getAt ( i ) ;
bodyctndatas . push ( member ) ;
var selectedRecords = this . gridList . selModel . getSelection ( ) ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
bodyctndatas . push ( rec ) ;
}
;
if ( selectedRecords . length == 0 ) {
Ext . Msg . show ( { title : '错误' , msg : "发送时必须选择至少一条箱信息" , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
var jsonCtnBody = ConvertRecordsToJsonAll ( bodyctndatas ) ;
@ -945,7 +1101,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
scope : this ,
params : {
data : Ext . JSON . encode ( data ) ,
bodylist : jsonCtnBody ,
bodylist : jsonCtnBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
@ -972,6 +1128,71 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
}
} ) ;
} //end save
, onSaveVGM : function ( ISCARRIER , ISYGT , FILEROLE , saveandsend = false ) {
var basicForm = this . formEdit . getForm ( ) ;
if ( ! basicForm . isValid ( ) ) {
return ;
}
this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . setValue ( ISCARRIER ) ;
this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . setValue ( ISYGT ) ;
this . formEdit . getForm ( ) . findField ( 'SENDTYPE' ) . setValue ( FILEROLE ) ;
MATOU = this . formEdit . getForm ( ) . findField ( 'MATOU' ) . getValue ( ) ;
LOADPORT = this . formEdit . getForm ( ) . findField ( 'LOADPORT' ) . getValue ( ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( false ) ;
var data = this . formEdit . getForm ( ) . getValues ( false , false , false ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( true ) ;
var bodyctndatas = [ ] ;
for ( var i = 0 ; i < this . storeCtnList . getCount ( ) ; i += 1 ) {
var member = this . storeCtnList . getAt ( i ) ;
bodyctndatas . push ( member ) ;
}
var jsonCtnBody = ConvertRecordsToJsonAll ( bodyctndatas ) ;
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsOpVgmSend/SaveVgm' ,
scope : this ,
params : {
data : Ext . JSON . encode ( data ) ,
bodylist : jsonCtnBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
if ( ! saveandsend ) {
_this . LoadData ( _this . bsno ) ;
_this . winVGMShow . close ( ) ;
} else {
_this . onSendVGM ( ISCARRIER , ISYGT , FILEROLE ) ;
}
} else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
_this . winVGMShow . close ( ) ;
}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} //end save
, ShowHistory : function ( BSNO ) {
@ -1165,6 +1386,135 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
ShowPublicINFO ( title , model , proxyUrl , condition , columns , 500 ) ;
}
, OnRefreshCtn : function ( ) {
_this = this ;
//this.storeCtnList.removeAll();
var addList = [ ] ;
for ( var j = 0 ; j < this . MStoreList . getCount ( ) ; j += 1 ) {
var memberbody = this . MStoreList . getAt ( j ) ;
havecntrno = false ;
for ( var i = 0 ; i < this . storeCtnList . getCount ( ) ; i += 1 ) {
var ctndata = this . storeCtnList . getAt ( i ) . data ;
if ( ctndata . CNTRNO == memberbody . data . CNTRNO ) {
havecntrno = true ;
}
} ;
if ( ! havecntrno ) {
var record = Ext . create ( 'MsOpVgmCtn' , {
BSNO : memberbody . data . BSNO ,
CTNALL : memberbody . data . CTNALL ,
CNTRNO : memberbody . data . CNTRNO ,
SEALNO : memberbody . data . SEALNO ,
KGS : memberbody . data . KGS ,
WEIGHTYPE : 'SM2' ,
TAREWEIGHT : memberbody . data . TAREWEIGHT ,
VGMKGS : Add ( memberbody . data . KGS , memberbody . data . TAREWEIGHT ) ,
YARD : _this . MeditRecord . data . YARD ,
WEIGHDATE : memberbody . data . WEIGHDATE
} ) ;
//addList.push(record);
this . storeCtnList . add ( record ) ;
}
} ;
//if (addList != []) {
// foreach(addList, function (item) {
// _this.storeCtnList.add(item);
// });
//}
var cgFILEROLE = Ext . getCmp ( 'vGMFILEROLE' ) ;
var FILEROLE = cgFILEROLE . getValue ( ) ;
var ISCARRIER = _this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . getValue ( ) ;
var ISYGT = _this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . getValue ( ) ;
_this . onSaveVGM ( ISCARRIER , ISYGT , FILEROLE . FILEROLE , false ) ;
}
, OnDelCtn : function ( ) {
_this = this ;
var basicForm = this . formEdit . getForm ( ) ;
if ( ! basicForm . isValid ( ) ) {
return ;
}
var cgFILEROLE = Ext . getCmp ( 'vGMFILEROLE' ) ;
var FILEROLE = cgFILEROLE . getValue ( ) ;
var ISCARRIER = _this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . getValue ( ) ;
var ISYGT = _this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . getValue ( ) ;
this . formEdit . getForm ( ) . findField ( 'ISCARRIER' ) . setValue ( ISCARRIER ) ;
this . formEdit . getForm ( ) . findField ( 'ISYGT' ) . setValue ( ISYGT ) ;
this . formEdit . getForm ( ) . findField ( 'SENDTYPE' ) . setValue ( FILEROLE ) ;
MATOU = this . formEdit . getForm ( ) . findField ( 'MATOU' ) . getValue ( ) ;
LOADPORT = this . formEdit . getForm ( ) . findField ( 'LOADPORT' ) . getValue ( ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( false ) ;
var data = this . formEdit . getForm ( ) . getValues ( false , false , false ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( true ) ;
var selectedRecords = this . gridList . selModel . getSelection ( ) ;
var bodyctndatas = [ ] ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
if ( rec . data . CTN _ID == "" || ! rec . data . CTN _ID ) //如果是新增但没有保存的数据,没有必要提交到后台
{
this . storeCtnList . remove ( selectedRecords [ i ] ) ;
}
else {
bodyctndatas . push ( rec ) ;
}
}
var jsonCtnBody = ConvertRecordsToJsonAll ( bodyctndatas ) ;
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsOpVgmSend/DelCtn' ,
scope : this ,
params : {
data : Ext . JSON . encode ( data ) ,
bodylist : jsonCtnBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
_this . LoadData ( _this . bsno ) ;
_this . winVGMShow . close ( ) ;
} else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
_this . winVGMShow . close ( ) ;
}
} else {
Ext . Msg . show ( {
title : '请重试' ,
msg : '服务器响应出错' ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
}
} ) ;