Browse Source

feat:销售单新建平台订单号验证

snow 1 year ago
parent
commit
5360e635ca
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/views/sellOut/salesOrder/components/addForm.vue

+ 17 - 0
src/views/sellOut/salesOrder/components/addForm.vue

@@ -771,6 +771,23 @@ export default {
       },
       rulesThis: this.rules,
       rules: {
+        platform_order:[
+          {
+            trigger: 'change',
+            validator:(rule, value, callback) => {
+              const len = value.length
+              if (value === '' || !value) {
+                callback()
+              } else if (len < 0 || len > 255) {
+                callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+              } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+                callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+              } else {
+                callback()
+              }
+            }
+          }
+        ],
         managerid: [
           {
             required: true,