'20221020-1'

临时发布20240103
ddlucky 2 years ago
parent 49fb876b5e
commit 1c365a08d7

@ -157,6 +157,8 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
var curr = this.formADVANCE.getForm().findField('ADVANCE_CURRENCY');
curr.setValue(records[0].data.CURR);
this.LoadDateCurr(true);
}
}
}
@ -173,6 +175,7 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
this.comboxStlMode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SettlementType,
store: this.StoreStlMode,
flex:0.5,
forceSelection: true,
name: 'SETTLETYPE',
valueField: 'STLCODE',
@ -325,12 +328,14 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
}, {
fieldLabel: 'HXBILLNO',
name: 'HXBILLNO', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '汇率',
hidden: true,
name: 'RATE'
},
// {
// fieldLabel: '汇率',
// hidden: true,
// name: 'RATE'
//},
{
fieldLabel: Zi.LAN.BillNo,
readOnly: true,
@ -343,7 +348,12 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
fieldLabel: Zi.LAN.SettlementTime,
format: 'Y-m-d H:i:s',
xtype: 'datefield',
name: 'SETTLETIME'
name: 'SETTLETIME',
listeners: {
change: function () {
_this.LoadDateCurr(true);
}
}
}, {
fieldLabel: Zi.LAN.SettlementUser,
readOnly: true,
@ -377,7 +387,14 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
}
return value;
}
}, this.comboxStlMode, this.comboxBANK, {
}, this.comboxStlMode, {
fieldLabel: Zi.LAN.ExchangeRate,
flex: 0.5,
labelWidth: 50,
name: 'RATE'
}, this.comboxBANK
, {
fieldLabel: Zi.LAN.SettlementNo,
flex: 1,
name: 'SETTLENO'
@ -3182,6 +3199,8 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
_this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: data.BILLNO } });
if (_this.opStatus == 'add') {
_this.formEdit.getForm().findField('CURR').setValue('');
_this.formEdit.getForm().findField('RATE').setValue(1);
}
_this.storeBodyList.load({ params: { billno: billno },
callback: function (r, options, success) {
@ -3471,12 +3490,15 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
var CUSTOMERNAME = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
var CURR = this.formEdit.getForm().findField('CURR').getValue();
if (addcurr == '') {
if ((CURR == '') || (CURR == null))
if ((CURR == '') || (CURR == null)) {
this.formEdit.getForm().findField('CURR').setValue('RMB');
this.formEdit.getForm().findField('RATE').setValue(1);
}
} else {
if ((CURR == '') || (CURR == null))
if ((CURR == '') || (CURR == null)) {
this.formEdit.getForm().findField('CURR').setValue(addcurr);
}
}
//if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null) || (CURR == '') || (CURR == null)) {
var selectedRecords = this.gridAddFeeList.selModel.getSelection();
if (selectedRecords.length > 0) {
@ -3485,12 +3507,61 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
var addcurr2 = rec.data.CURR;
if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null))
this.formEdit.getForm().findField('CUSTOMERNAME').setValue(cust);
if ((CURR == '') || (CURR == null)) {
if (addcurr2 != '')
this.formEdit.getForm().findField('CURR').setValue(addcurr2);
else {
if (rec.data.BALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('RMB');
else if (rec.data.USDBALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('USD');
//if ((CURR == '') || (CURR == null)) {
// if (addcurr2 != '')
// this.formEdit.getForm().findField('CURR').setValue(addcurr2);
// else {
// if (rec.data.BALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('RMB');
// else if (rec.data.USDBALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('USD');
// }
//}
if (CURR != curr) {
this.formEdit.getForm().findField('CURR').setValue(curr);
if (curr == 'RMB') {
this.formEdit.getForm().findField('RATE').setValue(1);
} else {
//var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', curr);
//if (FFrecords.getCount() > 0) {
// var ffdata = FFrecords.getAt(0).data;
// var DEFRATE = ffdata.DEFRATE;
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
//} else {
// var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', curr);
// if (DFrecords.getCount() > 0) {
// var dfdata = DFrecords.getAt(0).data;
// var DEFRATE = dfdata.DEFRATE;
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
// } else {
// this.formEdit.getForm().findField('RATE').setValue(1);
// }
//}
this.LoadDateCurr()
}
//this.LoadDateCurr();
////等待300毫秒后重新执行
//_return = true;
//setTimeout(this.addDetail, 300);
} else {
var CUST = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
var recs = DsStoreQueryBy(this.storeCustCode, 'CustName', CUST);
var CUSTBANK = this.formEdit.getForm().findField('CUSTBANK');
var CUSTACCOUNT = this.formEdit.getForm().findField('CUSTACCOUNT');
var CURR = this.formEdit.getForm().findField('CURR').getValue();
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
if (CURR == 'RMB') {
CUSTBANK.setValue(data.RMBBank);
CUSTACCOUNT.setValue(data.RMBAccount);
} else if (CURR == 'USD') {
CUSTBANK.setValue(data.USDBank);
CUSTACCOUNT.setValue(data.USDAccount);
}
} else {
CUSTBANK.setValue('');
CUSTACCOUNT.setValue('');
}
}
this.formEdit.getForm().findField('SETTLETYPE').setValue(rec.data.SETTLETYPE);
@ -5389,7 +5460,125 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
}
win.show();
}
//#endregion
//#endregion
//#region 载入汇率信息
,
async LoadDateCurr(needload = false) {
_this = this;
var DateStr = _this.formEdit.getForm().findField("SETTLETIME").getRawValue();
if (needload) {
this.StoreDateCurr.load({
async: false,
params: {
DateStr: DateStr
},
callback: function (r, options, success) {
if (success) {
if (_this.StoreDateCurr.getCount() > 0) {
for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
var member = _this.StoreDateCurr.getAt(i);
if (member.data.CURR == CURR) {
this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
}
}
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
var DEFRATE = dfdata.DEFRATE;
this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
} else {
this.formEdit.getForm().findField('RATE').setValue(1);
}
}
}
},
scope: this
});
}
var CURR = this.formEdit.getForm().findField('CURR').getValue();
if (CURR == 'RMB') {
this.StoreDateCurr.load({
params: {
DateStr: DateStr
},
callback: function (r, options, success) {
if (success) {
//_this.LoadDateCurr();
}
},
scope: this
});
this.formEdit.getForm().findField('RATE').setValue(1);
} else {
if (_this.StoreDateCurr.getCount() > 0) {
for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
var member = _this.StoreDateCurr.getAt(i);
if (member.data.CURR == CURR) {
this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
}
}
return;
} else {
this.StoreDateCurr.load({
async: false,
params: {
DateStr: DateStr
},
callback: function (r, options, success) {
if (success) {
_this.LoadDateCurr();
}
},
scope: this
});
}
//await this.StoreDateCurr.load({
// async:false,
// params: {
// DateStr: DateStr
// },
// callback: function (r, options, success) {
// if (success) {
// if (_this.StoreDateCurr.getCount() > 0) {
// for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
// var member = _this.StoreDateCurr.getAt(i);
// if (member.data.CURR == CURR) {
// this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
// }
// }
// } else {
// var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
// if (DFrecords.getCount() > 0) {
// var dfdata = DFrecords.getAt(0).data;
// var DEFRATE = dfdata.DEFRATE;
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
// } else {
// this.formEdit.getForm().findField('RATE').setValue(1);
// }
// }
// }
// },
// scope: this
//});
}
}
//#endregion
});

@ -4096,6 +4096,7 @@ Ext.extend(Shipping.MsChRecvSettlementBLEdit, Ext.Panel, {
}
var data = result.data;
_this.formEdit.getForm().findField('BILLSTATUS').setDisabled(false);
_this.formEdit.getForm().findField('SETTLEUSERREF').setDisabled(false);
_this.formEdit.getForm().reset();
@ -4114,6 +4115,7 @@ Ext.extend(Shipping.MsChRecvSettlementBLEdit, Ext.Panel, {
_this.formREMITTANCE.getForm().setValues(data);
if (_this.opStatus == 'add') {
_this.formEdit.getForm().findField('CURR').setValue('');
_this.formEdit.getForm().findField('RATE').setValue(1);
}
_this.formEdit.getForm().findField('BILLSTATUS').setDisabled(true);
_this.formEdit.getForm().findField('SETTLEUSERREF').setDisabled(true);

Loading…
Cancel
Save