|
@@ -53,6 +53,43 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
|
|
|
columnWidth: 0.5,
|
|
columnWidth: 0.5,
|
|
|
listeners: {
|
|
listeners: {
|
|
|
change: 'clearDetails'
|
|
change: 'clearDetails'
|
|
|
|
|
+ },
|
|
|
|
|
+ aftertrigger:function(f,record){
|
|
|
|
|
+ let form = f.ownerCt
|
|
|
|
|
+ let vendName = f.value
|
|
|
|
|
+ let currency = form.down('[xtype=condbfindtrigger]').items.items[0].value
|
|
|
|
|
+ if(vendName&&vendName!=''&¤cy&¤cy!=''&&record.get('ve_code')&&record.get('ve_code')!=''){
|
|
|
|
|
+ Ext.Ajax.request({
|
|
|
|
|
+ url: '/api/document/vendapamount/getVendApByVendCodeAndCurrency',
|
|
|
|
|
+ params:{
|
|
|
|
|
+ vendCode:record.get('ve_code'),
|
|
|
|
|
+ currency:currency
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
|
|
+ 'Authorization': saas.util.State.get('session').token,
|
|
|
|
|
+ "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (response, opts) {
|
|
|
|
|
+ var res = Ext.decode(response.responseText);
|
|
|
|
|
+ if(res.success&&res.data){
|
|
|
|
|
+ let va_leftamount = res.data.va_leftamount
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(va_leftamount)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //清除总欠款
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(0)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ failure: function (response, opts) {
|
|
|
|
|
+ var res = Ext.decode(response.responseText);
|
|
|
|
|
+ saas.util.BaseUtil.showErrorToast('查询总欠款失败: ' + res.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //清除总欠款
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(0)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}, {
|
|
}, {
|
|
|
xtype: 'condbfindtrigger',
|
|
xtype: 'condbfindtrigger',
|
|
@@ -67,6 +104,44 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
|
|
|
listeners: {
|
|
listeners: {
|
|
|
change: 'clearDetails'
|
|
change: 'clearDetails'
|
|
|
},
|
|
},
|
|
|
|
|
+ mainFieldConfig:{
|
|
|
|
|
+ aftertrigger:function(f,record){
|
|
|
|
|
+ let form = f.ownerCt.ownerCt
|
|
|
|
|
+ let currency = f.value
|
|
|
|
|
+ let vendCode = form.down('[name=pb_vendcode]').value
|
|
|
|
|
+ if(vendCode&&vendCode!=''&¤cy&¤cy!=''){
|
|
|
|
|
+ Ext.Ajax.request({
|
|
|
|
|
+ url: '/api/document/vendapamount/getVendApByVendCodeAndCurrency',
|
|
|
|
|
+ params:{
|
|
|
|
|
+ vendCode:vendCode,
|
|
|
|
|
+ currency:currency
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
|
|
+ 'Authorization': saas.util.State.get('session').token,
|
|
|
|
|
+ "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (response, opts) {
|
|
|
|
|
+ var res = Ext.decode(response.responseText);
|
|
|
|
|
+ if(res.success&&res.data){
|
|
|
|
|
+ let va_leftamount = res.data.va_leftamount
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(va_leftamount)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(0)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ failure: function (response, opts) {
|
|
|
|
|
+ var res = Ext.decode(response.responseText);
|
|
|
|
|
+ saas.util.BaseUtil.showErrorToast('查询总欠款失败: ' + res.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //清除总欠款
|
|
|
|
|
+ form.down('[name=ve_leftamount]').setValue(0)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
supFieldConfig: {
|
|
supFieldConfig: {
|
|
|
xtype: 'numberfield',
|
|
xtype: 'numberfield',
|
|
|
readOnly: false,
|
|
readOnly: false,
|