Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_web
Commits
7574f58d
Commit
7574f58d
authored
Feb 28, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单退款功能及网关状态查询条件
parent
14c9f651
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
199 additions
and
9 deletions
+199
-9
coupon.js
src/api/system/coupon.js
+8
-0
order.js
src/api/system/order.js
+9
-0
index.vue
src/views/system/gateway/index.vue
+10
-0
index.vue
src/views/system/order/index.vue
+172
-9
No files found.
src/api/system/coupon.js
View file @
7574f58d
...
...
@@ -31,6 +31,14 @@ export function listDuration(query) {
})
}
export
function
durationCoupon
(
query
)
{
return
request
({
url
:
'/system/coupon/list/durationCoupon'
,
method
:
'get'
,
params
:
query
})
}
export
function
listGroup
(
query
)
{
return
request
({
url
:
'/system/coupon/list/group'
,
...
...
src/api/system/order.js
View file @
7574f58d
...
...
@@ -60,3 +60,12 @@ export function repealOrder(data) {
data
})
}
// 退款操作
export
function
refund
(
data
)
{
return
request
({
url
:
'/system/order/refund'
,
method
:
'post'
,
data
:
data
})
}
src/views/system/gateway/index.vue
View file @
7574f58d
...
...
@@ -28,6 +28,16 @@
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"设备状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in dict.type.device_status"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
></el-option>
</el-select>
</el-form-item>
<!--
<el-form-item
label=
"设备ID"
prop=
"devId"
>
-->
<!--
<el-input-->
<!-- v-model="queryParams.devId"-->
...
...
src/views/system/order/index.vue
View file @
7574f58d
...
...
@@ -302,13 +302,13 @@
<
el
-
table
-
column
label
=
"备注"
align
=
"center"
prop
=
"remark"
/>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<!--
<
el
-
button
-->
<!--
size
=
"mini"
-->
<!--
type
=
"text"
-->
<!--
icon
=
"el-icon-edit"
-->
<!--
@
click
=
"handleUpdate(scope.row)"
-->
<!--
v
-
hasPermi
=
"['system:order:edit']"
-->
<!--
>
修改
<
/el-button>--
>
<
el
-
button
v
-
if
=
"scope.row.payStatus == 1 && scope.row.status != 3"
size
=
"mini"
type
=
"text"
icon
=
"el-icon-edit"
@
click
=
"orderRefund(scope.row)"
v
-
hasPermi
=
"['system:order:refund']"
>
退款
<
/el-button
>
<!--
<
el
-
button
-->
<!--
size
=
"mini"
-->
<!--
type
=
"text"
-->
...
...
@@ -479,11 +479,113 @@
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<!--
订单退款对话框
-->
<
el
-
dialog
:
title
=
"refundTitle"
:
visible
.
sync
=
"refundOpen"
width
=
"800px"
append
-
to
-
body
>
<
el
-
form
ref
=
"refundForm"
:
model
=
"refundForm"
:
rules
=
"refundRules"
label
-
width
=
"120px"
>
<
el
-
alert
title
=
"1: 退款金额可修改,但不能大于实际付款金额"
type
=
"error"
:
closable
=
"false"
show
-
icon
>
<
/el-alert
>
<
el
-
divider
><
/el-divider
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"订单号"
prop
=
"orderNo"
>
<
el
-
input
v
-
model
=
"refundForm.orderNo"
:
readonly
=
"true"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"订单状态"
prop
=
"orderStatus"
>
<
el
-
input
v
-
model
=
"refundForm.orderStatus"
:
readonly
=
"true"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"是否使用优惠券"
prop
=
"isUseCoupon"
>
<
el
-
radio
-
group
v
-
model
=
"refundForm.isUseCoupon"
:
readonly
=
"true"
>
<
el
-
radio
v
-
for
=
"dict in dict.type.store_is_use_coupon"
:
key
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radio
>
<
/el-radio-group
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"优惠券名称"
prop
=
"couponName"
>
<
el
-
input
v
-
model
=
"refundForm.couponName"
:
readonly
=
"true"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"优惠券金额"
prop
=
"couponAmount"
>
<
el
-
input
v
-
model
=
"refundForm.couponAmount"
:
readonly
=
"true"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"实际支付金额"
prop
=
"payAmount"
>
<
el
-
input
v
-
model
=
"refundForm.payAmount"
:
readonly
=
"true"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"退款金额"
prop
=
"amount"
>
<
el
-
input
v
-
model
=
"refundForm.amount"
type
=
"number"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"是否退券"
prop
=
"refundCoupon"
>
<
el
-
radio
-
group
v
-
model
=
"refundForm.refundCoupon"
>
<
el
-
radio
v
-
for
=
"dict in dict.type.store_is_use_coupon"
:
key
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radio
>
<
/el-radio-group
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"是否生成保洁"
prop
=
"isClean"
>
<
el
-
radio
-
group
v
-
model
=
"refundForm.isClean"
>
<
el
-
radio
v
-
for
=
"dict in dict.type.store_is_use_coupon"
:
key
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radio
>
<
/el-radio-group
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"20"
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
label
=
"退款原因"
prop
=
"refundReason"
>
<
el
-
input
v
-
model
=
"refundForm.refundReason"
type
=
"textarea"
:
rows
=
"3"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
/el-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"submitRefundForm"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listOrder
,
getOrder
,
delOrder
,
addOrder
,
updateOrder
,
repealOrder
}
from
"@/api/system/order"
;
import
{
listOrder
,
getOrder
,
delOrder
,
addOrder
,
updateOrder
,
repealOrder
,
refund
}
from
"@/api/system/order"
;
import
{
allList
}
from
"@/api/system/store"
;
import
{
queryRoom
}
from
"@/api/system/room"
;
import
{
query
}
from
"@/api/system/pack"
;
...
...
@@ -579,7 +681,17 @@ export default {
remark
:
[
{
required
:
true
,
message
:
"备注不能为空"
,
trigger
:
"blur"
}
]
}
}
,
refundTitle
:
""
,
refundOpen
:
false
,
// 表单参数
refundForm
:
{
}
,
// 表单校验
refundRules
:
{
amount
:
[
{
required
:
true
,
message
:
"退款金额不能为空"
,
trigger
:
"blur"
}
]
}
,
}
;
}
,
created
()
{
...
...
@@ -675,6 +787,8 @@ export default {
this
.
repealOpen
=
false
;
this
.
open
=
false
;
this
.
reset
();
this
.
refundOpen
=
false
;
this
.
resetRefund
();
}
,
// 表单重置
reset
()
{
...
...
@@ -708,6 +822,20 @@ export default {
this
.
resetForm
(
"form"
);
this
.
resetForm
(
"repealForm"
);
}
,
resetRefund
()
{
this
.
refundForm
=
{
orderNo
:
null
,
isUseCoupon
:
null
,
couponName
:
null
,
couponAmount
:
null
,
payAmount
:
null
,
amount
:
null
,
refundCoupon
:
'0'
,
isClean
:
'0'
,
refundReason
:
null
,
orderStatus
:
null
}
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
...
...
@@ -780,6 +908,41 @@ export default {
this
.
download
(
'system/order/export'
,
{
...
this
.
queryParams
}
,
`order_${new Date().getTime()
}
.xlsx`
)
}
,
/** 退款按钮操作 */
orderRefund
(
row
)
{
this
.
resetRefund
();
this
.
refundOpen
=
true
;
this
.
refundTitle
=
"订单退款"
;
this
.
refundForm
.
orderNo
=
row
.
orderNo
;
this
.
refundForm
.
orderStatus
=
this
.
orderStatusFormat
(
row
.
status
);
this
.
refundForm
.
isUseCoupon
=
row
.
couponId
?
'1'
:
'0'
;
if
(
row
.
couponId
)
{
let
coupon
=
this
.
couponList
.
find
(
item
=>
item
.
id
===
row
.
couponId
);
this
.
refundForm
.
couponName
=
coupon
.
name
;
this
.
refundForm
.
couponAmount
=
coupon
.
subPrice
?
coupon
.
subPrice
:
row
.
couponPrice
;
}
this
.
refundForm
.
payAmount
=
row
.
payPrice
;
this
.
refundForm
.
amount
=
row
.
payPrice
?
row
.
payPrice
:
0
;
this
.
refundForm
.
refundCoupon
=
'0'
;
this
.
refundForm
.
isClean
=
'0'
;
}
,
// 字典翻译
orderStatusFormat
(
value
)
{
return
this
.
selectDictLabel
(
this
.
dict
.
type
.
order_status_admin
,
value
);
}
,
/** 退款提交按钮操作 */
submitRefundForm
()
{
this
.
$refs
[
"refundForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
refund
(
this
.
refundForm
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"退款成功"
);
this
.
refundOpen
=
false
;
this
.
getList
();
}
);
}
}
)
}
}
}
;
...
...
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