From a9400c5171f4a8b630fe377c8ef3ba5df4ee2b60 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 12 Jan 2024 23:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20MALL=EF=BC=9A=E7=AE=80=E5=8C=96=20S?= =?UTF-8?q?PU=20=E5=B1=9E=E6=80=A7=E7=9A=84=E7=BB=B4=E6=8A=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/property.ts | 5 ----- src/views/mall/product/property/value/index.vue | 4 ++-- src/views/mall/product/spu/form/DescriptionForm.vue | 2 +- src/views/mall/product/spu/form/OtherForm.vue | 2 +- src/views/mall/product/spu/form/SkuForm.vue | 5 ++--- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/api/mall/product/property.ts b/src/api/mall/product/property.ts index c4398486..44dc663f 100644 --- a/src/api/mall/product/property.ts +++ b/src/api/mall/product/property.ts @@ -65,11 +65,6 @@ export const getPropertyPage = (params: PageParam) => { return request.get({ url: '/product/property/page', params }) } -// 获得属性项列表 -export const getPropertyList = (params: any) => { - return request.get({ url: '/product/property/list', params }) -} - // ------------------------ 属性值 ------------------- // 获得属性值分页 diff --git a/src/views/mall/product/property/value/index.vue b/src/views/mall/product/property/value/index.vue index 700afb5a..d708172c 100644 --- a/src/views/mall/product/property/value/index.vue +++ b/src/views/mall/product/property/value/index.vue @@ -9,7 +9,7 @@ label-width="68px" > - + { onMounted(async () => { await getList() // 属性项下拉框数据 - propertyOptions.value = await PropertyApi.getPropertyList({}) + propertyOptions.value.push(await PropertyApi.getProperty(queryParams.propertyId)) }) diff --git a/src/views/mall/product/spu/form/DescriptionForm.vue b/src/views/mall/product/spu/form/DescriptionForm.vue index 8bd6b48c..2980aa46 100644 --- a/src/views/mall/product/spu/form/DescriptionForm.vue +++ b/src/views/mall/product/spu/form/DescriptionForm.vue @@ -70,7 +70,7 @@ const validate = async () => { try { await unref(formRef)?.validate() // 校验通过更新数据 - Object.assign(props.propFormData, formData) + Object.assign(props.propFormData, formData.value) } catch (e) { message.error('【商品详情】不完善,请填写相关信息') emit('update:activeName', 'description') diff --git a/src/views/mall/product/spu/form/OtherForm.vue b/src/views/mall/product/spu/form/OtherForm.vue index ceb438cf..e7e63580 100644 --- a/src/views/mall/product/spu/form/OtherForm.vue +++ b/src/views/mall/product/spu/form/OtherForm.vue @@ -80,7 +80,7 @@ const validate = async () => { try { await unref(formRef)?.validate() // 校验通过更新数据 - Object.assign(props.propFormData, formData) + Object.assign(props.propFormData, formData.value) } catch (e) { message.error('【其它设置】不完善,请填写相关信息') emit('update:activeName', 'other') diff --git a/src/views/mall/product/spu/form/SkuForm.vue b/src/views/mall/product/spu/form/SkuForm.vue index 69814a61..0bd79723 100644 --- a/src/views/mall/product/spu/form/SkuForm.vue +++ b/src/views/mall/product/spu/form/SkuForm.vue @@ -135,11 +135,10 @@ watch( /** 表单校验 */ const emit = defineEmits(['update:activeName']) const validate = async () => { - // 校验 sku - skuListRef.value.validateSku() - // 校验表单 if (!formRef) return try { + // 校验 sku + skuListRef.value.validateSku() await unref(formRef).validate() // 校验通过更新数据 Object.assign(props.propFormData, formData)