浏览代码

币别汇率合并字段设计

zhuth 7 年之前
父节点
当前提交
60d3aa722c
共有 26 个文件被更改,包括 619 次插入241 次删除
  1. 5 10
      frontend/saas-web/app/util/FormUtil.js
  2. 100 0
      frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js
  3. 15 0
      frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.scss
  4. 12 1
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  5. 13 0
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  6. 44 19
      frontend/saas-web/app/view/core/form/FormPanel.js
  7. 9 9
      frontend/saas-web/app/view/document/customer/FormController.js
  8. 35 13
      frontend/saas-web/app/view/document/customer/FormPanel.js
  9. 9 9
      frontend/saas-web/app/view/document/vendor/FormController.js
  10. 36 14
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  11. 32 11
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  12. 11 11
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  13. 33 11
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  14. 11 11
      frontend/saas-web/app/view/money/othspendings/FormPanelController.js
  15. 33 11
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  16. 11 11
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  17. 33 11
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  18. 11 11
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  19. 33 11
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  20. 11 11
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  21. 33 11
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  22. 11 11
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  23. 33 11
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  24. 11 11
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  25. 23 1
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  26. 11 11
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js

+ 5 - 10
frontend/saas-web/app/util/FormUtil.js

@@ -282,26 +282,21 @@ Ext.define('saas.util.FormUtil', {
                     Ext.applyIf(item, {
                         maxLength: 50
                     });
-                }
-                
-                if(item.xtype == 'datefield') {
+                }else if(item.xtype == 'datefield') {
                     Ext.applyIf(item, {
                         editable: false,
                         format: 'Y-m-d'
                     });
-                }
-
-                if(item.xtype == 'numberfield') {
+                }else if(item.xtype == 'numberfield') {
                     Ext.applyIf(item, {
                         hideTrigger: true, // 隐藏trigger
                         mouseWheelEnabled: false // 取消滚轮事件
                     });
                     // 设置默认值为0
                     formModel.set(item.name, 0);
-                }
-
-                // 如果是从表为其绑定store
-                if(item.xtype == 'detailGridField') {
+                }else if(item.xtype == 'condbfindtrigger') {
+                    item.isConField = true;
+                }else if(item.xtype == 'detailGridField') {
                     let index = form.detailCount;
                     let columns = item.columns,
                     cnames = columns.filter(function(c) {

+ 100 - 0
frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js

@@ -0,0 +1,100 @@
+/**
+ * 放大镜组合字段
+ */
+Ext.define('saas.view.core.form.field.ConDbfindTrigger', {
+    extend: 'Ext.form.FieldContainer',
+    alias: 'widget.condbfindtrigger',
+
+    cls: 'x-confield',
+
+    layout: 'hbox',
+    height: 32,
+    
+    isConField: true,
+
+    // 额外字段自定义替换属性
+    supFieldConfig: {},
+
+    initComponent: function() {
+        var me = this,
+        allowBlank = Ext.isBoolean(me.allowBlank) ? me.allowBlank : true,
+        dbType = me.dbType,
+        dbfinds = me.dbfinds,
+        name0 = dbfinds[0].to,
+        name1 = dbfinds[1].to;
+
+        Ext.apply(me, {
+            items: [{
+                xtype: dbType,
+                name: name0,
+                allowBlank: allowBlank,
+                msgTarget: 'none',
+                bind: {
+                    value: '{' + name0 + '}'
+                },
+                dbfinds: dbfinds,
+                flex: 0.5,
+                listeners: {
+                    validChange: function() {
+                        me.fireEvent('validChange');
+                    },
+                    validitychange: function() {
+                        me.items.items[1].isValid();
+                        me.fireEvent('validitychange');
+                    },
+                    change: function(f) {
+                        var field1 = me.items.items[1];
+                        if(f.dbValues) {
+                            var value = f.dbValues[f.dbfinds[1].from];
+                            field1.setValue(value);
+                            field1.publishState('value', value);
+                        }
+                    },
+                    blur: function() {
+                        this.fireEvent('change', this)
+                    }
+                }
+            }, Ext.Object.merge({
+                xtype: 'textfield',
+                name: name1,
+                allowBlank: allowBlank,
+                readOnly: true,
+                defaultReadOnly: true,
+                bind: {
+                    value: '{' + name1 + '}'
+                },
+                flex: 0.5
+            }, me.supFieldConfig)]
+        });
+        me.callParent(arguments);
+    },
+
+    listeners: {
+        afterrender: function(me) {
+            me.items.items[1].on('validChange', function() {
+                me.fireEvent('validChange');
+            });
+            me.items.items[1].on('validitychange', function() {
+                me.items.items[0].isValid();
+                me.fireEvent('validitychange');
+            });
+        }
+    },
+
+    setValue: function(values) {
+        var me = this,
+        name0 = dbfinds[0].to,
+        name1 = dbfinds[1].to;
+
+        me.items.items[0].setValue(values[name0]);
+        me.items.items[1].setValue(values[name1]);
+    },
+    
+    isValid: function() {
+        return this.items.items[0].isValid() && this.items.items[1].isValid();
+    },
+
+    isDirty: function() {
+        return this.items.items[0].isDirty() && this.items.items[1].isDirty();
+    }
+});

+ 15 - 0
frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.scss

@@ -0,0 +1,15 @@
+.x-confield {
+    .x-field {
+        &:first-child {
+            .x-form-trigger-wrap {
+                border-radius: 2px 0 0 2px;
+            }
+        }
+        &:last-child {
+            .x-form-trigger-wrap {
+                border-radius: 0 2px 2px 0;
+                border-left: none;
+            }
+        }
+    }
+}

+ 12 - 1
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -114,6 +114,9 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         itemClick: function(view,record) {
             var me = this;
             var dbfinds = me.dbfinds;
+            var ownerTrigger = me.ownerCt.trigger;
+            ownerTrigger.dbValues = record.data;
+
             if(dbfinds&&dbfinds.length>0){
                 if(me.belong=='grid'){
                     for (let index = 0; index < dbfinds.length; index++) {
@@ -141,8 +144,16 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                             }    
                         }
                     }
+                }else {
+                    var dbfind = Ext.Array.findBy(dbfinds, function(d) {
+                        return d.to = ownerTrigger.name;
+                    });
+                    if(dbfind) {
+                        ownerTrigger.setValue(record.get(dbfind.from));
+                    }
                 }
-                me.ownerCt.trigger.aftertrigger(me.ownerCt.trigger,record);
+                
+                ownerTrigger.aftertrigger(ownerTrigger,record);
             }
             me.ownerCt.close();
         }

+ 13 - 0
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -236,6 +236,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 });
             }
             if (!f.value || f.value == '' || data.length > 1 || data.length == 0) {
+                me.dbValues = {};
                 if (dbfinds && dbfinds.length > 0) {
                     if (me.belong == 'grid') {
                         for (let index = 0; index < dbfinds.length; index++) {
@@ -265,9 +266,12 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                                 }
                             }
                         }
+                    }else {
+                        me.setValue(null);
                     }
                 }
             } else if (data.length == 1) {
+                me.dbValues = data[0];
                 var dbfinds = me.dbfinds;
                 if (dbfinds && dbfinds.length > 0) {
                     if (me.belong == 'grid') {
@@ -303,6 +307,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         select: function (combo, record, eOpts) {
             var me = combo;
             var dbfinds = me.dbfinds;
+            me.dbValues = record.data;
             if (dbfinds && dbfinds.length > 0) {
                 if (me.belong == 'grid') {
                     for (let index = 0; index < dbfinds.length; index++) {
@@ -330,7 +335,15 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                             }
                         }
                     }
+                }else {
+                    var dbfind = Ext.Array.findBy(dbfinds, function(d) {
+                        return d.to = me.name;
+                    });
+                    if(dbfind) {
+                        me.setValue(record.get(dbfind.from));
+                    }
                 }
+                
                 me.aftertrigger(me, record);
             }
         }

+ 44 - 19
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -395,7 +395,8 @@ Ext.define('saas.view.core.form.FormPanel', {
             bind = item.bind,
             name = item.name,
             ignore = item.ignore,
-            defaultValue = item.defaultValue;
+            defaultValue = item.defaultValue,
+            isConField = item.isConField;
 
             item.listeners = item.listeners || {};
             item.listeners.validChange = function() {
@@ -415,29 +416,53 @@ Ext.define('saas.view.core.form.FormPanel', {
                 item.defaultReadOnly = item.readOnly;
             }
 
-            if (bind) {
-                if (!Ext.isString(bind)) {
-                    Ext.apply(bind, {
-                        value: '{' + name + '}'
-                    });
+            // 如果是组合放大镜
+            if(isConField) {
+                let names = item.dbfinds.map(function(d) {
+                    return d.to;
+                });
+
+                // 设置默认值
+                if (defaultValue != undefined) {
+                    
+
+                    for(let x = 0; x < names.length; x++) {
+                        viewModel.set(names[x], defaultValue[names[x]]);
+                    }
+                }
+
+                // 设置model绑定
+                if (!ignore) {
+                    for(let x = 0; x < names.length; x++) {
+                        if(!Ext.Array.contains(bindFields, names[x])) {
+                            bindFields.push(names[x]);
+                        }
+                    }
+                }
+            }else {
+                if (bind) {
+                    if (!Ext.isString(bind)) {
+                        Ext.apply(bind, {
+                            value: '{' + name + '}'
+                        });
+                    } else {
+                        item.bind = '{' + name + '}';
+                    }
                 } else {
                     item.bind = '{' + name + '}';
                 }
-            } else {
-                item.bind = '{' + name + '}';
-            }
-            // 设置默认值
-            if (defaultValue != undefined) {
-                viewModel.set(name, defaultValue);
-            }
-
-            // 设置model绑定
-            if (!ignore) {
-                if(!Ext.Array.contains(bindFields, name)) {
-                    bindFields.push(name);
+                // 设置默认值
+                if (defaultValue != undefined) {
+                    viewModel.set(name, defaultValue);
+                }
+    
+                // 设置model绑定
+                if (!ignore) {
+                    if(!Ext.Array.contains(bindFields, name)) {
+                        bindFields.push(name);
+                    }
                 }
             }
-            
         });
         viewModel.set('base.bindFields', bindFields);
     },

+ 9 - 9
frontend/saas-web/app/view/document/customer/FormController.js

@@ -18,15 +18,15 @@ Ext.define('saas.view.document.customer.FormController', {
                     }) ;   
                 }
             },
-            'currencyDbfindTrigger[name=cu_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'cu_currency'
-                        }],
-                    }) ;   
-                }
-            }
+            // 'currencyDbfindTrigger[name=cu_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'cu_currency'
+            //             }],
+            //         }) ;   
+            //     }
+            // }
         });
     },
 

