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
4c2eb3d8
authored
Oct 04, 2023
by
芋道源码
Committed by
Gitee
Oct 04, 2023
Browse files
Options
Browse Files
Download
Plain Diff
!262 核销
Merge pull request !262 from 疯狂的世界/dev
parents
7c491ff6
58b6b1ba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
12 deletions
+103
-12
src/api/mall/trade/order/index.ts
+5
-0
src/utils/constants.ts
+25
-0
src/views/mall/trade/order/detail/index.vue
+34
-5
src/views/mall/trade/order/index.vue
+39
-7
No files found.
src/api/mall/trade/order/index.ts
View file @
4c2eb3d8
...
@@ -139,3 +139,8 @@ export const updateOrderPrice = async (data: any) => {
...
@@ -139,3 +139,8 @@ export const updateOrderPrice = async (data: any) => {
export
const
updateOrderAddress
=
async
(
data
:
any
)
=>
{
export
const
updateOrderAddress
=
async
(
data
:
any
)
=>
{
return
await
request
.
put
({
url
:
`/trade/order/update-address`
,
data
})
return
await
request
.
put
({
url
:
`/trade/order/update-address`
,
data
})
}
}
// 订单核销
export
const
pickUpOrder
=
async
(
id
:
number
)
=>
{
return
await
request
.
put
({
url
:
`/trade/order/pick-up?id=
${
id
}
`
})
}
src/utils/constants.ts
View file @
4c2eb3d8
...
@@ -389,3 +389,28 @@ export const DeliveryTypeEnum = {
...
@@ -389,3 +389,28 @@ export const DeliveryTypeEnum = {
name
:
'到店自提'
name
:
'到店自提'
}
}
}
}
/**
* 交易订单 - 状态
*/
export
const
TradeOrderStatusEnum
=
{
UNPAID
:
{
status
:
0
,
name
:
'待支付'
},
UNDELIVERED
:
{
status
:
10
,
name
:
'待发货'
},
DELIVERED
:
{
status
:
20
,
name
:
'已发货'
},
COMPLETED
:
{
status
:
30
,
name
:
'已完成'
},
CANCELED
:
{
status
:
40
,
name
:
'已取消'
}
}
src/views/mall/trade/order/detail/index.vue
View file @
4c2eb3d8
...
@@ -27,24 +27,40 @@
...
@@ -27,24 +27,40 @@
<dict-tag
:type=
"DICT_TYPE.TRADE_ORDER_STATUS"
:value=
"formData.status!"
/>
<dict-tag
:type=
"DICT_TYPE.TRADE_ORDER_STATUS"
:value=
"formData.status!"
/>
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label-class-name=
"no-colon"
>
<el-descriptions-item
label-class-name=
"no-colon"
>
<el-button
v-if=
"formData.status! === 0"
type=
"primary"
@
click=
"updatePrice"
>
<el-button
v-if=
"formData.status! === TradeOrderStatusEnum.UNPAID.status"
type=
"primary"
@
click=
"updatePrice"
>
调整价格
调整价格
</el-button>
</el-button>
<el-button
type=
"primary"
@
click=
"remark"
>
备注
</el-button>
<el-button
type=
"primary"
@
click=
"remark"
>
备注
</el-button>
<!-- 待发货 -->
<template
v-if=
"formData.status! === TradeOrderStatusEnum.UNDELIVERED.status"
>
<!-- 快递发货 -->
<el-button
<el-button
v-if=
"formData.status! === 10 &&
formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
v-if=
"
formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
type=
"primary"
type=
"primary"
@
click=
"delivery"
@
click=
"delivery"
>
>
发货
发货
</el-button>
</el-button>
<el-button
<el-button
v-if=
"formData.status! === 10 &&
formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
v-if=
"
formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
type=
"primary"
type=
"primary"
@
click=
"updateAddress"
@
click=
"updateAddress"
>
>
修改地址
修改地址
</el-button>
</el-button>
<!-- 到店自提 -->
<el-button
v-if=
"formData.deliveryType === DeliveryTypeEnum.PICK_UP.type"
type=
"primary"
@
click=
"handlePickUp"
>
核销
</el-button>
</
template
>
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item>
<el-descriptions-item>
<
template
#
label
><span
style=
"color: red"
>
提醒:
</span></
template
>
<
template
#
label
><span
style=
"color: red"
>
提醒:
</span></
template
>
...
@@ -168,7 +184,7 @@
...
@@ -168,7 +184,7 @@
<!-- 自提门店 -->
<!-- 自提门店 -->
<div
v-if=
"formData.deliveryType === DeliveryTypeEnum.PICK_UP.type"
>
<div
v-if=
"formData.deliveryType === DeliveryTypeEnum.PICK_UP.type"
>
<el-descriptions-item
label=
"自提门店: "
v-if=
"formData.pickUpStoreId"
>
<el-descriptions-item
label=
"自提门店: "
v-if=
"formData.pickUpStoreId"
>
{{ pickUpStore.name }}
{{ pickUpStore
?
.name }}
</el-descriptions-item>
</el-descriptions-item>
</div>
</div>
</el-descriptions>
</el-descriptions>
...
@@ -217,7 +233,7 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd
...
@@ -217,7 +233,7 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd
import
OrderUpdatePriceForm
from
'@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
import
OrderUpdatePriceForm
from
'@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
import
*
as
DeliveryExpressApi
from
'@/api/mall/trade/delivery/express'
import
*
as
DeliveryExpressApi
from
'@/api/mall/trade/delivery/express'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
DeliveryTypeEnum
}
from
'@/utils/constants'
import
{
DeliveryTypeEnum
,
TradeOrderStatusEnum
}
from
'@/utils/constants'
import
*
as
DeliveryPickUpStoreApi
from
'@/api/mall/trade/delivery/pickUpStore'
import
*
as
DeliveryPickUpStoreApi
from
'@/api/mall/trade/delivery/pickUpStore'
defineOptions
({
name
:
'TradeOrderDetail'
})
defineOptions
({
name
:
'TradeOrderDetail'
})
...
@@ -263,6 +279,19 @@ const updatePrice = () => {
...
@@ -263,6 +279,19 @@ const updatePrice = () => {
updatePriceFormRef
.
value
?.
open
(
formData
.
value
)
updatePriceFormRef
.
value
?.
open
(
formData
.
value
)
}
}
/** 核销 */
const
handlePickUp
=
async
()
=>
{
try
{
// 二次确认
await
message
.
confirm
(
'确认核销订单吗?'
)
// 提交
await
TradeOrderApi
.
pickUpOrder
(
formData
.
value
.
id
!
)
message
.
success
(
'核销成功'
)
// 刷新列表
await
getDetail
()
}
catch
{}
}
/** 获得详情 */
/** 获得详情 */
const
{
params
}
=
useRoute
()
// 查询参数
const
{
params
}
=
useRoute
()
// 查询参数
const
getDetail
=
async
()
=>
{
const
getDetail
=
async
()
=>
{
...
...
src/views/mall/trade/order/index.vue
View file @
4c2eb3d8
...
@@ -74,7 +74,11 @@
...
@@ -74,7 +74,11 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"queryParams.deliveryType === 1"
label=
"快递公司"
>
<el-form-item
v-if=
"queryParams.deliveryType === DeliveryTypeEnum.EXPRESS.type"
label=
"快递公司"
prop=
"logisticsId"
>
<el-select
v-model=
"queryParams.logisticsId"
class=
"!w-280px"
clearable
placeholder=
"全部"
>
<el-select
v-model=
"queryParams.logisticsId"
class=
"!w-280px"
clearable
placeholder=
"全部"
>
<el-option
<el-option
v-for=
"item in deliveryExpressList"
v-for=
"item in deliveryExpressList"
...
@@ -84,7 +88,11 @@
...
@@ -84,7 +88,11 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"queryParams.deliveryType === 2"
label=
"自提门店"
>
<el-form-item
v-if=
"queryParams.deliveryType === DeliveryTypeEnum.PICK_UP.type"
label=
"自提门店"
prop=
"pickUpStoreId"
>
<el-select
<el-select
v-model=
"queryParams.pickUpStoreId"
v-model=
"queryParams.pickUpStoreId"
class=
"!w-280px"
class=
"!w-280px"
...
@@ -100,6 +108,19 @@
...
@@ -100,6 +108,19 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"queryParams.deliveryType === DeliveryTypeEnum.PICK_UP.type"
label=
"核销码"
prop=
"pickUpVerifyCode"
>
<el-input
v-model=
"queryParams.pickUpVerifyCode"
class=
"!w-280px"
clearable
placeholder=
"请输入自提核销码"
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<!-- TODO puhui 聚合搜索等售后结束后实现-->
<!-- TODO puhui 聚合搜索等售后结束后实现-->
<!-- TODO puhui999:尽量不要用 .k 这样的参数,完整拼写,有完整的业务含义 -->
<!-- TODO puhui999:尽量不要用 .k 这样的参数,完整拼写,有完整的业务含义 -->
<el-form-item
label=
"聚合搜索"
>
<el-form-item
label=
"聚合搜索"
>
...
@@ -234,7 +255,10 @@
...
@@ -234,7 +255,10 @@
<el-table-column
label=
"买家/收货人"
min-width=
"160"
>
<el-table-column
label=
"买家/收货人"
min-width=
"160"
>
<
template
#
default
>
<
template
#
default
>
<!-- 快递发货 -->
<!-- 快递发货 -->
<div
v-if=
"scope.row.deliveryType === 1"
class=
"flex flex-col"
>
<div
v-if=
"scope.row.deliveryType === DeliveryTypeEnum.EXPRESS.type"
class=
"flex flex-col"
>
<span>
买家:
{{
scope
.
row
.
user
.
nickname
}}
</span>
<span>
买家:
{{
scope
.
row
.
user
.
nickname
}}
</span>
<span>
<span>
收货人:
{{
scope
.
row
.
receiverName
}}
{{
scope
.
row
.
receiverMobile
}}
收货人:
{{
scope
.
row
.
receiverName
}}
{{
scope
.
row
.
receiverMobile
}}
...
@@ -242,7 +266,10 @@
...
@@ -242,7 +266,10 @@
</span>
</span>
</div>
</div>
<!-- 自提 -->
<!-- 自提 -->
<div
v-if=
"scope.row.deliveryType === 2"
class=
"flex flex-col"
>
<div
v-if=
"scope.row.deliveryType === DeliveryTypeEnum.PICK_UP.type"
class=
"flex flex-col"
>
<span>
<span>
门店名称:
门店名称:
{{
pickUpStoreList
.
find
((
p
)
=>
p
.
id
===
scope
.
row
.
pickUpStoreId
)?.
name
}}
{{
pickUpStoreList
.
find
((
p
)
=>
p
.
id
===
scope
.
row
.
pickUpStoreId
)?.
name
}}
...
@@ -273,7 +300,7 @@
...
@@ -273,7 +300,7 @@
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"160"
>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"160"
>
<
template
#
default
>
<
template
#
default
>
<!-- TODO 权限后续补齐 -->
<!-- TODO 权限后续补齐 -->
<div
class=
"flex
justify-center items
-center"
>
<div
class=
"flex
items-center justify
-center"
>
<el-button
link
type=
"primary"
@
click=
"openDetail(scope.row.id)"
>
<el-button
link
type=
"primary"
@
click=
"openDetail(scope.row.id)"
>
<Icon
icon=
"ep:notification"
/>
<Icon
icon=
"ep:notification"
/>
详情
详情
...
@@ -287,7 +314,10 @@
...
@@ -287,7 +314,10 @@
<el-dropdown-menu>
<el-dropdown-menu>
<!-- 如果是【快递】,并且【未发货】,则展示【发货】按钮 -->
<!-- 如果是【快递】,并且【未发货】,则展示【发货】按钮 -->
<el-dropdown-item
<el-dropdown-item
v-if=
"scope.row.deliveryType === 1 && scope.row.status === 10"
v-if=
"
scope.row.deliveryType === DeliveryTypeEnum.EXPRESS.type &&
scope.row.status === TradeOrderStatusEnum.UNDELIVERED.status
"
command=
"delivery"
command=
"delivery"
>
>
<Icon
icon=
"ep:takeaway-box"
/>
<Icon
icon=
"ep:takeaway-box"
/>
...
@@ -332,6 +362,7 @@ import { formatDate } from '@/utils/formatTime'
...
@@ -332,6 +362,7 @@ import { formatDate } from '@/utils/formatTime'
import
{
floatToFixed2
}
from
'@/utils'
import
{
floatToFixed2
}
from
'@/utils'
import
{
createImageViewer
}
from
'@/components/ImageViewer'
import
{
createImageViewer
}
from
'@/components/ImageViewer'
import
*
as
DeliveryExpressApi
from
'@/api/mall/trade/delivery/express'
import
*
as
DeliveryExpressApi
from
'@/api/mall/trade/delivery/express'
import
{
DeliveryTypeEnum
,
TradeOrderStatusEnum
}
from
'@/utils/constants'
defineOptions
({
name
:
'TradeOrder'
})
defineOptions
({
name
:
'TradeOrder'
})
...
@@ -352,7 +383,8 @@ const queryParams = ref({
...
@@ -352,7 +383,8 @@ const queryParams = ref({
type
:
null
,
// 订单类型
type
:
null
,
// 订单类型
deliveryType
:
null
,
// 配送方式
deliveryType
:
null
,
// 配送方式
logisticsId
:
null
,
// 快递公司
logisticsId
:
null
,
// 快递公司
pickUpStoreId
:
null
// 自提门店
pickUpStoreId
:
null
,
// 自提门店
pickUpVerifyCode
:
null
// 自提核销码
})
})
const
queryType
=
reactive
({
k
:
''
})
// 订单搜索类型 k
const
queryType
=
reactive
({
k
:
''
})
// 订单搜索类型 k
...
...
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