Browse Source

代码校验添加

master
李胜楠 1 year ago
parent
commit
f3ec52936e
  1. 3
      src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts
  2. 5
      src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts
  3. 5
      src/views/wms/basicDataManage/orderManage/owner/owner.data.ts
  4. 5
      src/views/wms/basicDataManage/orderManage/shift/shift.data.ts
  5. 5
      src/views/wms/basicDataManage/orderManage/team/team.data.ts
  6. 5
      src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts
  7. 5
      src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts

3
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' }

5
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<CrudSchema[]>([
//表单校验
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' },

5
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<CrudSchema[]>([
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' }

5
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<CrudSchema[]>([
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' }

5
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<CrudSchema[]>([
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' }

5
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<CrudSchema[]>([
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' }

5
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' }

Loading…
Cancel
Save