+ 35 - 13
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -132,21 +132,43 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 columnWidth: 0.25,
                 group: '交易信息',
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "cu_currency",
-                fieldLabel: "币别",
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
                 allowBlank: false,
-                columnWidth: 0.25,
-                group: '交易信息',
-            }, {
-                xtype: "numberfield",
-                name: "cu_taxrate",
-                fieldLabel: "税率(%)",
-                allowBlank: false,
-                columnWidth: 0.25,
-                minValue: 0,
-                maxValue: 100,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'cu_currency'
+                }, {
+                    from: 'cr_rate', to: 'cu_taxrate'
+                }],
+                defaultValue: {
+                    cu_currency: 'RMB',
+                    cu_taxrate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                },
                 group: '交易信息',
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "cu_currency",
+            //     fieldLabel: "币别",
+            //     allowBlank: false,
+            //     columnWidth: 0.25,
+            //     group: '交易信息',
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "cu_taxrate",
+            //     fieldLabel: "税率(%)",
+            //     allowBlank: false,
+            //     columnWidth: 0.25,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
+            //     group: '交易信息',
             },{
                 xtype: "numberfield",
                 hideTrigger: true,

+ 9 - 9
frontend/saas-web/app/view/document/vendor/FormController.js

@@ -19,15 +19,15 @@ Ext.define('saas.view.document.vendor.FormController', {
 
                 }
             },
-            'currencyDbfindTrigger[name=ve_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'ve_currency'
-                        }],
-                    }) ;   
-                }
-            }
+            // 'currencyDbfindTrigger[name=ve_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'ve_currency'
+            //             }],
+            //         }) ;   
+            //     }
+            // }
         });
 
     },

