Browse Source

制造单数量限制正数

zhuth 7 years ago
parent
commit
0e5a088ed3

+ 1 - 1
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -92,7 +92,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
         fieldLabel : "数量",
         fieldLabel : "数量",
         columnWidth: 0.25,
         columnWidth: 0.25,
         allowBlank : false,
         allowBlank : false,
-        minValue:1
+        vtype: 'positiveNumber',
     },{
     },{
         xtype : "hidden", 
         xtype : "hidden", 
         name : "ma_whid", 
         name : "ma_whid", 

+ 7 - 1
frontend/saas-web/overrides/form/field/TrimVtype.js

@@ -8,5 +8,11 @@ Ext.define('saas.override.form.field.TrimVtype', {
     // RegExp for the value to be tested against within the validation function
     // RegExp for the value to be tested against within the validation function
     trimRe: /(^ .*)|(.* $)/,
     trimRe: /(^ .*)|(.* $)/,
     // vtype Text property: The error text to display when the validation function returns false
     // vtype Text property: The error text to display when the validation function returns false
-    trimText: '请不要在内容的开头和结尾添加空格'
+    trimText: '请不要在内容的开头和结尾添加空格',
+
+    // 正数验证
+    positiveNumber: function(value) {
+        return value > 0;
+    },
+    positiveNumberText: '该输入项必须是一个正数'
 });
 });