Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 be15fcfd
authored
May 24, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优惠券bug修复
1 parent
a3b2702e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
815 additions
and
369 deletions
src/router/routes.js
src/views/couponManage/editCashCoupon.vue
src/views/couponManage/editDiscountCoupon.vue
src/views/couponManage/editExchangeCoupon.vue
src/views/couponManage/editMemberService.vue
src/views/couponManage/index.vue
src/views/couponManage/receiveDetail.vue
src/views/couponManage/recordList.vue
src/router/routes.js
View file @
be15fcf
...
@@ -89,6 +89,12 @@ const staticRoutes = Object.freeze([
...
@@ -89,6 +89,12 @@ const staticRoutes = Object.freeze([
meta
:
{}
meta
:
{}
},
},
{
{
name
:
'editMemberService'
,
path
:
'/couponManage/editMemberService'
,
component
:
resolve
=>
require
([
`@/views/couponManage/editMemberService.vue`
],
resolve
),
meta
:
{}
},
{
name
:
'editCashCoupon'
,
name
:
'editCashCoupon'
,
path
:
'/couponManage/editCashCoupon/:addOrEdit'
,
path
:
'/couponManage/editCashCoupon/:addOrEdit'
,
component
:
resolve
=>
require
([
`@/views/couponManage/editCashCoupon.vue`
],
resolve
),
component
:
resolve
=>
require
([
`@/views/couponManage/editCashCoupon.vue`
],
resolve
),
...
...
src/views/couponManage/editCashCoupon.vue
View file @
be15fcf
...
@@ -751,7 +751,7 @@ export default {
...
@@ -751,7 +751,7 @@ export default {
var
merchantval
=
true
var
merchantval
=
true
if
(
this
.
$isGroupUp
)
{
if
(
this
.
$isGroupUp
)
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
merchantval
=
merchantVaild
merchantval
=
merchantVaild
})
})
}
}
if
(
valid
&&
merchantval
)
{
if
(
valid
&&
merchantval
)
{
...
...
src/views/couponManage/editDiscountCoupon.vue
View file @
be15fcf
...
@@ -534,7 +534,7 @@ export default {
...
@@ -534,7 +534,7 @@ export default {
var
merchantval
=
true
var
merchantval
=
true
if
(
this
.
$isGroupUp
)
{
if
(
this
.
$isGroupUp
)
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
merchantval
=
merchantVaild
merchantval
=
merchantVaild
})
})
}
}
if
(
valid
&&
merchantval
)
{
if
(
valid
&&
merchantval
)
{
...
...
src/views/couponManage/editExchangeCoupon.vue
View file @
be15fcf
...
@@ -437,7 +437,7 @@ export default {
...
@@ -437,7 +437,7 @@ export default {
var
merchantval
=
true
var
merchantval
=
true
if
(
this
.
$isGroupUp
)
{
if
(
this
.
$isGroupUp
)
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
merchantval
=
merchantVaild
merchantval
=
merchantVaild
})
})
}
}
if
(
valid
&&
merchantval
)
{
if
(
valid
&&
merchantval
)
{
...
...
src/views/couponManage/editMemberService.vue
View file @
be15fcf
<!-- 编辑服务券 -->
<
template
>
<
template
>
<div
class=
"edit-share marketing p-t-20 edit-box"
>
<div
class=
"live-room marketing edit-box"
>
<div
class=
"container edit-container"
v-loading=
"loading"
>
<div
class=
"topMsg"
>
<p
class=
"edit-title"
>
{{
title
}}
服务券
</p>
<p
class=
"pageTitle"
>
基本信息
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:isEdit=
"true"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
</div>
<template
slot=
"effectiveHtml"
>
<div
class=
"live-room container m-t-10"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"3"
:disabled=
"apear != 'couponAdd'"
>
永久有效
</el-radio>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"120px"
class=
"demo-ruleForm"
>
<br
/>
<el-form-item
size=
"small"
label=
"服务名称"
prop=
"couponName"
style=
"width: 440px"
>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px; display: block"
>
<el-input
size=
"small"
:disabled=
"disabledContent"
v-model
.
trim=
"ruleForm.couponName"
maxlength=
"20"
placeholder=
"请输入服务名称,如“精洗轿车”"
></el-input>
<el-radio
v-model=
"editForm.effectiveType"
label=
"2"
:disabled=
"apear != 'couponAdd'"
>
<el-date-picker
v-model=
"editForm.effectiveTime"
type=
"daterange"
style=
"width: 295px"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
:disabled=
"editForm.effectiveType != 2 || apear != 'couponAdd'"
clearable
></el-date-picker>
</el-radio>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"effectiveDays"
>
<el-form-item
size=
"small"
label=
"预估成本/元"
prop=
"anticipatedCost"
style=
"width: 440px"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
<el-input
size=
"small"
:disabled=
"disabledCost"
v-model
.
trim=
"ruleForm.anticipatedCost"
maxlength=
"20"
placeholder=
"请输入预估成本"
></el-input>
</el-form-item>
<el-form-item
size=
"small"
label=
"有效期"
prop=
"effectiveType"
>
<div
class=
"radioGroupWrap"
>
<el-radio-group
v-model=
"ruleForm.effectiveType"
:disabled=
"disabledContent"
>
<el-radio
:label=
"3"
class=
"itemBlock"
>
无有效期
</el-radio>
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio
:label=
"1"
>
领取后
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px; margin-left: 5px; margin-right: 5px"
:disabled=
"apear != 'couponAdd' || editForm.effectiveType != 1"
/>
<el-input
v-model=
"ruleForm.effectiveDays"
maxlength=
"4"
@
input=
"
val =>
{
ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1" placeholder="请输入" size="small" style="width: 100px">
</el-input>
天内有效
天内有效
</el-radio>
</el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
<el-radio
:label=
"2"
>
<el-date-picker
:size=
"small"
:disabled=
"title == '查看' || title == '编辑' || ruleForm.effectiveType != 2"
style=
"width: 230px"
v-model=
"ruleForm.daterange"
type=
"daterange"
value-format=
"yyyy-MM-dd"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:picker-options=
"pickerOptions ||
{}">
</el-date-picker>
</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-form-item>
<
/
template
>
<
el-form-item
size=
"small"
label=
"使用限制"
prop=
"customUseLimit"
>
<
template
slot=
"useTypeHtml
"
>
<div
class=
"radioGroupWrap
"
>
<el-radio
v-model=
"editForm.useType"
label=
"0"
:disabled=
"apear != 'couponAdd'"
>
无限制
</el-radio
>
<el-radio-group
v-model=
"ruleForm.customUseLimit"
:disabled=
"disabledContent"
>
<br
/
>
<el-radio
:label=
"0"
class=
"itemBlock"
>
不限制使用次数
</el-radio
>
<el-form-item
prop=
"usageTimes"
style=
"margin-top: 12px; display: block"
>
<!-- useType:1 useAmount:6 --
>
<el-radio
v-model=
"editForm.useType"
label=
"1"
:disabled=
"apear != 'couponAdd'
"
>
<el-radio
:label=
"1
"
>
有效期内可使用
有效期内可使用
<el-input
v-model=
"editForm.usageTimes"
style=
"width: 100px; margin-left: 5px; margin-right: 5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 1"
/>
<el-button
@
click=
"sub1"
class=
"addsubBtn"
:disabled=
"title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1"
>
-
</el-button>
<div
class=
"numWrap"
>
{{
ruleForm
.
limitTime1
}}
</div>
<el-button
@
click=
"add1"
class=
"addsubBtn"
:disabled=
"title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1"
>
+
</el-button>
次
</el-radio>
<el-radio
:label=
"2"
>
有效期内每
<el-input
v-model=
"ruleForm.limitDays"
maxlength=
"4"
@
input=
"
val =>
{
ruleForm.limitDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2" placeholder="请输入" size="small" style="width: 100px">
</el-input>
天内可使用
<el-button
@
click
.
stop=
"sub2"
class=
"addsubBtn"
:disabled=
"title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
>
-
</el-button>
<span
class=
"numWrap"
>
{{
ruleForm
.
limitTime2
}}
</span>
<el-button
@
click
.
stop=
"add2"
class=
"addsubBtn"
:disabled=
"title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
>
+
</el-button>
次
次
</el-radio>
</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-form-item>
<el-radio
v-model=
"editForm.useType"
label=
"2"
:disabled=
"apear != 'couponAdd'
"
>
<el-form-item
v-if=
"!$isGroupUp"
size=
"small"
label=
"会员价"
prop=
"vipPrice"
style=
"width: 315px
"
>
<el-form-item
prop=
"useLimitDays
"
>
<el-input
size=
"small"
:disabled=
"disabledContent"
maxlength=
"8"
v-model=
"ruleForm.vipPrice"
placeholder=
"请输入"
@
keyup
.
native=
"ruleForm.vipPrice = oninput(ruleForm.vipPrice)
"
>
有效期内
<!--
<template
slot=
"append"
>
元
</
template
>
-->
<el-input
v-model=
"editForm.useLimitDays"
style=
"width: 100px; margin-left: 5px; margin-right: 5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 2"
/
>
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span
>
天可使用
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"usageTimes2"
>
<el-form-item
v-if=
"!$isGroupUp"
size=
"small"
label=
"门店价"
prop=
"shopPrice"
style=
"width: 315px"
>
<el-input
v-model=
"editForm.usageTimes2"
style=
"width: 100px; margin-right: 5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 2"
/>
<el-input
size=
"small"
:disabled=
"disabledContent"
maxlength=
"8"
v-model=
"ruleForm.shopPrice"
placeholder=
"请输入"
@
keyup
.
native=
"ruleForm.shopPrice = oninput(ruleForm.shopPrice)"
>
次
<!-- <template slot="append">元</template> -->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
</el-form-item>
</el-radio>
</
template
>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<
template
slot=
"stock"
slot-scope=
"scope"
>
<el-form-item
size=
"small"
label=
"库存"
prop=
"stock"
style=
"width: 315px"
>
<span
v-if=
"$isGroupUp"
>
无库存限制
</span>
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<el-input
:disabled=
"apear != 'couponAdd'"
v-else
class=
"w-150"
v-model=
"editForm[scope.scope.name]"
placeholder=
"请输入库存"
>
<span
v-if=
"$isGroupUp"
>
永久有效
</span>
<el-input
:disabled=
"title == '查看'"
v-else
class=
"w-150"
v-model=
"ruleForm.stock"
placeholder=
"请输入库存"
>
<span
slot=
"suffix"
>
张
</span>
<span
slot=
"suffix"
>
张
</span>
</el-input>
</el-input>
</
template
>
</el-form-item>
<
template
slot=
"useDescriptionHtml"
>
<el-form-item
size=
"small"
label=
"使用说明"
prop=
"useDescription"
style=
"width: 670px"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" />
<el-input
size=
"small"
:rows=
"6"
:disabled=
"disabledDescription"
type=
"textarea"
v-model=
"ruleForm.useDescription"
placeholder=
"请输入"
maxlength=
"200"
show-word-limit
></el-input>
</
template
>
</el-form-item>
</glsx-combi-form>
<el-form-item
size=
"small"
style=
"margin-left: -100px"
v-show=
"isEdit"
>
<div
v-if=
"$isGroupUp"
>
<el-button
style=
"margin-left: 80px"
@
click=
"editMessage"
>
编辑
</el-button>
</el-form-item>
<!-- <el-form-item size="small">
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="resetForm('ruleForm')" size="small">重置</el-button>
</el-form-item> -->
</el-form>
<div
class=
"edit-container"
v-if=
"$isGroupUp"
>
<p
class=
"edit-title"
>
适用门店配置
</p>
<p
class=
"edit-title"
>
适用门店配置
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"merchantRef"
:isEdit=
"true"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"merchantEditFormData"
:formRules=
"merchantRule"
></glsx-combi-form>
<glsx-combi-form
class=
"edit-form-container"
ref=
"merchantRef"
:isEdit=
"true"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"ruleForm"
:formData=
"merchantEditFormData"
:formRules=
"merchantRule"
></glsx-combi-form>
</div>
<!-- <div class="serviceCard">
<div class="cardtop">
<img src="@/assets/serviceMemberCard.png" alt="" />
<span class="serviceName ellipsis-1" :title="ruleForm.couponName">{{ ruleForm.couponName || '-' }}</span>
<span class="effectiveRange">{{ limitText }}</span>
<span class="timeRange">{{ effectiveRangeText }}</span>
<div class="grayLine"></div>
<div class="desc">使用说明:</div>
<span class="detailDesc">{{ ruleForm.useDescription }}</span>
</div>
</div> -->
<div
class=
"right_show"
>
<div
class=
"card-top"
></div>
<div
class=
"slider"
>
<div
class=
"card_one"
>
<div
:class=
"ruleForm.status == 3 ? 'darkColor' : ''"
class=
"cname"
>
{{ ruleForm.couponName }}
</div>
<img
src=
"../../images/unService.png"
class=
"couponImg"
v-if=
"ruleForm.status == 3"
/>
<img
src=
"../../images/service.png"
class=
"couponImg"
v-else
/>
<!-- <div class="ctype">
<div class="ctypeName"></div>
</div> -->
<div
class=
"validityPeriod"
>
<!-- <span class="ctime_name">有效期:</span> -->
<span>
{{ effectiveRangeText }}
</span>
</div>
</div>
<div
style=
"height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px;"
></div>
<div
:class=
"ruleForm.status == 3 ? 'darkColor' : ''"
class=
"ctime"
>
<!-- <span class="ctime_name">使用限制:</span> -->
<span
class=
"ctime_content"
>
{{ limitText }}
</span>
</div>
</div>
<!-- <div class="left_show">
<div
class=
"ccode"
>
<div class="card-panel-top">
<img
src=
"../../assets/coupon/code2.png"
/>
<div class="card-h-title">会员券</div>
<div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div>
<div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div>
<div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div>
<div class="card-name">{{editForm.couponName}}</div>
<div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div>
<div class="card-day" v-if="editForm.useType == 1">使用限制:{{editForm.usageTimes}}次</div>
<div class="card-day" v-if="editForm.useType == 2">使用限制:每{{editForm.useLimitDays}}天可以使用{{editForm.usageTimes2}}次</div>
</div>
</div>
<div class="card-panel-bottom">
<div
style=
"height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"
></div>
<div class="card-remark">使用说明:</div>
<div
class=
"process"
>
<div class="card-remark">{{editForm.useDescription}}</div>
<img
src=
"../../images/unArrow.png"
v-if=
"ruleForm.status == 3"
/>
<img
src=
"../../images/arrow.png"
v-else
/>
<span
class=
"process_text"
>
导航到店
</span>
<img
class=
"rightArrow"
src=
"../../images/rightArrow.png"
/>
<img
src=
"../../images/unCar.png"
v-if=
"ruleForm.status == 3"
/>
<img
src=
"../../images/car.png"
v-else
/>
<span
class=
"process_text"
>
开始服务
</span>
<img
class=
"rightArrow"
src=
"../../images/rightArrow.png"
/>
<img
src=
"../../images/unTicket.png"
v-if=
"ruleForm.status == 3"
/>
<img
src=
"../../images/ticket.png"
v-else
/>
<span
class=
"process_text"
>
出示核销码
</span>
</div>
</div>
<div
class=
"card_two"
>
<div
class=
"cremarks"
>
有效日期:
</div>
<div
class=
"validityPeriod"
style=
"margin: 0 8px 8px 8px;"
>
<span>
{{ effectiveRangeText }}
</span>
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
style=
"white-space:pre-wrap"
>
{{ ruleForm.useDescription }}
</div>
</div>
</div>
</div> -->
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"primary"
v-if=
"apear != 'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
v-if=
"apear != 'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
v-if=
"apear == 'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
</div>
</div>
</div>
</div>
<div
class=
"footer-panel"
:style=
"{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
size=
"medium"
:loading=
"sloading"
v-if=
"showSubmit"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"goBack"
size=
"medium"
>
取消
</el-button>
</div>
<!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" -->
<glsx-dialog
title=
""
top=
"30vh"
:hasScroll=
"false"
width=
"547px"
btnCloseLabel=
"取消"
:noClose=
"false"
:noCancel=
"true"
btnSize=
"small"
:isVisible=
"isDialogVisible"
:showClose=
"false"
@
closeDialog=
"handleClose"
@
confirmDialog=
"handleConfirm"
>
<div
class=
"content-body"
>
<img
src=
"@/assets/icon-warning.png"
alt=
""
/>
<div>
当前有内容信息未保存,是否继续返回?
</div>
</div>
</glsx-dialog>
</div>
</template>
</template>
<
script
>
<
script
>
import
glsxDialog
from
'@/components/glsx-dialog'
import
{
limitPrice
}
from
'@/common/constant'
import
{
limitPrice
}
from
'@/common/constant'
import
{
createService
,
detailService
,
updateService
}
from
'@/api/modules/service'
export
default
{
export
default
{
name
:
'editCashCoupon'
,
components
:
{
glsxDialog
},
data
()
{
data
()
{
var
checkZero
=
(
rule
,
value
,
callback
)
=>
{
setTimeout
(()
=>
{
if
(
value
==
0
)
{
callback
(
new
Error
(
'请输入有效数字值'
))
}
else
{
callback
()
}
})
}
var
checkStock
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
$isGroupUp
)
{
return
callback
()
}
if
(
value
<=
0
)
{
return
callback
(
new
Error
(
'库存不能为空或负数'
))
}
setTimeout
(()
=>
{
if
(
!
(
/^
[
0-9
]
*$/
.
test
(
value
)))
{
callback
(
new
Error
(
'请输入数字值'
))
}
else
{
if
(
value
<
0
)
{
callback
(
new
Error
(
'必须大于或等于0'
))
}
else
{
callback
()
}
}
},
1000
)
}
return
{
return
{
size
:
'small'
,
isEdit
:
false
,
title
:
'创建'
,
showSubmit
:
true
,
titleObj
:
{
disabledDescription
:
false
,
1
:
'创建晒单'
,
disabledCost
:
false
,
2
:
'编辑晒单'
sloading
:
false
,
},
isDialogVisible
:
false
,
footerLeft
:
'0'
,
footerWidth
:
'0'
,
editChildRef
:
'editChildRef'
,
editChildRef
:
'editChildRef'
,
loading
:
false
,
pickerOptions
:
{
// pickerOptions: {
disabledDate
(
time
)
{
// disabledDate(v) {//禁用当前之前的日期
return
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
// 如果没有后面的-8.64e7就是不可以选择今天的
// return v.getTime() < new Date().getTime() - 86400000;
}
// },
// disabledDate(time) {//禁用当前之后的日期
// return time.getTime() > Date.now() - 8.64e6
// }
// },
routeInfo
:
{
// 1-新增;2-编辑;3-查看
addOrEdit
:
1
,
id
:
''
},
},
apear
:
''
,
ruleForm
:
{
isDisabled
:
true
,
anticipatedCost
:
''
,
couponTime
:
''
,
editForm
:
{
couponName
:
''
,
couponName
:
''
,
effectiveType
:
'3'
,
// region: '',
useType
:
'0'
,
// date1: '',
usageTimes
:
1
,
// date2: '',
usageTimes2
:
1
,
// delivery: false,
// type: [],
// resource: '',
effectiveType
:
3
,
//有效期(默认无有效期)
effectiveDays
:
''
,
customUseLimit
:
0
,
//使用限制(默认不限制使用次数)
limitTime1
:
1
,
limitDays
:
'30'
,
limitTime2
:
5
,
vipPrice
:
''
,
shopPrice
:
''
,
stock
:
''
,
useDescription
:
''
,
daterange
:
[],
scopeApplication
:
''
scopeApplication
:
''
},
},
editRule
:
{
copyRuleForm
:
{},
couponName
:
[{
required
:
true
,
message
:
'请输入优惠券名称'
,
trigger
:
'change'
}],
rules
:
{
anticipatedCost
:
[{
required
:
true
,
message
:
'请输入预估成本'
,
trigger
:
'change'
}],
couponName
:
[{
required
:
true
,
message
:
'请输入服务名称'
,
trigger
:
'blur'
}],
// region: [{ required: true, message: '请选择活动区域', trigger: 'change' }],
// date1: [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }],
// date2: [{ type: 'date', required: true, message: '请选择时间', trigger: 'change' }],
// type: [{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }],
effectiveType
:
[{
required
:
true
,
message
:
'请选择有效期'
,
trigger
:
'change'
}],
effectiveType
:
[{
required
:
true
,
message
:
'请选择有效期'
,
trigger
:
'change'
}],
effectiveTime
:
[{
required
:
true
,
message
:
'有效期不能为空'
,
trigger
:
'change'
}],
customUseLimit
:
[{
required
:
true
,
message
:
'请选择使用限制'
,
trigger
:
'change'
}],
effectiveDays
:
[{
required
:
true
,
message
:
'有效天数不能为空'
,
trigger
:
'blur'
}],
vipPrice
:
[
useType
:
[{
required
:
true
,
message
:
'请选择使用限制'
,
trigger
:
'change'
}],
{
required
:
true
,
message
:
'请输入会员价'
,
trigger
:
'blur'
},
usageTimes
:
[{
required
:
true
,
message
:
'使用次数不能为空'
,
trigger
:
'blur'
}],
{
validator
:
checkZero
,
trigger
:
'blur'
}
useLimitDays
:
[{
required
:
true
,
message
:
'有效期天数不能为空'
,
trigger
:
'blur'
}],
],
usageTimes2
:
[{
required
:
true
,
message
:
'使用次数不能为空'
,
trigger
:
'blur'
}],
shopPrice
:
[
vipPrice
:
[{
required
:
true
,
message
:
'会员价不能为空'
,
trigger
:
'change'
}],
{
required
:
true
,
message
:
'请输入门店价'
,
trigger
:
'blur'
},
shopPrice
:
[{
required
:
true
,
message
:
'门店价不能为空'
,
trigger
:
'change'
}],
{
validator
:
checkZero
,
trigger
:
'blur'
}
stock
:
[{
required
:
true
,
message
:
'库存不能为空'
,
trigger
:
'change'
}],
useDescription
:
[{
required
:
true
,
message
:
'使用说明不能为空'
,
trigger
:
'change'
}]
},
editFormData
:
[
{
label
:
'服务名称'
,
name
:
'couponName'
,
width
:
'320px'
,
type
:
'input'
,
maxlength
:
20
},
{
label
:
'有效期'
,
name
:
'effectiveType'
,
addHtml
:
'effectiveHtml'
},
{
label
:
'使用限制'
,
name
:
'useType'
,
addHtml
:
'useTypeHtml'
},
{
label
:
'会员价'
,
name
:
'vipPrice'
,
width
:
'150px'
,
type
:
'input'
,
isHide
:
false
},
{
label
:
'门店价'
,
name
:
'shopPrice'
,
width
:
'150px'
,
type
:
'input'
,
isHide
:
false
},
{
label
:
'库存'
,
name
:
'stock'
,
addHtml
:
'stock'
// width: '150px',
// type: 'input'
},
{
label
:
'使用说明'
,
name
:
'useDescription'
,
addHtml
:
'useDescriptionHtml'
}
],
],
stock
:
[
{
required
:
true
,
message
:
'请输入库存'
,
trigger
:
'blur'
},
{
validator
:
checkStock
,
trigger
:
'blur'
}
]
// useDescription: [{ required: true, message: '请填写活动形式', trigger: 'blur' }]
},
merchantId
:
''
,
merchantName
:
''
,
title
:
this
.
$route
.
query
.
title
||
''
,
// 适用门店
// 适用门店
merchantRule
:
{
merchantRule
:
{
scopeApplication
:
[{
required
:
true
,
message
:
'请选择适用范围'
,
trigger
:
'change'
}]
scopeApplication
:
[{
required
:
true
,
message
:
'请选择适用范围'
,
trigger
:
'change'
}]
...
@@ -207,287 +300,605 @@ export default {
...
@@ -207,287 +300,605 @@ export default {
]
]
}
}
},
},
computed
:
{
disabledContent
()
{
if
(
this
.
title
==
'查看'
||
this
.
title
==
'编辑'
)
{
return
true
}
return
false
},
limitText
()
{
if
(
this
.
ruleForm
.
customUseLimit
==
0
)
{
return
`不限次数`
}
else
if
(
this
.
ruleForm
.
customUseLimit
==
1
)
{
return
`有效期内可使用
${
this
.
ruleForm
.
limitTime1
}
次`
}
else
if
(
this
.
ruleForm
.
customUseLimit
==
2
&&
this
.
ruleForm
.
effectiveType
!=
3
)
{
return
`有效期内每
${
this
.
ruleForm
.
limitDays
}
天内可使用
${
this
.
ruleForm
.
limitTime2
}
次`
}
else
if
(
this
.
ruleForm
.
customUseLimit
==
2
&&
this
.
ruleForm
.
effectiveType
==
3
)
{
return
'不限次数'
}
return
'不限次数'
},
effectiveRangeText
()
{
if
(
this
.
ruleForm
.
effectiveType
==
1
)
{
return
`领取后
${
this
.
ruleForm
.
effectiveDays
}
天内有效`
}
else
if
(
this
.
ruleForm
.
effectiveType
==
2
)
{
return
`
${
this
.
ruleForm
.
daterange
[
0
]}
-
${
this
.
ruleForm
.
daterange
[
1
]}
`
}
return
'永久有效'
}
// 有效期内可使用3次
},
created
()
{
created
()
{
this
.
editRule
.
stock
[
0
].
required
=
!
this
.
$isGroupUp
this
.
copyRuleForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ruleForm
))
//深拷贝一份数据
let
hideAttrList
=
[
'vipPrice'
,
'shopPrice'
]
if
(
window
.
__POWERED_BY_QIANKUN__
)
{
if
(
this
.
$isGroupUp
)
{
//运行在qiankun容器中
hideAttrList
.
forEach
(
item
=>
{
this
.
merchantId
=
this
.
$globalState
.
session
.
merchantId
let
idx
=
this
.
editFormData
.
findIndex
(
k
=>
k
.
name
==
item
)
this
.
merchantName
=
this
.
$globalState
.
session
.
merchantName
this
.
editFormData
[
idx
].
isHide
=
true
}
})
if
(
this
.
title
==
'编辑'
||
this
.
title
==
'查看'
)
{
this
.
isEdit
=
true
var
breadcrumbTitle
=
this
.
title
this
.
getPageDetail
()
}
}
this
.
rules
.
stock
[
0
].
required
=
!
this
.
$isGroupUp
},
},
mounted
()
{
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
routeInfo
=
this
.
$route
.
params
if
(
this
.
title
==
'查看'
||
this
.
title
==
'编辑'
)
{
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this
.
disabledCost
=
true
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
this
.
disabledDescription
=
true
var
id
=
this
.
routeInfo
.
id
this
.
showSubmit
=
false
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
}
if
(
id
)
{
if
(
this
.
title
==
'查看'
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
this
.
title
=
'查看'
this
.
setAllDisabled
(
'merchantEditFormData'
)
this
.
setAllDisabled
(
'merchantEditFormData'
)
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
this
.
title
=
'编辑'
}
this
.
isDisabled
=
true
this
.
editFormData
[
0
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
3
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
4
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
5
].
isDisabled
=
this
.
isDisabled
}
else
{
this
.
apear
=
'couponAdd'
this
.
title
=
'创建'
this
.
isDisabled
=
false
}
}
},
},
watch
:
{
watch
:
{
'editForm.effectiveDays'
(
newValue
,
oldValue
)
{
'ruleForm.anticipatedCost'
(
newValue
,
oldValue
)
{
this
.
editForm
.
effectiveDays
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
this
.
ruleForm
.
anticipatedCost
=
limitPrice
(
newValue
,
oldValue
,
4
,
2
,
0
,
10000
)
},
'editForm.usageTimes'
(
newValue
,
oldValue
)
{
this
.
editForm
.
usageTimes
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.useLimitDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
useLimitDays
=
limitPrice
(
newValue
,
oldValue
,
4
,
0
)
},
'editForm.usageTimes2'
(
newValue
,
oldValue
)
{
this
.
editForm
.
usageTimes2
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.vipPrice'
(
newValue
,
oldValue
)
{
this
.
editForm
.
vipPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
)
},
'editForm.shopPrice'
(
newValue
,
oldValue
)
{
this
.
editForm
.
shopPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
)
},
'editForm.stock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
stock
=
limitPrice
(
newValue
,
oldValue
,
6
,
0
,
1
)
},
'editForm.effectiveTime'
(
newValue
,
oldValue
)
{
if
(
newValue
&&
newValue
.
length
>
0
)
{
this
.
couponTime
=
this
.
setDateString
(
newValue
[
0
],
true
)
+
' - '
+
this
.
setDateString
(
newValue
[
1
],
true
)
}
else
{
this
.
couponTime
=
''
}
}
}
},
},
methods
:
{
methods
:
{
setAllDisabled
(
editName
)
{
setAllDisabled
(
editName
)
{
this
[
editName
].
forEach
(
item
=>
{
this
[
editName
].
forEach
(
item
=>
{
item
.
isDisabled
=
true
item
.
isDisabled
=
true
})
})
},
},
setDateString
(
objField
,
special
)
{
editMessage
()
{
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
this
.
disabledCost
=
false
return
value
this
.
disabledDescription
=
false
this
.
showSubmit
=
true
},
},
getPageDetail
()
{
getInfo
()
{
let
params
=
{}
this
.
loading
=
true
params
.
couponId
=
this
.
$route
.
query
.
couponId
this
.
$apis
.
couponManage
detailService
(
params
).
then
(
res
=>
{
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
})
this
.
ruleForm
=
res
.
then
(
res
=>
{
this
.
ruleForm
.
anticipatedCost
=
(
res
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
ruleForm
.
customUseLimit
=
res
.
useType
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
this
.
editForm
.
useType
=
this
.
editForm
.
useType
+
''
if
(
this
.
$isGroupUp
)
{
if
(
this
.
$isGroupUp
)
{
this
.
editForm
.
scopeApplication
=
this
.
editForm
.
scopeApplication
+
''
this
.
ruleForm
.
scopeApplication
=
res
.
scopeApplication
+
''
}
}
if
(
res
.
effectiveType
==
1
)
{
//有效期
this
.
ruleForm
.
effectiveDays
=
res
.
effectiveDays
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
}
if
(
this
.
editForm
.
effectiveType
==
2
)
{
if
(
res
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
ruleForm
.
daterange
=
[
res
.
effectiveStartTime
,
res
.
effectiveEndTime
]
}
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
// this.ruleForm.limitTime1 = ''
if
(
this
.
editForm
.
useType
==
1
)
{
// this.ruleForm.limitTime2 = ''
this
.
editForm
.
usageTimes
=
this
.
editForm
.
useAmount
// this.limitDays = ''
}
else
if
(
this
.
editForm
.
useType
==
2
)
{
if
(
res
.
useType
==
1
)
{
this
.
editForm
.
usageTimes2
=
this
.
editForm
.
useAmount
this
.
ruleForm
.
limitTime1
=
res
.
useAmount
}
}
}).
finally
(()
=>
{
if
(
res
.
useType
==
2
)
{
this
.
loading
=
false
this
.
ruleForm
.
limitTime2
=
res
.
useAmount
this
.
ruleForm
.
limitDays
=
res
.
useLimitDays
}
this
.
copyRuleForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ruleForm
))
//深拷贝一份数据
})
})
},
},
submitForm
(
formName
)
{
validateRules
()
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
var
form
=
this
.
editForm
var
merchantval
=
true
if
(
form
.
effectiveType
==
'2'
)
{
if
(
this
.
$isGroupUp
)
{
//判断 有效期-日期选择是否验证
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
merchantval
=
merchantVaild
}
else
{
})
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
}
}
if
(
form
.
effectiveType
==
'1'
)
{
if
(
valid
&&
merchantval
)
{
//判断 有效期-有效天数是否验证
if
(
this
.
isEdit
==
true
)
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
this
.
updateService
()
}
else
{
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
this
.
createService
()
}
}
if
(
form
.
useType
==
'1'
)
{
//判断 使用限制-有效期内使用次数是否验证
this
.
editRule
.
usageTimes
[
0
].
required
=
true
}
else
{
}
else
{
this
.
editRule
.
usageTimes
[
0
].
required
=
false
return
false
}
})
},
//创建服务
createService
()
{
let
params
=
{
effectiveDays
:
''
,
useAmount
:
''
,
useLimitDays
:
''
}
params
.
anticipatedCost
=
this
.
ruleForm
.
anticipatedCost
*
100
params
.
directionalFlag
=
'1'
params
.
couponName
=
this
.
ruleForm
.
couponName
//有效期
params
.
effectiveType
=
this
.
ruleForm
.
effectiveType
//使用限制
params
.
useType
=
this
.
ruleForm
.
customUseLimit
//有效期 effectiveType: 3 1 2
if
(
this
.
ruleForm
.
effectiveType
==
1
&&
!
parseInt
(
this
.
ruleForm
.
effectiveDays
))
{
this
.
$message
.
error
(
'请输入有效期'
)
return
false
}
}
if
(
form
.
useType
==
'2'
)
{
params
.
effectiveDays
=
this
.
ruleForm
.
effectiveDays
//判断 使用限制-有效天数和使用次数是否验证
if
(
this
.
ruleForm
.
effectiveType
==
2
)
{
this
.
editRule
.
useLimitDays
[
0
].
required
=
true
if
(
!
this
.
ruleForm
.
daterange
)
{
this
.
editRule
.
usageTimes2
[
0
].
required
=
true
this
.
$message
.
error
(
'请输入有效期'
)
return
false
}
else
{
}
else
{
this
.
editRule
.
useLimitDays
[
0
].
required
=
false
params
.
effectiveStartTime
=
this
.
ruleForm
.
daterange
[
0
]
+
' 00:00:00'
this
.
editRule
.
usageTimes2
[
0
].
required
=
false
params
.
effectiveEndTime
=
this
.
ruleForm
.
daterange
[
1
]
+
' 23:59:59'
}
}
},
}
//使用限制
getCouponInfoParams
()
{
if
(
this
.
ruleForm
.
customUseLimit
==
1
)
{
var
obj
=
{}
if
(
!
parseInt
(
this
.
ruleForm
.
limitTime1
))
{
var
id
=
this
.
routeInfo
.
id
this
.
$message
.
error
(
'请输入有效期使用次数'
)
var
form
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
return
false
if
(
id
)
{
obj
.
couponId
=
id
}
else
{
}
else
{
//编辑时只允许编辑使用说明
params
.
useAmount
=
this
.
ruleForm
.
limitTime1
//优惠券名称
obj
.
couponName
=
form
.
couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:服务券
obj
.
discountType
=
'7'
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj
.
effectiveType
=
form
.
effectiveType
if
(
form
.
effectiveType
==
1
)
{
//固定天数
obj
.
effectiveDays
=
form
.
effectiveDays
}
else
if
(
form
.
effectiveType
==
2
)
{
//时间段
const
d
=
form
.
effectiveTime
if
(
d
&&
d
.
length
>
0
)
{
obj
.
effectiveStartTime
=
d
[
0
]
+
' 00:00:00'
obj
.
effectiveEndTime
=
d
[
1
]
+
' 23:59:59'
}
}
}
}
if
(
this
.
ruleForm
.
customUseLimit
==
2
)
{
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
if
(
!
parseInt
(
this
.
ruleForm
.
limitTime2
)
||
!
parseInt
(
this
.
ruleForm
.
limitDays
))
{
obj
.
useType
=
form
.
useType
this
.
$message
.
error
(
'请输入有效期使用次数'
)
if
(
form
.
useType
==
1
)
{
return
false
obj
.
useAmount
=
form
.
usageTimes
}
else
{
}
else
if
(
form
.
useType
==
2
)
{
params
.
useLimitDays
=
this
.
ruleForm
.
limitDays
obj
.
useLimitDays
=
form
.
useLimitDays
params
.
useAmount
=
this
.
ruleForm
.
limitTime2
obj
.
useAmount
=
form
.
usageTimes2
}
}
}
//会员价
params
.
vipPrice
=
this
.
ruleForm
.
vipPrice
obj
.
vipPrice
=
form
.
vipPrice
params
.
shopPrice
=
this
.
ruleForm
.
shopPrice
//门店价
// params.stock = this.ruleForm.stock
obj
.
shopPrice
=
form
.
shopPrice
//库存
//库存
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
params
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
if
(
!
this
.
$isGroupUp
)
{
obj
.
stock
=
f
orm
.
stock
params
.
stock
=
this
.
ruleF
orm
.
stock
}
else
{
}
else
{
obj
.
scopeApplication
=
form
.
scopeApplication
params
.
scopeApplication
=
this
.
ruleForm
.
scopeApplication
}
}
}
//使用描述
params
.
useDescription
=
this
.
ruleForm
.
useDescription
obj
.
useDescription
=
form
.
useDescription
return
obj
},
handleConfirm
()
{
params
.
discountType
=
7
this
.
validateRules
()
params
.
merchantId
=
this
.
merchantId
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
params
.
merchantName
=
this
.
merchantName
var
merchantval
=
true
this
.
sloading
=
true
if
(
this
.
$isGroupUp
)
{
createService
(
params
)
this
.
$refs
.
merchantRef
.
$refs
[
this
.
editChildRef
].
validate
(
merchantVaild
=>
{
.
then
(
res
=>
{
this
.
merchantval
=
merchantVaild
if
(
res
.
code
==
0
)
{
this
.
sloading
=
false
this
.
$message
.
success
(
'操作成功'
)
this
.
$router
.
push
(
'/couponManage/index'
)
}
else
{
this
.
sloading
=
false
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
})
})
}
}
if
(
valid
&&
merchantval
)
{
})
var
params
=
this
.
getCouponInfoParams
()
.
catch
(
err
=>
{
let
method
=
''
this
.
sloading
=
false
if
(
params
.
couponId
)
{
})
method
=
'updateCouponApi'
//后台修改优惠券
.
finally
(()
=>
{
this
.
sloading
=
false
})
},
//更新服务
updateService
()
{
let
param
=
{}
param
.
anticipatedCost
=
this
.
ruleForm
.
anticipatedCost
*
100
param
.
discountType
=
7
param
.
merchantId
=
this
.
merchantId
param
.
merchantName
=
this
.
merchantName
param
.
couponId
=
this
.
$route
.
query
.
couponId
param
.
stock
=
this
.
ruleForm
.
stock
param
.
useDescription
=
this
.
ruleForm
.
useDescription
this
.
sloading
=
true
updateService
(
param
)
.
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
sloading
=
false
this
.
$message
.
success
(
'编辑服务成功'
)
this
.
$router
.
push
(
'/couponManage/index'
)
}
else
{
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
this
.
sloading
=
false
}
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
'操作失败
'
,
type
:
'error
'
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
message
:
res
.
message
})
})
if
(
res
.
code
==
'0'
)
{
this
.
handleCancel
()
}
}
})
})
}
.
catch
(
err
=>
{
this
.
sloading
=
false
})
})
},
.
finally
(()
=>
{
handleCancel
()
{
this
.
sloading
=
false
this
.
$router
.
push
({
path
:
'/couponManage/index'
})
})
},
goBack
()
{
if
(
JSON
.
stringify
(
this
.
ruleForm
)
==
JSON
.
stringify
(
this
.
copyRuleForm
)
||
this
.
title
==
'查看'
)
{
this
.
$router
.
push
(
'/couponManage/index'
)
}
else
{
// this.$message.error('是否保存信息')
this
.
isDialogVisible
=
true
}
},
handleClose
()
{
this
.
isDialogVisible
=
false
},
handleConfirm
()
{
this
.
$router
.
push
(
'/couponManage/index'
)
},
oninput
(
value
)
{
let
str
=
value
let
len1
=
str
.
substr
(
0
,
1
)
let
len2
=
str
.
substr
(
1
,
1
)
//如果第一位是0,第二位不是点,就用数字把点替换掉
if
(
str
.
length
>
1
&&
len1
==
0
&&
len2
!=
'.'
)
{
str
=
str
.
substr
(
1
,
1
)
}
//第一位不能是.
if
(
len1
==
'.'
)
{
str
=
''
}
if
(
len1
==
'+'
)
{
str
=
''
}
if
(
len1
==
'-'
)
{
str
=
''
}
//限制只能输入一个小数点
if
(
Number
(
value
)
>=
999999999
)
{
return
(
str
=
999999999
)
}
if
(
str
.
indexOf
(
'.'
)
!=
-
1
)
{
let
str_
=
str
.
substr
(
str
.
indexOf
(
'.'
)
+
1
)
if
(
str_
.
indexOf
(
'.'
)
!=
-
1
)
{
str
=
str
.
substr
(
0
,
str
.
indexOf
(
'.'
)
+
str_
.
indexOf
(
'.'
)
+
1
)
}
}
//正则替换
// (/[^\-\d.]/g, ''))"
str
=
str
.
replace
(
/
[^\d
.^
]
+/g
,
''
)
// 保留数字和小数点
str
=
str
.
replace
(
/^
\D
*
([
0-9
]\d
*
\.?\d{0,2})?
.*$/
,
'$1'
)
// 小数点后只能输 2 位
return
str
},
sub1
()
{
if
(
this
.
ruleForm
.
limitTime1
<=
0
)
{
return
}
this
.
ruleForm
.
limitTime1
--
},
add1
()
{
this
.
ruleForm
.
limitTime1
++
},
sub2
()
{
if
(
this
.
ruleForm
.
limitTime2
<=
0
)
{
return
}
this
.
ruleForm
.
limitTime2
--
},
add2
()
{
this
.
ruleForm
.
limitTime2
++
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
.left_show
{
<
style
lang=
"scss"
scoped
>
width
:
400px
;
.live-room
{
/*min-height: 600px;*/
.topMsg
{
background
:
#fff
;
margin
:
20px
0px
0
;
/*border: 1px solid #eee;*/
padding
:
0
20px
;
position
:
relative
;
background-color
:
#fff
;
height
:
56px
;
border-bottom
:
1px
solid
#DCDFE6
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
align-items
:
center
;
.pageTitle
{
position
:
relative
;
//
margin-bottom
:
20px
;
//
height
:
20px
;
font-size
:
20px
;
font-weight
:
700
;
color
:
#333333
;
line-height
:
20px
;
letter-spacing
:
1px
;
}
}
.container
{
margin
:
0
0px
100px
;
position
:
relative
;
/deep/
.el-form-item__content
{
.radioGroupWrap
{
width
:
550px
;
height
:
164px
;
background-color
:
#f4f6fc
;
padding-top
:
10px
;
padding-left
:
20px
;
}
}
.numWrap
{
display
:
inline-block
;
background-color
:
#fff
;
min-width
:
34px
;
height
:
22px
;
text-align
:
center
;
line-height
:
22px
;
margin
:
0
2px
;
vertical-align
:
text-bottom
;
}
.addsubBtn
{
background-color
:
#fff
;
color
:
#5850ff
;
padding
:
5px
9px
;
}
.el-radio
{
display
:
block
;
&:not(:first-child)
{
margin-top
:
18px
;
}
}
.itemBlock
{
margin-top
:
10px
;
}
}
.footer-panel
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
width
:
100%
;
bottom
:
0px
;
height
:
64px
;
background
:
#ffffff
;
z-index
:
999
;
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
}
/
deep
/
.el-dialog__header
{
border
:
0
;
}
/
deep
/
.el-dialog__body
{
border-bottom
:
1px
solid
#e6e6e6
;
padding
:
20px
25px
;
.content-body
{
text-align
:
center
;
height
:
98px
;
line-height
:
26px
;
div
{
font-size
:
16px
;
color
:
#333333
;
font-weight
:
400
;
font-weight
:
400
;
color
:
#333333
;
}
}
}
/
deep
/
.el-dialog__footer
{
border
:
0
;
text-align
:
center
;
padding-top
:
15px
;
padding-bottom
:
15px
;
.el-button--small
{
padding
:
8px
26px
;
}
}
}
.right_show
{
position
:
absolute
;
position
:
absolute
;
top
:
110px
;
z-index
:
10
;
left
:
50%
;
height
:
566px
;
width
:
290px
;
right
:
44px
;
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
}
.right_show
.card-top
{
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
}
.left_show
.card-panel-top
{
.card_one
{
/* margin-top: 200px; */
width
:
243px
;
width
:
365px
;
height
:
285px
;
height
:
122px
;
background
:
#ffffff
;
background-color
:
rgba
(
245
,
154
,
35
,
0.7
);
border-radius
:
4px
;
border
:
none
;
margin-left
:
22px
;
margin-top
:
5.81px
;
}
.cname
{
margin
:
16px
0
10px
16px
;
display
:
inline-block
;
font-size
:
18px
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
#fc5b32
;
max-width
:
164px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
height
:
35px
;
}
.ctype
{
width
:
48px
;
height
:
20px
;
background
:
#5850ff
;
border-radius
:
2px
;
margin-right
:
8px
;
margin-top
:
8px
;
display
:
inline-block
;
float
:
right
;
}
.ctypeName
{
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#ffffff
;
font-weight
:
400
;
margin-left
:
6px
;
}
.ctime
{
margin
:
8px
16px
9px
;
text-align
:
center
;
text-align
:
center
;
line-height
:
24px
;
color
:
#fc5b32
;
position
:
relative
;
}
}
.card-h-title
{
/* .ctime_name {
position
:
absolute
;
width: 48px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
} */
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
font-weight
:
400
;
margin-left
:
5px
;
}
.ccode
{
width
:
120px
;
height
:
120px
;
margin
:
0
16px
;
margin
:
auto
;
}
.ccodeName
{
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1d1d1d
;
font-weight
:
500
;
font-weight
:
500
;
font-size
:
20px
;
margin-left
:
88px
;
top
:
20px
;
margin-top
:
8px
;
transform
:
rotate
(
-45deg
);
}
}
.card-panel-bottom
{
width
:
353px
;
.link-top
{
min-height
:
90px
;
width
:
227px
;
background-color
:
rgba
(
250
,
205
,
145
,
1
);
height
:
1px
;
padding
:
6px
;
background
:
#eeeeee
;
margin-left
:
8px
;
margin-top
:
8px
;
}
}
.card-extime
{
.code_d
{
margin-left
:
98px
;
margin-top
:
10px
;
margin-top
:
10px
;
}
}
.card-name
{
margin
:
16px
0px
;
.card_two
{
font-size
:
16px
;
width
:
243px
;
height
:
162px
;
background
:
#ffffff
;
border-radius
:
4px
;
margin-left
:
22px
;
margin-top
:
8px
;
}
}
.card-day
{
margin-top
:
10px
;
.cremarks
{
padding-left
:
8px
;
padding-top
:
8px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
}
.card-remark
{
.cremarks_content
{
margin-left
:
8px
;
margin-right
:
8px
;
margin-top
:
4px
;
width
:
227px
;
height
:
80px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
word-break
:
break-word
;
overflow
:
auto
;
}
.promptCopy
{
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
color
:
#999
;
margin-left
:
-10px
;
}
.couponImg
{
width
:
69px
;
height
:
69px
;
position
:
sticky
;
float
:
right
;
margin-top
:
-6px
;
margin-right
:
-6px
;
}
.validityPeriod
{
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#a0a0a0
;
margin
:
0
16px
8px
16px
;
}
.process
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-bottom
:
2px
;
}
.process
.process_text
{
margin-left
:
2px
;
font-size
:
12px
;
color
:
#333
;
}
.process
img
{
width
:
12px
;
height
:
12px
;
}
.process
.rightArrow
{
padding
:
0
4px
;
}
.slider
{
height
:
380px
;
overflow
:
auto
;
}
.slider
::-webkit-scrollbar-thumb
{
background
:
transparent
;
}
.darkColor
{
color
:
#999
;
}
}
</
style
>
</
style
>
src/views/couponManage/index.vue
View file @
be15fcf
...
@@ -349,7 +349,13 @@ export default {
...
@@ -349,7 +349,13 @@ export default {
//新增服务券
//新增服务券
addService
()
{
addService
()
{
this
.
$router
.
push
(
'/couponManage/editMemberService/1'
)
// this.$router.push('/couponManage/editMemberService/1')
this
.
$router
.
push
({
path
:
'/couponManage/editMemberService'
,
query
:
{
$title
:
encodeURI
(
'创建服务'
)
}
})
},
},
//新增折扣劵
//新增折扣劵
...
@@ -371,7 +377,15 @@ export default {
...
@@ -371,7 +377,15 @@ export default {
goto
=
'/couponManage/editCashCoupon/'
goto
=
'/couponManage/editCashCoupon/'
}
else
if
(
row
.
discountType
==
'7'
)
{
}
else
if
(
row
.
discountType
==
'7'
)
{
//服务券
//服务券
goto
=
'/couponManage/editMemberService/'
this
.
$router
.
push
({
path
:
'/couponManage/editMemberService'
,
query
:
{
couponId
:
row
.
id
,
title
:
addOrEdit
==
2
?
'编辑'
:
'查看'
,
$title
:
encodeURI
(
'编辑服务'
)
}
})
return
true
}
else
if
(
row
.
discountType
==
'2'
)
{
}
else
if
(
row
.
discountType
==
'2'
)
{
//折扣劵
//折扣劵
goto
=
'/couponManage/editDiscountCoupon/'
goto
=
'/couponManage/editDiscountCoupon/'
...
...
src/views/couponManage/receiveDetail.vue
View file @
be15fcf
...
@@ -203,7 +203,7 @@ export default {
...
@@ -203,7 +203,7 @@ export default {
// },
// },
{
{
confId
:
'1'
,
confId
:
'1'
,
confName
:
'
已领取
'
confName
:
'
未使用
'
},
},
{
{
confId
:
'2'
,
confId
:
'2'
,
...
@@ -211,7 +211,7 @@ export default {
...
@@ -211,7 +211,7 @@ export default {
},
},
{
{
confId
:
'3'
,
confId
:
'3'
,
confName
:
'已
过期
'
confName
:
'已
失效
'
}
}
],
],
wechatUserFlagList
:
[
wechatUserFlagList
:
[
...
...
src/views/couponManage/recordList.vue
View file @
be15fcf
...
@@ -202,7 +202,22 @@ export default {
...
@@ -202,7 +202,22 @@ export default {
label
:
'券来源'
,
label
:
'券来源'
,
prop
:
'packageName'
,
prop
:
'packageName'
,
formatter
:
cellValue
=>
{
formatter
:
cellValue
=>
{
return
cellValue
.
packageId
?
cellValue
.
packageName
:
cellValue
.
directionalGiftId
?
cellValue
.
directionalGiftName
:
'-'
let
txt
=
''
if
(
this
.
$isGroupUp
)
{
txt
=
cellValue
.
packageId
?
cellValue
.
packageName
:
cellValue
.
directionalGiftId
?
cellValue
.
directionalGiftName
:
'-'
}
else
{
txt
=
{
''
:
'-'
,
1
:
'营销活动'
,
2
:
'营销活动'
,
3
:
'会员服务套餐'
,
4
:
'营销活动'
,
5
:
'关联商品购买'
,
6
:
'通过集团套餐赠送'
,
7
:
'通过定向礼包赠送'
}[
cellValue
.
receiveWay
]
}
return
txt
}
}
},
},
{
{
...
...
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