Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
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
micro_app
gk
Commits
012a9720
Commit
012a9720
authored
Nov 25, 2025
by
daniel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(gpsDeposit): 批量退款联调
parent
d7b4661f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
195 additions
and
50 deletions
+195
-50
gpsDeposit.jsp
src/main/webapp/WEB-INF/views/cmpt/gpsDeposit.jsp
+195
-50
No files found.
src/main/webapp/WEB-INF/views/cmpt/gpsDeposit.jsp
View file @
012a9720
...
...
@@ -119,7 +119,7 @@
<
div
style
=
"min-width: 520px"
v
-
if
=
"tabIndex===2"
>
<
n
-
tabs
type
=
"segment"
@
update
:
value
=
"updateStatus"
:
value
=
"query.
s
tatus"
animated
pane
-
style
=
"padding:0;"
>
@
update
:
value
=
"updateStatus"
:
value
=
"query.
tradeS
tatus"
animated
pane
-
style
=
"padding:0;"
>
<
n
-
tab
-
pane
v
-
for
=
"item in tradeStatusOptions"
:
name
=
"item.value"
...
...
@@ -141,11 +141,11 @@
<
/div
>
<
div
class
=
"w-full gap-x-2 flex flex-row items-center mt-3"
>
<
n
-
space
v
-
if
=
"tabIndex===2"
>
<
n
-
button
type
=
"
primary
"
@
click
=
"refundAll"
>
一键
归还
<
n
-
button
type
=
"
error
"
@
click
=
"refundAll"
>
一键
退款
<
/n-button
>
<
n
-
button
v
-
if
=
"checkedRowKeys.length"
@
click
=
"batchRefund"
type
=
"error"
>
批量退款
批量退款
{{
checkedRowKeys
.
length
>
0
?
'(已选择'
+
checkedRowKeys
.
length
+
'条订单)'
:
''
}}
<
/n-button
>
<
/n-space
>
<
n
-
space
v
-
if
=
"tabIndex===3"
>
...
...
@@ -214,24 +214,33 @@
<
/n-button
>
<
/template
>
<
/n-card
>
<
n
-
modal
v
-
model
:
show
=
"showModal"
preset
=
"dialog"
title
=
"确认"
content
=
"是否确定开始随机分配?"
positive
-
text
=
"确认"
negative
-
text
=
"取消"
@
positive
-
click
/>
<
n
-
modal
v
-
model
:
show
=
"showBatchModal"
preset
=
"dialog"
title
=
"批量退款"
content
=
"是否确定对选中的用户进行退款?"
positive
-
text
=
"确认"
negative
-
text
=
"取消"
@
positive
-
click
=
"batchRefund"
/>
<
n
-
modal
:
mask
-
closable
=
"false"
:
loading
=
"loading"
style
=
"width: 300px"
title
=
"修改订单"
preset
=
"card"
draggable
v
-
model
:
show
=
"showEditModal"
>
<
n
-
form
ref
=
"editOrderFormRef"
:
model
=
"editOrderValue"
:
rules
=
"editOrderRules"
size
=
"small"
label
-
placement
=
"left"
label
-
width
=
"auto"
>
<
n
-
form
-
item
label
=
"参赛号"
path
=
"markNo"
>
<
n
-
input
clearable
type
=
"text"
v
-
model
:
value
=
"editOrderValue.markNo"
placeholder
=
"请输入参赛号"
/>
<
/n-form-item
>
<
/n-form
>
<
template
#
footer
>
<
div
class
=
"flex gap-x-2 flex-row items-center"
>
<
n
-
button
class
=
"flex-1"
:
loading
=
"loading"
@
click
=
"onEditCancel"
>
取消
<
/n-button
>
<
n
-
button
class
=
"flex-1"
:
loading
=
"loading"
type
=
'primary'
@
click
=
"editOrder"
>
保存
<
/n-button
>
<
/div
>
<
/template
>
<
/n-modal
>
<
/n-space
>
</script>
<script>
...
...
@@ -412,8 +421,8 @@
const
{
useMessage
,
useNotification
,
dateZhCN
,
NButton
,
NTag
,
zhCN
,
NSpace
,
NImageGroup
,
NImage
,
NText
}
=
naive
// 添加全局 loading 指令
const
uploadUrl
=
window
.
location
.
origin
+
'/api-common/v1/upload?folder='
+
'gk/invoice'
+
'&cmptId='
+
getCId
()
const
BASE_ECC_URL
=
"https://ecc.geexek.com"
//
const BASE_ECC_URL = "http://localhost:8081"
//
const BASE_ECC_URL = "https://ecc.geexek.com"
const
BASE_ECC_URL
=
"http://localhost:8081"
// 随机分配名单
const
RANDOM_ASSIGN_URL
=
BASE_ECC_URL
+
'/api-pick/v1/pick-up-batch?cmptId='
+
getCId
()
...
...
@@ -424,11 +433,16 @@
// 获取订单
const
GET_ORDER_PAGE_URL
=
BASE_ECC_URL
+
"/api-order/v1/order-list"
// 删除订单
const
DELETE_ORDER_URL
=
BASE_ECC_URL
+
"/api-order/v1/delete
-order
"
const
DELETE_ORDER_URL
=
BASE_ECC_URL
+
"/api-order/v1/delete"
// 订单退款
const
ORDER_REFUND_URL
=
BASE_ECC_URL
+
"/api-refund/v1/refund"
// 批量退款
const
ORDER_BATCH_REFUND_URL
=
BASE_ECC_URL
+
"/api-refund/v1/batch-refund"
// 一键退款
const
ORDER_REFUN_ALL_URL
=
BASE_ECC_URL
+
"/api-refund/v1/refund-all"
// 编辑订单
const
EDIT_ORDER_URL
=
BASE_ECC_URL
+
"/api-order/v1/edit"
// 一键退款
// 获取赛事信息
const
GET_CMPT_URL
=
"https://timerbackend.geexek.com/getCmpt.do?cmptId="
+
getCId
()
...
...
@@ -691,6 +705,14 @@
await
deleteOrder
(
row
)
}
},
'删除订单'
),
// 编辑订单
[
TradeStatusEnum
.
WAIT_PAY
.
value
,
TradeStatusEnum
.
PAY_SUCCESS
.
value
].
includes
(
row
.
tradeStatus
)
&&
h
(
NButton
,
{
type
:
'primary'
,
size
:
'small'
,
onClick
:
()
=>
{
openEditModal
(
row
)
}
},
'编辑订单'
),
])
}
...
...
@@ -721,10 +743,24 @@
tradeStatus
:
undefined
,
})
// 删除自助选号
const
showModal
=
ref
(
false
)
const
showBatchModal
=
ref
(
false
)
const
showEditModal
=
ref
(
false
)
// 订单列表
const
orders
=
ref
([])
// 反馈表单
const
editOrderValue
=
reactive
({
id
:
undefined
,
markNo
:
''
,
})
// 反馈的校验规则
editOrderRules
=
{
markNo
:
{
required
:
true
,
message
:
'请输入参赛号'
,
trigger
:
'blur'
}
}
// 反馈的formRef
const
editOrderFormRef
=
ref
(
null
)
/***----------------订单列表 end -----------------*/
/***----------------押金配置 start -----------------*/
...
...
@@ -749,6 +785,7 @@
message
:
'请输入押金金额'
,
},
}
/***----------------押金配置 end -----------------*/
/***----------------订单列表 start -----------------*/
function
handleCheck
(
rowKeys
)
{
...
...
@@ -768,12 +805,9 @@
tabIndex
.
value
=
value
if
(
value
===
TabEnum
.
ORDER
.
value
)
{
fetchOrders
()
getOrderStats
()
}
else
{
getDeposit
()
}
// 全部状态下不获取统计
// getOrderStats()
}
// 获取自助选号分页列表
const
fetchOrders
=
async
()
=>
{
...
...
@@ -793,6 +827,7 @@
},
body
:
JSON
.
stringify
(
params
)
}).
then
(
res
=>
res
.
json
()))
getOrderStats
()
loading
.
value
=
false
if
(
err
)
{
message
.
error
(
err
)
...
...
@@ -844,7 +879,7 @@
let
params
=
{
applyId
:
row
.
applyId
,
refundAmount
:
row
.
refundAmount
,
refundReason
:
getCId
()
+
"_gps押金退款_"
+
row
.
markNo
,
refundReason
:
row
.
markNo
()
+
"gps押金退款"
,
operatorCode
:
getUId
(),
}
const
[
err
,
res
]
=
await
to
(
fetch
(
ORDER_REFUND_URL
,
{
...
...
@@ -862,7 +897,6 @@
if
(
res
.
code
===
200
)
{
message
.
success
(
'退款成功'
)
fetchOrders
()
getOrderStats
()
}
else
{
message
.
error
(
res
.
message
)
}
...
...
@@ -890,18 +924,54 @@
if
(
res
.
code
===
200
)
{
message
.
success
(
'删除成功'
)
fetchOrders
()
getOrderStats
()
}
else
{
message
.
error
(
res
.
message
)
}
}
// 打开编辑订单
const
openEditModal
=
(
row
)
=>
{
editOrderValue
.
id
=
row
.
id
editOrderValue
.
markNo
=
row
.
markNo
editOrderFormRef
.
value
?.
resetFields
()
showEditModal
.
value
=
true
}
// 编辑订单
const
editOrder
=
async
()
=>
{
editOrderFormRef
.
value
?.
validate
(
async
(
errors
)
=>
{
if
(
errors
)
return
message
.
error
(
'请检查表单是否填写完整'
)
loading
.
value
=
true
const
[
err
,
res
]
=
await
to
(
fetch
(
EDIT_ORDER_URL
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
editOrderValue
)
}).
then
(
res
=>
res
.
json
()))
loading
.
value
=
false
if
(
err
)
{
message
.
error
(
err
)
return
}
if
(
res
.
code
===
200
)
{
message
.
success
(
'编辑成功'
)
fetchOrders
()
showEditModal
.
value
=
false
}
else
{
message
.
error
(
res
.
message
)
}
})
}
// 取消编辑订单
const
onEditCancel
=
()
=>
{
showEditModal
.
value
=
false
}
// 富文本编辑器 .setContent() .getContent()
let
editor
;
/***---------------- 自助选号相关 end -----------------*/
/***---------------- 押金交互相关 start -----------------*/
//
todo
保存押金配置
// 保存押金配置
const
saveDeposit
=
()
=>
{
depositFormRef
.
value
?.
validate
(
async
(
errors
)
=>
{
if
(
errors
)
return
message
.
error
(
'请检查表单是否填写完整'
)
...
...
@@ -930,9 +1000,7 @@
message
.
error
(
res
.
message
)
}
})
}
// 获取赛事信息
const
getCmptInfo
=
async
()
=>
{
loading
.
value
=
true
...
...
@@ -971,7 +1039,6 @@
}
if
(
res
.
code
===
200
)
{
if
(
res
.
data
)
{
// depositForm.value = res.data
depositForm
.
value
.
id
=
res
.
data
.
id
depositForm
.
value
.
amount
=
res
.
data
.
amount
depositForm
.
value
.
status
=
res
.
data
.
status
...
...
@@ -984,21 +1051,95 @@
message
.
error
(
res
.
message
)
}
}
// todo 批量退款
const
batchRefund
=
()
=>
{
message
.
success
(
'功能未实现'
)
// 批量退款
const
batchRefund
=
async
()
=>
{
let
refundAmount
=
0
;
let
confirmFlag
=
confirm
(
'是否对选中的订单进行退款?'
)
if
(
!
confirmFlag
)
{
message
.
error
(
'已取消批量退款'
)
checkedRowKeys
.
value
=
[]
return
}
confirmFlag
=
confirm
(
'是否确定全额退款吗?'
)
if
(
!
confirmFlag
)
{
// 请输入退款金额
refundAmount
=
prompt
(
'请输入退款金额'
)
if
(
!
refundAmount
)
{
message
.
error
(
'请输入退款金额'
)
return
}
if
(
Number
(
refundAmount
)
>
Number
(
depositForm
.
value
.
amount
))
{
message
.
error
(
'退款金额不能大于押金金额'
)
return
}
}
// 批量退款 调用接口
loading
.
value
=
true
const
[
err
,
result
]
=
await
to
(
fetch
(
ORDER_BATCH_REFUND_URL
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
({
applyIds
:
checkedRowKeys
.
value
,
refundAmount
:
refundAmount
>
0
?
Number
(
refundAmount
)
:
null
,
operatorCode
:
getUId
(),
cmptId
:
getCId
()
})
}).
then
(
res
=>
res
.
json
())
)
loading
.
value
=
false
if
(
err
)
{
message
.
error
(
err
)
return
}
if
(
result
.
code
===
200
)
{
checkedRowKeys
.
value
=
[]
result
.
data
.
length
&&
confirm
(
result
.
data
.
map
(
v
=>
v
.
markNo
+
":"
+
v
.
result
).
join
(
'
\
n'
))
message
.
success
(
'退款操作成功,等待微信反馈结果'
)
fetchOrders
()
}
else
{
message
.
error
(
result
.
message
)
}
}
// todo 批量退款
const
refundAll
=
()
=>
{
message
.
success
(
'功能未实现'
)
// 一键退款
const
refundAll
=
async
()
=>
{
const
confirmFlag
=
confirm
(
'是否确定发起一键退款,该操作会将已归还设备的押金全额退款?'
)
if
(
!
confirmFlag
)
{
message
.
error
(
'已取消一键退款'
)
return
}
loading
.
value
=
true
// 批量退款 调用接口
const
[
err
,
result
]
=
await
to
(
fetch
(
ORDER_REFUN_ALL_URL
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
({
operatorCode
:
getUId
(),
cmptId
:
getCId
()
})
}).
then
(
res
=>
res
.
json
())
)
loading
.
value
=
false
if
(
err
)
{
message
.
error
(
err
)
return
}
if
(
result
.
code
===
200
)
{
result
.
data
.
length
&&
confirm
(
result
.
data
.
map
(
v
=>
v
.
markNo
+
":"
+
v
.
result
).
join
(
'
\
n'
))
message
.
success
(
'退款操作成功,等待微信反馈结果'
)
fetchOrders
()
}
else
{
message
.
error
(
result
.
message
)
}
}
/***---------------- 押金交互相关 end -----------------*/
onMounted
(()
=>
{
// getDeposit()
fetchOrders
()
getOrderStats
()
getCmptInfo
()
editor
=
UE
.
getEditor
(
'rich-text-container'
);
})
...
...
@@ -1020,8 +1161,7 @@
pagination
,
orderColumns
,
isConfigTab
,
showModal
,
showBatchModal
,
showEditModal
,
checkedRowKeys
,
fetchOrders
,
updateStatus
,
...
...
@@ -1040,7 +1180,12 @@
getDeposit
,
batchRefund
,
refundAll
,
// 编辑相关
editOrderValue
,
editOrderRules
,
editOrderFormRef
,
editOrder
,
onEditCancel
,
}
}
})
...
...
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