Browse Source

物料资料从表小数位数bug

zhuth 7 years ago
parent
commit
940a820f64

+ 3 - 3
frontend/saas-web/app/model/document/ProductDetail.js

@@ -8,8 +8,8 @@ Ext.define('saas.model.document.ProductDetail', {
         { name: 'pd_whcode', type: 'string' },
         { name: 'pd_whname', type: 'string' },
         { name: 'pd_whid', type: 'int' },
-        { name: 'pd_price', type: 'string' },
-        { name: 'pd_amount', type: 'int' },
-        { name: 'pd_num', type: 'int' }
+        { name: 'pd_price', type: 'float' },
+        { name: 'pd_amount', type: 'float' },
+        { name: 'pd_num', type: 'float' }
     ]
 });

+ 10 - 16
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -256,15 +256,15 @@ Ext.define('saas.view.document.product.FormPanel', {
             xtype : "numbercolumn", 
         },
         {
-            allowBlank:true,
             text : "期初数量", 
             dataIndex : "pd_num", 
-            xtype: 'numbercolumn',
+            // xtype: 'numbercolumn',
+            align: 'end',
             width : 110.0,
             allowBlank : false,
             editor : {
                 xtype : "numberfield",
-                decimalPrecision: 0,
+                decimalPrecision: 3,
                 minValue:0
             },
             listeners:{
@@ -287,8 +287,8 @@ Ext.define('saas.view.document.product.FormPanel', {
         {
             text : "单位成本", 
             dataIndex : "pd_price", 
-            allowBlank:false,
-            xtype: 'numbercolumn',
+            // xtype: 'numbercolumn',
+            align: 'end',
             width : 110.0,
             allowBlank : false,
             editor : {
@@ -301,34 +301,28 @@ Ext.define('saas.view.document.product.FormPanel', {
             },
             renderer : function(v) {
                 var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
                 var format = '0.' + xr.join();
                 return Ext.util.Format.number(v, format);
             },
-            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);
-            }
         },
         {
             text : "期初总价", 
             dataIndex : "pd_amount", 
-            xtype: 'numbercolumn',
+            // xtype: 'numbercolumn',
+            align: 'end',
             width : 110.0,
             allowBlank : true,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                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);
             },
             summaryType: 'sum',
             summaryRenderer: function(v) {
                 var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                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);
             }