+ 36 - 14
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -137,23 +137,45 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 allowBlank: true,
                 columnWidth: 0.25,
                 group: '交易信息',
-            },{
-                xtype: "currencyDbfindTrigger",
-                name: "ve_currency",
-                fieldLabel: "币别",
-                allowBlank: false,
-                columnWidth: 0.25,
-                group: '交易信息',
             }, {
-                xtype: "numberfield",
-                name: "ve_taxrate",
-                hideTrigger: true,
-                fieldLabel: "税率(%)",
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
                 allowBlank: false,
-                columnWidth: 0.25,
-                minValue: 0,
-                maxValue: 100,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 've_currency'
+                }, {
+                    from: 'cr_rate', to: 've_taxrate'
+                }],
+                defaultValue: {
+                    ve_currency: 'RMB',
+                    ve_taxrate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                },
                 group: '交易信息',
+            // },{
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "ve_currency",
+            //     fieldLabel: "币别",
+            //     allowBlank: false,
+            //     columnWidth: 0.25,
+            //     group: '交易信息',
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "ve_taxrate",
+            //     hideTrigger: true,
+            //     fieldLabel: "税率(%)",
+            //     allowBlank: false,
+            //     columnWidth: 0.25,
+            //     minValue: 0,
+            //     maxValue: 100,
+            //     group: '交易信息',
             },{
                 xtype: "numberfield",
                 hideTrigger: true,

+ 32 - 11
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -62,18 +62,39 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 fieldLabel: '单据日期',
                 defaultValue: new Date(),
                 allowBlank: false
-            },{
-                xtype: "currencyDbfindTrigger",
-                name: "or_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
             }, {
-                xtype: "numberfield",
-                name: "or_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'or_currency'
+                }, {
+                    from: 'cr_rate', to: 'or_rate'
+                }],
+                defaultValue: {
+                    or_currency: 'RMB',
+                    or_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                },
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "or_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "or_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 11 - 11
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -106,17 +106,17 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
 
                 }
             },
