spu:分佣属性和分佣保持一致

This commit is contained in:
puhui999 2023-09-09 23:14:02 +08:00
parent 615763d415
commit 5dc0c6e3da
4 changed files with 24 additions and 24 deletions

View File

@ -20,8 +20,8 @@ export interface Sku {
stock?: number // 库存
weight?: number // 商品重量单位kg 千克
volume?: number // 商品体积单位m^3 平米
subCommissionFirstPrice?: number | string // 一级分销的佣金
subCommissionSecondPrice?: number | string // 二级分销的佣金
firstBrokerageRecord?: number | string // 一级分销的佣金
secondBrokerageRecord?: number | string // 二级分销的佣金
salesCount?: number // 商品销量
}

View File

@ -80,7 +80,7 @@
<el-table-column align="center" label="一级返佣(元)" min-width="168">
<template #default="{ row }">
<el-input-number
v-model="row.subCommissionFirstPrice"
v-model="row.firstBrokerageRecord"
:min="0"
:precision="2"
:step="0.1"
@ -91,7 +91,7 @@
<el-table-column align="center" label="二级返佣(元)" min-width="168">
<template #default="{ row }">
<el-input-number
v-model="row.subCommissionSecondPrice"
v-model="row.secondBrokerageRecord"
:min="0"
:precision="2"
:step="0.1"
@ -181,12 +181,12 @@
<template v-if="formData!.subCommissionType">
<el-table-column align="center" label="一级返佣(元)" min-width="80">
<template #default="{ row }">
{{ row.subCommissionFirstPrice }}
{{ row.firstBrokerageRecord }}
</template>
</el-table-column>
<el-table-column align="center" label="二级返佣(元)" min-width="80">
<template #default="{ row }">
{{ row.subCommissionSecondPrice }}
{{ row.secondBrokerageRecord }}
</template>
</el-table-column>
</template>
@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([
stock: 0, //
weight: 0, //
volume: 0, //
subCommissionFirstPrice: 0, //
subCommissionSecondPrice: 0 //
firstBrokerageRecord: 0, //
secondBrokerageRecord: 0 //
}
]) //
@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => {
stock: 0,
weight: 0,
volume: 0,
subCommissionFirstPrice: 0,
subCommissionSecondPrice: 0
firstBrokerageRecord: 0,
secondBrokerageRecord: 0
}
// sku
const index = formData.value!.skus!.findIndex(
@ -491,8 +491,8 @@ watch(
stock: 0,
weight: 0,
volume: 0,
subCommissionFirstPrice: 0,
subCommissionSecondPrice: 0
firstBrokerageRecord: 0,
secondBrokerageRecord: 0
}
]
}

View File

@ -332,8 +332,8 @@ defineExpose({ validate })
const changeSubCommissionType = () => {
//
for (const item of formData.skus) {
item.subCommissionFirstPrice = 0
item.subCommissionSecondPrice = 0
item.firstBrokerageRecord = 0
item.secondBrokerageRecord = 0
}
}
@ -352,8 +352,8 @@ const onChangeSpec = () => {
stock: 0,
weight: 0,
volume: 0,
subCommissionFirstPrice: 0,
subCommissionSecondPrice: 0
firstBrokerageRecord: 0,
secondBrokerageRecord: 0
}
]
}

View File

@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({
stock: 0, //
weight: 0, //
volume: 0, //
subCommissionFirstPrice: 0, //
subCommissionSecondPrice: 0 //
firstBrokerageRecord: 0, //
secondBrokerageRecord: 0 //
}
],
description: '', //
@ -112,15 +112,15 @@ const getDetail = async () => {
item.price = floatToFixed2(item.price)
item.marketPrice = floatToFixed2(item.marketPrice)
item.costPrice = floatToFixed2(item.costPrice)
item.subCommissionFirstPrice = floatToFixed2(item.subCommissionFirstPrice)
item.subCommissionSecondPrice = floatToFixed2(item.subCommissionSecondPrice)
item.firstBrokerageRecord = floatToFixed2(item.firstBrokerageRecord)
item.secondBrokerageRecord = floatToFixed2(item.secondBrokerageRecord)
} else {
//
item.price = formatToFraction(item.price)
item.marketPrice = formatToFraction(item.marketPrice)
item.costPrice = formatToFraction(item.costPrice)
item.subCommissionFirstPrice = formatToFraction(item.subCommissionFirstPrice)
item.subCommissionSecondPrice = formatToFraction(item.subCommissionSecondPrice)
item.firstBrokerageRecord = formatToFraction(item.firstBrokerageRecord)
item.secondBrokerageRecord = formatToFraction(item.secondBrokerageRecord)
}
})
formData.value = res
@ -149,8 +149,8 @@ const submitForm = async () => {
item.price = convertToInteger(item.price)
item.marketPrice = convertToInteger(item.marketPrice)
item.costPrice = convertToInteger(item.costPrice)
item.subCommissionFirstPrice = convertToInteger(item.subCommissionFirstPrice)
item.subCommissionSecondPrice = convertToInteger(item.subCommissionSecondPrice)
item.firstBrokerageRecord = convertToInteger(item.firstBrokerageRecord)
item.secondBrokerageRecord = convertToInteger(item.secondBrokerageRecord)
})
//
const newSliderPicUrls: any[] = []