Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8778f574
authored
Sep 13, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spu:分佣属性和分佣保持一致
parent
5dc0c6e3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
24 deletions
+24
-24
src/api/mall/product/spu.ts
+2
-2
src/views/mall/product/spu/components/SkuList.vue
+10
-10
src/views/mall/product/spu/form/BasicInfoForm.vue
+4
-4
src/views/mall/product/spu/form/index.vue
+8
-8
No files found.
src/api/mall/product/spu.ts
View file @
8778f574
...
...
@@ -20,8 +20,8 @@ export interface Sku {
stock
?:
number
// 库存
weight
?:
number
// 商品重量,单位:kg 千克
volume
?:
number
// 商品体积,单位:m^3 平米
firstBrokerage
Record
?:
number
|
string
// 一级分销的佣金
secondBrokerage
Record
?:
number
|
string
// 二级分销的佣金
firstBrokerage
Price
?:
number
|
string
// 一级分销的佣金
secondBrokerage
Price
?:
number
|
string
// 二级分销的佣金
salesCount
?:
number
// 商品销量
}
...
...
src/views/mall/product/spu/components/SkuList.vue
View file @
8778f574
...
...
@@ -80,7 +80,7 @@
<el-table-column
align=
"center"
label=
"一级返佣(元)"
min-width=
"168"
>
<template
#
default=
"
{ row }">
<el-input-number
v-model=
"row.firstBrokerage
Record
"
v-model=
"row.firstBrokerage
Price
"
: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.secondBrokerage
Record
"
v-model=
"row.secondBrokerage
Price
"
: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
.
firstBrokerage
Record
}}
{{
row
.
firstBrokerage
Price
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"二级返佣(元)"
min-width=
"80"
>
<
template
#
default=
"{ row }"
>
{{
row
.
secondBrokerage
Record
}}
{{
row
.
secondBrokerage
Price
}}
</
template
>
</el-table-column>
</template>
...
...
@@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([
stock
:
0
,
// 库存
weight
:
0
,
// 商品重量
volume
:
0
,
// 商品体积
firstBrokerage
Record
:
0
,
// 一级分销的佣金
secondBrokerage
Record
:
0
// 二级分销的佣金
firstBrokerage
Price
:
0
,
// 一级分销的佣金
secondBrokerage
Price
:
0
// 二级分销的佣金
}
])
// 批量添加时的临时数据
...
...
@@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => {
stock
:
0
,
weight
:
0
,
volume
:
0
,
firstBrokerage
Record
:
0
,
secondBrokerage
Record
:
0
firstBrokerage
Price
:
0
,
secondBrokerage
Price
:
0
}
// 如果存在属性相同的 sku 则不做处理
const
index
=
formData
.
value
!
.
skus
!
.
findIndex
(
...
...
@@ -491,8 +491,8 @@ watch(
stock
:
0
,
weight
:
0
,
volume
:
0
,
firstBrokerage
Record
:
0
,
secondBrokerage
Record
:
0
firstBrokerage
Price
:
0
,
secondBrokerage
Price
:
0
}
]
}
...
...
src/views/mall/product/spu/form/BasicInfoForm.vue
View file @
8778f574
...
...
@@ -332,8 +332,8 @@ defineExpose({ validate })
const
changeSubCommissionType
=
()
=>
{
// 默认为零,类型切换后也要重置为零
for
(
const
item
of
formData
.
skus
)
{
item
.
firstBrokerage
Record
=
0
item
.
secondBrokerage
Record
=
0
item
.
firstBrokerage
Price
=
0
item
.
secondBrokerage
Price
=
0
}
}
...
...
@@ -352,8 +352,8 @@ const onChangeSpec = () => {
stock
:
0
,
weight
:
0
,
volume
:
0
,
firstBrokerage
Record
:
0
,
secondBrokerage
Record
:
0
firstBrokerage
Price
:
0
,
secondBrokerage
Price
:
0
}
]
}
...
...
src/views/mall/product/spu/form/index.vue
View file @
8778f574
...
...
@@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({
stock
:
0
,
// 库存
weight
:
0
,
// 商品重量
volume
:
0
,
// 商品体积
firstBrokerage
Record
:
0
,
// 一级分销的佣金
secondBrokerage
Record
:
0
// 二级分销的佣金
firstBrokerage
Price
:
0
,
// 一级分销的佣金
secondBrokerage
Price
:
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
.
firstBrokerage
Record
=
floatToFixed2
(
item
.
firstBrokerageRecord
)
item
.
secondBrokerage
Record
=
floatToFixed2
(
item
.
secondBrokerageRecord
)
item
.
firstBrokerage
Price
=
floatToFixed2
(
item
.
firstBrokeragePrice
)
item
.
secondBrokerage
Price
=
floatToFixed2
(
item
.
secondBrokeragePrice
)
}
else
{
// 回显价格分转元
item
.
price
=
formatToFraction
(
item
.
price
)
item
.
marketPrice
=
formatToFraction
(
item
.
marketPrice
)
item
.
costPrice
=
formatToFraction
(
item
.
costPrice
)
item
.
firstBrokerage
Record
=
formatToFraction
(
item
.
firstBrokerageRecord
)
item
.
secondBrokerage
Record
=
formatToFraction
(
item
.
secondBrokerageRecord
)
item
.
firstBrokerage
Price
=
formatToFraction
(
item
.
firstBrokeragePrice
)
item
.
secondBrokerage
Price
=
formatToFraction
(
item
.
secondBrokeragePrice
)
}
})
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
.
firstBrokerage
Record
=
convertToInteger
(
item
.
firstBrokerageRecord
)
item
.
secondBrokerage
Record
=
convertToInteger
(
item
.
secondBrokerageRecord
)
item
.
firstBrokerage
Price
=
convertToInteger
(
item
.
firstBrokeragePrice
)
item
.
secondBrokerage
Price
=
convertToInteger
(
item
.
secondBrokeragePrice
)
})
// 处理轮播图列表
const
newSliderPicUrls
:
any
[]
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment