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
bba5187a
Commit
bba5187a
authored
Jan 09, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷赠送功能
parent
d13e7620
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
2 deletions
+96
-2
consumerCoupon.js
src/api/system/consumerCoupon.js
+8
-0
index.vue
src/views/system/consumer/index.vue
+88
-2
No files found.
src/api/system/consumerCoupon.js
View file @
bba5187a
...
...
@@ -63,3 +63,11 @@ export function queryCouponList() {
method
:
'get'
})
}
export
function
give
(
data
)
{
return
request
({
url
:
'/system/consumerCoupon/give'
,
method
:
'post'
,
data
:
data
})
}
src/views/system/consumer/index.vue
View file @
bba5187a
...
...
@@ -190,6 +190,13 @@
@
click
=
"handleDelete(scope.row)"
v
-
hasPermi
=
"['system:consumer:remove']"
>
删除
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"give(scope.row)"
>
赠送优惠卷
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -251,19 +258,72 @@
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
el
-
dialog
:
title
=
"couponTitle"
:
visible
.
sync
=
"couponOpen"
width
=
"80%"
append
-
to
-
bod
>
<
el
-
table
v
-
loading
=
"couponLoading"
:
data
=
"couponList"
>
<
el
-
table
-
column
label
=
"优惠券名称"
align
=
"center"
prop
=
"name"
/>
<
el
-
table
-
column
label
=
"优惠券类型"
align
=
"center"
prop
=
"couponType"
>
<
template
slot
-
scope
=
"scope"
>
<
dict
-
tag
:
options
=
"dict.type.store_coupon_type"
:
value
=
"scope.row.couponType"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"时长"
align
=
"center"
prop
=
"duration"
/>
<
el
-
table
-
column
label
=
"平台类型"
align
=
"center"
prop
=
"platformType"
>
<
template
slot
-
scope
=
"scope"
>
<
dict
-
tag
:
options
=
"dict.type.store_platform_type"
:
value
=
"scope.row.platformType"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"有效期开始"
align
=
"center"
prop
=
"startDate"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
startDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"有效期结束"
align
=
"center"
prop
=
"endDate"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
endDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"数量"
align
=
"center"
prop
=
"number"
/>
<
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:consumer:edit']"
-->
<!--
>
修改
<
/el-button>--
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-circle-plus"
@
click
=
"submitcouponGive(scope.row)"
>
选择
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
@
click
=
"couponCancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listConsumer
,
getConsumer
,
delConsumer
,
addConsumer
,
updateConsumer
}
from
"@/api/system/consumer"
;
import
{
listCoupon
}
from
"../../../api/system/coupon"
;
import
{
give
}
from
"../../../api/system/consumerCoupon"
;
export
default
{
name
:
"Consumer"
,
dicts
:
[
'sys_user_sex'
,
'wechat_role
_type'
],
dicts
:
[
'sys_user_sex'
,
'wechat_role_type'
,
'store_coupon_type'
,
'store_platform_type'
,
'store_platform
_type'
],
data
()
{
return
{
// 遮罩层
loading
:
true
,
couponLoading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
...
...
@@ -276,10 +336,14 @@ export default {
total
:
0
,
// 会员用户表格数据
consumerList
:
[],
couponList
:
[],
// 弹出层标题
title
:
""
,
couponTitle
:
""
,
// 是否显示弹出层
couponOpen
:
false
,
open
:
false
,
consumerId
:
null
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
...
...
@@ -296,6 +360,7 @@ export default {
}
,
// 表单参数
form
:
{
}
,
couponForm
:
{
}
,
// 表单校验
rules
:
{
openId
:
[
...
...
@@ -318,7 +383,6 @@ export default {
getList
()
{
this
.
loading
=
true
;
listConsumer
(
this
.
queryParams
).
then
(
response
=>
{
console
.
log
(
response
,
909090
)
this
.
consumerList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
...
...
@@ -413,7 +477,29 @@ export default {
this
.
download
(
'system/consumer/export'
,
{
...
this
.
queryParams
}
,
`consumer_${new Date().getTime()
}
.xlsx`
)
}
,
give
(
row
)
{
this
.
consumerId
=
row
.
id
;
this
.
couponLoading
=
true
;
listCoupon
().
then
(
response
=>
{
this
.
couponList
=
response
.
rows
;
}
);
this
.
couponLoading
=
false
;
this
.
couponOpen
=
true
;
this
.
couponTitle
=
"优惠卷列表"
;
}
,
submitcouponGive
(
row
)
{
give
({
consumerId
:
this
.
consumerId
,
couponId
:
row
.
id
}
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"赠送成功"
);
this
.
couponOpen
=
false
;
}
);
this
.
consumerId
=
null
;
this
.
couponOpen
=
false
;
}
,
couponCancel
()
{
this
.
couponOpen
=
false
;
}
}
}
;
<
/script
>
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