diff --git a/src/views/wms/basicDataManage/customerManage/customer/customer.data.ts b/src/views/wms/basicDataManage/customerManage/customer/customer.data.ts index 5a37002d9..0be4f9115 100644 --- a/src/views/wms/basicDataManage/customerManage/customer/customer.data.ts +++ b/src/views/wms/basicDataManage/customerManage/customer/customer.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' + /** * @returns {Array} 客户 */ @@ -274,13 +276,16 @@ export const CustomerRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], phone: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateHanset, message: '请输入正确的手机号', trigger: 'blur'} ], fax: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateFax, message: '请输入正确的传真', trigger: 'blur'} ], postId: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validatePostCode, message: '请输入正确的邮编', trigger: 'blur'} ], contacts: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts b/src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts index b163140af..063381cd1 100644 --- a/src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts +++ b/src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateHanset} from '@/utils/validator' + /** * @returns {Array} 客户月台 */ @@ -230,7 +232,8 @@ export const CustomerdockRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], contactPhone: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateHanset, message: '请输入正确的手机号', trigger: 'blur'} ], remark: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts b/src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts index 4277a10ca..4a06cfaab 100644 --- a/src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts +++ b/src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts @@ -7,6 +7,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 {validateHanset} from '@/utils/validator' + const { t } = useI18n() // 国际化 /** @@ -250,7 +252,8 @@ export const DockRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], contactPhone: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateHanset, message: '请输入正确的手机号', trigger: 'blur'} ], type: [ { required: true, message: '请输入类型', trigger: 'change' } diff --git a/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts b/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts index ad35fb188..88fa83ec0 100644 --- a/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts +++ b/src/views/wms/basicDataManage/orderManage/carrier/carrier.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' + /** * @returns {Array} 承运商 */ @@ -277,13 +279,16 @@ export const CarrierRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], phone: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateHanset, message: '请输入正确的手机号', trigger: 'blur'} ], fax: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateFax, message: '请输入正确的传真', trigger: 'blur'} ], postId: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validatePostCode, message: '请输入正确的邮编', trigger: 'blur'} ], contacts: [ { 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 efeaeb9a0..62e5c662e 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts @@ -2,6 +2,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 +import {validateHanset,validateFax,validatePostCode} from '@/utils/validator' + /** * @returns {Array} 供应商 */ @@ -270,13 +272,16 @@ export const SupplierRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], phone: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateHanset, message: '请输入正确的手机号', trigger: 'blur'} ], fax: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateFax, message: '请输入正确的传真', trigger: 'blur'} ], postId: [ - { max: 50, message: '不得超过50个字符', trigger: 'blur' } + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validatePostCode, message: '请输入正确的邮编', trigger: 'blur'} ], contacts: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } diff --git a/src/views/wms/basicDataManage/systemSetting/currencyexchange/index.vue b/src/views/wms/basicDataManage/systemSetting/currencyexchange/index.vue index 12a04ec52..27075c47b 100644 --- a/src/views/wms/basicDataManage/systemSetting/currencyexchange/index.vue +++ b/src/views/wms/basicDataManage/systemSetting/currencyexchange/index.vue @@ -41,7 +41,7 @@ { basicFormRef.value.open(type, row) } +// form表单提交 +const formsSuccess = async (formType,data) => { + var isHave =Currencyexchange.allSchemas.formSchema.some(function (item) { + return item.field === 'activeTime' || item.field === 'expireTime'; + }); + if(isHave){ + if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ + message.error('失效时间要大于生效时间') + return; + } + } + if(data.activeTime==0)data.activeTime = null; + if(data.expireTime==0)data.expireTime = null; + if (formType === 'create') { + await CurrencyexchangeApi.createCurrencyexchange(data) + message.success(t('common.createSuccess')) + } else { + await CurrencyexchangeApi.updateCurrencyexchange(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + getList() +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { diff --git a/src/views/wms/basicDataManage/systemSetting/systemcalendar/index.vue b/src/views/wms/basicDataManage/systemSetting/systemcalendar/index.vue index 24e86d3aa..1f1dea4b7 100644 --- a/src/views/wms/basicDataManage/systemSetting/systemcalendar/index.vue +++ b/src/views/wms/basicDataManage/systemSetting/systemcalendar/index.vue @@ -41,7 +41,7 @@ { basicFormRef.value.open(type, row) } +// form表单提交 +const formsSuccess = async (formType,data) => { + var isHave =Systemcalendar.allSchemas.formSchema.some(function (item) { + return item.field === 'activeTime' || item.field === 'expireTime'; + }); + if(isHave){ + if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ + message.error('失效时间要大于生效时间') + return; + } + } + if(data.activeTime==0)data.activeTime = null; + if(data.expireTime==0)data.expireTime = null; + if (formType === 'create') { + await SystemcalendarApi.createSystemcalendar(data) + message.success(t('common.createSuccess')) + } else { + await SystemcalendarApi.updateSystemcalendar(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + getList() +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => {