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 b04ead14
authored
Jul 17, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
服务券、兑换券添加不限制库存功能
1 parent
e31572c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
153 deletions
src/views/couponManage/editCashCoupon.vue
src/views/couponManage/editDiscountCoupon.vue
src/views/couponManage/editExchangeCoupon.vue
src/views/couponManage/editMemberService.vue
src/views/couponManage/editCashCoupon.vue
View file @
b04ead1
This diff is collapsed.
Click to expand it.
src/views/couponManage/editDiscountCoupon.vue
View file @
b04ead1
...
...
@@ -18,7 +18,6 @@
<span
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
style=
"height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px;"
></div>
<div
:class=
"editForm.status == 3 ? 'darkColor' : ''"
class=
"ctime"
>
<!--
<span
class=
"ctime_name"
>
使用限制:
</span>
-->
<span
class=
"ctime_content"
style=
"font-size: 20px;font-weight: 600;"
v-show=
"editForm.discountIntensity"
>
{{
editForm
.
discountIntensity
}}
</span>
...
...
@@ -98,8 +97,9 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<
template
slot=
"stock"
slot-scope=
"scope"
>
<span
v-if=
"$isGroupUp"
>
无库存限制
</span>
<el-input
:disabled=
"apear != 'couponAdd'"
v-else
class=
"w-150"
v-model=
"editForm[scope.scope.name]"
placeholder=
"请输入库存"
></el-input>
<el-input
:disabled=
"apear != 'couponAdd'
|| isLimitStock
"
v-else
class=
"w-150"
v-model=
"editForm[scope.scope.name]"
placeholder=
"请输入库存"
></el-input>
张
<el-checkbox
style=
"margin-left:10px;"
v-model=
"isLimitStock"
:disabled=
"apear != 'couponAdd'"
@
change=
"updateStock"
>
不限制库存
</el-checkbox>
</
template
>
<
template
slot=
"useDescriptionHtml"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
...
...
@@ -119,13 +119,13 @@
</GLFooter>
</div>
</template>
<
script
>
import
{
limitPrice
}
from
'@/common/constant'
export
default
{
name
:
'editDiscountCoupon'
,
data
()
{
return
{
isLimitStock
:
false
,
defaultTime
:
[
'00:00:00'
,
'23:59:59'
],
// 选择日期后的默认时间
format
:
'yyyy-MM-dd HH:mm:ss'
,
// 日期显示格式
showSubmit
:
true
,
...
...
@@ -242,7 +242,7 @@ export default {
addHtml
:
'editHtml'
,
isHide
:
true
}
]
,
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...
...
@@ -269,11 +269,9 @@ export default {
// ]
}
},
created
()
{
this
.
editRule
.
stock
[
0
].
required
=
!
this
.
$isGroupUp
},
mounted
()
{
this
.
setMinHeight
()
this
.
routeInfo
=
this
.
$route
.
params
...
...
@@ -301,7 +299,6 @@ export default {
this
.
isDisabled
=
false
}
},
watch
:
{
editForm
:
{
handler
(
val
)
{
...
...
@@ -348,8 +345,12 @@ export default {
}
},
methods
:
{
updateStock
(
e
)
{
this
.
editRule
.
stock
[
0
].
required
=
!
e
this
.
editForm
.
stock
=
''
},
setAllDisabled
(
editName
)
{
this
[
editName
].
forEach
(
item
=>
{
this
[
editName
]
&&
this
[
editName
]
.
forEach
(
item
=>
{
item
.
isDisabled
=
true
})
},
...
...
@@ -383,7 +384,6 @@ export default {
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getInfo
()
{
this
.
loading
=
true
this
.
$apis
.
couponManage
...
...
@@ -399,6 +399,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if
(
res
.
limitStockFlag
==
2
)
{
this
.
isLimitStock
=
true
this
.
editRule
.
stock
[
0
].
required
=
false
}
//使用限制,满多少元可用
if
(
this
.
editForm
.
useBarriers
==
2
)
{
this
.
editForm
.
full
=
this
.
editForm
.
full
...
...
@@ -416,7 +420,6 @@ export default {
this
.
loading
=
false
})
},
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
)
{
...
...
@@ -441,7 +444,6 @@ export default {
this
.
editForm
.
discountIntensity
=
''
}
},
getCouponInfoParams
()
{
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
...
...
@@ -475,8 +477,8 @@ export default {
obj
.
full
=
form
.
full
}
//库存
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
obj
.
limitStockFlag
=
this
.
$isGroupUp
||
this
.
isLimitStock
?
2
:
1
if
(
!
this
.
$isGroupUp
||
!
this
.
isLimitStock
)
{
obj
.
stock
=
form
.
stock
}
// else {
...
...
@@ -497,12 +499,10 @@ export default {
obj
.
anticipatedCost
=
(
form
.
anticipatedCost
*
100
).
toFixed
(
0
)
return
obj
},
// 跳转
whereToGo
(
id
)
{
document
.
getElementById
(
id
).
scrollIntoView
()
},
handleConfirm
()
{
this
.
validateRules
()
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
valid
,
errorObj
)
=>
{
...
...
@@ -529,15 +529,16 @@ export default {
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
loading
=
true
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
this
.
$apis
.
couponManage
[
method
](
params
)
.
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
})
if
(
res
.
code
==
'0'
)
{
this
.
cancelJump
()
}
})
if
(
res
.
code
==
'0'
)
{
this
.
cancelJump
()
}
})
.
finally
(()
=>
{
this
.
loading
=
false
})
...
...
@@ -559,7 +560,7 @@ export default {
.
then
(()
=>
{
this
.
cancelJump
()
})
.
catch
(()
=>
{
})
.
catch
(()
=>
{})
}
else
{
this
.
cancelJump
()
}
...
...
@@ -577,21 +578,18 @@ export default {
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
}
.right_show
.card-top
{
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
/* .right_show .card-middle {
height: 388px;
width: 251px;
margin-left: 18px;
overflow: auto;
}
.right_show .card-middle .cname {
width: 170px;
height: 17px;
...
...
@@ -603,7 +601,6 @@ export default {
margin-top: 15px;
display: inline-block;
}
.right_show .card-middle .ctype {
width: 48px;
height: 20px;
...
...
@@ -614,7 +611,6 @@ export default {
display: inline-block;
float: right;
}
.right_show .card-middle .ctype .ctypeName {
width: 36px;
height: 17px;
...
...
@@ -624,7 +620,6 @@ export default {
font-weight: 400;
margin-left: 6px;
}
.right_show .card-middle .ctime {
margin-left: 10px;
margin-top: 17px;
...
...
@@ -637,7 +632,6 @@ export default {
color: #333333;
font-weight: 400;
}
.right_show .card-middle .ctime .ctime_content {
height: 17px;
font-family: PingFangSC-Regular;
...
...
@@ -646,14 +640,12 @@ export default {
font-weight: 400;
margin-left: 5px;
}
.right_show .card-middle .ccode {
width: 120px;
height: 120px;
margin-left: 67px;
margin-top: 8px;
}
.right_show .card-middle .ccodeName {
width: 68px;
height: 17px;
...
...
@@ -664,7 +656,6 @@ export default {
margin-left: 93px;
margin-top: 8px;
}
.right_show .card-middle .cremarks {
margin-left: 10px;
margin-top: 17px;
...
...
@@ -675,7 +666,6 @@ export default {
color: #333333;
font-weight: 400;
}
.right_show .card-middle .cremarks_content {
margin-left: 10px;
margin-right: 11px;
...
...
@@ -688,7 +678,6 @@ export default {
font-weight: 400;
word-break: break-word;
} */
.card_one
{
width
:
243px
;
height
:
288px
;
...
...
@@ -697,7 +686,6 @@ export default {
margin-left
:
22px
;
margin-top
:
5.81px
;
}
.cname
{
margin
:
16px
0
10px
16px
;
display
:
inline-block
;
...
...
@@ -710,7 +698,6 @@ export default {
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.ctype
{
width
:
48px
;
height
:
20px
;
...
...
@@ -721,7 +708,6 @@ export default {
display
:
inline-block
;
float
:
right
;
}
.ctypeName
{
width
:
36px
;
height
:
17px
;
...
...
@@ -731,13 +717,11 @@ export default {
font-weight
:
400
;
margin-left
:
6px
;
}
.ctime
{
margin
:
8px
16px
9px
;
text-align
:
center
;
color
:
#fc5b32
;
}
/* .ctime_name {
width: 48px;
height: 17px;
...
...
@@ -746,7 +730,6 @@ export default {
color: #333333;
font-weight: 400;
} */
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
...
...
@@ -754,14 +737,12 @@ export default {
font-weight
:
400
;
margin-left
:
5px
;
}
.ccode
{
width
:
120px
;
height
:
120px
;
margin
:
0
16px
;
margin
:
auto
;
}
.ccodeName
{
width
:
68px
;
height
:
17px
;
...
...
@@ -772,7 +753,6 @@ export default {
margin-left
:
88px
;
margin-top
:
8px
;
}
.link-top
{
width
:
227px
;
height
:
1px
;
...
...
@@ -780,12 +760,10 @@ export default {
margin-left
:
8px
;
margin-top
:
8px
;
}
.code_d
{
margin-left
:
98px
;
margin-top
:
10px
;
}
.card_two
{
width
:
243px
;
height
:
162px
;
...
...
@@ -794,7 +772,6 @@ export default {
margin-left
:
22px
;
margin-top
:
8px
;
}
.cremarks
{
padding-left
:
8px
;
padding-top
:
8px
;
...
...
@@ -805,7 +782,6 @@ export default {
color
:
#333333
;
font-weight
:
400
;
}
.cremarks_content
{
margin-left
:
8px
;
margin-right
:
8px
;
...
...
@@ -819,18 +795,15 @@ export default {
word-break
:
break-word
;
overflow
:
auto
;
}
.promptCopy
{
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
color
:
#999
;
margin-left
:
-10px
;
}
.glsx-combi-form
.el-form-item--small.el-form-item
{
margin-top
:
0px
!important
;
}
.couponImg
{
width
:
69px
;
height
:
69px
;
...
...
@@ -840,7 +813,6 @@ export default {
margin-top
:
-6px
;
margin-right
:
-6px
;
}
.validityPeriod
{
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
...
...
@@ -848,39 +820,32 @@ export default {
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
>
\ No newline at end of file
src/views/couponManage/editExchangeCoupon.vue
View file @
b04ead1
...
...
@@ -21,7 +21,6 @@
<span
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
style=
"height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px 7px;"
></div>
<div
class=
"ccode"
>
<img
src=
"../../assets/coupon/code2.png"
/>
</div>
...
...
@@ -57,9 +56,10 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template
slot=
"stock"
slot-scope=
"scope"
>
<span
v-if=
"$isGroupUp"
>
无库存限制
</span>
<el-input
:disabled=
"apear != 'couponAdd'"
v-else
class=
"w-150"
v-model=
"editForm[scope.scope.name]"
placeholder=
"请输入库存"
>
<el-input
:disabled=
"apear != 'couponAdd'
||isLimitStock
"
v-else
class=
"w-150"
v-model=
"editForm[scope.scope.name]"
placeholder=
"请输入库存"
>
<!--
<span
slot=
"suffix"
>
张
</span>
-->
</el-input>
<el-checkbox
style=
"margin-left:10px;"
v-model=
"isLimitStock"
:disabled=
"apear != 'couponAdd'"
@
change=
"updateStock"
>
不限制库存
</el-checkbox>
</
template
>
<
template
slot=
"directionalFlagHtml"
>
<div>
...
...
@@ -107,13 +107,13 @@
</GLFooter>
</div>
</template>
<
script
>
import
{
limitPrice
}
from
'@/common/constant'
export
default
{
name
:
'editDiscountCoupon'
,
data
()
{
return
{
isLimitStock
:
false
,
defaultTime
:
[
'00:00:00'
,
'23:59:59'
],
// 选择日期后的默认时间
format
:
'yyyy-MM-dd HH:mm:ss'
,
// 日期显示格式
showSubmit
:
true
,
...
...
@@ -213,7 +213,7 @@ export default {
addHtml
:
'editHtml'
,
isHide
:
true
}
]
,
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...
...
@@ -240,11 +240,9 @@ export default {
// ]
}
},
created
()
{
this
.
editRule
.
stock
[
0
].
required
=
!
this
.
$isGroupUp
},
mounted
()
{
this
.
setMinHeight
()
this
.
routeInfo
=
this
.
$route
.
params
...
...
@@ -272,7 +270,6 @@ export default {
this
.
isDisabled
=
false
}
},
watch
:
{
editForm
:
{
handler
(
val
)
{
...
...
@@ -305,10 +302,13 @@ export default {
}
}
},
methods
:
{
updateStock
(
e
)
{
this
.
editRule
.
stock
[
0
].
required
=
!
e
this
.
editForm
.
stock
=
''
},
setAllDisabled
(
editName
)
{
this
[
editName
].
forEach
(
item
=>
{
this
[
editName
]
&&
this
[
editName
]
.
forEach
(
item
=>
{
item
.
isDisabled
=
true
})
},
...
...
@@ -334,7 +334,6 @@ export default {
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getInfo
()
{
this
.
loading
=
true
this
.
$apis
.
couponManage
...
...
@@ -347,6 +346,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if
(
res
.
limitStockFlag
==
2
)
{
this
.
isLimitStock
=
true
this
.
editRule
.
stock
[
0
].
required
=
false
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if
(
this
.
editForm
.
effectiveType
==
2
)
{
...
...
@@ -360,7 +363,6 @@ export default {
this
.
loading
=
false
})
},
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
)
{
...
...
@@ -376,7 +378,6 @@ export default {
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
}
},
getCouponInfoParams
()
{
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
...
...
@@ -404,10 +405,9 @@ export default {
obj
.
effectiveEndTime
=
d
[
1
]
}
}
//库存
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
obj
.
limitStockFlag
=
this
.
$isGroupUp
||
this
.
isLimitStock
?
2
:
1
if
(
!
this
.
$isGroupUp
||
!
this
.
isLimitStock
)
{
obj
.
stock
=
form
.
stock
}
// else {
...
...
@@ -426,12 +426,10 @@ export default {
obj
.
anticipatedCost
=
(
form
.
anticipatedCost
*
100
).
toFixed
(
0
)
return
obj
},
// 跳转
whereToGo
(
id
)
{
document
.
getElementById
(
id
).
scrollIntoView
()
},
handleConfirm
()
{
this
.
validateRules
()
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
valid
,
errorObj
)
=>
{
...
...
@@ -458,15 +456,16 @@ export default {
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
loading
=
true
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
this
.
$apis
.
couponManage
[
method
](
params
)
.
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
})
if
(
res
.
code
==
'0'
)
{
this
.
cancelJump
()
}
})
if
(
res
.
code
==
'0'
)
{
this
.
cancelJump
()
}
})
.
finally
(()
=>
{
this
.
loading
=
false
})
...
...
@@ -488,7 +487,7 @@ export default {
.
then
(()
=>
{
this
.
cancelJump
()
})
.
catch
(()
=>
{
})
.
catch
(()
=>
{})
}
else
{
this
.
cancelJump
()
}
...
...
@@ -506,14 +505,12 @@ export default {
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
}
.right_show
.card-top
{
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
.card_one
{
width
:
243px
;
height
:
260px
;
...
...
@@ -522,7 +519,6 @@ export default {
margin-left
:
22px
;
margin-top
:
5.81px
;
}
.cname
{
margin
:
16px
0
10px
16px
;
display
:
inline-block
;
...
...
@@ -535,7 +531,6 @@ export default {
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.ctype
{
width
:
48px
;
height
:
20px
;
...
...
@@ -546,7 +541,6 @@ export default {
display
:
inline-block
;
float
:
right
;
}
.ctypeName
{
width
:
36px
;
height
:
17px
;
...
...
@@ -556,7 +550,6 @@ export default {
font-weight
:
400
;
margin-left
:
6px
;
}
/* .ctime_name {
width: 48px;
height: 17px;
...
...
@@ -565,14 +558,12 @@ export default {
color: #333333;
font-weight: 400;
} */
.ccode
{
width
:
120px
;
height
:
120px
;
margin
:
0
16px
;
margin
:
auto
;
}
.ccodeName
{
width
:
68px
;
height
:
17px
;
...
...
@@ -583,7 +574,6 @@ export default {
margin-left
:
88px
;
margin-top
:
8px
;
}
.link-top
{
width
:
227px
;
height
:
1px
;
...
...
@@ -591,12 +581,10 @@ export default {
margin-left
:
8px
;
margin-top
:
8px
;
}
.code_d
{
margin-left
:
98px
;
margin-top
:
10px
;
}
.card_two
{
width
:
243px
;
height
:
162px
;
...
...
@@ -605,7 +593,6 @@ export default {
margin-left
:
22px
;
margin-top
:
8px
;
}
.cremarks
{
padding-left
:
8px
;
padding-top
:
8px
;
...
...
@@ -616,7 +603,6 @@ export default {
color
:
#333333
;
font-weight
:
400
;
}
.cremarks_content
{
margin-left
:
8px
;
margin-right
:
8px
;
...
...
@@ -630,18 +616,15 @@ export default {
word-break
:
break-word
;
overflow
:
auto
;
}
.promptCopy
{
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
color
:
#999
;
margin-left
:
-10px
;
}
.glsx-combi-form
.el-form-item--small.el-form-item
{
margin-top
:
0px
!important
;
}
.couponImg
{
width
:
69px
;
height
:
69px
;
...
...
@@ -651,7 +634,6 @@ export default {
margin-top
:
-6px
;
margin-right
:
-6px
;
}
.validityPeriod
{
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
...
...
@@ -659,39 +641,32 @@ export default {
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
>
\ No newline at end of file
src/views/couponManage/editMemberService.vue
View file @
b04ead1
...
...
@@ -18,11 +18,19 @@
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio
:label=
"1"
id=
"effectiveDays"
>
领取后
<el-input
v-model=
"ruleForm.effectiveDays"
maxlength=
"4"
@
input=
"
<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>
"
:disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1"
placeholder="请输入"
size="small"
style="width: 100px"
>
</el-input>
天内有效
</el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
...
...
@@ -46,11 +54,19 @@
</el-radio>
<el-radio
:label=
"2"
id=
"limitDays"
>
有效期内每
<el-input
v-model=
"ruleForm.limitDays"
maxlength=
"4"
@
input=
"
<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>
"
: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>
...
...
@@ -69,12 +85,13 @@
元
</el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item
size=
"small"
label=
"库存:"
prop=
"stock
"
>
<el-form-item
size=
"small"
label=
"库存:"
:prop=
"!isLimitStock ? 'stock' : ''
"
>
<!--
<el-input
size=
"small"
:disabled=
"title == '查看'"
maxlength=
"6"
v-model
.
number=
"ruleForm.stock"
placeholder=
"请输入"
></el-input>
-->
<span
v-if=
"$isGroupUp"
>
无库存限制
</span>
<div
v-else
>
<el-input
:disabled=
"title == '查看'"
class=
"w-150"
v-model=
"ruleForm.stock"
placeholder=
"请输入库存"
></el-input>
<el-input
:disabled=
"title == '查看'
|| isLimitStock
"
class=
"w-150"
v-model=
"ruleForm.stock"
placeholder=
"请输入库存"
></el-input>
张
<el-checkbox
style=
"margin-left:10px;"
v-model=
"isLimitStock"
:disabled=
"title == '查看'"
@
change=
"updateStock"
>
不限制库存
</el-checkbox>
</div>
</el-form-item>
<el-form-item
size=
"small"
label=
"使用说明:"
prop=
"useDescription"
>
...
...
@@ -84,7 +101,6 @@
<el-button
style=
"margin-left: 80px"
@
click=
"editMessage"
>
编辑
</el-button>
</el-form-item>
</el-form>
<!--
<div
class=
"edit-container"
v-if=
"$isGroupUp"
>
<p
class=
"edit-title"
>
适用门店配置
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"merchantRef"
:isEdit=
"true"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"ruleForm"
:formData=
"merchantEditFormData"
:formRules=
"merchantRule"
></glsx-combi-form>
...
...
@@ -107,7 +123,6 @@
<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>
-->
...
...
@@ -116,7 +131,6 @@
<span>
{{
effectiveRangeText
}}
</span>
</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>
...
...
@@ -163,7 +177,6 @@
</glsx-dialog>
</div>
</
template
>
<
script
>
import
glsxDialog
from
'@/components/glsx-dialog'
import
{
limitPrice
}
from
'@/common/constant'
...
...
@@ -190,7 +203,7 @@ export default {
return
callback
(
new
Error
(
'库存不能为空或负数'
))
}
setTimeout
(()
=>
{
if
(
!
(
/^
[
0-9
]
*$/
.
test
(
value
)
))
{
if
(
!
/^
[
0-9
]
*$/
.
test
(
value
))
{
callback
(
new
Error
(
'请输入数字值'
))
}
else
{
if
(
value
<
0
)
{
...
...
@@ -203,6 +216,7 @@ export default {
}
return
{
timer
:
Function
,
isLimitStock
:
false
,
isEdit
:
false
,
showSubmit
:
true
,
disabledDescription
:
false
,
...
...
@@ -228,7 +242,8 @@ export default {
shopPrice
:
''
,
stock
:
''
,
useDescription
:
''
,
daterange
:
[]
daterange
:
[],
limitStockFlag
:
1
// scopeApplication: ''
},
copyRuleForm
:
{},
...
...
@@ -249,12 +264,11 @@ export default {
{
required
:
true
,
message
:
'请输入库存'
,
trigger
:
'blur'
},
{
validator
:
checkStock
,
trigger
:
'blur'
}
]
// useDescription: [{ required: true, message: '请填写活动形式', trigger: 'blur' }]
},
merchantId
:
''
,
merchantName
:
''
,
title
:
this
.
$route
.
query
.
title
||
''
,
title
:
this
.
$route
.
query
.
title
||
''
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...
...
@@ -340,6 +354,9 @@ export default {
}
},
methods
:
{
updateStock
(
e
)
{
this
.
ruleForm
.
stock
=
''
},
setAllDisabled
(
editName
)
{
this
[
editName
].
forEach
(
item
=>
{
item
.
isDisabled
=
true
...
...
@@ -357,9 +374,9 @@ export default {
this
.
ruleForm
=
res
this
.
ruleForm
.
anticipatedCost
=
(
res
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
ruleForm
.
customUseLimit
=
res
.
useType
// if (this.$isGroupUp
) {
// this.ruleForm.scopeApplication = res.scopeApplication + ''
//
}
if
(
res
.
limitStockFlag
==
2
)
{
this
.
isLimitStock
=
true
}
if
(
res
.
effectiveType
==
1
)
{
this
.
ruleForm
.
effectiveDays
=
res
.
effectiveDays
}
...
...
@@ -379,12 +396,10 @@ export default {
this
.
copyRuleForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ruleForm
))
//深拷贝一份数据
})
},
// 跳转
whereToGo
(
id
)
{
document
.
getElementById
(
id
).
scrollIntoView
()
},
submitForm
(
formName
)
{
clearTimeout
(
this
.
timer
)
this
.
timer
=
setTimeout
(()
=>
{
...
...
@@ -462,20 +477,18 @@ export default {
params
.
useAmount
=
this
.
ruleForm
.
limitTime2
}
}
params
.
vipPrice
=
this
.
ruleForm
.
vipPrice
params
.
shopPrice
=
this
.
ruleForm
.
shopPrice
// params.stock = this.ruleForm.stock
//库存
params
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
params
.
limitStockFlag
=
this
.
$isGroupUp
||
this
.
isLimitStock
?
2
:
1
if
(
!
this
.
$isGroupUp
||
!
this
.
isLimitStock
)
{
params
.
stock
=
this
.
ruleForm
.
stock
}
// else {
// params.scopeApplication = this.ruleForm.scopeApplication
// }
params
.
useDescription
=
this
.
ruleForm
.
useDescription
params
.
discountType
=
7
params
.
merchantId
=
this
.
merchantId
params
.
merchantName
=
this
.
merchantName
...
...
@@ -523,7 +536,6 @@ export default {
this
.
sloading
=
false
})
},
goBack
()
{
if
(
JSON
.
stringify
(
this
.
ruleForm
)
==
JSON
.
stringify
(
this
.
copyRuleForm
)
||
this
.
title
==
'查看'
)
{
this
.
$router
.
push
(
'/couponManage/index'
)
...
...
@@ -590,7 +602,6 @@ export default {
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.live-room
{
.topMsg
{
...
...
@@ -615,7 +626,6 @@ export default {
}
.container
{
margin
:
0
0px
16px
;
position
:
relative
;
/deep/
.el-form-item__content
{
.radioGroupWrap
{
...
...
@@ -701,14 +711,12 @@ export default {
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
}
.right_show
.card-top
{
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
.card_one
{
width
:
243px
;
height
:
285px
;
...
...
@@ -717,7 +725,6 @@ export default {
margin-left
:
22px
;
margin-top
:
5.81px
;
}
.cname
{
margin
:
16px
0
10px
16px
;
display
:
inline-block
;
...
...
@@ -731,7 +738,6 @@ export default {
white-space
:
nowrap
;
height
:
35px
;
}
.ctype
{
width
:
48px
;
height
:
20px
;
...
...
@@ -742,7 +748,6 @@ export default {
display
:
inline-block
;
float
:
right
;
}
.ctypeName
{
width
:
36px
;
height
:
17px
;
...
...
@@ -752,7 +757,6 @@ export default {
font-weight
:
400
;
margin-left
:
6px
;
}
.ctime
{
margin
:
8px
16px
9px
;
text-align
:
center
;
...
...
@@ -766,7 +770,6 @@ export default {
color: #333333;
font-weight: 400;
} */
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
...
...
@@ -774,14 +777,12 @@ export default {
font-weight
:
400
;
margin-left
:
5px
;
}
.ccode
{
width
:
120px
;
height
:
120px
;
margin
:
0
16px
;
margin
:
auto
;
}
.ccodeName
{
width
:
68px
;
height
:
17px
;
...
...
@@ -792,7 +793,6 @@ export default {
margin-left
:
88px
;
margin-top
:
8px
;
}
.link-top
{
width
:
227px
;
height
:
1px
;
...
...
@@ -800,12 +800,10 @@ export default {
margin-left
:
8px
;
margin-top
:
8px
;
}
.code_d
{
margin-left
:
98px
;
margin-top
:
10px
;
}
.card_two
{
width
:
243px
;
height
:
162px
;
...
...
@@ -814,7 +812,6 @@ export default {
margin-left
:
22px
;
margin-top
:
8px
;
}
.cremarks
{
padding-left
:
8px
;
padding-top
:
8px
;
...
...
@@ -825,7 +822,6 @@ export default {
color
:
#333333
;
font-weight
:
400
;
}
.cremarks_content
{
margin-left
:
8px
;
margin-right
:
8px
;
...
...
@@ -888,4 +884,4 @@ export default {
.darkColor
{
color
:
#999
;
}
</
style
>
</
style
>
\ No newline at end of file
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