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 @@