From ae1a9e2fd60a40ef9a9fccb57c2d823eadb0645f Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 14 Nov 2023 10:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 38 +++---- .../itemManage/itembasic/index.vue | 27 ++++- .../itemManage/itempackaging/index.vue | 100 ++++++++++++------ .../supplierManage/supplier/index.vue | 25 ++++- 4 files changed, 137 insertions(+), 53 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 1bf3b167b..4ae198926 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -244,26 +244,26 @@ const submitForm = async () => { // data.masterId = props.masterParmas.masterId // data.number = props.masterParmas.number // } - console.log(props.formAllSchemas.formSchema) - var isHave = props.formAllSchemas.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 (formType.value === 'create') { - await props.apiCreate(data) - message.success(t('common.createSuccess')) - } else { - await props.apiUpdate(data) - message.success(t('common.updateSuccess')) - } - dialogVisible.value = false + // console.log(props.formAllSchemas.formSchema) + // var isHave = props.formAllSchemas.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 (formType.value === 'create') { + // await props.apiCreate(data) + // message.success(t('common.createSuccess')) + // } else { + // await props.apiUpdate(data) + // message.success(t('common.updateSuccess')) + // } + // dialogVisible.value = false // 发送操作成功的事件 - emit('success') + emit('success',formType.value,data) } finally { formLoading.value = false } diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue index f9788935e..3c40167b6 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue @@ -38,7 +38,7 @@ { basicFormRef.value.open(type, id) } +// form表单提交 +const formsSuccess = async (formType,data) => { + var isHave =Itembasic.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 ItembasicApi.createItembasic(data) + message.success(t('common.createSuccess')) + } else { + await ItembasicApi.updateItembasic(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + getList() +} + const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicItembasic') @@ -198,6 +222,7 @@ const searchFormClick = (searchData) => { getList() // 刷新当前列表 } + /** 初始化 **/ onMounted(() => { getList() diff --git a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue index a0f37daa8..7e98abd65 100644 --- a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue @@ -1,17 +1,21 @@