Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ba6e8a82
authored
Nov 15, 2024
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
积分抵扣
1 parent
aeb3e8b8
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1121 additions
and
21 deletions
src/api/point.js
src/common/util.js
src/router/modules/914_pointManagement.js
src/views/pointManagement/addDeduction.vue
src/views/pointManagement/components/ConfirmDialog.vue
src/views/pointManagement/components/chooseOrderDialog.vue
src/views/pointManagement/components/pointDetailDialog.vue
src/views/pointManagement/components/revocationDialog.vue
src/views/pointManagement/pointDetail.vue
src/views/pointManagement/pointParticulars.vue
src/api/point.js
View file @
ba6e8a8
...
...
@@ -64,3 +64,18 @@ export function markAsRefunded(data) {
data
.
method
=
`dj.api.smartcarlife.goodsOrder.points.markAsRefunded`
return
request
(
data
)
}
//积分管理-手动抵扣
export
function
manualDeduct
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.staff.score.manual.deduct`
return
request
(
data
)
}
// 查询可手动抵扣的订单列表
export
function
deductOrderPage
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.merchant.score.deduct.order.page`
return
request
(
data
)
}
// 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】
export
function
cancelDeduct
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.staff.score.cancel.deduct`
return
request
(
data
)
}
\ No newline at end of file
src/common/util.js
View file @
ba6e8a8
...
...
@@ -371,6 +371,30 @@ export const Util = {
browserType
=
"谷歌"
}
return
browserType
},
validateNumber
(
value
)
{
// 尝试将输入转换为浮点数
const
number
=
parseFloat
(
value
)
// 检查是否成功转换为数字,并且是否大于0
if
(
isNaN
(
number
)
||
number
<=
0
)
{
return
false
}
// 将数字转换为字符串,并检查小数点后的长度
const
numberString
=
number
.
toString
()
const
decimalIndex
=
numberString
.
indexOf
(
"."
)
// 如果没有小数点,则视为有效(例如,1或100)
if
(
decimalIndex
===
-
1
)
{
return
true
}
// 获取小数点后的部分
const
decimalPart
=
numberString
.
slice
(
decimalIndex
+
1
)
// 检查小数点后的长度是否不超过2
return
decimalPart
.
length
<=
2
}
}
...
...
src/router/modules/914_pointManagement.js
View file @
ba6e8a8
/*
* @Author: 王志慧 wangzh@didihu.com.cn
* @Date: 2024-08-13 14:35:06
* @LastEditors: 王志慧 wangzh@didihu.com.cn
* @LastEditTime: 2024-09-12 14:12:46
* @FilePath: \dj-car-life-system\src\router\modules\914_pointManagement.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const
_import
=
require
(
"@/libs/util.import."
+
process
.
env
.
NODE_ENV
)
export
const
routerName
=
{
914
:
{
...
...
@@ -81,6 +74,7 @@ export const routerName = {
]
},
{
authId
:
"9140202"
,
parentId
:
"91402"
,
...
...
@@ -88,7 +82,21 @@ export const routerName = {
category
:
"Button"
,
type
:
"primary"
,
handle
:
"handleExport"
}
},
{
authId
:
"9140203"
,
parentId
:
"91402"
,
label
:
"新增"
,
handle
:
"handleDetail"
,
addRoutePath
:
[
{
authId
:
"91404"
,
name
:
"新增手动抵扣"
,
parentId
:
"91402"
}
]
},
],
component
:
_import
(
"pointManagement/pointParticulars"
)
},
...
...
@@ -104,4 +112,17 @@ export const routerName = {
},
component
:
_import
(
"pointManagement/pointDetail"
)
},
//新增抵扣
91404
:
{
path
:
"/deduction"
,
name
:
"deduction"
,
meta
:
{
title
:
"新增抵扣"
,
authId
:
"91403"
,
parentId
:
"91402"
,
cache
:
false
,
activePath
:
"/pointParticulars"
},
component
:
_import
(
"pointManagement/addDeduction"
)
},
}
src/views/pointManagement/addDeduction.vue
0 → 100644
View file @
ba6e8a8
<
template
>
<div
class=
"revocation-wrap"
>
<div
class=
"content"
>
<div
class=
"title"
>
新增抵扣
</div>
<div
class=
"form-wrap"
>
<glsx-combi-form
class=
"form-container"
ref=
"formRef"
label-width=
"154px"
:isBlock=
"true"
:form-ref=
"childRef"
:form-obj=
"formObj"
:form-data=
"formData"
:form-rules=
"formRule"
>
<div
slot=
"orderData"
>
<div
class=
"order-btn"
@
click=
"handleChooseOrder"
>
选择订单
</div>
<d2-table
:table-params=
"tableParams"
:table-data=
"formObj.orderData"
:has-page=
"false"
>
<div
slot=
"orderGoodsName"
slot-scope=
"scope"
>
<span
v-for=
"(item, index) in scope.scope.subOrderList"
:key=
"index"
>
<p
v-if=
"item.upgradeGoodsId"
>
<el-tooltip
class=
"item"
:content=
"item.upgradeGoodsName"
placement=
"right"
>
<span>
{{
item
.
upgradeGoodsName
?
item
.
upgradeGoodsName
.
length
>
10
?
item
.
upgradeGoodsName
.
substring
(
0
,
10
)
+
"..."
:
item
.
upgradeGoodsName
:
"-"
}}
</span>
</el-tooltip>
</p>
<p
v-else
>
{{
item
.
baseGoodsName
}}
</p>
</span>
</div>
<div
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"deleteTable(scope.scope)"
>
删除
</el-button
>
</div>
</d2-table>
</div>
</glsx-combi-form>
</div>
</div>
<div
class=
"btn-wrap"
>
<div
class=
"btn btn-wrap-left"
@
click=
"submit"
>
提交
</div>
<div
class=
"btn btn-wrap-right"
@
click=
"cancel"
>
取消
</div>
</div>
<!-- 选择订单 -->
<choose-order-dialog
:visible=
"orderDialogVisible"
v-if=
"orderDialogVisible"
:choose-order-data=
"formObj.orderData"
@
dialogClose=
"handleClose"
@
chooseOrder=
"chooseOrder"
>
</choose-order-dialog>
<!-- 确认提醒 -->
<confirm-dialog
:visible=
"confirmDialogVisible"
v-if=
"confirmDialogVisible"
:data-info=
"formObj"
@
dialogClose=
"handleConfirmClose"
@
handleConfirm=
"handleComfirm"
></confirm-dialog>
</div>
</
template
>
<
script
>
import
{
Util
}
from
"@/common/util"
import
{
manualDeduct
}
from
"@api/point"
import
ChooseOrderDialog
from
"./components/chooseOrderDialog"
import
ConfirmDialog
from
"./components/ConfirmDialog"
export
default
{
components
:
{
ChooseOrderDialog
,
ConfirmDialog
},
data
()
{
function
checkPrice
(
rule
,
value
,
callback
)
{
if
(
!
Util
.
validateNumber
(
value
))
{
callback
(
new
Error
(
"输入范围为大于0的数字,至少支持小数点后两位"
))
return
false
}
callback
()
}
return
{
orderDialogVisible
:
false
,
confirmDialogVisible
:
false
,
//确认提醒
formObj
:
{
score
:
""
,
orderData
:
[],
orderCode
:
""
,
remark
:
""
,
operator
:
""
},
confirmData
:
{},
formData
:
[
{
label
:
"选择订单"
,
name
:
"orderData"
,
addHtml
:
"orderData"
},
{
label
:
"扣减积分"
,
name
:
"score"
,
type
:
"input"
,
maxlength
:
20
,
placeholder
:
"请输入"
,
tips
:
"此订单需要在员工账户里扣除的积分"
,
width
:
"136px"
},
{
label
:
"备注"
,
name
:
"remark"
,
type
:
"input"
,
maxlength
:
30
,
placeholder
:
"请输入"
,
inputType
:
"textarea"
,
width
:
"580px"
,
rows
:
3
}
],
formRule
:
{
orderData
:
[
{
required
:
true
,
message
:
"选择需要关联的已退款订单"
,
trigger
:
"change"
}
],
score
:
[
{
required
:
true
,
message
:
"请输入积分"
,
trigger
:
"change"
},
{
validator
:
checkPrice
,
trigger
:
"blur"
}
]
},
tableParams
:
{
tableOption
:
true
,
tableColumns
:
[
{
label
:
"订单编号"
,
prop
:
"orderCode"
,
width
:
"150px"
},
{
label
:
"订单时间"
,
prop
:
"orderTimeStr"
,
width
:
"200px"
},
{
label
:
"客户姓名"
,
prop
:
"customerName"
,
width
:
"120px"
},
{
label
:
"商品名称"
,
prop
:
"orderGoodsName"
,
addHtml
:
"orderGoodsName"
,
width
:
240
},
{
label
:
"总价"
,
prop
:
"totalPrice"
,
width
:
"120px"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
totalPrice
?
"¥"
+
cellValue
.
totalPrice
:
"0"
}
}
]
},
childRef
:
"editChildRef"
}
},
created
()
{},
methods
:
{
//订单选择成功
chooseOrder
(
data
)
{
this
.
formObj
.
orderData
=
data
this
.
orderDialogVisible
=
false
},
handleClose
()
{
this
.
orderDialogVisible
=
false
},
handleConfirmClose
()
{
this
.
confirmDialogVisible
=
false
},
handleComfirm
()
{
let
params
=
{
orderCode
:
this
.
formObj
.
orderData
[
0
].
orderCode
,
score
:
this
.
formObj
.
score
,
remark
:
this
.
formObj
.
remark
,
operator
:
this
.
formObj
.
operator
}
manualDeduct
(
params
)
.
then
((
result
)
=>
{
console
.
log
(
result
)
if
(
result
)
{
this
.
$router
.
go
(
-
1
)
this
.
$notify
({
type
:
"success"
,
title
:
"新增成功"
})
this
.
confirmDialogVisible
=
false
}
else
{
this
.
$message
.
error
(
'新增失败'
)
}
})
.
catch
((
err
)
=>
{
this
.
$message
.
error
(
err
)
})
},
submit
()
{
this
.
$refs
.
formRef
.
$refs
[
this
.
childRef
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
confirmDialogVisible
=
true
}
})
},
cancel
()
{
this
.
$router
.
go
(
-
1
)
},
handleChooseOrder
()
{
this
.
orderDialogVisible
=
true
this
.
$refs
.
formRef
.
$refs
[
this
.
childRef
].
clearValidate
(
"orderDataAttr"
)
},
deleteTable
()
{
this
.
formObj
.
orderData
=
[]
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.revocation-wrap
{
margin
:
16px
24px
;
.content
{
background-color
:
#fff
;
.title
{
padding
:
12px
16px
;
font-weight
:
500
;
font-size
:
18px
;
color
:
#333333
;
line-height
:
24px
;
border-bottom
:
1px
solid
#e8e8ea
;
}
.title
::before
{
display
:
inline-block
;
vertical-align
:
middle
;
margin-right
:
8px
;
content
:
""
;
width
:
4px
;
height
:
16px
;
background
:
#185efe
;
border-radius
:
2px
;
}
.form-wrap
{
padding
:
16px
0
;
min-height
:
500px
;
.order-btn
{
width
:
88px
;
height
:
32px
;
background
:
#f8f8f8
;
border
:
1px
solid
#e6e6e6
;
border-radius
:
4px
;
font-size
:
14px
;
color
:
#666666
;
text-align
:
center
;
line-height
:
32px
;
cursor
:
pointer
;
}
}
}
.btn-wrap
{
display
:
flex
;
align-items
:
center
;
padding
:
16px
154px
;
.btn
{
width
:
104px
;
height
:
36px
;
border-radius
:
4px
;
font-weight
:
500
;
font-size
:
16px
;
text-align
:
center
;
line-height
:
36px
;
}
&
-right
{
color
:
#666666
;
background
:
#e8e8e8
;
margin-left
:
16px
;
}
&
-left
{
background
:
#185efe
;
color
:
#ffffff
;
}
}
}
::v-deep
.form-container
{
.tips-icon
{
border
:
none
;
}
.el-form-item__error
{
width
:
300px
;
}
}
</
style
>
\ No newline at end of file
src/views/pointManagement/components/ConfirmDialog.vue
0 → 100644
View file @
ba6e8a8
<
template
>
<d2-dialog
title=
"确认提醒"
:is-visible=
"isVisible"
width=
"720px"
@
closeDialog=
"handleClose"
@
confirmDialog=
"handleConfirm"
>
<div
class=
"confirm-wrap"
>
<div
class=
"title"
>
请确定以下信息是否正确
</div>
<div
class=
"point-info"
>
<div
class=
"label"
>
扣减积分:
<span
class=
"integral"
>
{{
dataInfo
.
score
}}
</span></div>
<div
class=
"label"
>
备注:
<span
class=
"remark"
>
{{
dataInfo
.
remark
||
'--'
}}
</span
>
</div>
</div>
<div
class=
"order-detail"
>
<div
class=
"title"
>
订单详情
</div>
<div
class=
"item"
>
订单编号:
<span>
{{
dataInfo
.
orderData
[
0
].
orderCode
}}
</span></div>
<div
class=
"item"
>
订单时间:
<span>
{{
dataInfo
.
orderData
[
0
].
orderTimeStr
}}
</span></div>
<div
class=
"item"
>
客户姓名:
<span>
{{
dataInfo
.
orderData
[
0
].
customerName
}}
</span></div>
<div
class=
"item"
>
商品名称:
<span
v-for=
"(item, index) in dataInfo.orderData[0].subOrderList"
:key=
"index"
>
<template
v-if=
"item.upgradeGoodsId"
>
<span
class=
"upgrade-goods"
>
{{
item
.
upgradeGoodsName
?
item
.
upgradeGoodsName
:
"-"
}}
</span>
</
template
>
<span
v-else
class=
"upgrade-goods"
>
{{ item.baseGoodsName }}
</span>
</span></div>
<div
class=
"item"
>
总价:
<span>
{{dataInfo.orderData[0].totalPrice?dataInfo.orderData[0].totalPrice:'0'}}
</span></div>
</div>
</div>
</d2-dialog>
</template>
<
script
>
export
default
{
data
()
{
return
{}
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
dataInfo
:
{
type
:
Object
,
default
:
{}
}
},
computed
:
{
isVisible
:
{
get
()
{
return
this
.
visible
},
set
(
newVal
)
{}
}
},
mounted
()
{
console
.
log
(
this
.
dataInfo
)
},
methods
:
{
handleConfirm
()
{
this
.
$emit
(
"handleConfirm"
)
},
handleClose
()
{
this
.
$emit
(
"dialogClose"
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.confirm-wrap
{
.title
{
font-weight
:
500
;
font-size
:
14px
;
color
:
#1d1d1d
;
margin-bottom
:
18px
;
}
.point-info
{
margin-bottom
:
18px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.label
{
font-weight
:
500
;
font-size
:
14px
;
color
:
#1d1d1d
;
}
.integral
{
font-weight
:
600
;
font-size
:
20px
;
color
:
#185efe
;
}
.remark
{
font-weight
:
400
;
font-size
:
14px
;
color
:
#1d1d1d
;
}
}
.order-detail
{
height
:
auto
;
background
:
#fafafa
;
padding
:
8px
10px
;
.title
{
font-weight
:
500
;
font-size
:
14px
;
color
:
#1d1d1d
;
}
.item
{
color
:
#666666
;
font-size
:
14px
;
margin-bottom
:
8px
;
span{
color
:
#333333
;
}
}
}
}
.upgrade-goods
{
margin-right
:
4px
;
}
</
style
>
\ No newline at end of file
src/views/pointManagement/components/chooseOrderDialog.vue
0 → 100644
View file @
ba6e8a8
<
template
>
<d2-dialog
title=
"选择订单"
:is-visible=
"visible"
width=
"1200px"
@
closeDialog=
"handleClose"
@
confirmDialog=
"handleAddConfirm"
>
<div
class=
"order-list"
>
<div
class=
"flex"
>
<d2-search
class=
"show-search"
:search-form=
"searchForm"
:label-width=
"'90px'"
:form-data=
"showFormData"
/>
<div
class=
"up-btns"
>
<el-button
@
click=
"handleSearch"
size=
"small"
type=
"primary"
>
查询
</el-button>
</div>
</div>
<div
class=
"table-wrap"
>
<d2-table
ref=
"orderTable"
:search-form=
"searchFormSearch"
:table-params=
"tableParams"
:get-list-api=
"getListApi"
:before-search-fn=
"beforeSearchFn"
:hasNum=
"false"
@
setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"radio"
slot-scope=
"scope"
>
<el-radio
v-model=
"orderId"
:label=
"scope.scope.orderCode"
@
input=
"getCurrentOrderData"
>
<span
class=
"order-name"
>
{{
scope
.
scope
.
orderCode
}}
</span>
</el-radio>
</div>
<div
slot=
"status"
slot-scope=
"scope"
>
<span>
{{
statusOpts
[
scope
.
scope
.
status
]
}}
</span>
</div>
<div
slot=
"orderGoodsName"
slot-scope=
"scope"
>
<span
v-for=
"(item, index) in scope.scope.subOrderList"
:key=
"index"
>
<p
v-if=
"item.upgradeGoodsId"
>
<el-tooltip
class=
"item"
:content=
"item.upgradeGoodsName"
placement=
"right"
>
<span>
{{
item
.
upgradeGoodsName
?
item
.
upgradeGoodsName
.
length
>
10
?
item
.
upgradeGoodsName
.
substring
(
0
,
10
)
+
"..."
:
item
.
upgradeGoodsName
:
"-"
}}
</span>
</el-tooltip>
</p>
<p
v-else
>
{{
item
.
baseGoodsName
}}
</p>
</span>
</div>
</d2-table>
</div>
</div>
</d2-dialog>
</
template
>
<
script
>
import
{
deepClone
,
Util
}
from
"@/common/util"
import
{
deductOrderPage
}
from
"@api/point"
export
default
{
data
()
{
return
{
sellerUserId
:
""
,
getListApi
:
deductOrderPage
,
orderId
:
""
,
orderData
:
[],
searchForm
:
{
customerName
:
""
,
orderCode
:
""
,
status
:
""
,
paySuccessDate
:
[]
},
searchFormSearch
:
{},
tableParams
:
{
listName
:
"list"
,
tableColumns
:
[
{
type
:
""
,
addHtml
:
"radio"
,
width
:
100
},
{
label
:
"序号"
,
prop
:
"key"
,
width
:
"100"
},
{
label
:
"订单编号"
,
prop
:
"orderCode"
},
{
label
:
"订单时间"
,
prop
:
"orderTimeStr"
,
width
:
"180"
},
{
label
:
"订单状态"
,
prop
:
"status"
,
addHtml
:
"status"
},
{
label
:
"客户姓名"
,
prop
:
"customerName"
,
},
{
label
:
"商品名称"
,
prop
:
"orderGoodsName"
,
addHtml
:
"orderGoodsName"
,
width
:
240
},
{
label
:
"总价"
,
prop
:
"totalPrice"
,
width
:
"120"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
totalPrice
?
"¥"
+
cellValue
.
totalPrice
:
"0"
}
}
]
},
showFormData
:
[
{
label
:
"客户"
,
name
:
"customerName"
,
type
:
"input"
,
isClear
:
true
,
},
{
label
:
"订单编号"
,
name
:
"orderCode"
,
type
:
"input"
,
isClear
:
true
,
},
{
label
:
"订单状态"
,
name
:
"status"
,
type
:
"select"
,
optionList
:
[],
optionId
:
"confId"
,
optionLabel
:
"confLabel"
,
optionsName
:
"orderStatusList"
},
{
label
:
"订单日期"
,
name
:
"paySuccessDate"
,
type
:
"datePicker"
,
labelWidth
:
72
,
isClear
:
true
,
pickerOptions
:
"beforeRangePickerOptions"
}
],
statusOpts
:
{
1
:
"待升级"
,
2
:
"战败"
,
3
:
"待支付"
,
4
:
"已支付"
,
// 5: '已退款',
6
:
"已评价"
,
9
:
"已撤销"
,
10
:
"已关闭"
,
11
:
"错误订单"
,
12
:
"已退款"
},
baseData
:
{
orderStatusList
:
[
{
confId
:
1
,
confLabel
:
"待升级"
},
{
confId
:
2
,
confLabel
:
"战败"
},
{
confId
:
3
,
confLabel
:
"待支付"
},
{
confId
:
4
,
confLabel
:
"已支付"
},
/* {
confId: 5,
confLabel: '已退款'
}, */
{
confId
:
6
,
confLabel
:
"已评价"
},
{
confId
:
9
,
confLabel
:
"已撤销"
},
{
confId
:
10
,
confLabel
:
"已关闭"
},
{
confId
:
11
,
confLabel
:
"错误订单"
},
{
confId
:
12
,
confLabel
:
"已退款"
}
]
}
}
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
chooseOrderData
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
computed
:
{
isVisible
:
{
get
()
{
return
this
.
visible
},
set
(
newVal
)
{}
}
},
created
()
{
this
.
searchForm
.
userId
=
this
.
$route
.
query
.
userId
this
.
searchForm
.
merchantId
=
this
.
$route
.
query
.
merchantId
},
mounted
()
{
this
.
getOptionsList
()
},
methods
:
{
init
()
{
console
.
log
(
this
.
chooseOrderData
)
this
.
orderId
=
this
.
chooseOrderData
.
length
?
this
.
chooseOrderData
[
0
].
orderCode
:
""
},
getCurrentOrderData
(
value
)
{
let
data
=
this
.
$refs
.
orderTable
.
data
this
.
orderData
=
data
.
filter
((
item
)
=>
item
.
orderCode
==
value
)
console
.
log
(
this
.
orderData
)
},
handleAddConfirm
()
{
this
.
$emit
(
"chooseOrder"
,
this
.
orderData
)
},
handleClose
()
{
this
.
$emit
(
"dialogClose"
)
},
handleSearch
()
{
this
.
$refs
.
orderTable
.
refreshTable
()
},
setTableFinishFun
(
data
)
{
let
{
page
}
=
this
.
$refs
.
orderTable
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
data
[
i
].
key
=
i
+
1
+
page
.
pageSize
*
(
page
.
currentPage
-
1
)
}
this
.
init
()
},
beforeSearchFn
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
if
(
this
.
searchFormSearch
.
paySuccessDate
&&
this
.
searchFormSearch
.
paySuccessDate
.
length
)
{
this
.
searchFormSearch
.
paySuccessStartDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
paySuccessDate
[
0
],
"YYYY-MM-DD"
)
+
" 00:00:00"
this
.
searchFormSearch
.
paySuccessEndDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
paySuccessDate
[
1
],
"YYYY-MM-DD"
)
+
" 23:59:59"
}
delete
this
.
searchFormSearch
.
paySuccessDate
resolve
()
})
},
getOptionsList
(
hasAll
=
true
)
{
console
.
log
(
1111
)
this
.
showFormData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
"select"
)
{
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
]?.
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
.
showFormData
[
index
].
optionLabel
]
!==
"全部"
)
{
if
(
item
.
optionsName
!=
"parkServiceList"
)
{
// 服务对接由于是多选不应该添加全部选项
const
temp
=
{}
temp
[
this
.
showFormData
[
index
].
optionId
]
=
""
temp
[
this
.
showFormData
[
index
].
optionLabel
]
=
"全部"
this
.
baseData
[
item
.
optionsName
].
unshift
(
temp
)
}
}
this
.
$set
(
this
.
showFormData
[
index
],
"optionList"
,
this
.
baseData
[
item
.
optionsName
]
)
}
})
},
}
}
</
script
>
<
style
lang=
'scss'
scoped
>
.order-list
{
height
:
540px
;
}
.flex
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.table-wrap
{
height
:
500px
;
overflow-y
:
auto
;
}
.show-search
{
display
:
flex
;
align-items
:
center
;
::v-deep
.el-form
{
display
:
flex
;
align-items
:
center
;
.el-form-item
{
display
:
flex
;
width
:
100%
;
margin-bottom
:
0px
;
}
.el-col
{
width
:
auto
!important
;
}
.el-form-item__label
{
width
:
70px
!important
;
white-space
:
nowrap
;
}
.el-form-item__content
{
width
:
170px
;
}
}
::v-deep
.d2-search-block
{
padding
:
16px
0
0
!important
;
}
}
.order-name
{
display
:
inline-block
;
color
:
transparent
;
width
:
0
;
}
</
style
>
\ No newline at end of file
src/views/pointManagement/components/pointDetailDialog.vue
View file @
ba6e8a8
...
...
@@ -109,6 +109,31 @@
</el-form-item>
</
template
>
</el-col>
<
template
v-if=
"detailInfo.infoName =='撤销抵扣'"
>
<el-col
:span=
"12"
v-if=
"detailInfo.relationRemark"
>
<el-form-item
label=
"备注:"
class=
"halfItem"
>
{{
detailInfo
.
relationRemark
?
detailInfo
.
relationRemark
:
"-"
}}
</el-form-item>
</el-col>
</
template
>
<
template
v-else-if=
"detailInfo.infoName =='手动抵扣'"
>
<el-col
:span=
"12"
v-if=
"detailInfo.remark"
>
<el-form-item
label=
"备注:"
class=
"halfItem"
>
{{
detailInfo
.
remark
?
detailInfo
.
remark
:
"-"
}}
</el-form-item>
</el-col>
</
template
>
<
template
v-if=
"detailInfo.infoName =='撤销抵扣'"
>
<el-col
:span=
"12"
v-if=
"detailInfo.remark"
>
<el-form-item
label=
"撤销原因:"
class=
"halfItem"
>
{{
detailInfo
.
remark
?
detailInfo
.
remark
:
"-"
}}
</el-form-item></el-col
>
</
template
>
</el-row>
</el-form>
</div>
...
...
src/views/pointManagement/components/revocationDialog.vue
0 → 100644
View file @
ba6e8a8
<!-- 驳回 -->
<
template
>
<d2-dialog
title=
"提示"
:is-visible=
"visible"
@
closeDialog=
"handleClose"
@
confirmDialog=
"handleAddConfirm"
>
<div
class=
"reject-dialog"
>
<glsx-combi-form
class=
"edit-form-container"
ref=
"formRef"
label-width=
"112px"
default-width=
"390px"
:form-ref=
"rejectRef"
:form-obj=
"infoForm"
:form-data=
"editFormData"
:form-rules=
"formRules"
></glsx-combi-form>
</div>
</d2-dialog>
</
template
>
<
script
>
import
{
cancelDeduct
,
getScoreDetail
}
from
"@api/point"
export
default
{
name
:
"RejectDialog"
,
data
()
{
return
{
infoForm
:
{
remark
:
""
},
dialogConfig
:
{
title
:
"提示"
,
width
:
"576px"
,
height
:
"315px"
},
rejectRef
:
"rejectRef"
,
formRules
:
{
// remark: [{ required: true, message: "请输入撤销原因", trigger: "blur" }]
},
editFormData
:
[
{
label
:
"撤销原因"
,
name
:
"remark"
,
type
:
"input"
,
maxlength
:
20
,
inputType
:
"textarea"
,
showLimit
:
true
,
rows
:
4
}
],
baseData
:
{}
}
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
id
:
{
type
:
Number
,
default
:
""
}
},
computed
:
{
isVisible
:
{
get
()
{
return
this
.
visible
},
set
(
newVal
)
{}
}
},
mounted
()
{},
methods
:
{
handleAddConfirm
()
{
this
.
$refs
.
formRef
.
$refs
[
this
.
rejectRef
].
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
let
detailData
=
await
getScoreDetail
({
id
:
this
.
id
})
let
params
=
{}
params
.
remark
=
this
.
infoForm
.
remark
params
.
orderCode
=
detailData
.
orderCode
params
.
scoreId
=
this
.
id
cancelDeduct
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$emit
(
"handleConfirm"
,
false
)
this
.
notice
.
okTips
(
"操作成功"
)
}
})
}
})
},
handleClose
()
{
this
.
$emit
(
"dialogClose"
,
false
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.reject-dialog
{
margin
:
21px
0
83px
;
::v-deep
.el-textarea__inner
{
height
:
70px
;
}
::v-deep
.el-input__count
{
right
:
15px
!important
;
bottom
:
3px
!important
;
font-size
:
12px
;
color
:
#999999
;
}
}
</
style
>
\ No newline at end of file
src/views/pointManagement/pointDetail.vue
View file @
ba6e8a8
...
...
@@ -9,8 +9,11 @@
>
<div
class=
"title"
>
{{
item
.
title
}}
</div>
<div
class=
"score"
>
{{
topPointsInfo
[
item
.
key
]
||
topPointsInfo
[
item
.
key
]
==
0
?
topPointsInfo
[
item
.
key
]
:
"--"
}}
{{
topPointsInfo
[
item
.
key
]
||
topPointsInfo
[
item
.
key
]
==
0
?
topPointsInfo
[
item
.
key
]
:
"--"
}}
</div>
</div>
</div>
...
...
@@ -34,7 +37,12 @@
:title=
"'积分明细列表'"
:title-class-name=
"'tableHeaderTitle'"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"handleExport"
>
导出
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"addDeduction"
>
新增手动抵扣
</el-button>
<el-button
size=
"small"
plain
type=
"primary"
@
click=
"handleExport"
>
导出
</el-button>
</d2-table-header>
<d2-table
...
...
@@ -49,6 +57,9 @@
<el-button
type=
"text"
@
click=
"handleDetail(scope.scope)"
>
详情
</el-button
>
<el-button
type=
"text"
v-if=
"!scope.scope.relateId"
@
click=
"handleRevocation(scope.scope)"
>
撤销
</el-button
>
</div>
</d2-table>
<!-- 详细信息 -->
...
...
@@ -57,6 +68,14 @@
v-if=
"detailVisible"
:id=
"recordInfo.id"
/>
<!-- 撤销抵扣 -->
<revocation-dialog
:visible
.
sync=
"revocationVisible"
v-if=
"revocationVisible"
:id=
"recordInfo.id"
@
dialogClose=
"handleRevocationClose"
@
handleConfirm=
"handleRevocationComfirm"
/>
</div>
</d2-container>
</div>
...
...
@@ -65,13 +84,16 @@
import
{
Util
,
deepClone
}
from
"@/common/util"
import
{
getDetailList
,
exportDetailScore
,
getScorePage
}
from
"@api/point"
import
pointDetailDialog
from
"./components/pointDetailDialog"
import
revocationDialog
from
"./components/revocationDialog"
export
default
{
components
:
{
pointDetailDialog
pointDetailDialog
,
revocationDialog
},
data
()
{
return
{
detailVisible
:
false
,
revocationVisible
:
false
,
recordInfo
:
{},
searchForm
:
{
infoName
:
""
,
...
...
@@ -80,6 +102,10 @@ export default {
searchFormSearch
:
{},
list
:
[
{
title
:
"员工姓名"
,
key
:
"staffName"
},
{
title
:
"当前积分"
,
key
:
"currentScore"
},
...
...
@@ -131,6 +157,14 @@ export default {
{
confId
:
"错单抵扣"
,
confLabel
:
"错单抵扣"
},
{
confId
:
"手动抵扣"
,
confLabel
:
"手动抵扣"
},
{
confId
:
"撤销抵扣"
,
confLabel
:
"撤销抵扣"
}
]
},
...
...
@@ -156,7 +190,7 @@ export default {
label
:
"当前积分"
,
prop
:
"finalTotalScore"
,
formatter
:
(
cell
)
=>
{
return
cell
.
finalTotalScore
||
cell
.
finalTotalScore
==
0
return
cell
.
finalTotalScore
||
cell
.
finalTotalScore
==
0
?
cell
.
finalTotalScore
:
"--"
}
...
...
@@ -165,7 +199,7 @@ export default {
label
:
"变化前积分"
,
prop
:
"currentTotalScore"
,
formatter
:
(
cell
)
=>
{
return
cell
.
currentTotalScore
||
cell
.
currentTotalScore
==
0
return
cell
.
currentTotalScore
||
cell
.
currentTotalScore
==
0
?
cell
.
currentTotalScore
:
"--"
}
...
...
@@ -176,6 +210,10 @@ export default {
formatter
:
(
cell
)
=>
{
return
Util
.
dateFormate
(
cell
.
updatedTime
,
"YYYY-MM-DD HH:mm:ss"
)
}
},
{
label
:
"操作人"
,
prop
:
"operator"
}
]
},
...
...
@@ -184,10 +222,20 @@ export default {
},
created
()
{
this
.
detailObj
=
this
.
$route
.
query
console
.
log
(
this
.
detailObj
)
this
.
getOptionsList
()
},
methods
:
{
//新增抵扣
addDeduction
()
{
console
.
log
(
this
.
detailObj
)
this
.
$router
.
push
({
name
:
"deduction"
,
query
:
{
userId
:
this
.
detailObj
.
staffUuid
,
merchantId
:
this
.
detailObj
.
merchantId
}
})
},
// 导出
handleExport
()
{
let
params
=
{
...
...
@@ -204,8 +252,11 @@ export default {
beforeSearchFn
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
this
.
searchFormSearch
.
staffId
=
this
.
detailObj
.
staffId
if
(
this
.
searchFormSearch
.
rewardTime
&&
this
.
searchFormSearch
.
rewardTime
.
length
)
{
this
.
searchFormSearch
.
staffId
=
this
.
detailObj
.
staffId
if
(
this
.
searchFormSearch
.
rewardTime
&&
this
.
searchFormSearch
.
rewardTime
.
length
)
{
this
.
searchFormSearch
.
rewardBeginTime
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
rewardTime
[
0
],
...
...
@@ -217,7 +268,10 @@ export default {
"YYYY-MM-DD"
)
+
" 23:59:59"
}
if
(
this
.
searchFormSearch
.
withdrawalTime
&&
this
.
searchFormSearch
.
withdrawalTime
.
length
)
{
if
(
this
.
searchFormSearch
.
withdrawalTime
&&
this
.
searchFormSearch
.
withdrawalTime
.
length
)
{
this
.
searchFormSearch
.
withdrawalBeginTime
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
withdrawalTime
[
0
],
...
...
@@ -262,6 +316,19 @@ export default {
this
.
recordInfo
=
data
this
.
detailVisible
=
true
},
//撤销
handleRevocation
(
data
)
{
this
.
recordInfo
=
data
this
.
revocationVisible
=
true
},
//取消撤销
handleRevocationClose
(
value
)
{
this
.
revocationVisible
=
value
},
handleRevocationComfirm
(
value
)
{
this
.
revocationVisible
=
value
this
.
$refs
.
pointTable
.
refreshTable
()
},
handleSearch
()
{
this
.
$refs
.
pointTable
.
refreshTable
()
},
...
...
@@ -274,7 +341,7 @@ export default {
staffId
:
this
.
detailObj
.
staffId
}
// 根据staffId查询积分明细列表数据作为顶部积分信息
getScorePage
(
params
).
then
(
res
=>
{
getScorePage
(
params
).
then
(
(
res
)
=>
{
this
.
topPointsInfo
=
res
.
list
?.[
0
]
||
{}
})
},
...
...
@@ -299,7 +366,7 @@ export default {
}
}
}
.header
{
.header
{
background
:
#ffffff
;
}
.detail-wrap
{
...
...
src/views/pointManagement/pointParticulars.vue
View file @
ba6e8a8
...
...
@@ -122,6 +122,10 @@ export default {
{
label
:
"累计兑换积分"
,
prop
:
"totalWithdrawalScore"
},
{
label
:
"累计抵扣积分"
,
prop
:
"totalDeductScore"
}
]
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment