From efb472b17332b6b091dcda82a50dd80abf39cb32 Mon Sep 17 00:00:00 2001 From: chenfang Date: Tue, 9 Apr 2024 17:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E7=94=9F=E4=BA=A7=E6=97=A5=E6=9C=9F=E4=B8=8E=E7=89=A9?= =?UTF-8?q?=E6=96=99=E6=9C=89=E6=95=88=E6=9C=9F=E8=AE=A1=E7=AE=97=E5=87=BA?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/formatTime.ts | 8 ++++++++ .../strategy/supplieDeliveryStrategy/AddForm.vue | 6 +++--- .../supplierManage/supplier/supplier.data.ts | 1 + .../supplierdeliverRequestMain/index.vue | 11 ++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index e2b0e59a5..64bb9c8b3 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -23,6 +23,14 @@ export function formatDate(date: Date | number, format?: string): string { return dayjs(date).format(format) } +/** + * 获取当前的日期+时间 + */ +export function addDay(date: Date | number,addDay:number) { + return dayjs(date).add(addDay,'day') +} + + /** * 获取当前的日期+时间 */ diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue index 50ce4c375..d0531a644 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue @@ -237,7 +237,7 @@ - + @@ -314,8 +314,8 @@ const rules = ref({ name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], - PhoneNumber: [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, - {message: '请输入联系电话', trigger: 'blur' ,validator:validateHanset}] + 'configuration.PhoneNumber': [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, + {message: '请输入正确格式的电话', trigger: 'blur' ,validator:validateHanset}] }) // 所有的范围类型 diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts index cea87d094..e08c9a14d 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts @@ -300,6 +300,7 @@ export const SupplierRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], email: [ + { required: true, message: '请输入邮箱', trigger: 'blur' }, { max: 128, message: '不得超过128个字符', trigger: 'blur' }, { validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'} ], diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 218742190..e046b3943 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -116,7 +116,8 @@ import { import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import { formatDate } from '@/utils/formatTime' +import { formatDate,addDay } from '@/utils/formatTime' +import * as itemBasicApi from '@/api/wms/itembasic' // 供应商发货申请 defineOptions({ name: 'SupplierdeliverRequestMain' }) @@ -148,6 +149,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => row['poLine'] = val[0]['poLine'] row['orderQty'] = val[0]['orderQty'] row['uom'] = val[0]['uom'] + itemBasicApi.getItembasicPage({ + code: val[0]['itemCode'] + }).then((res) => { + let cf = addDay(row['produceDate'],res.list[0].validityDays); + row['expireDate'] = cf; + }).catch((err) => { + console.log(err) + }) } } else { const setV = {}