From 0be9e746240256f8b7921ecc8df0dbe019c1360e Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Wed, 21 Aug 2024 10:16:00 +0800 Subject: [PATCH] =?UTF-8?q?HL-5407@=E7=8E=8B=E5=AE=87=E9=A3=9E=20=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E8=AE=A2=E5=8D=95=E5=8F=B7=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scrapRequestMain/scrapRequestMain.data.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts index 3822c77ef..f86c652aa 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts @@ -794,11 +794,27 @@ export const ScrapRequestMain = useCrudSchemas( ]) ) +const validateOrderNumber = (rule: any, value: any, callback: any) => { + if (!value) { + callback(); + } else { + const codeReg = /^[0-9]+$/ + if (codeReg.test(value)) { + callback() + } else { + callback(new Error('订单号只能是数字')) + } + } +} + //表单校验 export const ScrapRequestMainRules = reactive({ departmentCode: [ { required: true, message: '请输入部门', trigger: 'blur' } ], + orderNumber: [ + { validator: validateOrderNumber, trigger: 'change' } + ], autoCommit: [ { required: true, message: '请选择是否自动提交', trigger: 'change' } ],