diff --git a/src/views/supermarket/shopSpu/form.vue b/src/views/supermarket/shopSpu/form.vue index c1acb6f..c111228 100644 --- a/src/views/supermarket/shopSpu/form.vue +++ b/src/views/supermarket/shopSpu/form.vue @@ -183,7 +183,7 @@ import { getObj, addObj, putObj } from "/@/api/supermarket/shopSpu" import { rule } from "/@/utils/validate" import { tree as fetchCategoryTree } from "/@/api/supermarket/shopCategory" import { select as fetchMerchantSelect } from "/@/api/wallet/mch-manage" -import { displayPrice } from "/@/utils/formatMoney" +import { displayPrice, storePrice } from "/@/utils/formatMoney" const emit = defineEmits(["refresh"]) @@ -300,6 +300,14 @@ const onSubmit = async () => { ...form, categoryId: Array.isArray(form.categoryId) ? form.categoryId.slice(-1)[0] : form.categoryId, merchantIds, + skuList: + form.skuList?.map((sku) => { + return { + ...sku, + promotionPrice: storePrice(sku.promotionPrice), + retailPrice: storePrice(sku.retailPrice), + } + }) || [], } form.id ? await putObj(submitForm) : await addObj(submitForm) useMessage().success(form.id ? "修改成功" : "添加成功")