-            'currencyDbfindTrigger[name=or_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'or_currency'
-                        },{
-                            from:'cr_rate',to:'or_rate'
-                        }],
-                    }) ;   
-                }
-            }
+            // 'currencyDbfindTrigger[name=or_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'or_currency'
+            //             },{
+            //                 from:'cr_rate',to:'or_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // }
         });
     },
     onSave: function() {

+ 33 - 11
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -56,18 +56,40 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 name: "os_bankname",
                 fieldLabel: "账户名称",
                 allowBlank: false
-            },{
-                xtype: "currencyDbfindTrigger",
-                name: "os_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
             }, {
-                xtype: "numberfield",
-                name: "os_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'os_currency'
+                }, {
+                    from: 'cr_rate', to: 'os_rate'
+                }],
+                defaultValue: {
+                    os_currency: 'RMB',
+                    os_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            // },{
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "os_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "os_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             }, {
                 xtype: 'datefield',
                 name: 'os_date',

+ 11 - 11
frontend/saas-web/app/view/money/othspendings/FormPanelController.js

@@ -97,17 +97,17 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
 
                 }
             },
-            'currencyDbfindTrigger[name=os_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'os_currency'
-                        },{
-                            from:'cr_rate',to:'os_rate'
-                        }],
-                    }) ;   
-                }
-            }
+            // 'currencyDbfindTrigger[name=os_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'os_currency'
+            //             },{
+            //                 from:'cr_rate',to:'os_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // }
         });
 
     },

+ 33 - 11
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -74,17 +74,39 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     this.dialog.show();
                 }
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "pu_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
-            }, {
-                xtype: "numberfield",
-                name: "pu_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pu_currency'
+                }, {
+                    from: 'cr_rate', to: 'pu_rate'
+                }],
+                defaultValue: {
+                    pu_currency: 'RMB',
+                    pu_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "pu_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "pu_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 11 - 11
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -68,17 +68,17 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
 
                 }
             },
-            'currencyDbfindTrigger[name=pu_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'pu_currency'
-                        },{
-                            from:'cr_rate',to:'pu_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=pu_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'pu_currency'
+            //             },{
+            //                 from:'cr_rate',to:'pu_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
         });
     },
 

+ 33 - 11
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -72,17 +72,39 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 columnWidth: 0.25,
                 defaultValue: new Date()
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "pi_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
-            }, {
-                xtype: "numberfield",
-                name: "pi_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pi_currency'
+                }, {
+                    from: 'cr_rate', to: 'pi_rate'
+                }],
+                defaultValue: {
+                    pi_currency: 'RMB',
+                    pi_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                },
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "pi_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "pi_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             },{
                 xtype: "hidden",
                 name: "pi_puid",

+ 11 - 11
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -92,17 +92,17 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                     }) ;   
                 }
             },
-            'currencyDbfindTrigger[name=pi_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'pi_currency'
-                        },{
-                            from:'cr_rate',to:'pi_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=pi_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'pi_currency'
+            //             },{
+            //                 from:'cr_rate',to:'pi_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
 
         });
 

