Browse Source

收付款单代码提交

hy 6 years ago
parent
commit
4721f81de8

+ 3 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java

@@ -72,7 +72,9 @@ public enum  BillCodeSeq {
 
     PRODUCTUNIT("物料单位", "ProductUnit"),
 
-    VENDAPAMOUNT("供应商期初", "VendApamount");
+    VENDAPAMOUNT("供应商期初", "VendApamount"),
+
+    CUSTARAMOUNT("客户期初", "CustAramount");
 
 
 

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustAramountController.java

@@ -67,4 +67,10 @@ public class CustAramountController {
         return Result.success();
     }
 
+    //根据客户编号+币别查询 客户期初数据
+    @RequestMapping("/getCustArByCustCodeAndCurrency")
+    public Result getCustArByCustCodeAndCurrency(String custCode, String currency) {
+        return Result.success(custAramountService.getCustArByCustCodeAndCurrency(custCode, currency));
+    }
+
 }

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendApamountController.java

@@ -75,4 +75,10 @@ public class VendApamountController {
         return Result.success();
     }
 
+    //根据客户编号+币别查询 客户期初数据
+    @RequestMapping("/getVendApByVendCodeAndCurrency")
+    public Result getVendApByVendCodeAndCurrency(String vendCode, String currency) {
+        return Result.success(vendApamountService.getVendApByVendCodeAndCurrency(vendCode, currency));
+    }
+
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustAramountService.java

@@ -25,4 +25,6 @@ public interface CustAramountService extends CommonBaseService<CustAramountMappe
     void deleteById(Long id);
 
     void saveToFormal(Integer id, boolean update);
+
+    CustAramount getCustArByCustCodeAndCurrency(String custCode, String currency);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendApamountService.java

@@ -27,4 +27,6 @@ public interface VendApamountService extends CommonBaseService<VendApamountMappe
     void deleteById(Long id);
 
     void saveToFormal(Integer id, boolean update);
+
+    VendApamount getVendApByVendCodeAndCurrency(String vendCode, String currency);
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustAramountServiceImpl.java

@@ -118,6 +118,11 @@ public class CustAramountServiceImpl extends CommonBaseServiceImpl<CustAramountM
         }
     }
 
+    public CustAramount getCustArByCustCodeAndCurrency(String custCode,String currency){
+        CustAramount custAramount = getMapper().getCustAramountByCustCodeAndCurrency(custCode,BaseContextHolder.getCompanyId(),currency,0L);
+        return custAramount;
+    }
+
     public DocBaseDTO saveData(CustAramount custAramount){
         DocBaseDTO docBaseDTO = null;
         if(custAramount.getId()==null){custAramount.setId(0L);}

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendApamountServiceImpl.java

@@ -117,6 +117,11 @@ public class VendApamountServiceImpl extends CommonBaseServiceImpl<VendApamountM
         }
     }
 
+    public VendApamount getVendApByVendCodeAndCurrency(String vendCode, String currency){
+        VendApamount vendApamount = getMapper().getVendApamountByVendCodeAndCurrency(vendCode,BaseContextHolder.getCompanyId(),currency,0L);
+        return vendApamount;
+    }
+
     public DocBaseDTO saveData(VendApamount vendApamount){
         DocBaseDTO docBaseDTO = null;
         if(vendApamount.getId()==null){vendApamount.setId(0L);}

+ 0 - 1
frontend/saas-web/app/view/core/chart/ChartBase.js

@@ -27,7 +27,6 @@ Ext.define('saas.view.core.chart.ChartBase', {
                 width: '100%',
                 // listeners: {
                 //     boxready: function() {
-                //         debugger
                 //     }
                 // }
             }),

+ 20 - 2
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -129,7 +129,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         if (!this.fireEvent('beforetriggerclick', this)) {
             return;
         };
-        f.blur(f);
+        f.blur(f,null,null,true);
         //判断dbfindtrigger归属
         f.judge(f); //form
         var panel = f.up('core-tab-panel') || Ext.getCmp('mainView'),
@@ -192,7 +192,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     },
 
     listeners: {
-        blur: function (f, e) {
+        blur: function (f, e, op, isTrigger) {
             var me = f;
             var dbfinds = me.dbfinds,
                 data;
@@ -270,6 +270,15 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                         me.setValue(null);
                     }
                 }
+                if(!isTrigger){
+                    let rec = {
+                        data:{},
+                        get:function(name){
+                            return this.data[name]
+                        }
+                    }
+                    f.aftertrigger(f,rec);
+                }
             } else if (data.length == 1) {
                 me.dbValues = data[0];
                 var dbfinds = me.dbfinds;
@@ -302,6 +311,15 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                         }
                     }
                 }
