Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
hooloo
web
soss
Commits
cdeafc6d
Commit
cdeafc6d
authored
2 years ago
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改优惠券的新增区域门店
parent
bea0845d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
19 deletions
+60
-19
src/api/coupon/coupon.js
+9
-0
src/views/coupon/coupon/index.vue
+51
-19
No files found.
src/api/coupon/coupon.js
View file @
cdeafc6d
...
...
@@ -69,3 +69,12 @@ export function getCusOrderNum(custId) {
});
}
// 获取优惠券详情
export
function
getCouponDetail
(
id
)
{
return
request
({
url
:
"/coupon/detail/"
+
id
,
method
:
"get"
,
});
}
This diff is collapsed.
Click to expand it.
src/views/coupon/coupon/index.vue
View file @
cdeafc6d
...
...
@@ -160,7 +160,8 @@
<el-col>
<el-form-item
label=
"适用范围"
>
<el-cascader
:options=
"shopRangeList"
v-model=
"shopRange"
clearable
placeholder=
"请选择使用商品范围"
class=
"width"
:props=
"{ multiple: true}"
collapse-tags
:show-all-levels=
"false"
/>
<el-cascader
:options=
"shopAreaTreeList"
v-model=
"storesRange"
:props=
"{ multiple: true }"
clearable
collapse-tags
placeholder=
"请选择地区门店"
:show-all-levels=
"false"
style=
"margin-left:55px;width:300px;"
/>
<el-cascader
ref=
"area"
:options=
"shopAreaTreeList"
v-model=
"storesRange"
:props=
"{ multiple: true }"
clearable
collapse-tags
placeholder=
"请选择地区门店"
:show-all-levels=
"false"
style=
"margin-left:55px;width:300px;"
/>
<el-select
v-model=
"form.weekLimit"
placeholder=
"请选择可用日期"
multiple
collapse-tags
style=
"margin-left: 130px;width: 328px;"
clearable
>
<el-option
v-for=
"item in weekList"
...
...
@@ -233,7 +234,11 @@ export default {
form
:
{
categoryIds
:[],
goodsIds
:[],
sendMsgTag
:
2
sendMsgTag
:
2
,
shopIds
:[],
area
:[],
city
:[],
province
:[]
},
// 表单校验
rules
:
{
...
...
@@ -245,25 +250,25 @@ export default {
},
couCategoryList
:
[],
weekList
:[{
value
:
1
,
value
:
2
,
label
:
'星期一'
},
{
value
:
2
,
value
:
3
,
label
:
'星期二'
},
{
value
:
3
,
value
:
4
,
label
:
'星期三'
},
{
value
:
4
,
value
:
5
,
label
:
'星期四'
},
{
value
:
5
,
value
:
6
,
label
:
'星期五'
},
{
value
:
6
,
value
:
7
,
label
:
'星期六'
},
{
value
:
7
,
value
:
1
,
label
:
'星期日'
}],
type
:
""
,
...
...
@@ -526,7 +531,33 @@ export default {
this
.
form
.
goodsIds
=
goodSList
;
}
if
(
this
.
storesRange
.
length
>
0
){
//console.log("this.storesRange",this.storesRange);
let
proList
=
[];
let
shopIdList
=
[];
let
areaIdList
=
[];
let
cityIdList
=
[];
if
(
this
.
storesRange
[
0
][
0
]
==
0
){
proList
.
push
(
0
);
}
else
{
let
areaNode
=
this
.
$refs
[
"area"
].
getCheckedNodes
();
areaNode
=
areaNode
.
filter
(
item
=>
!
(
item
.
parent
&&
item
.
parent
.
checked
));
for
(
let
j
=
0
;
j
<
areaNode
.
length
;
j
++
){
if
(
areaNode
[
j
].
level
==
5
){
shopIdList
.
push
(
areaNode
[
j
].
value
)
}
else
if
(
areaNode
[
j
].
level
==
4
){
areaIdList
.
push
(
areaNode
[
j
].
value
);
}
else
if
(
areaNode
[
j
].
level
==
3
){
cityIdList
.
push
(
areaNode
[
j
].
value
);
}
else
if
(
areaNode
[
j
].
level
==
2
){
proList
.
push
(
areaNode
[
j
].
value
);
}
else
if
(
areaNode
[
j
].
level
==
1
){
proList
.
push
(
0
);
}
}
}
this
.
form
.
shopIds
=
shopIdList
;
this
.
form
.
area
=
areaIdList
;
this
.
form
.
city
=
cityIdList
;
this
.
form
.
province
=
proList
;
}
if
(
this
.
form
.
sendMsgTag
==
1
){
this
.
form
.
sendMsg
=
true
;
...
...
@@ -535,17 +566,18 @@ export default {
}
console
.
log
(
"this.form"
,
this
.
form
);
if
(
this
.
form
.
id
!=
null
)
{
updateClass
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addCoupon
(
this
.
form
).
then
((
response
)
=>
{
console
.
log
(
"response"
,
response
);
// this.$modal.msgSuccess("新增成功");
// updateClass(this.form).then((response) => {
// this.$modal.msgSuccess("修改成功");
// this.open = false;
// this.getList();
// });
}
else
{
addCoupon
(
this
.
form
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
){
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
});
}
}
...
...
This diff is collapsed.
Click to expand it.
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