From f3ec52936ecb0bbc3eb179e81f0b5933a813db4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=83=9C=E6=A5=A0?= <2792649152@qq.com> Date: Mon, 27 Nov 2023 15:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=A1=E9=AA=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicDataManage/itemManage/itembasic/itembasic.data.ts | 3 +++ .../wms/basicDataManage/orderManage/carrier/carrier.data.ts | 5 +++-- .../wms/basicDataManage/orderManage/owner/owner.data.ts | 5 +++-- .../wms/basicDataManage/orderManage/shift/shift.data.ts | 5 ++++- src/views/wms/basicDataManage/orderManage/team/team.data.ts | 5 ++++- .../basicDataManage/supplierManage/supplier/supplier.data.ts | 5 +++-- .../supplierManage/supplieritem/supplieritem.data.ts | 5 ++++- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts index 70196395b..b422e5187 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateYS} from '@/utils/validator' + /** * @returns {Array} 基础物料信息 */ @@ -421,6 +423,7 @@ export const rules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' }, { max: 30, message: '不得超过30个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], name: [ { required: true, message: '请输入名称', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts b/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts index 86eab8bfd..ed31a233b 100644 --- a/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts +++ b/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts @@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 -import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' +import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator' /** * @returns {Array} 承运商 @@ -255,7 +255,8 @@ export const Carrier = useCrudSchemas(reactive([ //表单校验 export const CarrierRules = reactive({ code: [ - { required: true, message: '请输入代码', trigger: 'blur' } + { required: true, message: '请输入代码', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], shortName: [ { required: true, message: '请输入简称', trigger: 'blur' }, diff --git a/src/views/wms/basicDataManage/orderManage/owner/owner.data.ts b/src/views/wms/basicDataManage/orderManage/owner/owner.data.ts index 66fa8f01d..42c9ed7f8 100644 --- a/src/views/wms/basicDataManage/orderManage/owner/owner.data.ts +++ b/src/views/wms/basicDataManage/orderManage/owner/owner.data.ts @@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 -import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' +import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator' /** * @returns {Array} 货主 @@ -255,7 +255,8 @@ export const Owner = useCrudSchemas(reactive([ export const OwnerRules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' }, - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], name: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/orderManage/shift/shift.data.ts b/src/views/wms/basicDataManage/orderManage/shift/shift.data.ts index f59abd705..0fa31a053 100644 --- a/src/views/wms/basicDataManage/orderManage/shift/shift.data.ts +++ b/src/views/wms/basicDataManage/orderManage/shift/shift.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateYS} from '@/utils/validator' + /** * @returns {Array} 班次 */ @@ -226,7 +228,8 @@ export const Shift = useCrudSchemas(reactive([ export const ShiftRules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' }, - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], name: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/orderManage/team/team.data.ts b/src/views/wms/basicDataManage/orderManage/team/team.data.ts index 7b3eb13cb..6b48838cc 100644 --- a/src/views/wms/basicDataManage/orderManage/team/team.data.ts +++ b/src/views/wms/basicDataManage/orderManage/team/team.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateYS} from '@/utils/validator' + /** * @returns {Array} 班组 */ @@ -155,7 +157,8 @@ export const Team = useCrudSchemas(reactive([ export const TeamRules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' }, - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], name: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts index 8e3afd7e9..284ca2a7c 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts @@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 -import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' +import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator' /** * @returns {Array} 供应商 @@ -254,7 +254,8 @@ export const Supplier = useCrudSchemas(reactive([ export const SupplierRules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' }, - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], name: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts b/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts index 74b425e43..2d06266e6 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts @@ -13,6 +13,8 @@ import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse import * as LocationApi from '@/api/wms/location' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' +import {validateYS} from '@/utils/validator' + const { t } = useI18n() // 国际化 /** @@ -337,7 +339,8 @@ export const SupplieritemRules = reactive({ { required: true, message: '请输入物料代码', trigger: 'change' } ], supplierItemCode: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} ], packUnit: [ { required: true, message: '请选择供应商包装单位', trigger: 'change' }