Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

guq 7 years ago
parent
commit
d192fa18e1

+ 1 - 2
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -85,9 +85,8 @@
         select  *  from sale left join saledetail on sa_id=sd_said left join product
         on sd_prodid = pr_id and sale.companyId = product.companyid
         <where>
-            sa_statuscode='AUDITED'
             <if test="con != null">
-               and  ${con}
+                ${con}
             </if>
             <if test="companyId != null">
                 and   sale.companyId = #{companyId}

+ 8 - 4
frontend/saas-web/app/model/purchase/ProdInDetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.ProdInDetail', {
         { name: 'pd_netprice', type: 'float'}, // 单价
         { name: 'pd_orderprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_inqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_netprice', 'pd_inqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_orderprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_orderprice') * rec.get('pd_inqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_orderprice', 'pd_inqty']
         },

+ 8 - 4
frontend/saas-web/app/model/purchase/ProdOutDetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.ProdOutDetail', {
         { name: 'pd_netprice', type: 'float' }, // 单价
         { name: 'pd_orderprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_netprice', 'pd_outqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_orderprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_orderprice') * rec.get('pd_outqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_orderprice', 'pd_outqty']
         },

+ 8 - 4
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.Purchasedetail', {
         },
         { name: 'pd_price', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_taxprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_taxprice') * (1 + rec.get('pd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['pd_taxprice', 'pd_taxrate']
         },
         { name: 'pd_taxtotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_taxprice') * rec.get('pd_qty');
+                var t = rec.get('pd_taxprice') * rec.get('pd_qty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_taxprice', 'pd_qty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_total') - rec.get('pd_taxtotal');
+                var t = rec.get('pd_total') - rec.get('pd_taxtotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_total', 'pd_taxtotal']
         },
         { name: 'pd_total', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_price') * rec.get('pd_qty');
+                var t = rec.get('pd_price') * rec.get('pd_qty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_price', 'pd_qty']
         },

+ 8 - 4
frontend/saas-web/app/model/sale/SaleInDetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.sale.SaleInDetail', {
         },
         { name: 'pd_sendprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_inqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_netprice', 'pd_inqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float',// 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_sendprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_sendprice') * rec.get('pd_inqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_sendprice', 'pd_inqty']
         },

+ 8 - 4
frontend/saas-web/app/model/sale/SaleOutDetail.js

@@ -19,25 +19,29 @@ Ext.define('saas.model.sale.SaleOutDetail', {
         { name: 'pd_netprice', type: 'float' }, // 单价
         { name: 'pd_sendprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_netprice', 'pd_outqty']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_sendprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_sendprice') * rec.get('pd_outqty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_sendprice', 'pd_outqty']
         },
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },

+ 8 - 4
frontend/saas-web/app/model/sale/Saledetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.sale.Saledetail', {
         },
         { name: 'sd_price', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('sd_netprice') * (1 + rec.get('sd_taxrate') / 100);
+                var t = rec.get('sd_netprice') * (1 + rec.get('sd_taxrate') / 100);
+                return saas.util.BaseUtil.numberFormat(t, 4, true);
             },
             depends: ['sd_netprice', 'sd_taxrate']
         },
         { name: 'sd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('sd_netprice') * rec.get('sd_qty');
+                var t = rec.get('sd_netprice') * rec.get('sd_qty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['sd_netprice', 'sd_qty']
         },
         { name: 'sd_taxrate', type: 'float' }, // 税率
         { name: 'sd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('sd_total') - rec.get('sd_nettotal');
+                var t = rec.get('sd_total') - rec.get('sd_nettotal');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['sd_total', 'sd_nettotal']
         },
         { name: 'sd_total', type: 'float',// 价税合计
             convert: function(v, rec) {
-                return rec.get('sd_price') * rec.get('sd_qty');
+                var t = rec.get('sd_price') * rec.get('sd_qty');
+                return saas.util.BaseUtil.numberFormat(t, 2, true);
             },
             depends: ['sd_price', 'sd_qty']
         },

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.scss

@@ -3,7 +3,7 @@
     .x-querygrid-code-column {
 
         .x-grid-cell-inner {
-            color: #53b0f3;
+            color: #3e80f6;
             cursor: pointer;
         }
     }

+ 0 - 1
frontend/saas-web/app/view/home/infoCardList/InfoList.scss

@@ -6,7 +6,6 @@
     .x-code-column {
 
         .x-grid-cell-inner {
-            text-decoration: underline;
             color: #3E80F6;
             cursor: pointer;
         }

+ 2 - 2
frontend/saas-web/app/view/main/Main.js

@@ -67,10 +67,10 @@ Ext.define('saas.view.main.Main', {
                 },
                 {
                     margin:'0 3 0 6',
-                    iconCls:'x-fa fa-share-alt-square',
+                    iconCls:'x-fa fa-share-square',
                     cls:'sa-nav-button',
                     ui: 'header',
-                    tooltip: '企业分享',
+                    tooltip: '邀请同事',
                     handler:'shareCompany'
                 },
                 {

+ 17 - 10
frontend/saas-web/app/view/main/MainController.js

@@ -244,10 +244,10 @@ Ext.define('saas.view.main.MainController', {
         //打开分享窗口
         var win = Ext.create('Ext.window.Window', {  
             cls:'x-window-dbfind', 
-            height: 385,
-            width: 350,
+            height: 415,
+            width: 550,
             modal:true,
-            title: '分享企业',
+            title: '邀请同事',
             bodyPadding: 10,
             constrain: true,
             closable: true,
@@ -257,7 +257,7 @@ Ext.define('saas.view.main.MainController', {
                 xtype:'tabpanel',
                 cls:'x-tab-shareTab',
                 items:[{
-                    title:'二维码分享',
+                    title:'二维码邀请',
                     xtype:'panel',
                     layout: {
                         type: 'vbox',
@@ -267,7 +267,7 @@ Ext.define('saas.view.main.MainController', {
                         width:180,
                         height:180,
                         xtype: 'image',
-                        margin:'35 0 0 0',
+                        margin:'25 0 0 0',
                         padding:'5',
                         style:'border: 1px solid #000;',
                         src:'resources/images/default/basePhoto.png',
@@ -276,17 +276,20 @@ Ext.define('saas.view.main.MainController', {
                         listeners:{
                             afterrender:function(f){
                                 var serverOptions = Ext.manifest.server;
-                                var delay = 15;//天
+                                var delay = 1;//天
                                 var basePath = serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath;
-                                f.setSrc('/api/commons/share/qrcode?basePath='+basePath)
+                                f.setSrc('/api/commons/share/qrcode?basePath='+basePath+'&delay='+delay)
                             }
                         }
                     },{
                         xtype:'displayfield',
                         value:'扫描二维码分享至微信/QQ'
+                    },{
+                        xtype:'displayfield',
+                        value:'(分享后'+'<font style="color:#ff0000;">24小时</font>'+'内有效)'
                     }]
                 },{
-                    title:'链接分享',
+                    title:'链接邀请',
                     xtype:'panel',
                     layout: {
                         type: 'vbox',
@@ -298,8 +301,8 @@ Ext.define('saas.view.main.MainController', {
                         value:'复制以下链接分享给好友'
                     },{
                         xtype:'textfield',
-                        width:200,
-                        value:'https://www.usoftchina.com?admin=false&_noc=0'
+                        width:500,
+                        value:'https://saas.usoftchina.com?admin=false&_noc=0'
                     },{
                         margin:'10 0 0 0',
                         width:110,
@@ -319,6 +322,10 @@ Ext.define('saas.view.main.MainController', {
                             document.body.removeChild(target);
                             saas.util.BaseUtil.showSuccessToast('复制链接成功');
                         }
+                    },{
+                        margin:'10 0 0 0',
+                        xtype:'displayfield',
+                        value:'(分享后'+'<font style="color:#ff0000;">24小时</font>'+'内有效)'
                     }]
                 }]
             }]

+ 12 - 41
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -160,17 +160,11 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     }
                 }, {
                     text: "单位",
@@ -194,10 +188,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     }
                 }, {
                     text: "含税单价(元)",
@@ -210,16 +201,14 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     },
                     listeners: {
                         edit: function (value, grid) {
                             var r = grid.getSelection()[0],
                                 pd_taxrate = r.get('pd_taxrate');
-                            r.set('pd_taxprice', value / (1 + pd_taxrate / 100));
+                            var v = value / (1 + pd_taxrate / 100);
+                            r.set('pd_taxprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                         }
                     }
                 }, {
@@ -228,17 +217,11 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     dataIndex: "pd_taxtotal",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "税率",
@@ -260,17 +243,11 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     dataIndex: "pd_taxamount",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "价税合计",
@@ -278,17 +255,11 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     dataIndex: "pd_total",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "需求日期",

+ 13 - 42
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -184,17 +184,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -217,12 +211,9 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 minValue: 0
             },
             dataIndex: "pd_netprice",
-            width: 120.0,
+            width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -236,16 +227,14 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             dataIndex: "pd_orderprice",
             width: 120.0,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                 }
             }
         }, {
@@ -254,17 +243,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             dataIndex: "pd_nettotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             xtype: 'numbercolumn',
@@ -286,17 +269,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "价税合计",
@@ -304,17 +281,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库id",

+ 12 - 41
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -179,17 +179,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -213,10 +207,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -229,16 +220,14 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             },
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                 }
             }
         }, {
@@ -247,17 +236,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             dataIndex: "pd_nettotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "税率",
@@ -279,17 +262,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "价税合计",
@@ -297,17 +274,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库id",

+ 12 - 41
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -183,17 +183,11 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     }
                 }, {
                     text: "单位",
@@ -217,10 +211,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     }
                 }, {
                     text: "含税单价(元)",
@@ -233,16 +224,14 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     },
                     listeners: {
                         edit: function (value, grid) {
                             var r = grid.getSelection()[0],
                                 sd_taxrate = r.get('sd_taxrate');
-                            r.set('sd_netprice', value / (1 + sd_taxrate / 100));
+                            var v = value / (1 + sd_taxrate / 100);
+                            r.set('sd_netprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                         }
                     }
                 }, {
@@ -251,17 +240,11 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     dataIndex: "sd_nettotal",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "税率",
@@ -283,17 +266,11 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     dataIndex: "sd_taxamount",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "价税合计",
@@ -301,17 +278,11 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     dataIndex: "sd_total",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "交货日期",

+ 65 - 48
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -108,16 +108,23 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 110
-        }, {
-            text: '客户编号',
-            dataIndex: 'sa_custcode',
-            hidden :true
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
-            width: 250
+            width: 200
         }, {
-            text: '总金额',
+            text: '金额(元)',
+            dataIndex: 'sa_nettotal',
+            width: 110,
+            xtype: 'numbercolumn',
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '价税合计(元)',
             dataIndex: 'sa_total',
             width: 110,
             xtype: 'numbercolumn',
@@ -131,20 +138,16 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             text: '审核状态',
             align: 'center',
             dataIndex: 'sa_status',
-            width: 90
+            width: 80
         }, {
             text: '业务状态',
             align: 'center',
             dataIndex: 'sa_sendstatus',
-            width: 100
+            width: 80
         }, {
             text: '业务员',
             dataIndex: 'sa_seller',
-            width: 110
-        }, {
-            text: '收货地址',
-            dataIndex: 'sa_toplace',
-            hidden :true
+            width: 80
         }, {
             text: '备注',
             dataIndex: 'sa_remark',
@@ -157,48 +160,39 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             hidden:true,
             xtype: 'numbercolumn'
         }, {
-            text: '单据编号',
+            text: '销售单号',
             dataIndex: 'sa_code',
-            width: 200
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'sa_status',
-            width: 120
+            width: 150
         }, {
             text: '单据日期',
             dataIndex: 'sa_date',
             xtype: 'datecolumn',
-            width: 200
+            width: 110
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
-            width: 120
-        },  {
-            text: '业务状态',
+            width: 200
+        }, {
+            text: '审核状态',
             align: 'center',
-            dataIndex: 'sa_sendstatus',
-            width: 90
+            dataIndex: 'sa_status',
+            width: 80
         }, {
-            text: '明细序号',
-            dataIndex: 'sd_detno',
-            xtype: 'numbercolumn',
-            width: 120,
-            renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            }
+            text: '业务员',
+            dataIndex: 'sa_seller',
+            width: 80
         }, {
             text: '物料编号',
             dataIndex: 'sd_prodcode',
-            width: 120
+            width: 150
         },{
             text: '品牌',
             dataIndex: 'pr_brand',
-            width: 150
+            width: 100
         },{
-            text: '名称',
+            text: '物料名称',
             dataIndex: 'pr_detail',
-            width: 200
+            width: 150
         },{
             text: '型号',
             dataIndex: 'pr_orispeccode',
@@ -206,12 +200,12 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         },{
             text: '规格',
             dataIndex: 'pr_spec',
-            width: 150
+            width: 200
         },{
             text: '数量',
             dataIndex: 'sd_qty',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
@@ -221,12 +215,12 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '单位',
             dataIndex: 'pr_unit',
-            width: 80
+            width: 65
         }, {
             text: '单价(元)',
-            dataIndex: 'sd_price',
+            dataIndex: 'sd_netprice',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -234,16 +228,39 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                 return Ext.util.Format.number(v, format);
             },
         }, {
-            text: '已出货数',
-            dataIndex: 'sd_sendqty',
+            text: '金额(元)',
+            dataIndex: 'sd_nettotal',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
-            },
+            }
+        }, {
+            text: '税额',
+            dataIndex: 'sd_taxamount',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v,g,r) {
+                v = (r.data["sd_total"]||0.0) - (r.data["sd_nettotal"]||0.0);
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        },{
+            text: '价税合计(元)',
+            dataIndex: 'sd_total',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '备注',
             dataIndex: 'sd_remark',

+ 12 - 41
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -198,17 +198,11 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 3, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 3, true);
                 }
             },{
                 text : "单位", 
@@ -232,10 +226,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 4, true);
                 },
             }, {
                 text : "含税单价(元)", 
@@ -248,16 +239,14 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 4, true);
                 },
                 listeners: {
                     edit: function(value, grid) {
                         var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                        r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                        var v = value / (1 + pd_taxrate / 100);
+                        r.set('pd_netprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                     }
                 }
             }, {
@@ -266,17 +255,11 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 dataIndex : "pd_nettotal", 
                 width : 120, 
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
                 text : "税率", 
@@ -298,17 +281,11 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 dataIndex: "pd_taxamount",
                 width: 120,
                 renderer: function (v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function (v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
                 text : "价税合计", 
@@ -316,17 +293,11 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 dataIndex : "pd_ordertotal", 
                 width : 120, 
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
                 text : "仓库ID", 

+ 13 - 42
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -205,17 +205,11 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -239,10 +233,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -255,16 +246,14 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_netprice');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                        pd_taxrate = r.get('pd_taxrate');
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', saas.util.BaseUtil.numberFormat(v, 4, true));
                 }
             }
         }, {
@@ -273,17 +262,11 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             dataIndex: "pd_nettotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "税率",
@@ -305,17 +288,11 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "价税合计",
@@ -323,17 +300,11 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库ID",