Ver código fonte

采购报价单-增加折扣填写校验

jingbb 2 meses atrás
pai
commit
8489628c3b

+ 12 - 6
src/views/purchase/purchaseQuotationFrm/PurchaseQuotationForm.data.ts

@@ -266,11 +266,11 @@ export const PuechaseQuotationFormProductColumns: JVxeColumn[] = [
       width:"200px",
       defaultValue:'',
       validateRules: [{ required: true, message: '' }],
-      formatter({ cellValue, row, column }) {
-        row.taxAmount = Number(row.quantity)*Number(row.taxPrice)
-        row.taxAmount = isNaN( row.taxAmount)?'':Number(row.taxAmount).toFixed(4)
-        return cellValue
-      },
+      // formatter({ cellValue, row, column }) {
+      //   row.taxAmount = Number(row.quantity)*Number(row.taxPrice)
+      //   row.taxAmount = isNaN( row.taxAmount)?'':Number(row.taxAmount).toFixed(4)
+      //   return cellValue
+      // },
     },
     {
       title: '折扣(discount)',
@@ -279,7 +279,13 @@ export const PuechaseQuotationFormProductColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       defaultValue:'',  
       width:"200px",
-      validateRules: [{ required: true, message: '' }],
+      validateRules: [
+        { required: true, message: '' },
+        {
+          pattern: /^(0|[1-9]\d?|100)(\.\d+)?$/, // 正则
+          message: '不得小于0或者大于100',
+        },
+      ],
     },
     {
       title: '单价(price)',

+ 1 - 1
src/views/purchase/purchaseQuotationFrm/components/PurchaseQuotationFormForm.vue

@@ -715,7 +715,7 @@
     margin-bottom: 8px !important;
   }
   /deep/.vxe-cell--valid-error-msg{
-    color: white !important;
+    color:red !important;
     background-color: white !important;
   }  
 </style>

+ 7 - 1
src/views/purchase/purchaseQuotationFrm/components/SetSonList.vue

@@ -41,7 +41,13 @@
         sm: { span: 19 },
     });
     const rules = {
-      numericalValue: [{required: true,message: '请输入数值',},],
+      numericalValue: [
+        {required: true,message: '请输入数值',},
+        {
+          pattern: /^(0|[1-9]\d?|100)(\.\d+)?$/, // 正则
+          message: '不得小于0或者大于100',
+        },
+    ],
     }
     function handleOk(){
         formRef.value .validate().then(() => {