+                if(!isTrigger){
+                    let rec = {
+                        data:data[0],
+                        get:function(name){
+                            return this.data[name]
+                        }
+                    }
+                    f.aftertrigger(f,rec);
+                }
             }
         },
         select: function (combo, record, eOpts) {

+ 75 - 0
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -53,6 +53,43 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 columnWidth: 0.5,
                 listeners: {
                     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!=''&&currency&&currency!=''&&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',
@@ -67,6 +104,44 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 listeners: {
                     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!=''&&currency&&currency!=''){
+                            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: {
                     xtype: 'numberfield',
                     readOnly: false,

+ 0 - 3
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -15,9 +15,6 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                         }, {
                             from: 've_name',
                             to: 'pb_vendname'
-                        },{
-                            from: 've_leftamount',
-                            to: 've_leftamount'
                         },{
                             from: 'id',
                             to: 'pb_vendid',

+ 75 - 0
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -52,6 +52,43 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 columnWidth: 0.5,
                 listeners: {
                     change: 'clearDetails'
+                },
+                aftertrigger:function(f,record){
+                    let form = f.ownerCt
+                    let custName = f.value
+                    let currency = form.down('[xtype=condbfindtrigger]').items.items[0].value
+                    if(custName&&custName!=''&&currency&&currency!=''&&record.get('cu_code')&&record.get('cu_code')!=''){
+                        Ext.Ajax.request({
+                            url: '/api/document/custaramount/getCustArByCustCodeAndCurrency',
+                            params:{
+                                custCode:record.get('cu_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 ca_leftamount = res.data.ca_leftamount
+                                    form.down('[name=cu_leftamount]').setValue(ca_leftamount)
+                                }else{
+                                    //清除总欠款
+                                    form.down('[name=cu_leftamount]').setValue(0)
+                                }
+                            },
+                            failure: function (response, opts) {
+                                var res = Ext.decode(response.responseText);
+                                saas.util.BaseUtil.showErrorToast('查询总欠款失败: ' + res.message);
+                            }
+                        });
+                    }else{
+                        //清除总欠款
+                        form.down('[name=cu_leftamount]').setValue(0)
+                    }
                 }
             }, {
                 xtype: 'condbfindtrigger',
@@ -66,6 +103,44 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 listeners: {
                     change: 'clearDetails'
                 },
+                mainFieldConfig:{
+                    aftertrigger:function(f,record){
+                        let form = f.ownerCt.ownerCt
+                        let currency = f.value
+                        let custCode = form.down('[name=rb_custcode]').value
+                        if(custCode&&custCode!=''&&currency&&currency!=''){
+                            Ext.Ajax.request({
+                                url: '/api/document/custaramount/getCustArByCustCodeAndCurrency',
+                                params:{
+                                    custCode:custCode,
+                                    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 ca_leftamount = res.data.ca_leftamount
+                                        form.down('[name=cu_leftamount]').setValue(ca_leftamount)
+                                    }else{
+                                        form.down('[name=cu_leftamount]').setValue(0)
+                                    }
+                                },
+                                failure: function (response, opts) {
+                                    var res = Ext.decode(response.responseText);
+                                    saas.util.BaseUtil.showErrorToast('查询总欠款失败: ' + res.message);
+                                }
+                            });
+                        }else{
+                            //清除总欠款
+                            form.down('[name=cu_leftamount]').setValue(0)
+                        }
+                    }
+                },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,

+ 0 - 3
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -16,8 +16,6 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from:'cu_code', to:'rb_custcode'
                         },{
                             from:'cu_name', to:'rb_custname'
-                        },{
-                            from:'cu_leftamount', to:'cu_leftamount'
                         },{
                             from:'cu_currency',to:'rb_currency'
                         },{
@@ -26,7 +24,6 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                     }) ;   
                 }
             },
-
             // 资金账户
             'dbfindtrigger[name=rd_bankname]':{
                 beforerender:function(f){