diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 25475cf8..2ffb37d0 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -180,17 +180,17 @@ @@ -211,12 +211,12 @@ diff --git a/src/views/mall/promotion/components/SpuAndSkuList.vue b/src/views/mall/promotion/components/SpuAndSkuList.vue index 5a96ddc3..1a0598ca 100644 --- a/src/views/mall/promotion/components/SpuAndSkuList.vue +++ b/src/views/mall/promotion/components/SpuAndSkuList.vue @@ -30,13 +30,13 @@ @@ -56,13 +56,13 @@ const props = defineProps<{ spuList: T[] ruleConfig: RuleConfig[] spuPropertyListP: SpuProperty[] - isDelete?: boolean // SPU 是否可删除;TODO deletable 换成这个名字好点。 + deletable?: boolean // SPU 是否可删除; }>() const spuData = ref([]) // spu 详情数据列表 const skuListRef = ref() // 商品属性列表Ref const spuPropertyList = ref[]>([]) // spuId 对应的 sku 的属性列表 -const expandRowKeys = ref() // 控制展开行需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。 +const expandRowKeys = ref([]) // 控制展开行需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。 /** * 获取所有 sku 活动配置 @@ -71,10 +71,10 @@ const expandRowKeys = ref() // 控制展开行需要设置 row-key 属 */ const getSkuConfigs = (extendedAttribute: string) => { skuListRef.value.validateSku() - const seckillProducts = [] + const seckillProducts: any[] = [] spuPropertyList.value.forEach((item) => { - item.spuDetail.skus.forEach((sku) => { - seckillProducts.push(sku[extendedAttribute]) + item.spuDetail.skus?.forEach((sku: any) => { + seckillProducts.push(sku[extendedAttribute] as any) }) }) return seckillProducts @@ -124,10 +124,10 @@ watch( () => props.spuPropertyListP, (data) => { if (!data) return - spuPropertyList.value = data as SpuProperty[] + spuPropertyList.value = data as SpuProperty[] as any // 解决如果之前选择的是单规格 spu 的话后面选择多规格 sku 多规格属性信息不展示的问题。解决方法:让 SkuList 组件重新渲染(行折叠会干掉包含的组件展开时会重新加载) setTimeout(() => { - expandRowKeys.value = data.map((item) => item.spuId) + expandRowKeys.value = data.map((item) => item.spuId + '') }, 200) }, { diff --git a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue index 915af43c..cc2c0422 100644 --- a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue +++ b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue @@ -8,28 +8,40 @@ :schema="allSchemas.formSchema" > - - - -