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
Unverified
Commit
ef152619
authored
Sep 12, 2023
by
芋道源码
Committed by
Gitee
Sep 12, 2023
Browse files
Options
Browse Files
Download
Plain Diff
!240 完善前端 mall-order 模块相关问题
Merge pull request !240 from puhui999/dev-to-dev
parents
0e2ea395
5dc0c6e3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
86 additions
and
75 deletions
+86
-75
src/api/mall/product/spu.ts
+2
-2
src/api/mall/trade/order/index.ts
+2
-3
src/config/axios/service.ts
+0
-5
src/views/Login/components/LoginForm.vue
+4
-7
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
src/views/mall/trade/afterSale/detail/index.vue
+2
-1
src/views/mall/trade/order/detail/index.vue
+4
-3
src/views/mall/trade/order/index.vue
+50
-32
No files found.
src/api/mall/product/spu.ts
View file @
ef152619
...
@@ -20,8 +20,8 @@ export interface Sku {
...
@@ -20,8 +20,8 @@ export interface Sku {
stock
?:
number
// 库存
stock
?:
number
// 库存
weight
?:
number
// 商品重量,单位:kg 千克
weight
?:
number
// 商品重量,单位:kg 千克
volume
?:
number
// 商品体积,单位:m^3 平米
volume
?:
number
// 商品体积,单位:m^3 平米
subCommissionFirstPrice
?:
number
|
string
// 一级分销的佣金
firstBrokerageRecord
?:
number
|
string
// 一级分销的佣金
s
ubCommissionSecondPrice
?:
number
|
string
// 二级分销的佣金
s
econdBrokerageRecord
?:
number
|
string
// 二级分销的佣金
salesCount
?:
number
// 商品销量
salesCount
?:
number
// 商品销量
}
}
...
...
src/api/mall/trade/order/index.ts
View file @
ef152619
...
@@ -51,11 +51,10 @@ export interface OrderVO {
...
@@ -51,11 +51,10 @@ export interface OrderVO {
avatar
?:
string
avatar
?:
string
}
}
// 订单操作日志
// 订单操作日志
logs
?:
logs
[]
logs
?:
OrderLogRespVO
[]
}
}
// TODO @puhui999:OrderLogRespVO 会不会更好哈。
export
interface
OrderLogRespVO
{
export
interface
logs
{
content
?:
string
content
?:
string
createTime
?:
Date
createTime
?:
Date
userType
?:
number
userType
?:
number
...
...
src/config/axios/service.ts
View file @
ef152619
...
@@ -191,11 +191,6 @@ service.interceptors.response.use(
...
@@ -191,11 +191,6 @@ service.interceptors.response.use(
}
}
return
Promise
.
reject
(
'error'
)
return
Promise
.
reject
(
'error'
)
}
else
{
}
else
{
// TODO @puhui999:这个先不用支持哈;
// 前端处理 data 为 null 的情况,进行提示
if
(
data
.
msg
!==
''
)
{
ElNotification
.
error
({
title
:
msg
})
}
return
data
return
data
}
}
},
},
...
...
src/views/Login/components/LoginForm.vue
View file @
ef152619
...
@@ -230,6 +230,7 @@ const getCookie = () => {
...
@@ -230,6 +230,7 @@ const getCookie = () => {
}
}
}
}
}
}
const
loading
=
ref
()
// ElLoading.service 返回的实例
// 登录
// 登录
const
handleLogin
=
async
(
params
)
=>
{
const
handleLogin
=
async
(
params
)
=>
{
loginLoading
.
value
=
true
loginLoading
.
value
=
true
...
@@ -244,7 +245,7 @@ const handleLogin = async (params) => {
...
@@ -244,7 +245,7 @@ const handleLogin = async (params) => {
if
(
!
res
)
{
if
(
!
res
)
{
return
return
}
}
ElLoading
.
service
({
loading
.
value
=
ElLoading
.
service
({
lock
:
true
,
lock
:
true
,
text
:
'正在加载系统中...'
,
text
:
'正在加载系统中...'
,
background
:
'rgba(0, 0, 0, 0.7)'
background
:
'rgba(0, 0, 0, 0.7)'
...
@@ -264,13 +265,9 @@ const handleLogin = async (params) => {
...
@@ -264,13 +265,9 @@ const handleLogin = async (params) => {
}
else
{
}
else
{
push
({
path
:
redirect
.
value
||
permissionStore
.
addRouters
[
0
].
path
})
push
({
path
:
redirect
.
value
||
permissionStore
.
addRouters
[
0
].
path
})
}
}
}
catch
{
loginLoading
.
value
=
false
}
finally
{
}
finally
{
setTimeout
(()
=>
{
loginLoading
.
value
=
false
const
loadingInstance
=
ElLoading
.
service
()
loading
.
value
.
close
()
loadingInstance
.
close
()
},
400
)
}
}
}
}
...
...
src/views/mall/product/spu/components/SkuList.vue
View file @
ef152619
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
<el-table-column
align=
"center"
label=
"一级返佣(元)"
min-width=
"168"
>
<el-table-column
align=
"center"
label=
"一级返佣(元)"
min-width=
"168"
>
<template
#
default=
"
{ row }">
<template
#
default=
"
{ row }">
<el-input-number
<el-input-number
v-model=
"row.
subCommissionFirstPrice
"
v-model=
"row.
firstBrokerageRecord
"
:min=
"0"
:min=
"0"
:precision=
"2"
:precision=
"2"
:step=
"0.1"
:step=
"0.1"
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
<el-table-column
align=
"center"
label=
"二级返佣(元)"
min-width=
"168"
>
<el-table-column
align=
"center"
label=
"二级返佣(元)"
min-width=
"168"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-input-number
<el-input-number
v-model=
"row.s
ubCommissionSecondPrice
"
v-model=
"row.s
econdBrokerageRecord
"
:min=
"0"
:min=
"0"
:precision=
"2"
:precision=
"2"
:step=
"0.1"
:step=
"0.1"
...
@@ -181,12 +181,12 @@
...
@@ -181,12 +181,12 @@
<
template
v-if=
"formData!.subCommissionType"
>
<
template
v-if=
"formData!.subCommissionType"
>
<el-table-column
align=
"center"
label=
"一级返佣(元)"
min-width=
"80"
>
<el-table-column
align=
"center"
label=
"一级返佣(元)"
min-width=
"80"
>
<template
#
default=
"
{ row }">
<template
#
default=
"
{ row }">
{{
row
.
subCommissionFirstPrice
}}
{{
row
.
firstBrokerageRecord
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"二级返佣(元)"
min-width=
"80"
>
<el-table-column
align=
"center"
label=
"二级返佣(元)"
min-width=
"80"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
{{
row
.
s
ubCommissionSecondPrice
}}
{{
row
.
s
econdBrokerageRecord
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</template>
</template>
...
@@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([
...
@@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([
stock
:
0
,
// 库存
stock
:
0
,
// 库存
weight
:
0
,
// 商品重量
weight
:
0
,
// 商品重量
volume
:
0
,
// 商品体积
volume
:
0
,
// 商品体积
subCommissionFirstPrice
:
0
,
// 一级分销的佣金
firstBrokerageRecord
:
0
,
// 一级分销的佣金
s
ubCommissionSecondPrice
:
0
// 二级分销的佣金
s
econdBrokerageRecord
:
0
// 二级分销的佣金
}
}
])
// 批量添加时的临时数据
])
// 批量添加时的临时数据
...
@@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => {
...
@@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => {
stock
:
0
,
stock
:
0
,
weight
:
0
,
weight
:
0
,
volume
:
0
,
volume
:
0
,
subCommissionFirstPrice
:
0
,
firstBrokerageRecord
:
0
,
s
ubCommissionSecondPrice
:
0
s
econdBrokerageRecord
:
0
}
}
// 如果存在属性相同的 sku 则不做处理
// 如果存在属性相同的 sku 则不做处理
const
index
=
formData
.
value
!
.
skus
!
.
findIndex
(
const
index
=
formData
.
value
!
.
skus
!
.
findIndex
(
...
@@ -491,8 +491,8 @@ watch(
...
@@ -491,8 +491,8 @@ watch(
stock
:
0
,
stock
:
0
,
weight
:
0
,
weight
:
0
,
volume
:
0
,
volume
:
0
,
subCommissionFirstPrice
:
0
,
firstBrokerageRecord
:
0
,
s
ubCommissionSecondPrice
:
0
s
econdBrokerageRecord
:
0
}
}
]
]
}
}
...
...
src/views/mall/product/spu/form/BasicInfoForm.vue
View file @
ef152619
...
@@ -332,8 +332,8 @@ defineExpose({ validate })
...
@@ -332,8 +332,8 @@ defineExpose({ validate })
const
changeSubCommissionType
=
()
=>
{
const
changeSubCommissionType
=
()
=>
{
// 默认为零,类型切换后也要重置为零
// 默认为零,类型切换后也要重置为零
for
(
const
item
of
formData
.
skus
)
{
for
(
const
item
of
formData
.
skus
)
{
item
.
subCommissionFirstPrice
=
0
item
.
firstBrokerageRecord
=
0
item
.
s
ubCommissionSecondPrice
=
0
item
.
s
econdBrokerageRecord
=
0
}
}
}
}
...
@@ -352,8 +352,8 @@ const onChangeSpec = () => {
...
@@ -352,8 +352,8 @@ const onChangeSpec = () => {
stock
:
0
,
stock
:
0
,
weight
:
0
,
weight
:
0
,
volume
:
0
,
volume
:
0
,
subCommissionFirstPrice
:
0
,
firstBrokerageRecord
:
0
,
s
ubCommissionSecondPrice
:
0
s
econdBrokerageRecord
:
0
}
}
]
]
}
}
...
...
src/views/mall/product/spu/form/index.vue
View file @
ef152619
...
@@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({
...
@@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({
stock
:
0
,
// 库存
stock
:
0
,
// 库存
weight
:
0
,
// 商品重量
weight
:
0
,
// 商品重量
volume
:
0
,
// 商品体积
volume
:
0
,
// 商品体积
subCommissionFirstPrice
:
0
,
// 一级分销的佣金
firstBrokerageRecord
:
0
,
// 一级分销的佣金
s
ubCommissionSecondPrice
:
0
// 二级分销的佣金
s
econdBrokerageRecord
:
0
// 二级分销的佣金
}
}
],
],
description
:
''
,
// 商品详情
description
:
''
,
// 商品详情
...
@@ -112,15 +112,15 @@ const getDetail = async () => {
...
@@ -112,15 +112,15 @@ const getDetail = async () => {
item
.
price
=
floatToFixed2
(
item
.
price
)
item
.
price
=
floatToFixed2
(
item
.
price
)
item
.
marketPrice
=
floatToFixed2
(
item
.
marketPrice
)
item
.
marketPrice
=
floatToFixed2
(
item
.
marketPrice
)
item
.
costPrice
=
floatToFixed2
(
item
.
costPrice
)
item
.
costPrice
=
floatToFixed2
(
item
.
costPrice
)
item
.
subCommissionFirstPrice
=
floatToFixed2
(
item
.
subCommissionFirstPrice
)
item
.
firstBrokerageRecord
=
floatToFixed2
(
item
.
firstBrokerageRecord
)
item
.
s
ubCommissionSecondPrice
=
floatToFixed2
(
item
.
subCommissionSecondPrice
)
item
.
s
econdBrokerageRecord
=
floatToFixed2
(
item
.
secondBrokerageRecord
)
}
else
{
}
else
{
// 回显价格分转元
// 回显价格分转元
item
.
price
=
formatToFraction
(
item
.
price
)
item
.
price
=
formatToFraction
(
item
.
price
)
item
.
marketPrice
=
formatToFraction
(
item
.
marketPrice
)
item
.
marketPrice
=
formatToFraction
(
item
.
marketPrice
)
item
.
costPrice
=
formatToFraction
(
item
.
costPrice
)
item
.
costPrice
=
formatToFraction
(
item
.
costPrice
)
item
.
subCommissionFirstPrice
=
formatToFraction
(
item
.
subCommissionFirstPrice
)
item
.
firstBrokerageRecord
=
formatToFraction
(
item
.
firstBrokerageRecord
)
item
.
s
ubCommissionSecondPrice
=
formatToFraction
(
item
.
subCommissionSecondPrice
)
item
.
s
econdBrokerageRecord
=
formatToFraction
(
item
.
secondBrokerageRecord
)
}
}
})
})
formData
.
value
=
res
formData
.
value
=
res
...
@@ -149,8 +149,8 @@ const submitForm = async () => {
...
@@ -149,8 +149,8 @@ const submitForm = async () => {
item
.
price
=
convertToInteger
(
item
.
price
)
item
.
price
=
convertToInteger
(
item
.
price
)
item
.
marketPrice
=
convertToInteger
(
item
.
marketPrice
)
item
.
marketPrice
=
convertToInteger
(
item
.
marketPrice
)
item
.
costPrice
=
convertToInteger
(
item
.
costPrice
)
item
.
costPrice
=
convertToInteger
(
item
.
costPrice
)
item
.
subCommissionFirstPrice
=
convertToInteger
(
item
.
subCommissionFirstPrice
)
item
.
firstBrokerageRecord
=
convertToInteger
(
item
.
firstBrokerageRecord
)
item
.
s
ubCommissionSecondPrice
=
convertToInteger
(
item
.
subCommissionSecondPrice
)
item
.
s
econdBrokerageRecord
=
convertToInteger
(
item
.
secondBrokerageRecord
)
})
})
// 处理轮播图列表
// 处理轮播图列表
const
newSliderPicUrls
:
any
[]
=
[]
const
newSliderPicUrls
:
any
[]
=
[]
...
...
src/views/mall/trade/afterSale/detail/index.vue
View file @
ef152619
...
@@ -195,7 +195,8 @@ const getDetail = async () => {
...
@@ -195,7 +195,8 @@ const getDetail = async () => {
if
(
id
)
{
if
(
id
)
{
const
res
=
await
AfterSaleApi
.
getAfterSale
(
id
)
const
res
=
await
AfterSaleApi
.
getAfterSale
(
id
)
// 没有表单信息则关闭页面返回
// 没有表单信息则关闭页面返回
if
(
res
===
null
)
{
if
(
res
==
null
)
{
message
.
notifyError
(
'售后订单不存在'
)
close
()
close
()
}
}
formData
.
value
=
res
formData
.
value
=
res
...
...
src/views/mall/trade/order/detail/index.vue
View file @
ef152619
...
@@ -245,9 +245,10 @@ const { params } = useRoute() // 查询参数
...
@@ -245,9 +245,10 @@ const { params } = useRoute() // 查询参数
const
getDetail
=
async
()
=>
{
const
getDetail
=
async
()
=>
{
const
id
=
params
.
orderId
as
unknown
as
number
const
id
=
params
.
orderId
as
unknown
as
number
if
(
id
)
{
if
(
id
)
{
const
res
=
(
await
TradeOrderApi
.
getOrder
(
id
))
as
TradeOrderApi
.
OrderVO
const
res
=
(
await
TradeOrderApi
.
getOrder
(
66666
))
as
TradeOrderApi
.
OrderVO
// 没有表单信息则关闭页面返回
// 没有表单信息则关闭页面返回
if
(
res
===
null
)
{
if
(
res
==
null
)
{
message
.
error
(
'交易订单不存在'
)
close
()
close
()
}
}
formData
.
value
=
res
formData
.
value
=
res
...
@@ -259,7 +260,7 @@ const { delView } = useTagsViewStore() // 视图操作
...
@@ -259,7 +260,7 @@ const { delView } = useTagsViewStore() // 视图操作
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
close
=
()
=>
{
const
close
=
()
=>
{
delView
(
unref
(
currentRoute
))
delView
(
unref
(
currentRoute
))
push
({
name
:
'Trade
AfterSale
'
})
push
({
name
:
'Trade
Order
'
})
}
}
/** 复制 */
/** 复制 */
...
...
src/views/mall/trade/order/index.vue
View file @
ef152619
...
@@ -104,13 +104,19 @@
...
@@ -104,13 +104,19 @@
<el-form-item
label=
"聚合搜索"
>
<el-form-item
label=
"聚合搜索"
>
<el-input
<el-input
v-show=
"true"
v-show=
"true"
v-model=
"query
Type.v
"
v-model=
"query
Params[queryType.k]
"
class=
"!w-280px"
class=
"!w-280px"
clearable
clearable
placeholder=
"请输入"
placeholder=
"请输入"
>
>
<template
#
prepend
>
<template
#
prepend
>
<el-select
v-model=
"queryType.k"
class=
"!w-110px"
clearable
placeholder=
"全部"
>
<el-select
v-model=
"queryType.k"
class=
"!w-110px"
clearable
placeholder=
"全部"
@
change=
"inputChangeSelect"
>
<el-option
<el-option
v-for=
"dict in searchList"
v-for=
"dict in searchList"
:key=
"dict.value"
:key=
"dict.value"
...
@@ -335,41 +341,41 @@ const total = ref(2) // 列表的总页数
...
@@ -335,41 +341,41 @@ const total = ref(2) // 列表的总页数
const
list
=
ref
<
TradeOrderApi
.
OrderVO
[]
>
([])
// 列表的数据
const
list
=
ref
<
TradeOrderApi
.
OrderVO
[]
>
([])
// 列表的数据
const
queryFormRef
=
ref
<
FormInstance
>
()
// 搜索的表单
const
queryFormRef
=
ref
<
FormInstance
>
()
// 搜索的表单
// 表单搜索
// 表单搜索
const
queryParams
=
reactive
({
const
queryParams
=
ref
({
pageNo
:
1
,
//首页
pageNo
:
1
,
// 页数
pageSize
:
10
,
//页面大小
pageSize
:
10
,
// 每页显示数量
no
:
''
,
status
:
null
,
// 订单状态
userId
:
''
,
payChannelCode
:
null
,
// 支付方式
userNickname
:
''
,
createTime
:
null
,
// 创建时间
userMobile
:
''
,
terminal
:
null
,
// 订单来源
receiverName
:
''
,
type
:
null
,
// 订单类型
receiverMobile
:
''
,
deliveryType
:
null
,
// 配送方式
logisticsId
:
null
,
// 快递公司
terminal
:
''
,
pickUpStoreId
:
null
// 自提门店
type
:
null
,
status
:
null
,
payChannelCode
:
''
,
createTime
:
[],
deliveryType
:
null
,
spuName
:
''
,
itemCount
:
''
,
pickUpStoreId
:
[],
logisticsId
:
null
,
all
:
''
})
})
const
queryType
=
reactive
({
k
:
''
,
v
:
''
})
// 订单搜索类型kv
const
queryType
=
reactive
({
k
:
''
})
// 订单搜索类型 k
/**
* 订单聚合搜索
// 订单聚合搜索 select 类型配置
* 商品名称、商品件数、全部
*
* 需要后端支持 TODO
*/
const
searchList
=
ref
([
const
searchList
=
ref
([
{
value
:
'no'
,
label
:
'订单号'
},
{
value
:
'no'
,
label
:
'订单号'
},
{
value
:
'userId'
,
label
:
'用户UID'
},
{
value
:
'userId'
,
label
:
'用户UID'
},
{
value
:
'userNickname'
,
label
:
'用户昵称'
},
{
value
:
'userNickname'
,
label
:
'用户昵称'
},
{
value
:
'userMobile'
,
label
:
'用户电话'
}
{
value
:
'userMobile'
,
label
:
'用户电话'
}
])
])
/**
* 聚合搜索切换查询对象时触发
* @param val
*/
const
inputChangeSelect
=
(
val
:
string
)
=>
{
searchList
.
value
.
filter
((
item
)
=>
item
.
value
!==
val
)
?.
forEach
((
item1
)
=>
{
// 清除集合搜索无用属性
if
(
queryParams
.
value
.
hasOwnProperty
(
item1
.
value
))
{
delete
queryParams
.
value
[
item1
.
value
]
}
})
}
const
headerStyle
=
({
row
,
columnIndex
}:
any
)
=>
{
const
headerStyle
=
({
row
,
columnIndex
}:
any
)
=>
{
// 表头第一行第一列占 8
// 表头第一行第一列占 8
...
@@ -417,7 +423,7 @@ const spanMethod = ({ row, rowIndex, columnIndex }: SpanMethodProps) => {
...
@@ -417,7 +423,7 @@ const spanMethod = ({ row, rowIndex, columnIndex }: SpanMethodProps) => {
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
const
data
=
await
TradeOrderApi
.
getOrderPage
(
queryParams
)
const
data
=
await
TradeOrderApi
.
getOrderPage
(
unref
(
queryParams
)
)
list
.
value
=
data
.
list
list
.
value
=
data
.
list
total
.
value
=
data
.
total
total
.
value
=
data
.
total
}
finally
{
}
finally
{
...
@@ -427,13 +433,25 @@ const getList = async () => {
...
@@ -427,13 +433,25 @@ const getList = async () => {
/** 搜索按钮操作 */
/** 搜索按钮操作 */
const
handleQuery
=
async
()
=>
{
const
handleQuery
=
async
()
=>
{
queryParams
.
pageNo
=
1
queryParams
.
value
.
pageNo
=
1
await
getList
()
await
getList
()
}
}
/** 重置按钮操作 */
/** 重置按钮操作 */
const
resetQuery
=
()
=>
{
const
resetQuery
=
()
=>
{
queryFormRef
.
value
?.
resetFields
()
queryFormRef
.
value
?.
resetFields
()
queryParams
.
value
=
{
pageNo
:
1
,
// 页数
pageSize
:
10
,
// 每页显示数量
status
:
null
,
// 订单状态
payChannelCode
:
null
,
// 支付方式
createTime
:
null
,
// 创建时间
terminal
:
null
,
// 订单来源
type
:
null
,
// 订单类型
deliveryType
:
null
,
// 配送方式
logisticsId
:
null
,
// 快递公司
pickUpStoreId
:
null
// 自提门店
}
handleQuery
()
handleQuery
()
}
}
...
...
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