@ -48,7 +48,8 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
this . AMENDSELFWORKFLOW = 0 ;
this . FEENOTPR = false ;
this . ISWACC = 0 ;
this . FEEMANGERMUSTBE = 0 ;
this . FEEMANGERMUSTBE = 0 ;
this . FEESAVENOTSAMEAMOUNT = 0 ;
this . MODIFYCUSTBFFEELOCK = 0 ;
this . DrRangDaStr = " 1=1 " ;
this . CrRangDaStr = " 1=1 " ;
@ -1265,7 +1266,12 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} , {
sortable : true ,
dataIndex : 'STATEMENTNO' ,
header : Zi . LAN . FEE . STATEMENTNO ,
header : Zi . LAN . FEE . STATEMENTNO ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true ,
enableKeyEvents : true
} ,
width : 100
}
] ;
@ -2404,7 +2410,12 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} , {
sortable : true ,
dataIndex : 'STATEMENTNO' ,
header : Zi . LAN . FEE . STATEMENTNO ,
header : Zi . LAN . FEE . STATEMENTNO ,
editor : {
xtype : 'textfield' ,
selectOnFocus : true ,
enableKeyEvents : true
} ,
width : 100
}
] ;
@ -5673,6 +5684,33 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsSysParamSet/GetData' ,
params : {
condition : "PARAMNAME='FEESAVENOTSAMEAMOUNT'"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
} else {
var data = result . data ;
if ( data . PARAMVALUE == '1' ) {
this . FEESAVENOTSAMEAMOUNT = 1 ;
} else {
}
}
} else {
}
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
@ -7274,7 +7312,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
var bodyDrChFeeDatas = [ ] ;
var i ;
this . isrepeatfee = 0 ;
if ( type == '1' ) {
for ( i = 0 ; i < this . storeDrChFee . getCount ( ) ; i += 1 ) {
var memberyf = this . storeDrChFee . getAt ( i ) ;
@ -7291,7 +7329,10 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} ;
var jsonChFeeBody = ConvertFeeRecordsToJson ( bodyDrChFeeDatas ) ;
} else if ( type == '2' ) {
this . TMPstoreDrChFee = Ext . create ( 'Ext.data.Store' , {
model : 'MsChFee' ,
remoteSort : false
} ) ;
for ( i = 0 ; i < this . storeCrChFee . getCount ( ) ; i += 1 ) {
var memberyf = this . storeCrChFee . getAt ( i ) ;
if ( memberyf . data . Currency == LOCALCURR && memberyf . data . ExChangerate != 1 ) {
@ -7304,11 +7345,27 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
bodyDrChFeeDatas . push ( memberyf ) ;
var amount = memberyf . data . Amount ;
var ExChangerate = memberyf . data . ExChangerate ;
if ( this . FEESAVENOTSAMEAMOUNT == 1 ) {
for ( var j = 0 ; j < this . TMPstoreDrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . TMPstoreDrChFee . getAt ( j ) ;
if ( memberbody . data . CustomerName == memberyf . data . CustomerName && memberbody . data . FeeName == memberyf . data . FeeName
&& memberbody . data . Amount == memberyf . data . Amount && memberbody . data . Currency == memberyf . data . Currency )
{
this . isrepeatfee = 1
}
}
if ( this . isrepeatfee == 0 ) {
this . TMPstoreDrChFee . add ( memberyf ) ;
}
}
} ;
var jsonChFeeBody = ConvertFeeRecordsToJson ( bodyDrChFeeDatas ) ;
} else if ( type == '3' ) {
this . TMPstoreDrChFee = Ext . create ( 'Ext.data.Store' , {
model : 'MsChFee' ,
remoteSort : false
} ) ;
for ( i = 0 ; i < this . storeDrChFee . getCount ( ) ; i += 1 ) {
var memberyf = this . storeDrChFee . getAt ( i ) ;
if ( memberyf . data . Currency == LOCALCURR && memberyf . data . ExChangerate != 1 ) {
@ -7333,6 +7390,18 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
bodyDrChFeeDatas . push ( memberyf ) ;
var amount = memberyf . data . Amount ;
var ExChangerate = memberyf . data . ExChangerate ;
if ( this . FEESAVENOTSAMEAMOUNT == 1 ) {
for ( var j = 0 ; j < this . TMPstoreDrChFee . getCount ( ) ; j += 1 ) {
var memberbody = this . TMPstoreDrChFee . getAt ( j ) ;
if ( memberbody . data . CustomerName == memberyf . data . CustomerName && memberbody . data . FeeName == memberyf . data . FeeName
&& memberbody . data . Amount == memberyf . data . Amount && memberbody . data . Currency == memberyf . data . Currency ) {
this . isrepeatfee = 1
}
}
if ( this . isrepeatfee == 0 ) {
this . TMPstoreDrChFee . add ( memberyf ) ;
}
}
} ;
var jsonChFeeBody = ConvertFeeRecordsToJson ( bodyDrChFeeDatas ) ;
@ -7343,69 +7412,96 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
Ext . Msg . show ( { title : Zi . LAN . FEE . ChuoWu , msg : '请先保存业务信息!' , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
return ;
}
Ext . Msg . wait ( Zi . LAN . FEE . ZhengZaiCaoZuoShuJu ) ;
Ext . Ajax . request ( {
waitMsg : Zi . LAN . FEE . ZhengZaiCaoZuoShuJu , //'正在保存数据...',
url : '/MvcShipping/MsChFee/Save' ,
scope : this ,
params : {
bsno : _thisfee . strBSNO ,
type : type ,
chfeebody : jsonChFeeBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
// if (type == '1') {
// for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) {
// var member = this.storeDrChFee.getAt(i);
// member.set("BsNo", _thisfee.strBSNO);
// member.commit();
// }
//// this.gridDrChFee.unSelectAll();
// } else if (type == '2') {
// for (var i = 0; i < this.storeCrChFee.getCount(); i += 1) {
// var member = this.storeCrChFee.getAt(i);
// member.set("BsNo", _thisfee.strBSNO);
// member.commit();
// }
//// this.gridCrChFee.unSelectAll();
// }
if ( this . FEESAVENOTSAMEAMOUNT == 1 && this . isrepeatfee == 1 ) {
Ext . MessageBox . confirm ( '提示' , '结算对象,金额,币别,费用名称,相同,确定保存?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( Zi . LAN . FEE . ZhengZaiCaoZuoShuJu ) ;
Ext . Ajax . request ( {
waitMsg : Zi . LAN . FEE . ZhengZaiCaoZuoShuJu , //'正在保存数据...',
url : '/MvcShipping/MsChFee/Save' ,
scope : this ,
params : {
bsno : _thisfee . strBSNO ,
type : type ,
chfeebody : jsonChFeeBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
if ( type == 1 ) {
_thisfee . LoadDrChFee ( ) ;
} else if ( type == 2 ) {
_thisfee . LoadCrChFee ( ) ;
} else {
_thisfee . LoadDrChFee ( ) ;
_thisfee . LoadCrChFee ( ) ;
if ( type == 1 ) {
_thisfee . LoadDrChFee ( ) ;
} else if ( type == 2 ) {
_thisfee . LoadCrChFee ( ) ;
} else {
_thisfee . LoadDrChFee ( ) ;
_thisfee . LoadCrChFee ( ) ;
}
} else {
Ext . Msg . show ( { title : Zi . LAN . FEE . ChuoWu , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
} else {
Ext . Msg . show ( {
title : Zi . LAN . FEE . TiShi ,
msg : Zi . LAN . FEE . FuWuQiXiangYingChuCuo ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} else {
return false ;
}
} )
} else {
Ext . Msg . wait ( Zi . LAN . FEE . ZhengZaiCaoZuoShuJu ) ;
Ext . Ajax . request ( {
waitMsg : Zi . LAN . FEE . ZhengZaiCaoZuoShuJu , //'正在保存数据...',
url : '/MvcShipping/MsChFee/Save' ,
scope : this ,
params : {
bsno : _thisfee . strBSNO ,
type : type ,
chfeebody : jsonChFeeBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
Ext . MessageBox . hide ( ) ;
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
if ( type == 1 ) {
_thisfee . LoadDrChFee ( ) ;
} else if ( type == 2 ) {
_thisfee . LoadCrChFee ( ) ;
} else {
_thisfee . LoadDrChFee ( ) ;
_thisfee . LoadCrChFee ( ) ;
}
} else {
Ext . Msg . show ( { title : Zi . LAN . FEE . ChuoWu , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
//this.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
//this.storeChFeeMasterGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
//this.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb },
// callback: function (r, options, success) {
// if (success) {
// _thisfee.setTotalHead();
// }
// }
//});
} else {
Ext . Msg . show ( { title : Zi . LAN . FEE . ChuoWu , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
Ext . Msg . show ( {
title : Zi . LAN . FEE . TiShi ,
msg : Zi . LAN . FEE . FuWuQiXiangYingChuCuo ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
} else {
Ext . Msg . show ( { title : Zi . LAN . FEE . TiShi ,
msg : Zi . LAN . FEE . FuWuQiXiangYingChuCuo ,
icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK
} ) ;
}
}
} ) ;
} ) ;
}
} , //end save
onShenModifyClick : function ( button , event , type ) {
var allow = this . getAllowOperationDetail ( ) ;