From 078407fa10ed24deb1b68427b05644b54e4a0856 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 5 Nov 2024 16:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E:=20=E4=BF=AE=E5=A4=8D=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E9=80=89=E6=8B=A9=E5=95=86=E5=93=81=E6=97=B6=20sku=20?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/components/SpuSelect.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/mall/promotion/components/SpuSelect.vue b/src/views/mall/promotion/components/SpuSelect.vue index fd7dffe0..648a8635 100644 --- a/src/views/mall/promotion/components/SpuSelect.vue +++ b/src/views/mall/promotion/components/SpuSelect.vue @@ -115,7 +115,7 @@ import { getPropertyList, PropertyAndValues, SkuList } from '@/views/mall/produc import { ElTable } from 'element-plus' import { dateFormatter } from '@/utils/formatTime' import { createImageViewer } from '@/components/ImageViewer' -import { formatToFraction } from '@/utils' +import { floatToFixed2, formatToFraction } from '@/utils' import { defaultProps, handleTree } from '@/utils/tree' import * as ProductCategoryApi from '@/api/mall/product/category' @@ -228,6 +228,13 @@ const expandChange = async (row: ProductSpuApi.Spu, expandedRows?: ProductSpuApi } // 获取 SPU 详情 const res = (await ProductSpuApi.getSpu(row.id as number)) as ProductSpuApi.Spu + res.skus?.forEach((item) => { + item.price = floatToFixed2(item.price) + item.marketPrice = floatToFixed2(item.marketPrice) + item.costPrice = floatToFixed2(item.costPrice) + item.firstBrokeragePrice = floatToFixed2(item.firstBrokeragePrice) + item.secondBrokeragePrice = floatToFixed2(item.secondBrokeragePrice) + }) propertyList.value = getPropertyList(res) spuData.value = res isExpand.value = true