Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
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
marketing-web
marketing
Commits
eb90b805
Commit
eb90b805
authored
Aug 26, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 奥莱抵金券
parent
2f4f0384
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
84 deletions
+56
-84
form.js
src/views/card/form.js
+36
-21
form.vue
src/views/card/form.vue
+20
-63
No files found.
src/views/card/form.js
View file @
eb90b805
...
...
@@ -151,7 +151,7 @@ export default {
};
const
that
=
this
;
return
{
initStoreSelector
:
true
,
storeUuid
:
''
,
// 商场抵金券适用门店-部分门店列表数据
originStoreList
:
[],
// 商场抵金券适用门店-门店选择器选中的数据
...
...
@@ -437,12 +437,11 @@ export default {
},
methods
:
{
onOptionsChange
(
value
)
{
this
.
storeMode
=
value
==
0
?
0
:
1
;
this
.
originStoreList
=
[];
},
onStoreChange
(
id
)
{
// 编辑卡券时,不保存门店选择器初始化的数据
if
((
this
.
isEdit
||
this
.
isInfo
)
&&
this
.
initStoreSelector
)
{
this
.
initStoreSelector
=
false
;
return
;
}
getStoreWidgetStore
({
key
:
id
,
pageSize
:
99999
,
currentPage
:
1
}).
then
(
res
=>
{
const
{
result
,
errorCode
}
=
res
||
{};
if
(
errorCode
==
0
&&
Array
.
isArray
(
result
.
result
))
{
...
...
@@ -632,13 +631,19 @@ export default {
initForm
.
useCardCodePrefix
=
this
.
form
.
useCardCodePrefix
;
initForm
.
cardCodePrefix
=
this
.
form
.
cardCodePrefix
;
this
.
uuid
=
''
;
this
.
storeUuid
=
''
;
this
.
originStoreList
=
[];
this
.
storeMode
=
0
;
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
initForm
));
this
.
sale_limit
=
JSON
.
parse
(
JSON
.
stringify
(
sale_limit
));
this
.
goods
=
JSON
.
parse
(
JSON
.
stringify
(
goods
));
this
.
form
.
cardType
=
e
;
this
.
$nextTick
(
_
=>
{
this
.
$refs
.
storeCard
.
initLeftList
();
});
if
(
this
.
form
.
cardType
!=
3
)
{
this
.
$nextTick
(
_
=>
{
this
.
$refs
.
storeCard
.
initLeftList
();
});
}
this
.
goodsList
=
[{
v1
:
''
,
f2
:
[],
v2
:
''
,
f3
:
[],
v3
:
[],
list
:
[]
}];
// 新增情况下,如果配置了线下门店,默认选中线下门店
if
(
this
.
isAdd
&&
this
.
cardApplyChannelOptions
.
some
(
v
=>
v
.
value
===
'offlineStore'
))
{
...
...
@@ -815,7 +820,8 @@ export default {
}
if
(
card
.
cardType
==
3
)
{
this
.
form
.
costValueType
=
card
.
costValueType
;
//成本费用0固定成本1门店成本
this
.
form
.
costValueProportionFlag
=
card
.
costValueProportionFlag
||
0
;
// 卡券成本比例 1:开 0:关
this
.
form
.
costValueType
=
card
.
costValueType
||
0
;
//成本费用0固定成本1门店成本
this
.
form
.
costValueProportion
=
card
.
costValueProportion
;
//成本比例
this
.
form
.
costStoreList
=
(
this
.
isEdit
||
this
.
isInfo
)
&&
Array
.
isArray
(
card
.
costStoreList
)
?
card
.
costStoreList
:
[];
this
.
originStoreList
=
this
.
form
.
costStoreList
;
...
...
@@ -929,11 +935,15 @@ export default {
this
.
form
.
startDay
=
card
.
startDay
||
0
;
this
.
form
.
limitDay
=
card
.
limitDay
||
0
;
}
this
.
uuid
=
card
.
storeWidgetKey
||
''
;
this
.
$nextTick
(
_
=>
{
// console.log(this.$refs.storeCard);
this
.
$refs
.
storeCard
.
init
();
});
if
(
this
.
form
.
cardType
==
3
)
{
this
.
storeUuid
=
card
.
storeWidgetKey
||
''
;
}
else
{
this
.
uuid
=
card
.
storeWidgetKey
||
''
;
this
.
$nextTick
(
_
=>
{
// console.log(this.$refs.storeCard);
this
.
$refs
.
storeCard
.
init
();
});
}
this
.
form
.
verificationType
=
card
.
verificationType
||
0
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
form
.
clearValidate
();
...
...
@@ -1023,17 +1033,17 @@ export default {
}
if
(
this
.
form
.
cardType
==
3
)
{
if
(
this
.
form
.
costValueProportionFlag
==
1
&&
this
.
form
.
costValueType
==
1
)
{
if
(
this
.
form
.
costValueProportionFlag
==
1
)
{
if
(
!
Array
.
isArray
(
this
.
originStoreList
)
||
this
.
originStoreList
.
length
==
0
)
{
this
.
$tips
({
type
:
'warning'
,
message
:
'请
添加卡券适用部分
门店'
});
this
.
$tips
({
type
:
'warning'
,
message
:
'请
选择卡券适用
门店'
});
const
body
=
document
.
getElementsByClassName
(
'dm-layout-page'
)[
0
];
toTop
(
body
,
this
.
$refs
.
costValueProportionFlag
.
$el
.
offsetTop
-
body
.
offsetTop
);
toTop
(
body
,
this
.
$refs
.
useStore
.
$el
.
offsetTop
-
body
.
offsetTop
);
return
;
}
if
(
this
.
originStoreList
.
some
(
el
=>
el
.
costValueProportion
==
undefined
||
el
.
costValueProportion
==
null
))
{
if
(
this
.
form
.
costValueType
==
1
&&
this
.
originStoreList
.
some
(
el
=>
el
.
costValueProportion
==
undefined
||
el
.
costValueProportion
==
null
))
{
this
.
$tips
({
type
:
'warning'
,
message
:
'请输入门店成本比例'
});
const
body
=
document
.
getElementsByClassName
(
'dm-layout-page'
)[
0
];
toTop
(
body
,
this
.
$refs
.
costValueProportionFlag
.
$el
.
offsetTop
-
body
.
offsetTop
);
toTop
(
body
,
this
.
$refs
.
useStore
.
$el
.
offsetTop
-
body
.
offsetTop
);
return
;
}
}
...
...
@@ -1185,6 +1195,7 @@ export default {
};
card
.
costValueType
=
this
.
form
.
costValueType
;
//成本费用0固定成本1门店成本
card
.
costValueProportion
=
this
.
form
.
costValueProportion
;
//成本比例
card
.
costValueProportionFlag
=
this
.
form
.
costValueProportionFlag
;
if
(
card
.
costValueType
==
0
)
{
card
.
costValue
=
typeof
this
.
form
.
costValueProportion
==
'number'
&&
typeof
this
.
form
.
cardDenomination
==
'number'
?
this
.
form
.
costValueProportion
*
this
.
form
.
cardDenomination
:
0
;
//成本
card
.
costStoreList
=
[];
...
...
@@ -1330,7 +1341,11 @@ export default {
card
.
applicableMode
=
0
;
card
.
storeProMode
=
0
;
card
.
storeMode
=
this
.
storeMode
;
card
.
storeWidgetKey
=
this
.
uuid
;
// 如果是商场抵金券,而且开启了卡券成本比例,而且选择了门店成本,storeMode就传0
if
(
card
.
cardType
==
3
&&
card
.
costValueProportionFlag
==
1
&&
card
.
costValueType
==
1
)
{
card
.
storeMode
=
0
;
}
card
.
storeWidgetKey
=
card
.
cardType
==
3
?
this
.
storeUuid
:
this
.
uuid
;
// 这里判断部分门店是否为空
if
(
card
.
storeMode
)
{
// let data = await this.$refs.storeCard.getRightList();
...
...
src/views/card/form.vue
View file @
eb90b805
...
...
@@ -6,7 +6,7 @@
<el-radio
:label=
"0"
>
抵金券
</el-radio>
<el-radio
:label=
"1"
>
折扣券
</el-radio>
<el-radio
:label=
"2"
>
兑换券
</el-radio>
<el-radio
v-if=
"$store.getters.getLimitCodeList.every(el => el != '
abc
')"
:label=
"3"
>
商场抵金券
</el-radio>
<el-radio
v-if=
"$store.getters.getLimitCodeList.every(el => el != '
couponCreate
')"
:label=
"3"
>
商场抵金券
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if=
"form.cardType != 3"
label=
"卡券适用渠道"
prop=
"cardApplyChannel"
>
...
...
@@ -78,31 +78,32 @@
<!-- 抵金券 -->
<el-form-item
prop=
"cardDenomination"
label=
"减免金额"
v-if=
"form.cardType === 0 || form.cardType == 3"
>
<el-input-number
controls-position=
"right"
:disabled=
"isEdit || isInfo"
v-model=
"form.cardDenomination"
class=
"200"
:precison=
"0"
:min=
"0"
:max=
"10000000"
></el-input-number>
元
<span
class=
"fz12 gray"
>
请输入大于0的整数
</span>
</el-form-item>
<el-form-item
v-if=
"form.cardType == 3"
label=
"卡券成本比例"
ref=
"costValueProportionFlag"
>
<el-form-item
v-if=
"form.cardType == 3"
label=
"卡券成本比例"
>
<el-switch
v-model=
"form.costValueProportionFlag"
:active-value=
"1"
:inactive-value=
"0"
:disabled=
"isEdit || isInfo"
></el-switch>
<div
class=
"cost-box"
v-if=
"form.costValueProportionFlag == 1"
>
<div
class=
"cost-box-type"
>
<span
class=
"cost-box-type-label"
>
成本费用
</span>
<el-radio-group
v-model=
"form.costValueType"
:disabled=
"isEdit || isInfo"
>
<el-radio
:label=
"0"
border
>
固定成本
</el-radio>
<el-radio
:label=
"1"
border
>
门店成本
</el-radio>
<el-radio
:label=
"0"
>
固定成本
</el-radio>
<el-radio
:label=
"1"
>
门店成本
</el-radio>
</el-radio-group>
</div>
</div>
</el-form-item>
<el-form-item
v-if=
"form.cardType == 3"
label=
"适用门店"
ref=
"useStore"
>
<div
slot=
"label"
>
适用门店
<el-tooltip
placement=
"top"
content=
"仅支持选择账号管辖门店范围内的门店"
>
<i
class=
"iconfont icon-QuestionCircleOutlined"
></i>
</el-tooltip>
</div>
<dm-store-selector
:uuid
.
sync=
"storeUuid"
:options=
"[5]"
@
optionsChange=
"onOptionsChange"
@
store-change=
"onStoreChange"
></dm-store-selector>
<div
v-if=
"form.costValueProportionFlag == 1"
class=
"cost-box"
>
<div
v-if=
"form.costValueType == 0"
class=
"fixed-cost"
>
<el-form-item
label=
"成本比例"
prop=
"costValueProportion"
label-width=
"
17
5px"
><el-input-number
v-model=
"form.costValueProportion"
:disabled=
"isEdit || isInfo"
:min=
"0"
:max=
"100"
:precision=
"0"
:controls=
"false"
style=
"margin-right: 10px; width: 130px"
placeholder=
"请输入成本比例"
></el-input-number>
%
</el-form-item>
<
el-form-item
label=
"成本金额"
label-width=
"100px"
><el-input
:value=
"typeof form.costValueProportion == 'number' && typeof form.cardDenomination == 'number' ? (form.costValueProportion * form.cardDenomination) / 100 : 0"
disabled
style=
"margin-right: 10px; width:120px"
></el-input>
元
</el-form-item
>
<el-form-item
label=
"成本比例"
prop=
"costValueProportion"
label-width=
"
8
5px"
><el-input-number
v-model=
"form.costValueProportion"
:disabled=
"isEdit || isInfo"
:min=
"0"
:max=
"100"
:precision=
"0"
:controls=
"false"
style=
"margin-right: 10px; width: 130px"
placeholder=
"请输入成本比例"
></el-input-number>
%
</el-form-item>
<
!-- <el-form-item label="成本金额" label-width="100px"><el-input :value="typeof form.costValueProportion == 'number' && typeof form.cardDenomination == 'number' ? (form.costValueProportion * form.cardDenomination) / 100 : 0" disabled style="margin-right: 10px; width:120px"></el-input>元</el-form-item> --
>
</div>
<div
v-if=
"form.costValueType == 1"
class=
"store-fixed-cost"
>
<div
class=
"store-cost-title"
>
<div
class=
"store-cost-title-text"
>
设置门店成本
</div>
<div
class=
"store-cost-selector"
>
<span>
适用门店:
</span>
<el-tooltip
placement=
"top"
content=
"仅支持选择账号管理门店权限内门店"
>
<i
class=
"iconfont icon-QuestionCircleOutlined"
style=
"margin-right: 10px"
></i>
</el-tooltip>
<dm-store-selector
:options=
"[5]"
@
store-change=
"onStoreChange"
></dm-store-selector>
</div>
</div>
<div
class=
"store-cost-search"
>
<el-input
v-model=
"searchStore"
placeholder=
"请输入门店名称/code"
prefix-icon=
"el-icon-search"
clearable
style=
"width: 260px"
></el-input>
<el-button
v-if=
"!isEdit && !isInfo"
@
click=
"importCost.visible = true"
type=
"primary"
style=
"border: none"
><i
class=
"iconfont icon-shangc"
></i>
成本批量导入
</el-button>
...
...
@@ -498,22 +499,7 @@ export default cardForm;
width
:
701
px
;
background
:
#
f5f7fa
;
.
cost
-
box
-
type
{
padding
:
20
px
16
px
;
border
-
bottom
:
1
px
solid
#
ebecf0
;
/deep/
.
el
-
radio
.
is
-
bordered
{
padding
:
8
px
20
px
8
px
10
px
;
margin
-
right
:
20
px
;
background
:
#
fff
;
&
+
.
el
-
radio
.
is
-
bordered
{
margin
-
left
:
0
;
}
&
:
last
-
child
{
margin
-
right
:
0
;
}
.
el
-
radio__input
{
height
:
17
px
;
}
}
padding
:
24
px
22
px
;
.
cost
-
box
-
type
-
label
{
margin
-
right
:
25
px
;
font
-
size
:
14
px
;
...
...
@@ -526,44 +512,15 @@ export default cardForm;
display
:
flex
;
justify
-
content
:
flex
-
start
;
align
-
items
:
center
;
padding
:
2
6
px
0
34
px
;
padding
:
2
0
px
;
}
.
store
-
fixed
-
cost
{
padding
:
17
px
20
px
20
px
17
px
;
.
store
-
cost
-
title
{
display
:
flex
;
justify
-
content
:
space
-
between
;
align
-
items
:
center
;
.
store
-
cost
-
title
-
text
{
font
-
size
:
14
px
;
font
-
weight
:
800
;
color
:
#
303133
;
line
-
height
:
20
px
;
}
.
store
-
cost
-
selector
{
display
:
flex
;
justify
-
content
:
flex
-
start
;
align
-
items
:
center
;
/deep/
.
dm
-
store
-
selector
{
.
el
-
select
:
first
-
child
{
margin
-
right
:
0
!
important
;
}
.
dm
-
new
-
store__reference
{
margin
-
left
:
10
px
;
margin
-
right
:
-
1
px
;
.
dm
-
new
-
store__inputtag
{
margin
-
top
:
-
1
px
;
box
-
sizing
:
border
-
box
;
}
}
}
}
}
.
store
-
cost
-
search
{
display
:
flex
;
justify
-
content
:
space
-
between
;
align
-
items
:
center
;
margin
:
20
px
0
;
margin
-
bottom
:
20
px
;
}
}
.
store
-
list
{
...
...
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