+ 33 - 11
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -68,17 +68,39 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 columnWidth: 0.25,
                 defaultValue: new Date()
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "pi_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
-            }, {
-                xtype: "numberfield",
-                name: "pi_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pi_currency'
+                }, {
+                    from: 'cr_rate', to: 'pi_rate'
+                }],
+                defaultValue: {
+                    pi_currency: 'RMB',
+                    pi_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "pi_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "pi_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             }, {
                 xtype: "hidden",
                 name: "pi_puid",

+ 11 - 11
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -95,17 +95,17 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                     }) ;   
                 }
             },
-            'currencyDbfindTrigger[name=pi_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'pi_currency'
-                        },{
-                            from:'cr_rate',to:'pi_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=pi_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'pi_currency'
+            //             },{
+            //                 from:'cr_rate',to:'pi_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
         });
 
     },

+ 33 - 11
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -96,17 +96,39 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 storeUrl: '/api/document/customer/getAddressCombo',
                 hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "sa_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
-            }, {
-                xtype: "numberfield",
-                name: "sa_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'sa_currency'
+                }, {
+                    from: 'cr_rate', to: 'sa_rate'
+                }],
+                defaultValue: {
+                    sa_currency: 'RMB',
+                    sa_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "sa_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "sa_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             },{
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 11 - 11
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -96,17 +96,17 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                     }
                 }
             },
-            'currencyDbfindTrigger[name=sa_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'sa_currency'
-                        },{
-                            from:'cr_rate',to:'sa_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=sa_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'sa_currency'
+            //             },{
+            //                 from:'cr_rate',to:'sa_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
         });
 
     },

+ 33 - 11
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -104,17 +104,39 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 storeUrl: '/api/document/customer/getAddressCombo',
                 hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
-                xtype: "currencyDbfindTrigger",
-                name: "pi_currency",
-                fieldLabel: "币别",
-                defaultValue: 'RMB'
-            }, {
-                xtype: "numberfield",
-                name: "pi_rate",
-                fieldLabel: "汇率",
-                defaultValue: 1,
-                decimalPrecision: 6,
-                vtype: 'positiveNumber'
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pi_currency'
+                }, {
+                    from: 'cr_rate', to: 'pi_rate'
+                }],
+                defaultValue: {
+                    pi_currency: 'RMB',
+                    pi_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            // }, {
+            //     xtype: "currencyDbfindTrigger",
+            //     name: "pi_currency",
+            //     fieldLabel: "币别",
+            //     defaultValue: 'RMB'
+            // }, {
+            //     xtype: "numberfield",
+            //     name: "pi_rate",
+            //     fieldLabel: "汇率",
+            //     defaultValue: 1,
+            //     decimalPrecision: 6,
+            //     vtype: 'positiveNumber'
             },{
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 11 - 11
frontend/saas-web/app/view/sale/saleIn/FormPanelController.js

@@ -111,17 +111,17 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                     }
                 }
             },
-            'currencyDbfindTrigger[name=pi_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'pi_currency'
-                        },{
-                            from:'cr_rate',to:'pi_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=pi_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'pi_currency'
+            //             },{
+            //                 from:'cr_rate',to:'pi_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
         });
     }
 });

+ 23 - 1
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -112,7 +112,29 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 allowBlank: false,
                 storeUrl: '/api/document/customer/getAddressCombo',
                 hiddenBtn: true, //true 则会关闭新增按钮功能
-            },{
+            }, {
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pi_currency'
+                }, {
+                    from: 'cr_rate', to: 'pi_rate'
+                }],
+                defaultValue: {
+                    pi_currency: 'RMB',
+                    pi_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
+            }, {
                 xtype: "currencyDbfindTrigger",
                 name: "pi_currency",
                 fieldLabel: "币别",

+ 11 - 11
frontend/saas-web/app/view/sale/saleOut/FormPanelController.js

@@ -103,17 +103,17 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                     }
                 }
             },
-            'currencyDbfindTrigger[name=pi_currency]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cr_name',to:'pi_currency'
-                        },{
-                            from:'cr_rate',to:'pi_rate'
-                        }],
-                    }) ;   
-                }
-            },
+            // 'currencyDbfindTrigger[name=pi_currency]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dbfinds:[{
+            //                 from:'cr_name',to:'pi_currency'
+            //             },{
+            //                 from:'cr_rate',to:'pi_rate'
+            //             }],
+            //         }) ;   
+            //     }
+            // },
         });
     },
     turnProdIn: function() {