Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-pay
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 3dbf2410
authored
Dec 09, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/saas/scrm-micro-marketing
2 parents
6b3fc4d8
58e87c3a
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1485 additions
and
1136 deletions
src/api/modules/homeSet.js
src/assets/css/public.scss
src/common/constant.js
src/components/glsx-combi-form/index.vue
src/components/glsx-dialog/index.vue
src/components/relate-store-dialog/index.vue
src/components/selectMutiProDialog/indexForCoupon.vue
src/views/classifyList/editClassify.vue
src/views/couponManage/editCashCoupon.vue
src/views/couponManage/editDiscountCoupon.vue
src/views/couponManage/editExchangeCoupon.vue
src/views/couponManage/editMemberService.vue
src/views/homeSet/index.vue
src/views/memberCenter/center.vue
src/views/memberCenter/serviceAddUpdateLook.vue
src/views/memberCenter/setmeal.vue
src/views/memberCenter/setmealAddUpdate.vue
src/views/orderComment/commentDetail.vue
src/views/orderComment/index.vue
src/views/orderManage/index.vue
src/views/orderManage/orderDetail.vue
src/views/orderShare/editShare.vue
src/views/productGroup/editProduct.vue
src/views/productGroup/index.vue
src/views/productStore/editProductDh.vue
src/views/productStore/index.vue
src/views/seckillActivity/editActivity.vue
src/views/zoneList/editZone.vue
src/views/zoneList/index.vue
src/api/modules/homeSet.js
View file @
3dbf241
...
...
@@ -21,4 +21,15 @@ const updateHomeApi = params => {
})
}
export
default
{
getHomeInfoListApi
,
updateHomeApi
}
// 在线客服
const
getConsultantListApi
=
params
=>
{
params
.
method
=
'scrm.api.carlife.config.consultant.list'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getHomeInfoListApi
,
updateHomeApi
,
getConsultantListApi
}
\ No newline at end of file
src/assets/css/public.scss
View file @
3dbf241
...
...
@@ -8,12 +8,22 @@ html {
background-color
:
#F4F5FA
;
}
.el-range-editor.is-active
,
.el-range-editor.is-active
:hover
{
border-color
:
#5850ff
;
width
:
215px
;
}
.marketing
.container
{
background
:
#ffffff
;
box-shadow
:
0
10px
20px
0
rgba
(
88
,
80
,
255
,
0
.1
);
padding
:
20px
;
}
.marketing.edit-box
.container
{
padding
:
20px
0
20px
;
}
.live-room
.container
{
background
:
#FFFFFF
;
margin
:
20px
0px
;
...
...
@@ -21,6 +31,14 @@ html {
box-shadow
:
0
1px
5px
0
rgba
(
38
,
38
,
38
,
0
.10
);
}
//输入框后置文字(如 “元”)
.suffix-label
{
font-size
:
14px
;
font-weight
:
400
;
color
:
#333333
;
margin-right
:
5px
;
}
// 单行省略
.ellipsis-1
{
overflow
:
hidden
;
...
...
@@ -77,7 +95,7 @@ html {
}
.marketing
.wechat-container
{
width
:
375
px
;
width
:
290
px
;
margin-left
:
32px
;
background
:
#ffffff
;
position
:
relative
;
...
...
@@ -88,7 +106,7 @@ html {
}
.marketing
.wechat-container
.wechat-box
{
width
:
375
px
;
width
:
290
px
;
border
:
1px
solid
#cecece
;
// width: 100%;
border-radius
:
2px
;
...
...
@@ -102,10 +120,6 @@ html {
margin-top
:
20px
;
}
.marketing
.m-b-20
{
margin-bottom
:
20px
;
}
.marketing
.footer-btns
{
float
:
right
;
margin-bottom
:
18px
;
...
...
@@ -146,19 +160,40 @@ html {
height
:
100px
;
}
.marketing
.img-120
{
width
:
120px
;
height
:
120px
;
}
.marketing
.m-t-10
{
margin-top
:
10px
;
}
.marketing
.m-b-20
{
margin-bottom
:
20px
;
}
.marketing
.m-t-20
{
margin-top
:
20px
;
}
.marketing
.m-b-60
{
margin-bottom
:
60px
;
}
.marketing
.m-r-20
{
margin-right
:
20px
;
}
.marketing.p-t-20
,
.marketing
.p-t-20
{
padding-top
:
20px
;
}
.marketing
.p-l-40
{
padding-left
:
40px
;
}
.marketing
.txt-center
{
text-align
:
center
;
}
...
...
@@ -175,6 +210,10 @@ html {
z-index
:
999
;
}
.marketing
.flex-default
{
display
:
flex
;
}
.marketing
.flex
{
display
:
flex
;
justify-content
:
space-between
;
...
...
@@ -186,13 +225,13 @@ html {
.marketing
.edit-title
{
font-size
:
16px
;
font-weight
:
bold
;
height
:
48px
;
line-height
:
4
8px
;
// color: #0947C6
;
font-weight
:
500
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
height
:
2
8px
;
line-height
:
28px
;
border-bottom
:
1px
solid
#E7EAEC
;
// padding-left: 20px;
margin
:
0
0
;
padding
:
0
0
11px
40px
;
}
// .marketing .edit-sub-title::before {
...
...
src/common/constant.js
View file @
3dbf241
...
...
@@ -3,7 +3,8 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
/* eslint-disable */
var
reg
=
{
priceReg
:
/^
\d[\d\.]
*$/
,
numReg
:
/^
[
1-9
]\d
*$/
numReg
:
/^
[
1-9
]\d
*$/
,
zNumReg
:
/^
\d
*$/
}
/* eslint-enable */
regRule
=
regRule
||
'priceReg'
...
...
@@ -20,6 +21,9 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
newValue
=
pointDigit
?
intergerNum
+
'.'
+
pointNum
:
newValue
.
split
(
'.'
)[
0
]
}
else
{
newValue
=
newValue
.
length
>
intergerDigit
?
oldValue
.
slice
(
0
,
intergerDigit
)
:
newValue
if
(
regRule
==
'zNumReg'
)
{
newValue
=
newValue
.
split
(
''
)[
0
]
==
'0'
?
'0'
:
newValue
}
}
return
newValue
}
else
{
...
...
src/components/glsx-combi-form/index.vue
View file @
3dbf241
...
...
@@ -58,8 +58,8 @@
<p
class=
"photo-top-tips"
>
{{
item
.
topTips
}}
</p>
<div
v-if=
"!item.isDisabled"
:style=
"
{ width: item.width || defaultWidth }">
<div
v-if=
"Array.isArray(formObj[item.name]) ? formObj[item.name].length
< item
.
maxPhotoNum
:
!
formObj
[
item
.
name
]"
class=
"activity-img img-w-h"
>
<div
class=
"add"
>
+
</div>
<span
class=
"number"
>
{{
formObj
[
item
.
name
].
length
}}
/
{{
item
.
maxPhotoNum
}}
</span>
<div
class=
"add"
:style=
"
{ top: item.maxPhotoNum == 1 ? '50%' : '40%' }"
>+
</div>
<span
v-show=
"item.maxPhotoNum > 1"
class=
"number"
>
{{
formObj
[
item
.
name
].
length
}}
/
{{
item
.
maxPhotoNum
}}
</span>
<input
v-if=
"item.uploadType == 'video'"
type=
"file"
style=
"opacity: 0;"
:id=
"item.name + 'file'"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"video/mp4"
@
change=
"e => handleUploadChange(e, item)"
/>
<input
v-else
type=
"file"
style=
"opacity: 0;"
:id=
"item.name + 'file'"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleUploadChange(e, item)"
/>
</div>
...
...
@@ -322,7 +322,8 @@ export default {
.glsx-combi-form
.activity-img
{
position
:
relative
;
color
:
#999999
;
border
:
1px
dashed
#d9d9d9
;
background-color
:
#F7F7F7
;
border
:
1px
solid
#d9d9d9
;
cursor
:
pointer
;
}
...
...
src/components/glsx-dialog/index.vue
View file @
3dbf241
...
...
@@ -2,8 +2,7 @@
<
template
>
<div>
<el-dialog
:title=
"title"
:visible
.
sync=
"isVisible"
:show-close=
"showClose"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
:modal-append-to-body=
"false"
:width=
"width"
>
<div
:style=
"
{height:height,overflow:'auto'}">
<el-scrollbar
v-if=
"hasScroll"
>
<el-scrollbar
v-if=
"hasScroll"
>
<span
slot=
"title"
>
<span
class=
"main-title"
>
{{
title
}}
</span>
<span
class=
"dialog-sub-title"
>
...
...
@@ -21,7 +20,6 @@
</span>
<slot></slot>
</
template
>
</div>
<div
slot=
"footer"
>
<slot
name=
"btn-start"
></slot>
...
...
@@ -96,11 +94,7 @@ export default {
btnSize
:
{
type
:
String
,
default
:
'mini'
},
height
:
{
type
:
String
,
default
:
''
},
}
},
methods
:
{
...
...
src/components/relate-store-dialog/index.vue
View file @
3dbf241
...
...
@@ -7,25 +7,13 @@
<el-table
ref=
"seletingTable"
:data=
"selectingData"
height=
"464px"
class=
"table"
border
@
select=
"handleChange"
@
select-all=
"handleAll"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
:selectable=
"selectable"
></el-table-column>
<el-table-column
prop=
"merchantName"
label=
"商户名称"
align=
"center"
>
<!--
<template
slot-scope=
"scope"
>
<span
:class=
"
{ red: !scope.row.isSetUpgradeSettleRule
&&
needTip.includes(sourcePage) }">
{{
scope
.
row
.
yqMerchantName
}}
</span>
</
template
>
-->
</el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column> -->
</el-table>
<el-pagination
small
background
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"pageNum"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</el-col>
<el-col
:span=
"12"
>
<el-table
:data=
"selectedData"
class=
"table"
border
height=
"464px"
>
<el-table-column
prop=
"merchantName"
label=
"商户名称"
align=
"center"
></el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> -->
<el-table-column
label=
"删除"
align=
"center"
width=
"50"
>
<template
slot-scope=
"scope"
>
<el-button
style=
"padding: 0;"
class=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
type=
"text"
></el-button>
...
...
@@ -88,22 +76,24 @@ export default {
mounted
()
{
this
.
selectedData
=
this
.
storeSelected
this
.
selectedData
.
forEach
(
item
=>
{
item
.
merchantNo
=
item
.
merchantId
?
(
item
.
merchantId
+
''
)
:
item
.
merchantNo
})
this
.
getSelectingList
()
},
methods
:
{
selectable
(
row
,
index
)
{
var
isSelect
=
row
.
hasOwnProperty
(
'beServed'
)
?
!
row
.
beServed
:
true
// if (this.sourcePage === 'editProduct') {
// isSelect = row.isSetUpgradeSettleRule
// }
return
isSelect
},
recoverySelection
()
{
var
exitIds
=
this
.
selectedData
.
map
(
item
=>
item
.
merchantNo
+
''
)
this
.
selectingData
.
forEach
(
item
=>
{
if
(
exitIds
.
includes
(
item
.
merchantNo
))
{
if
(
exitIds
.
includes
(
item
.
merchantNo
+
''
))
{
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
item
,
true
)
}
else
{
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
item
,
false
)
}
})
},
...
...
@@ -138,7 +128,7 @@ export default {
},
handleDelete
(
row
)
{
this
.
selectedData
=
this
.
selectedData
.
filter
(
item
=>
item
.
merchantNo
!==
row
.
merchantNo
)
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
row
)
this
.
recoverySelection
(
)
},
handleCurrentChange
(
val
)
{
this
.
pageNum
=
val
...
...
src/components/selectMutiProDialog/indexForCoupon.vue
View file @
3dbf241
<!-- 选择商品弹窗 -->
<
template
>
<glsx-dialog
class=
"muti-pro"
title=
"选择商品"
:isVisible
.
sync=
"isMutiSelectVisible"
:height=
"height"
width=
"70%"
@
confirmDialog=
"handleMutiSelectConfirm"
@
closeDialog=
"handleMutiSelectClose"
>
<el-form
:inline=
"true"
:model=
"searchProForm"
>
<el-form-item
label=
"商品名称:"
>
<el-input
:size=
"size"
v-model=
"searchProForm.name"
placeholder=
"请输入商品名称"
maxlength=
"20"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleConfigSearch"
>
查询
</el-button>
<el-button
:size=
"size"
@
click=
"handleConfigReset"
>
重置
</el-button>
</el-form-item>
</el-form>
<GLTable
ref=
"mutiProRef"
:tableData=
"productList"
:hasPage=
"false"
:tableParams=
"tableParams"
@
refreshTable=
"getList"
>
<span
slot=
"goodsImage"
slot-scope=
"scope"
>
<img
class=
"m-t-10 img-60"
:src=
"scope.scope.goodsImage"
/>
</span>
</GLTable>
<div
style=
"max-height:60vh"
>
<el-form
:inline=
"true"
:model=
"searchProForm"
>
<el-form-item
label=
"商品名称:"
>
<el-input
:size=
"size"
v-model=
"searchProForm.name"
placeholder=
"请输入商品名称"
maxlength=
"20"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleConfigSearch"
>
查询
</el-button>
<el-button
:size=
"size"
@
click=
"handleConfigReset"
>
重置
</el-button>
</el-form-item>
</el-form>
<GLTable
ref=
"mutiProRef"
:tableData=
"productList"
:hasPage=
"false"
:tableParams=
"tableParams"
@
refreshTable=
"getList"
>
<span
slot=
"goodsImage"
slot-scope=
"scope"
>
<img
class=
"m-t-10 img-60"
:src=
"scope.scope.goodsImage"
/>
</span>
</GLTable>
</div>
</glsx-dialog>
</
template
>
...
...
@@ -70,11 +72,7 @@ export default {
selectedProList
:
{
type
:
Array
,
default
:
()
=>
[]
},
height
:
{
type
:
String
,
default
:
''
},
}
},
components
:
{
...
...
src/views/classifyList/editClassify.vue
View file @
3dbf241
<!-- 编辑分类 -->
<
template
>
<div
class=
"edit-classify marketing p-t-20"
>
<div
class=
"edit-classify marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container
m-r-20
"
ref=
"editFormRef"
labelWidth=
"140px"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<div
slot=
"selectProBtn"
slot-scope=
"scope"
class=
"select-pro"
>
<el-button
type=
"primary"
@
click=
"handleMutiProClose(scope)"
>
{{
editForm
.
goodsRefList
.
length
?
'更换'
:
'请选择'
}}
</el-button>
</div>
...
...
src/views/couponManage/editCashCoupon.vue
View file @
3dbf241
<!-- 编辑代金券 -->
<
template
>
<div
class=
"edit-share marketing p-t-20"
>
<div
class=
"edit-share marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
style=
"position: relative;"
>
<div
class=
"right_show"
>
<div
class=
"card-top"
></div>
<div
class=
"card-middle"
>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
代金券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 3"
>
无限制
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
使用限制:
</span>
<span
class=
"ctime_content"
>
{{
editForm
.
useBarriers
==
1
?
'无限制'
:
'满'
+
editForm
.
full
+
'可用'
}}
</span>
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
代金券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 3"
>
无限制
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
使用限制:
</span>
<span
class=
"ctime_content"
>
{{
editForm
.
useBarriers
==
1
?
'无限制'
:
'满'
+
editForm
.
full
+
'可用'
}}
</span>
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
</div>
</div>
<p
class=
"edit-title"
>
{{
title
}}
代金券
</p>
<glsx-combi-form
class=
"edit-form-container"
style=
"min-height: 570px;"
ref=
"editFormRef"
labelWidth=
"144px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"useChannelHtml"
>
<el-radio
v-model=
"editForm.useChannel"
label=
"1"
:disabled=
"apear!=
'couponAdd'"
>
线上商品
</el-radio>
<el-radio
v-model=
"editForm.useChannel"
label=
"2"
:disabled=
"apear!=
'couponAdd'"
>
到店核销
</el-radio>
<el-radio
v-model=
"editForm.useChannel"
label=
"1"
:disabled=
"apear !=
'couponAdd'"
>
线上商品
</el-radio>
<el-radio
v-model=
"editForm.useChannel"
label=
"2"
:disabled=
"apear !=
'couponAdd'"
>
到店核销
</el-radio>
</
template
>
<
template
slot=
"effectiveHtml"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"3"
:disabled=
"apear!='couponAdd'"
>
无有效期
</el-radio><br>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width:100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
<el-radio
v-model=
"editForm.effectiveType"
label=
"3"
:disabled=
"apear != 'couponAdd'"
>
无有效期
</el-radio>
<br
/>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width:100px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
</
template
>
<
template
slot=
"useBarriersHtml"
>
<el-radio
v-model=
"editForm.useBarriers"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
无限制
</el-radio>
<el-form-item
prop=
"full"
>
<el-radio
v-model=
"editForm.useBarriers"
label=
"2"
:disabled=
"apear!='couponAdd' || editForm.useChannel == 2"
>
订单满
<el-input
v-model=
"editForm.full"
placeholder=
"输入金额(元)"
style=
"width: 110px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.useBarriers != 2"
/>
元可用
</el-radio>
</el-form-item>
<el-radio
v-model=
"editForm.useBarriers"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
无限制
</el-radio>
<el-form-item
prop=
"full"
>
<el-radio
v-model=
"editForm.useBarriers"
label=
"2"
:disabled=
"apear != 'couponAdd' || editForm.useChannel == 2"
>
订单满
<el-input
v-model=
"editForm.full"
placeholder=
"输入金额(元)"
style=
"width: 110px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.useBarriers != 2"
/>
元可用
</el-radio>
</el-form-item>
</
template
>
<
template
slot=
"denominationHtml"
>
<el-input
v-model=
"editForm.denomination"
style=
"width: 150px"
:disabled=
"apear!=
'couponAdd'"
@
blur
.
native
.
capture=
"editForm.useChannel == 1 && denominationBlur($event)"
>
<span
slot=
"append"
>
元
</span>
</el-input>
<span
style=
"color:red;margin-left:15px"
v-if=
"priceFlag"
>
存在零售价低于代金券的商品
</span>
<el-input
v-model=
"editForm.denomination"
style=
"width: 150px"
:disabled=
"apear !=
'couponAdd'"
@
blur
.
native
.
capture=
"editForm.useChannel == 1 && denominationBlur($event)"
>
<span
slot=
"append"
>
元
</span>
</el-input>
<span
style=
"color:red;margin-left:15px"
v-if=
"priceFlag"
>
存在零售价低于代金券的商品
</span>
</
template
>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
<
template
slot=
"goodsHtml"
>
<el-radio
v-model=
"editForm.goods"
label=
"1"
v-if=
"apear=='couponAdd'"
>
全部商品可用
</el-radio>
<el-radio
v-model=
"editForm.goods"
label=
"2"
v-if=
"apear=='couponAdd'"
>
指定商品可用
<el-button
type=
"primary"
v-if=
"editForm.goods == 2"
@
click=
"chooseGoods"
>
选择商品
</el-button>
</el-radio>
<el-radio
v-model=
"editForm.goods"
label=
"1"
v-if=
"apear == 'couponAdd'"
>
全部商品可用
</el-radio>
<el-radio
v-model=
"editForm.goods"
label=
"2"
v-if=
"apear == 'couponAdd'"
>
指定商品可用
<el-button
type=
"primary"
v-if=
"editForm.goods == 2"
@
click=
"chooseGoods"
>
选择商品
</el-button>
</el-radio>
</
template
>
<!-- 新增时并且为指定商品时显示,编辑或者查看时也显示 -->
<div
slot=
"proTable"
class=
"select-pro"
v-if=
"apear
!=
'couponAdd' || (editForm.useChannel == 1 && editForm.goods == 2)"
>
<div
slot=
"proTable"
class=
"select-pro"
v-if=
"apear
!=
'couponAdd' || (editForm.useChannel == 1 && editForm.goods == 2)"
>
<div
style=
"height:110px"
v-if=
"editForm.goodsRefList.length"
></div>
<GLTable
v-show=
"editForm.goodsRefList.length"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.goodsRefList"
>
<
template
slot=
"goodsImage"
slot-scope=
"scope"
>
<img
class=
"img-60"
:src=
"scope.scope.goodsImage"
/>
<img
class=
"img-60"
:src=
"scope.scope.goodsImage"
/>
</
template
>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleProDelete(scope)"
>
删除
</el-button>
...
...
@@ -85,17 +82,16 @@
</GLTable>
</div>
<
template
slot=
"useDescriptionHtml"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear==
'couponSee'" />
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear ==
'couponSee'" />
</
template
>
</glsx-combi-form>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
<select-muti-pro-forcoupon-dialog
v-if=
"isMutiSelectVisible"
:height=
"dialogHeight"
:isMutiSelectVisible=
"isMutiSelectVisible"
:searchForm=
"searchProForm"
:selectedProList=
"selectedProList"
@
handleMutiSelectConfirm=
"handleMutiSelectConfirm"
@
handleMutiSelectClose=
"handleMutiSelectClose"
>
</select-muti-pro-forcoupon-dialog>
<select-muti-pro-forcoupon-dialog
v-if=
"isMutiSelectVisible"
:isMutiSelectVisible=
"isMutiSelectVisible"
:searchForm=
"searchProForm"
:selectedProList=
"selectedProList"
@
handleMutiSelectConfirm=
"handleMutiSelectConfirm"
@
handleMutiSelectClose=
"handleMutiSelectClose"
></select-muti-pro-forcoupon-dialog>
</div>
</template>
...
...
@@ -139,7 +135,7 @@ export default {
useBarriers
:
'1'
,
full
:
''
,
goods
:
'1'
,
goodsRefList
:
[]
,
goodsRefList
:
[]
},
//商品列表
tableParams
:
{
...
...
@@ -242,8 +238,7 @@ export default {
name
:
'useDescription'
,
addHtml
:
'useDescriptionHtml'
}
],
dialogHeight
:
'60vh'
]
}
},
...
...
@@ -257,58 +252,59 @@ export default {
var
id
=
this
.
routeInfo
.
id
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
if
(
id
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
;
this
.
title
=
'查看'
;
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
;
this
.
title
=
'编辑'
;
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
this
.
title
=
'查看'
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
this
.
title
=
'编辑'
}
this
.
editFormData
[
0
].
isDisabled
=
true
this
.
editFormData
[
5
].
isDisabled
=
true
}
else
{
this
.
apear
=
'couponAdd'
;
this
.
title
=
'创建'
;
this
.
apear
=
'couponAdd'
this
.
title
=
'创建'
}
},
watch
:
{
'editForm.effectiveDays'
(
newValue
,
oldValue
){
'editForm.effectiveDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
effectiveDays
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.full'
(
newValue
,
oldValue
){
'editForm.full'
(
newValue
,
oldValue
)
{
this
.
editForm
.
full
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
)
},
'editForm.denomination'
(
newValue
,
oldValue
){
this
.
editForm
.
denomination
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
,
0
,
1
00
)
'editForm.denomination'
(
newValue
,
oldValue
)
{
this
.
editForm
.
denomination
=
limitPrice
(
newValue
,
oldValue
,
4
,
0
,
0
,
20
00
)
},
'editForm.stock'
(
newValue
,
oldValue
){
'editForm.stock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
stock
=
limitPrice
(
newValue
,
oldValue
,
6
,
0
,
1
)
},
'editForm.effectiveTime'
(
newValue
,
oldValue
){
if
(
newValue
&&
newValue
.
length
>
0
)
{
'editForm.effectiveTime'
(
newValue
,
oldValue
)
{
if
(
newValue
&&
newValue
.
length
>
0
)
{
this
.
couponTime
=
this
.
setDateString
(
newValue
[
0
],
true
)
+
' - '
+
this
.
setDateString
(
newValue
[
1
],
true
)
}
else
{
}
else
{
this
.
couponTime
=
''
}
},
'editForm.useDescription'
(
newValue
,
oldValue
){
if
(
newValue
)
{
'editForm.useDescription'
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
this
.
remarksView
=
newValue
.
split
(
'\n'
)
}
},
'editForm.useChannel'
(
newValue
,
oldValue
){
if
(
newValue
==
1
)
{
'editForm.useChannel'
(
newValue
,
oldValue
)
{
if
(
newValue
==
1
)
{
this
.
editFormData
[
6
].
isHide
=
false
}
else
{
}
else
{
this
.
editForm
.
useBarriers
=
'1'
this
.
editForm
.
full
=
''
this
.
editFormData
[
6
].
isHide
=
true
}
},
'editForm.goods'
(
newValue
,
oldValue
){
if
(
newValue
==
1
){
//全部商品
// var goods = this.selectedAllProList
'editForm.goods'
(
newValue
,
oldValue
)
{
if
(
newValue
==
1
)
{
//全部商品
// var goods = this.selectedAllProList
// if(goods && goods.length > 0){
// this.minPirce = goods[0].retailPrice
// goods.forEach((item, index) => {
...
...
@@ -320,7 +316,8 @@ export default {
// this.priceFlag = true
// }
this
.
minPirce
=
this
.
minPirceForAll
}
else
{
//指定商品
}
else
{
//指定商品
// var goods2 = this.editForm.goodsRefList
// if(goods2 && goods2.length > 0){
// this.minPirce = goods2[0].retailPrice*100
...
...
@@ -333,58 +330,56 @@ export default {
// }
this
.
minPirce
=
this
.
minPirceForPart
}
if
(
this
.
editForm
.
denomination
&&
this
.
minPirce
&&
this
.
editForm
.
denomination
*
100
>
this
.
minPirce
)
{
if
(
this
.
editForm
.
denomination
&&
this
.
minPirce
&&
this
.
editForm
.
denomination
*
100
>
this
.
minPirce
)
{
this
.
priceFlag
=
true
}
else
{
}
else
{
this
.
priceFlag
=
false
}
}
,
}
},
methods
:
{
setDateString
(
objField
,
special
)
{
var
value
=
(
typeof
objField
==
'string'
)
?
objField
.
split
(
" "
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getAllGoods
(
goodsName
){
getAllGoods
(
goodsName
)
{
var
params
=
{
currentPage
:
1
,
pageNum
:
1
,
pageSize
:
100000
,
pageStart
:
0
,
goodsStatus
:
1
,
goodsName
:
''
goodsName
:
''
}
if
(
goodsName
)
{
if
(
goodsName
)
{
params
.
goodsName
=
goodsName
}
this
.
$apis
.
couponManage
.
getAllGoodsApi
(
params
).
then
(
res
=>
{
const
goods
=
this
.
$common
.
utils
.
deepClone
(
res
.
list
)
this
.
selectedAllProList
=
goods
if
(
goods
&&
goods
.
length
>
0
){
// this.minPirce = goods[0].retailPrice
// goods.forEach((item, index) => {
// if(item.retailPrice < this.minPirce){
// this.minPirce = item.retailPrice
// }
// })
this
.
minPirceForAll
=
goods
[
0
].
retailPrice
goods
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
retailPrice
<
this
.
minPirceForAll
){
this
.
minPirceForAll
=
item
.
retailPrice
}
})
}
else
{
this
.
priceFlag
=
true
}
const
goods
=
this
.
$common
.
utils
.
deepClone
(
res
.
list
)
this
.
selectedAllProList
=
goods
if
(
goods
&&
goods
.
length
>
0
)
{
// this.minPirce = goods[0].retailPrice
// goods.forEach((item, index) => {
// if(item.retailPrice < this.minPirce){
// this.minPirce = item.retailPrice
// }
// })
this
.
minPirceForAll
=
goods
[
0
].
retailPrice
goods
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
retailPrice
<
this
.
minPirceForAll
)
{
this
.
minPirceForAll
=
item
.
retailPrice
}
})
}
else
{
this
.
priceFlag
=
true
}
})
},
//选择商品
chooseGoods
(){
chooseGoods
()
{
this
.
selectedProList
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
.
goodsRefList
)
this
.
handleMutiSelectClose
()
},
...
...
@@ -414,16 +409,16 @@ export default {
// }else{
// this.priceFlag = false
// }
this
.
minPirceForPart
=
goods
[
0
].
retailPrice
*
100
this
.
minPirceForPart
=
goods
[
0
].
retailPrice
*
100
goods
.
forEach
((
item
,
index
)
=>
{
var
retailPrice
=
item
.
retailPrice
*
100
if
(
retailPrice
<
this
.
minPirceForPart
)
{
var
retailPrice
=
item
.
retailPrice
*
100
if
(
retailPrice
<
this
.
minPirceForPart
)
{
this
.
minPirceForPart
=
retailPrice
}
})
if
(
this
.
editForm
.
denomination
&&
this
.
editForm
.
denomination
*
100
>
this
.
minPirceForPart
)
{
if
(
this
.
editForm
.
denomination
&&
this
.
editForm
.
denomination
*
100
>
this
.
minPirceForPart
)
{
this
.
priceFlag
=
true
}
else
{
}
else
{
this
.
priceFlag
=
false
}
/** 选择指定商品时,面值最小值的判断区域应该在已选商品内 end*/
...
...
@@ -449,22 +444,24 @@ export default {
})
},
denominationBlur
(
event
){
if
(
this
.
editForm
.
goods
==
1
){
//全部商品
this
.
minPirce
=
this
.
minPirceForAll
}
else
{
//指定商品
this
.
minPirce
=
this
.
minPirceForPart
}
if
(
event
.
target
.
value
*
100
>
this
.
minPirce
){
this
.
priceFlag
=
true
}
else
{
this
.
priceFlag
=
false
}
denominationBlur
(
event
)
{
if
(
this
.
editForm
.
goods
==
1
)
{
//全部商品
this
.
minPirce
=
this
.
minPirceForAll
}
else
{
//指定商品
this
.
minPirce
=
this
.
minPirceForPart
}
if
(
event
.
target
.
value
*
100
>
this
.
minPirce
)
{
this
.
priceFlag
=
true
}
else
{
this
.
priceFlag
=
false
}
},
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
;
console
.
log
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
useChannel
=
this
.
editForm
.
useChannel
+
''
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
...
...
@@ -473,112 +470,121 @@ export default {
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
this
.
editForm
.
goodsRefList
=
[]
if
(
this
.
editForm
.
goodsIds
&&
this
.
editForm
.
goodsIds
.
length
>
0
)
{
this
.
editForm
.
goodsIds
.
forEach
((
goodsId
,
index
)
=>
{
var
good
=
this
.
selectedAllProList
.
find
(
item
=>
item
.
id
==
goodsId
)
good
.
retailPrice
=
(
good
.
retailPrice
/
100
).
toFixed
(
2
)
this
.
editForm
.
goodsRefList
.
push
(
good
)
})
if
(
this
.
editForm
.
goodsIds
&&
this
.
editForm
.
goodsIds
.
length
>
0
)
{
this
.
editForm
.
goodsIds
.
forEach
((
goodsId
,
index
)
=>
{
var
good
=
this
.
selectedAllProList
.
find
(
item
=>
item
.
id
==
goodsId
)
good
.
retailPrice
=
(
good
.
retailPrice
/
100
).
toFixed
(
2
)
this
.
editForm
.
goodsRefList
.
push
(
good
)
})
}
this
.
tableParams
.
tableOption
=
false
//去掉操作栏
})
},
validateRules
(){
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
){
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'2'
)
{
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
}
if
(
form
.
effectiveType
==
'1'
){
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'1'
)
{
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
}
if
(
form
.
useBarriers
==
'2'
){
//判断 使用限制-订单满多少可用是否验证
this
.
editRule
.
full
[
0
].
required
=
true
}
else
{
this
.
editRule
.
full
[
0
].
required
=
false
if
(
form
.
useBarriers
==
'2'
)
{
//判断 使用限制-订单满多少可用是否验证
this
.
editRule
.
full
[
0
].
required
=
true
}
else
{
this
.
editRule
.
full
[
0
].
required
=
false
}
if
(
this
.
apear
==
'couponAdd'
)
{
if
(
this
.
apear
==
'couponAdd'
)
{
this
.
editRule
.
goods
[
0
].
required
=
true
}
else
{
}
else
{
this
.
editRule
.
goods
[
0
].
required
=
false
}
},
getCouponInfoParams
()
{
var
obj
=
{}
;
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
var
form
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
id
)
{
obj
.
couponId
=
id
;
}
else
{
//编辑时只允许编辑使用说明
obj
.
couponId
=
id
}
else
{
//编辑时只允许编辑使用说明
//优惠券名称
obj
.
couponName
=
form
.
couponName
;
obj
.
couponName
=
form
.
couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj
.
discountType
=
'3'
;
obj
.
discountType
=
'3'
obj
.
useChannel
=
form
.
useChannel
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj
.
effectiveType
=
form
.
effectiveType
if
(
form
.
effectiveType
==
1
)
{
//固定天数
obj
.
effectiveDays
=
form
.
effectiveDays
;
}
else
if
(
form
.
effectiveType
==
2
)
{
//时间段
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'
;
obj
.
effectiveStartTime
=
d
[
0
]
+
' 00:00:00'
obj
.
effectiveEndTime
=
d
[
1
]
+
' 23:59:59'
}
}
//使用限制 1:无限制 2:满减
obj
.
useBarriers
=
form
.
useBarriers
if
(
form
.
useBarriers
==
2
)
{
//满多少减
obj
.
full
=
form
.
full
;
obj
.
full
=
form
.
full
}
//面值
obj
.
denomination
=
form
.
denomination
;
obj
.
denomination
=
form
.
denomination
//库存
obj
.
stock
=
form
.
stock
;
obj
.
stock
=
form
.
stock
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj
.
useType
=
1
obj
.
useType
=
1
//有效期或者间隔天数使用次数
obj
.
useAmount
=
1
obj
.
useAmount
=
1
if
(
form
.
useChannel
==
1
){
//使用途径选择线上商品才需要对应的商品
if
(
form
.
useChannel
==
1
)
{
//使用途径选择线上商品才需要对应的商品
//适用商品
if
(
form
.
goods
==
1
){
//全部商品
if
(
form
.
goods
==
1
)
{
//全部商品
obj
.
goodsIdList
=
this
.
selectedAllProList
.
length
?
this
.
selectedAllProList
.
map
(
item
=>
item
.
id
)
:
[]
}
else
{
//指定商品
}
else
{
//指定商品
obj
.
goodsIdList
=
form
.
goodsRefList
.
length
?
form
.
goodsRefList
.
map
(
item
=>
item
.
id
)
:
[]
}
}
}
//使用描述
obj
.
useDescription
=
form
.
useDescription
;
return
obj
;
obj
.
useDescription
=
form
.
useDescription
return
obj
},
handleConfirm
()
{
this
.
validateRules
()
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
priceFlag
){
//存在零售价低于代金券的商品
if
(
this
.
priceFlag
)
{
//存在零售价低于代金券的商品
return
}
var
params
=
this
.
getCouponInfoParams
()
console
.
log
(
params
)
;
if
(
this
.
apear
==
'couponAdd'
&&
params
.
useChannel
==
1
&&
!
params
.
goodsIdList
.
length
)
{
console
.
log
(
params
)
if
(
this
.
apear
==
'couponAdd'
&&
params
.
useChannel
==
1
&&
!
params
.
goodsIdList
.
length
)
{
this
.
$message
({
message
:
'未选择商品'
,
type
:
'error'
...
...
@@ -586,10 +592,10 @@ export default {
return
}
let
method
=
''
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
...
...
@@ -613,124 +619,124 @@ export default {
</
script
>
<
style
scoped
>
.right_show
{
/* float: right; */
position
:
absolute
;
z-index
:
10
;
height
:
566px
;
width
:
290px
;
right
:
44px
;
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
/* float: right; */
position
:
absolute
;
z-index
:
10
;
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
;
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
.right_show
.card-middle
{
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
;
}
.right_show
.card-middle
.cname
{
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
}
.right_show
.card-middle
.ctype
{
width
:
48px
;
height
:
20px
;
background
:
#5850FF
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
width
:
48px
;
height
:
20px
;
background
:
#5850ff
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
}
.right_show
.card-middle
.ctype
.ctypeName
{
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#FFFFFF
;
font-weight
:
400
;
margin-left
:
6px
;
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#ffffff
;
font-weight
:
400
;
margin-left
:
6px
;
}
.right_show
.card-middle
.ctime
{
margin-left
:
10px
;
margin-top
:
17px
;
margin-left
:
10px
;
margin-top
:
17px
;
}
.right_show
.card-middle
.ctime
.ctime_name
{
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.ctime
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
}
.right_show
.card-middle
.ccode
{
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.ccodeName
{
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1D1D1D
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1d1d1d
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.cremarks
{
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.cremarks_content
{
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
}
</
style
>
src/views/couponManage/editDiscountCoupon.vue
View file @
3dbf241
<!-- 编辑代金券 -->
<
template
>
<div
class=
"edit-share marketing p-t-20"
>
<div
class=
"container edit-container"
style=
"height: 630px;
position: relative;
"
>
<div
class=
"edit-share marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
style=
"height: 630px;
position: relative
"
>
<div
class=
"right_show"
>
<div
class=
"card-top"
></div>
<div
class=
"card-middle"
>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
折扣券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
核销劵码:
</span>
</div>
<img
class=
"ccode"
src=
"../../assets/coupon/code.png"
/>
<div
class=
"ccodeName"
>
GH078-003
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
折扣券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
核销劵码:
</span>
</div>
<img
class=
"ccode"
src=
"../../assets/coupon/code.png"
/>
<div
class=
"ccodeName"
>
GH078-003
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
</div>
</div>
<p
class=
"edit-title"
>
{{
title
}}
折扣劵
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"effectiveHtml"
>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px; display: block"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px; margin-left: 5px; margin-right: 5px"
:disabled=
"apear != 'couponAdd' || editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
</
template
>
<
template
slot=
"useDescriptionHtml"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear==
'couponSee'" />
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear ==
'couponSee'" />
</
template
>
</glsx-combi-form>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
</div>
</template>
...
...
@@ -92,7 +85,7 @@ export default {
couponTime
:
''
,
editForm
:
{
couponName
:
''
,
effectiveType
:
'2'
,
effectiveType
:
'2'
},
editRule
:
{
couponName
:
[{
required
:
true
,
message
:
'请输入优惠券名称'
,
trigger
:
'change'
}],
...
...
@@ -100,7 +93,7 @@ export default {
effectiveTime
:
[{
required
:
true
,
message
:
'有效期不能为空'
,
trigger
:
'change'
}],
effectiveDays
:
[{
required
:
true
,
message
:
'有效天数不能为空'
,
trigger
:
'blur'
}],
useDescription
:
[{
required
:
true
,
message
:
'使用说明不能为空'
,
trigger
:
'change'
}],
stock
:
[{
required
:
true
,
message
:
'发放数量不能为空'
,
trigger
:
'change'
}]
,
stock
:
[{
required
:
true
,
message
:
'发放数量不能为空'
,
trigger
:
'change'
}]
},
editFormData
:
[
{
...
...
@@ -115,7 +108,7 @@ export default {
name
:
'stock'
,
width
:
'180px'
,
type
:
'input'
,
append
:
'张'
,
append
:
'张'
},
{
label
:
'有效期'
,
...
...
@@ -140,109 +133,113 @@ export default {
var
id
=
this
.
routeInfo
.
id
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
if
(
id
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
;
this
.
title
=
'查看'
;
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
;
this
.
title
=
'编辑'
;
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
this
.
title
=
'查看'
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
this
.
title
=
'编辑'
}
this
.
isDisabled
=
true
this
.
editFormData
[
0
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
1
].
isDisabled
=
this
.
isDisabled
}
else
{
this
.
apear
=
'couponAdd'
;
this
.
title
=
'创建'
;
this
.
apear
=
'couponAdd'
this
.
title
=
'创建'
this
.
isDisabled
=
false
}
},
watch
:
{
'editForm.effectiveDays'
(
newValue
,
oldValue
){
'editForm.effectiveDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
effectiveDays
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.stock'
(
newValue
,
oldValue
){
'editForm.stock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
stock
=
limitPrice
(
newValue
,
oldValue
,
6
,
0
,
1
)
},
'editForm.effectiveTime'
(
newValue
,
oldValue
){
if
(
newValue
&&
newValue
.
length
>
0
)
{
'editForm.effectiveTime'
(
newValue
,
oldValue
)
{
if
(
newValue
&&
newValue
.
length
>
0
)
{
this
.
couponTime
=
this
.
setDateString
(
newValue
[
0
],
true
)
+
' ~ '
+
this
.
setDateString
(
newValue
[
1
],
true
)
}
else
{
}
else
{
this
.
couponTime
=
''
}
}
,
}
},
methods
:
{
setDateString
(
objField
,
special
)
{
var
value
=
(
typeof
objField
==
'string'
)
?
objField
.
split
(
" "
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
;
console
.
log
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
})
},
validateRules
(){
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
){
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'2'
)
{
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
}
if
(
form
.
effectiveType
==
'1'
){
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'1'
)
{
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
}
},
getCouponInfoParams
()
{
var
obj
=
{}
;
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
var
form
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
id
)
{
obj
.
couponId
=
id
;
}
else
{
//编辑时只允许编辑使用说明
obj
.
couponId
=
id
}
else
{
//编辑时只允许编辑使用说明
//优惠券名称
obj
.
couponName
=
form
.
couponName
;
obj
.
couponName
=
form
.
couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj
.
discountType
=
'2'
;
obj
.
discountType
=
'2'
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj
.
effectiveType
=
form
.
effectiveType
if
(
form
.
effectiveType
==
1
)
{
//固定天数
obj
.
effectiveDays
=
form
.
effectiveDays
;
}
else
if
(
form
.
effectiveType
==
2
)
{
//时间段
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'
;
obj
.
effectiveStartTime
=
d
[
0
]
+
' 00:00:00'
obj
.
effectiveEndTime
=
d
[
1
]
+
' 23:59:59'
}
}
//库存
obj
.
stock
=
form
.
stock
;
obj
.
stock
=
form
.
stock
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj
.
useType
=
1
obj
.
useType
=
1
//有效期或者间隔天数使用次数
obj
.
useAmount
=
1
obj
.
useAmount
=
1
}
//使用描述
obj
.
useDescription
=
form
.
useDescription
;
return
obj
;
obj
.
useDescription
=
form
.
useDescription
return
obj
},
handleConfirm
()
{
...
...
@@ -250,12 +247,12 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
this
.
getCouponInfoParams
()
console
.
log
(
params
)
;
console
.
log
(
params
)
let
method
=
''
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
...
...
@@ -279,124 +276,124 @@ export default {
</
script
>
<
style
scoped
>
.right_show
{
/* float: right; */
position
:
absolute
;
z-index
:
10
;
height
:
566px
;
width
:
290px
;
right
:
44px
;
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
/* float: right; */
position
:
absolute
;
z-index
:
10
;
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
;
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
.right_show
.card-middle
{
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
;
}
.right_show
.card-middle
.cname
{
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
}
.right_show
.card-middle
.ctype
{
width
:
48px
;
height
:
20px
;
background
:
#5850FF
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
width
:
48px
;
height
:
20px
;
background
:
#5850ff
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
}
.right_show
.card-middle
.ctype
.ctypeName
{
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#FFFFFF
;
font-weight
:
400
;
margin-left
:
6px
;
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#ffffff
;
font-weight
:
400
;
margin-left
:
6px
;
}
.right_show
.card-middle
.ctime
{
margin-left
:
10px
;
margin-top
:
17px
;
margin-left
:
10px
;
margin-top
:
17px
;
}
.right_show
.card-middle
.ctime
.ctime_name
{
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.ctime
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
}
.right_show
.card-middle
.ccode
{
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.ccodeName
{
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1D1D1D
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1d1d1d
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.cremarks
{
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.cremarks_content
{
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
}
</
style
>
src/views/couponManage/editExchangeCoupon.vue
View file @
3dbf241
<!-- 编辑代金券 -->
<
template
>
<div
class=
"edit-share marketing p-t-20"
>
<div
class=
"edit-share marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
style=
"height: 630px;position: relative;"
>
<div
class=
"right_show"
>
<div
class=
"card-top"
></div>
<div
class=
"card-middle"
>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
兑换券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
核销劵码:
</span>
</div>
<img
class=
"ccode"
src=
"../../assets/coupon/code.png"
/>
<div
class=
"ccodeName"
>
GH078-003
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
<div>
<span
class=
"cname"
>
{{
editForm
.
couponName
}}
</span>
<span
class=
"ctype"
><span
class=
"ctypeName"
>
兑换券
</span></span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
有效期:
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 1"
>
{{
editForm
.
effectiveDays
}}
天
</span>
<span
class=
"ctime_content"
v-if=
"editForm.effectiveType == 2"
>
{{
couponTime
}}
</span>
</div>
<div
class=
"ctime"
>
<span
class=
"ctime_name"
>
核销劵码:
</span>
</div>
<img
class=
"ccode"
src=
"../../assets/coupon/code.png"
/>
<div
class=
"ccodeName"
>
GH078-003
</div>
<div
class=
"cremarks"
>
使用说明:
</div>
<div
class=
"cremarks_content"
>
{{
editForm
.
useDescription
}}
</div>
</div>
</div>
<p
class=
"edit-title"
>
{{
title
}}
兑换券
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"effectiveHtml"
>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
</
template
>
<
template
slot=
"useDescriptionHtml"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear==
'couponSee'" />
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear ==
'couponSee'" />
</
template
>
</glsx-combi-form>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
</div>
</template>
...
...
@@ -92,7 +85,7 @@ export default {
couponTime
:
''
,
editForm
:
{
couponName
:
''
,
effectiveType
:
'2'
,
effectiveType
:
'2'
},
editRule
:
{
couponName
:
[{
required
:
true
,
message
:
'请输入优惠券名称'
,
trigger
:
'change'
}],
...
...
@@ -100,7 +93,7 @@ export default {
effectiveTime
:
[{
required
:
true
,
message
:
'有效期不能为空'
,
trigger
:
'change'
}],
effectiveDays
:
[{
required
:
true
,
message
:
'有效天数不能为空'
,
trigger
:
'blur'
}],
useDescription
:
[{
required
:
true
,
message
:
'使用说明不能为空'
,
trigger
:
'change'
}],
stock
:
[{
required
:
true
,
message
:
'发放数量不能为空'
,
trigger
:
'change'
}]
,
stock
:
[{
required
:
true
,
message
:
'发放数量不能为空'
,
trigger
:
'change'
}]
},
editFormData
:
[
{
...
...
@@ -115,7 +108,7 @@ export default {
name
:
'stock'
,
width
:
'180px'
,
type
:
'input'
,
append
:
'张'
,
append
:
'张'
},
{
label
:
'有效期'
,
...
...
@@ -140,109 +133,113 @@ export default {
var
id
=
this
.
routeInfo
.
id
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
if
(
id
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
;
this
.
title
=
'查看'
;
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
;
this
.
title
=
'编辑'
;
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
this
.
title
=
'查看'
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
this
.
title
=
'编辑'
}
this
.
isDisabled
=
true
this
.
editFormData
[
0
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
1
].
isDisabled
=
this
.
isDisabled
}
else
{
this
.
apear
=
'couponAdd'
;
this
.
title
=
'创建'
;
this
.
apear
=
'couponAdd'
this
.
title
=
'创建'
this
.
isDisabled
=
false
}
},
watch
:
{
'editForm.effectiveDays'
(
newValue
,
oldValue
){
'editForm.effectiveDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
effectiveDays
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.stock'
(
newValue
,
oldValue
){
'editForm.stock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
stock
=
limitPrice
(
newValue
,
oldValue
,
6
,
0
,
1
)
},
'editForm.effectiveTime'
(
newValue
,
oldValue
){
if
(
newValue
&&
newValue
.
length
>
0
)
{
'editForm.effectiveTime'
(
newValue
,
oldValue
)
{
if
(
newValue
&&
newValue
.
length
>
0
)
{
this
.
couponTime
=
this
.
setDateString
(
newValue
[
0
],
true
)
+
' - '
+
this
.
setDateString
(
newValue
[
1
],
true
)
}
else
{
}
else
{
this
.
couponTime
=
''
}
}
,
}
},
methods
:
{
setDateString
(
objField
,
special
)
{
var
value
=
(
typeof
objField
==
'string'
)
?
objField
.
split
(
" "
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
;
console
.
log
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
})
},
validateRules
(){
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
){
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'2'
)
{
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
}
if
(
form
.
effectiveType
==
'1'
){
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'1'
)
{
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
}
},
getCouponInfoParams
()
{
var
obj
=
{}
;
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
var
form
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
id
)
{
obj
.
couponId
=
id
;
}
else
{
//编辑时只允许编辑使用说明
obj
.
couponId
=
id
}
else
{
//编辑时只允许编辑使用说明
//优惠券名称
obj
.
couponName
=
form
.
couponName
;
obj
.
couponName
=
form
.
couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj
.
discountType
=
'4'
;
obj
.
discountType
=
'4'
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj
.
effectiveType
=
form
.
effectiveType
if
(
form
.
effectiveType
==
1
)
{
//固定天数
obj
.
effectiveDays
=
form
.
effectiveDays
;
}
else
if
(
form
.
effectiveType
==
2
)
{
//时间段
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'
;
obj
.
effectiveStartTime
=
d
[
0
]
+
' 00:00:00'
obj
.
effectiveEndTime
=
d
[
1
]
+
' 23:59:59'
}
}
//库存
obj
.
stock
=
form
.
stock
;
obj
.
stock
=
form
.
stock
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj
.
useType
=
1
obj
.
useType
=
1
//有效期或者间隔天数使用次数
obj
.
useAmount
=
1
obj
.
useAmount
=
1
}
//使用描述
obj
.
useDescription
=
form
.
useDescription
;
return
obj
;
obj
.
useDescription
=
form
.
useDescription
return
obj
},
handleConfirm
()
{
...
...
@@ -250,12 +247,12 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
this
.
getCouponInfoParams
()
console
.
log
(
params
)
;
console
.
log
(
params
)
let
method
=
''
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
...
...
@@ -279,124 +276,124 @@ export default {
</
script
>
<
style
scoped
>
.right_show
{
/* float: right; */
position
:
absolute
;
z-index
:
10
;
height
:
566px
;
width
:
290px
;
right
:
44px
;
top
:
92px
;
background-image
:
url(../../assets/coupon/phone.png)
;
/* float: right; */
position
:
absolute
;
z-index
:
10
;
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
;
height
:
59px
;
width
:
251px
;
margin-left
:
18px
;
margin-top
:
55px
;
}
.right_show
.card-middle
{
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
height
:
388px
;
width
:
251px
;
margin-left
:
18px
;
overflow
:
auto
;
}
.right_show
.card-middle
.cname
{
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
width
:
170px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
15px
;
display
:
inline-block
;
}
.right_show
.card-middle
.ctype
{
width
:
48px
;
height
:
20px
;
background
:
#5850FF
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
width
:
48px
;
height
:
20px
;
background
:
#5850ff
;
border-radius
:
10px
;
margin-right
:
6px
;
margin-top
:
10px
;
display
:
inline-block
;
float
:
right
;
}
.right_show
.card-middle
.ctype
.ctypeName
{
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#FFFFFF
;
font-weight
:
400
;
margin-left
:
6px
;
width
:
36px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#ffffff
;
font-weight
:
400
;
margin-left
:
6px
;
}
.right_show
.card-middle
.ctime
{
margin-left
:
10px
;
margin-top
:
17px
;
margin-left
:
10px
;
margin-top
:
17px
;
}
.right_show
.card-middle
.ctime
.ctime_name
{
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
width
:
48px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.ctime
.ctime_content
{
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#717171
;
font-weight
:
400
;
margin-left
:
5px
;
}
.right_show
.card-middle
.ccode
{
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
width
:
120px
;
height
:
120px
;
margin-left
:
67px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.ccodeName
{
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1D1D1D
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
width
:
68px
;
height
:
17px
;
font-family
:
PingFangSC-Medium
;
font-size
:
12px
;
color
:
#1d1d1d
;
font-weight
:
500
;
margin-left
:
93px
;
margin-top
:
8px
;
}
.right_show
.card-middle
.cremarks
{
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
margin-left
:
10px
;
margin-top
:
17px
;
width
:
60px
;
height
:
17px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#333333
;
font-weight
:
400
;
}
.right_show
.card-middle
.cremarks_content
{
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
margin-left
:
10px
;
margin-right
:
11px
;
margin-top
:
4px
;
width
:
230px
;
height
:
34px
;
font-family
:
PingFangSC-Regular
;
font-size
:
12px
;
color
:
#666666
;
font-weight
:
400
;
word-break
:
break-word
;
}
</
style
>
src/views/couponManage/editMemberService.vue
View file @
3dbf241
<!-- 编辑代金券 -->
<
template
>
<div
class=
"edit-share marketing p-t-20"
>
<div
class=
"edit-share marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
会员服务
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"effectiveHtml"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"3"
:disabled=
"apear!='couponAdd'"
>
无有效期
</el-radio><br>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
<el-radio
v-model=
"editForm.effectiveType"
label=
"3"
:disabled=
"apear != 'couponAdd'"
>
无有效期
</el-radio>
<br
/>
<el-form-item
prop=
"effectiveTime"
style=
"margin-top: 12px;display: block;"
>
<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
prop=
"effectiveDays"
>
<el-radio
v-model=
"editForm.effectiveType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
领取后
<el-input
v-model=
"editForm.effectiveDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.effectiveType != 1"
/>
天内有效
</el-radio>
</el-form-item>
</
template
>
<
template
slot=
"useTypeHtml"
>
<el-radio
v-model=
"editForm.useType"
label=
"0"
:disabled=
"apear!='couponAdd'"
>
无限制
</el-radio><br>
<el-form-item
prop=
"usageTimes"
style=
"margin-top: 12px;display: block;"
>
<el-radio
v-model=
"editForm.useType"
label=
"1"
:disabled=
"apear!='couponAdd'"
>
有效期内可使用
<el-input
v-model=
"editForm.usageTimes"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.useType != 1"
/>
次
</el-radio>
</el-form-item>
<el-radio
v-model=
"editForm.useType"
label=
"2"
:disabled=
"apear!='couponAdd'"
>
<el-form-item
prop=
"useLimitDays"
>
有效期内
<el-input
v-model=
"editForm.useLimitDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.useType != 2"
/>
天可使用
</el-form-item>
<el-form-item
prop=
"usageTimes2"
>
<el-input
v-model=
"editForm.usageTimes2"
style=
"width: 100px;margin-right:5px"
:disabled=
"apear!='couponAdd'|| editForm.useType != 2"
/>
次
</el-form-item>
</el-radio>
<el-radio
v-model=
"editForm.useType"
label=
"0"
:disabled=
"apear != 'couponAdd'"
>
无限制
</el-radio>
<br
/>
<el-form-item
prop=
"usageTimes"
style=
"margin-top: 12px;display: block;"
>
<el-radio
v-model=
"editForm.useType"
label=
"1"
:disabled=
"apear != 'couponAdd'"
>
有效期内可使用
<el-input
v-model=
"editForm.usageTimes"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 1"
/>
次
</el-radio>
</el-form-item>
<el-radio
v-model=
"editForm.useType"
label=
"2"
:disabled=
"apear != 'couponAdd'"
>
<el-form-item
prop=
"useLimitDays"
>
有效期内
<el-input
v-model=
"editForm.useLimitDays"
style=
"width: 100px;margin-left:5px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 2"
/>
天可使用
</el-form-item>
<el-form-item
prop=
"usageTimes2"
>
<el-input
v-model=
"editForm.usageTimes2"
style=
"width: 100px;margin-right:5px"
:disabled=
"apear != 'couponAdd' || editForm.useType != 2"
/>
次
</el-form-item>
</el-radio>
</
template
>
<
template
slot=
"useDescriptionHtml"
>
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear==
'couponSee'" />
<el-input
type=
"textarea"
v-model=
"editForm.useDescription"
style=
"width: 320px"
:autosize=
"
{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear ==
'couponSee'" />
</
template
>
</glsx-combi-form>
</div>
...
...
@@ -67,9 +64,9 @@
</div>
</div> -->
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
<el-button
type=
"default"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'couponSee'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'couponSee'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
</div>
</template>
...
...
@@ -180,12 +177,12 @@ export default {
var
id
=
this
.
routeInfo
.
id
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
if
(
id
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
;
this
.
title
=
'查看'
;
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
;
this
.
title
=
'编辑'
;
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'couponSee'
this
.
title
=
'查看'
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'couponEdit'
this
.
title
=
'编辑'
}
this
.
isDisabled
=
true
this
.
editFormData
[
0
].
isDisabled
=
this
.
isDisabled
...
...
@@ -193,52 +190,52 @@ export default {
this
.
editFormData
[
4
].
isDisabled
=
this
.
isDisabled
this
.
editFormData
[
5
].
isDisabled
=
this
.
isDisabled
}
else
{
this
.
apear
=
'couponAdd'
;
this
.
title
=
'创建'
;
this
.
apear
=
'couponAdd'
this
.
title
=
'创建'
this
.
isDisabled
=
false
}
},
watch
:
{
'editForm.effectiveDays'
(
newValue
,
oldValue
){
'editForm.effectiveDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
effectiveDays
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.usageTimes'
(
newValue
,
oldValue
){
'editForm.usageTimes'
(
newValue
,
oldValue
)
{
this
.
editForm
.
usageTimes
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.useLimitDays'
(
newValue
,
oldValue
){
'editForm.useLimitDays'
(
newValue
,
oldValue
)
{
this
.
editForm
.
useLimitDays
=
limitPrice
(
newValue
,
oldValue
,
4
,
0
)
},
'editForm.usageTimes2'
(
newValue
,
oldValue
){
'editForm.usageTimes2'
(
newValue
,
oldValue
)
{
this
.
editForm
.
usageTimes2
=
limitPrice
(
newValue
,
oldValue
,
3
,
0
)
},
'editForm.vipPrice'
(
newValue
,
oldValue
){
'editForm.vipPrice'
(
newValue
,
oldValue
)
{
this
.
editForm
.
vipPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
)
},
'editForm.shopPrice'
(
newValue
,
oldValue
){
'editForm.shopPrice'
(
newValue
,
oldValue
)
{
this
.
editForm
.
shopPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
)
},
'editForm.stock'
(
newValue
,
oldValue
){
'editForm.stock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
stock
=
limitPrice
(
newValue
,
oldValue
,
6
,
0
,
1
)
},
'editForm.effectiveTime'
(
newValue
,
oldValue
){
if
(
newValue
&&
newValue
.
length
>
0
)
{
'editForm.effectiveTime'
(
newValue
,
oldValue
)
{
if
(
newValue
&&
newValue
.
length
>
0
)
{
this
.
couponTime
=
this
.
setDateString
(
newValue
[
0
],
true
)
+
' - '
+
this
.
setDateString
(
newValue
[
1
],
true
)
}
else
{
}
else
{
this
.
couponTime
=
''
}
}
,
}
},
methods
:
{
setDateString
(
objField
,
special
)
{
var
value
=
(
typeof
objField
==
'string'
)
?
objField
.
split
(
" "
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
var
value
=
typeof
objField
==
'string'
?
objField
.
split
(
' '
)[
0
]
:
special
?
objField
.
format
(
'YYYY年MM月DD日'
)
:
objField
.
format
(
'YYYY年MM月DD日'
)
return
value
},
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
;
console
.
log
(
res
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
this
.
editForm
.
useType
=
this
.
editForm
.
useType
+
''
...
...
@@ -246,88 +243,94 @@ export default {
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
if
(
this
.
editForm
.
useType
==
1
)
{
this
.
editForm
.
usageTimes
=
this
.
editForm
.
useAmount
;
this
.
editForm
.
usageTimes
=
this
.
editForm
.
useAmount
}
else
if
(
this
.
editForm
.
useType
==
2
)
{
this
.
editForm
.
usageTimes2
=
this
.
editForm
.
useAmount
;
this
.
editForm
.
usageTimes2
=
this
.
editForm
.
useAmount
}
})
},
validateRules
(){
validateRules
()
{
var
form
=
this
.
editForm
if
(
form
.
effectiveType
==
'2'
){
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'2'
)
{
//判断 有效期-日期选择是否验证
this
.
editRule
.
effectiveTime
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveTime
[
0
].
required
=
false
}
if
(
form
.
effectiveType
==
'1'
){
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
if
(
form
.
effectiveType
==
'1'
)
{
//判断 有效期-有效天数是否验证
this
.
editRule
.
effectiveDays
[
0
].
required
=
true
}
else
{
this
.
editRule
.
effectiveDays
[
0
].
required
=
false
}
if
(
form
.
useType
==
'1'
){
//判断 使用限制-有效期内使用次数是否验证
this
.
editRule
.
usageTimes
[
0
].
required
=
true
}
else
{
this
.
editRule
.
usageTimes
[
0
].
required
=
false
if
(
form
.
useType
==
'1'
)
{
//判断 使用限制-有效期内使用次数是否验证
this
.
editRule
.
usageTimes
[
0
].
required
=
true
}
else
{
this
.
editRule
.
usageTimes
[
0
].
required
=
false
}
if
(
form
.
useType
==
'2'
){
//判断 使用限制-有效天数和使用次数是否验证
this
.
editRule
.
useLimitDays
[
0
].
required
=
true
this
.
editRule
.
usageTimes2
[
0
].
required
=
true
}
else
{
this
.
editRule
.
useLimitDays
[
0
].
required
=
false
this
.
editRule
.
usageTimes2
[
0
].
required
=
false
if
(
form
.
useType
==
'2'
)
{
//判断 使用限制-有效天数和使用次数是否验证
this
.
editRule
.
useLimitDays
[
0
].
required
=
true
this
.
editRule
.
usageTimes2
[
0
].
required
=
true
}
else
{
this
.
editRule
.
useLimitDays
[
0
].
required
=
false
this
.
editRule
.
usageTimes2
[
0
].
required
=
false
}
},
getCouponInfoParams
()
{
var
obj
=
{}
;
var
obj
=
{}
var
id
=
this
.
routeInfo
.
id
var
form
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
if
(
id
)
{
obj
.
couponId
=
id
;
}
else
{
//编辑时只允许编辑使用说明
obj
.
couponId
=
id
}
else
{
//编辑时只允许编辑使用说明
//优惠券名称
obj
.
couponName
=
form
.
couponName
;
obj
.
couponName
=
form
.
couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj
.
discountType
=
'7'
;
obj
.
discountType
=
'7'
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj
.
effectiveType
=
form
.
effectiveType
if
(
form
.
effectiveType
==
1
)
{
//固定天数
obj
.
effectiveDays
=
form
.
effectiveDays
;
}
else
if
(
form
.
effectiveType
==
2
)
{
//时间段
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'
;
obj
.
effectiveStartTime
=
d
[
0
]
+
' 00:00:00'
obj
.
effectiveEndTime
=
d
[
1
]
+
' 23:59:59'
}
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj
.
useType
=
form
.
useType
;
obj
.
useType
=
form
.
useType
if
(
form
.
useType
==
1
)
{
obj
.
useAmount
=
form
.
usageTimes
;
obj
.
useAmount
=
form
.
usageTimes
}
else
if
(
form
.
useType
==
2
)
{
obj
.
useLimitDays
=
form
.
useLimitDays
;
obj
.
useAmount
=
form
.
usageTimes2
;
obj
.
useLimitDays
=
form
.
useLimitDays
obj
.
useAmount
=
form
.
usageTimes2
}
//会员价
obj
.
vipPrice
=
form
.
vipPrice
;
obj
.
vipPrice
=
form
.
vipPrice
//门店价
obj
.
shopPrice
=
form
.
shopPrice
;
obj
.
shopPrice
=
form
.
shopPrice
//库存
obj
.
stock
=
form
.
stock
;
obj
.
stock
=
form
.
stock
}
//使用描述
obj
.
useDescription
=
form
.
useDescription
;
return
obj
;
obj
.
useDescription
=
form
.
useDescription
return
obj
},
handleConfirm
()
{
...
...
@@ -335,12 +338,12 @@ export default {
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
this
.
getCouponInfoParams
()
console
.
log
(
params
)
;
console
.
log
(
params
)
let
method
=
''
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
if
(
params
.
couponId
)
{
method
=
'updateCouponApi'
//后台修改优惠券
}
else
{
method
=
'createCouponApi'
//后台创建优惠券
}
this
.
$apis
.
couponManage
[
method
](
params
).
then
(
res
=>
{
this
.
$message
({
...
...
@@ -364,53 +367,53 @@ export default {
</
script
>
<
style
scoped
>
.left_show
{
width
:
400px
;
/*min-height: 600px;*/
background
:
#fff
;
/*border: 1px solid #eee;*/
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
width
:
400px
;
/*min-height: 600px;*/
background
:
#fff
;
/*border: 1px solid #eee;*/
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
position
:
absolute
;
top
:
110px
;
left
:
50%
;
position
:
absolute
;
top
:
110px
;
left
:
50%
;
}
.left_show
.card-panel-top
{
/* margin-top: 200px; */
width
:
365px
;
height
:
122px
;
background-color
:
rgba
(
245
,
154
,
35
,
0.7
);
border
:
none
;
text-align
:
center
;
line-height
:
24px
;
position
:
relative
;
/* margin-top: 200px; */
width
:
365px
;
height
:
122px
;
background-color
:
rgba
(
245
,
154
,
35
,
0.7
);
border
:
none
;
text-align
:
center
;
line-height
:
24px
;
position
:
relative
;
}
.card-h-title
{
position
:
absolute
;
font-weight
:
500
;
font-size
:
20px
;
top
:
20px
;
transform
:
rotate
(
-45deg
);
position
:
absolute
;
font-weight
:
500
;
font-size
:
20px
;
top
:
20px
;
transform
:
rotate
(
-45deg
);
}
.card-panel-bottom
{
width
:
353px
;
min-height
:
90px
;
background-color
:
rgba
(
250
,
205
,
145
,
1
);
padding
:
6px
;
width
:
353px
;
min-height
:
90px
;
background-color
:
rgba
(
250
,
205
,
145
,
1
);
padding
:
6px
;
}
.card-extime
{
margin-top
:
10px
;
margin-top
:
10px
;
}
.card-name
{
margin
:
16px
0px
;
font-size
:
16px
;
margin
:
16px
0px
;
font-size
:
16px
;
}
.card-day
{
margin-top
:
10px
;
margin-top
:
10px
;
}
.card-remark
{
word-break
:
break-word
;
word-break
:
break-word
;
}
</
style
>
src/views/homeSet/index.vue
View file @
3dbf241
<!-- 首页设置 -->
<
template
>
<div
class=
"home-set marketing p-t-20"
>
<div
class=
"home-set marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container flex"
>
<div
class=
"home-set-form flex-grow"
>
<div
v-for=
"(item, index) in externalFormList"
:key=
"index"
>
<p
class=
"edit-sub-title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<template
slot=
"merchantQrcode"
slot-scope=
"scope"
>
<img
class=
"img-100"
:src=
"editForm[scope.scope.name]"
/>
<el-button
type=
"text"
@
click=
"handleImgDown(editForm[scope.scope.name])"
>
下载
</el-button>
</
template
>
<p
class=
"edit-title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container p-l-40 m-b-60"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<div
slot=
"merchantQrcode"
slot-scope=
"scope"
:style=
"
{ 'margin-left': labelWidth, width: '120px', 'text-align': 'center' }">
<p>
<img
class=
"img-120"
:src=
"editForm[scope.scope.name]"
/>
</p>
<el-button
type=
"text"
@
click=
"handleImgDown(editForm[scope.scope.name])"
>
下载图片
</el-button>
</div>
<template
slot=
"bannerBtn"
>
<el-button
type=
"primary"
@
click=
"handleBannerAdd"
>
新增banner
</el-button>
<el-button
type=
"primary"
:size=
"size"
@
click=
"handleBannerAdd"
>
新增banner
</el-button>
</
template
>
<div
:style=
"{ 'margin-left': labelWidth }"
slot=
"bannerList"
slot-scope=
"scope"
>
<div
v-for=
"(subItem, subIndex) in editForm[scope.scope.name]"
:key=
"subIndex"
class=
"flex"
>
<!-- 上传图片 -->
<div
class=
"banner-upload-box"
>
<div
class=
"
p-t-12
"
>
<div
class=
""
>
<div
class=
"flex"
>
<div
v-show=
"!subItem.bannerImg"
class=
"activity-img img-w-h"
style=
"margin-bottom: 11px;"
>
<div
v-show=
"!subItem.bannerImg"
class=
"activity-img
home-
img-w-h"
style=
"margin-bottom: 11px;"
>
<div
class=
"add"
>
+
</div>
<span
class=
"number"
>
上传
</span>
<input
type=
"file"
style=
"opacity: 0;"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleImgChange(e, subIndex)"
/>
<input
type=
"file"
style=
"opacity: 0;"
ref=
"file"
class=
"activity-img
home-
img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleImgChange(e, subIndex)"
/>
</div>
<div
v-show=
"!subItem.bannerImg"
>
<el-button
type=
"text"
class=
"el-icon-delete"
@
click=
"handleBannerDelete(subIndex)"
></el-button>
</div>
</div>
<span
v-show=
"subItem.bannerImg"
class=
"muti-imgs"
>
<img
class=
"img-w-h"
:src=
"subItem.bannerImg"
/>
<span
class=
"img-btns"
>
<img
class=
"
home-
img-w-h"
:src=
"subItem.bannerImg"
/>
<span
class=
"img-btns
home-img-w-h
"
>
<span
class=
"btn-item"
>
<i
class=
"el-icon-delete"
@
click=
"handleImgDelete(scope.scope.name, subIndex)"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.bannerImg)"
></i>
...
...
@@ -38,30 +40,74 @@
</span>
</span>
</div>
<p
class=
"edit-tips"
>
支持上传10MB以内的jpg,png,jpeg图片
</p>
</div>
<!-- 选择商品 -->
<div
v-show=
"subItem.bannerImg"
class=
"flex-grow"
>
<div>
<span>
商品链接:
</span>
<el-button
v-show=
"!subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleSinglePro(scope.scope, subIndex)"
>
选择
</el-button>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleSinglePro(scope.scope, subIndex)"
>
更换
</el-button>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleProDelete(subIndex)"
>
删除
</el-button>
</div>
<div
class=
"show-pro-box flex"
v-if=
"subItem.goodsId"
>
<img
class=
"img-60"
:src=
"subItem.goods.goodsImage"
/>
<p
class=
"pro-txt flex-grow one-line-ellipsis"
>
{{ subItem.goods.goodsName }}
</p>
<div
v-if=
"subItem.bannerImg"
class=
"flex-grow"
>
<div
class=
"flex-default"
>
<span>
banner链接
</span>
<div
class=
"banner-link"
>
<el-radio-group
v-model=
"subItem.bannerType"
>
<el-radio
v-for=
"(m, n) in bannerRadioList"
:key=
"n"
:label=
"m.confId"
>
{{m.confName}}
</el-radio>
</el-radio-group>
<div
v-show=
"subItem.bannerType != '0'"
class=
"link-block"
>
<div
v-show=
"(subItem.bannerType == '1' && !subItem.goodsId) || (subItem.bannerType == '2' && !subItem.imgLinkUrl) || (subItem.bannerType == '3' && !subItem.videoLinkUrl)"
>
<el-button
class=
"banner-btn"
type=
"primary"
:size=
"size"
@
click=
"handleBnnerLinkClick(scope.scope, subIndex)"
>
选择
<input
v-if=
"subItem.bannerType == '2'"
type=
"file"
ref=
"file"
class=
"upload-btn"
accept=
"image/png, image/jpeg, image/jpg"
@
change=
"e => handleUploadChange(e, item)"
/>
<input
v-if=
"subItem.bannerType == '3'"
type=
"file"
ref=
"file"
class=
"upload-btn"
accept=
"video/mp4"
@
change=
"e => handleUploadVideoChange(e, item)"
/>
</el-button>
<p
class=
"banner-tips-txt"
>
点击banner后跳转{{subItem.bannerType == '1' ? '商品' : (subItem.bannerType == '2' ? '图文介绍' : '视频介绍')}}
</p>
</div>
<!-- 选择商品 -->
<div
v-show=
"subItem.bannerType == '1' && subItem.goodsId"
class=
"flex-grow"
>
<div
class=
"show-pro-box flex"
v-if=
"subItem.goodsId"
>
<img
class=
"img-56"
:src=
"subItem.goods.goodsImage"
/>
<div
class=
"flex-grow pro-txt"
>
<p
class=
"one-line-ellipsis"
:title=
"subItem.goods.goodsName"
>
{{ subItem.goods.goodsName }}
</p>
<div>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleSinglePro(scope.scope, subIndex)"
>
更换
</el-button>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleProDelete(subIndex)"
>
删除
</el-button>
</div>
</div>
</div>
</div>
<!-- 图文介绍 -->
<div
v-show=
"subItem.bannerType == '2' && subItem.imgLinkUrl"
class=
"m-t-8"
>
<span
class=
"muti-imgs"
>
<img
class=
"img-56"
:src=
"subItem.imgLinkUrl"
/>
<span
class=
"img-btns img-56"
>
<span
class=
"btn-item"
>
<i
class=
"el-icon-delete"
@
click=
"handleBannerItemDelete(subIndex, 'imgLinkUrl')"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.imgLinkUrl)"
></i>
</span>
</span>
</span>
</div>
<!-- 视频介绍 -->
<div
v-show=
"subItem.bannerType == '3' && subItem.videoLinkUrl"
class=
"m-t-8"
>
<span
class=
"muti-imgs"
>
<video
class=
"img-56 activity-img"
:src=
"subItem.videoLinkUrl"
></video>
<span
class=
"img-btns img-56"
>
<span
class=
"btn-item"
>
<i
class=
"el-icon-delete"
@
click=
"handleBannerItemDelete(subIndex, 'videoLinkUrl')"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.videoLinkUrl, 'video')"
></i>
</span>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<p
class=
"edit-tips"
>
最多支持4张banner,图片格式仅支持JPG,PNG格式
</p>
<p
class=
"edit-tips"
>
建议尺寸660*270px,大小10M以内
</p>
</div>
<
template
slot=
"onlineService
"
>
<
el-button
type=
"primary"
>
请选择
</el-button
>
</
template
>
<
!-- <div slot="serviceTable" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }
">
<
GLTable v-show="editForm.customerServerUserId" :hasPage="false" :tableParams="tableParams" :tableData="customerServerList"></GLTable
>
</
div> --
>
</glsx-combi-form>
</div>
</div>
<div
class=
"wechat-container"
>
<div
class=
"wechat-container
m-r-20"
style=
"margin-top: 40px;
"
>
<div
class=
"wechat-box"
>
<img
class=
"w-100-per"
src=
"./images/home-set-head.png"
/>
<img
class=
"w-100-per"
src=
"./images/home-set-footer.png"
/>
...
...
@@ -72,8 +118,14 @@
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
</div>
<select-single-pro-dialog
v-if=
"isSingleSelectVisible"
:isSingleSelectVisible=
"isSingleSelectVisible"
:selectedProInfo=
"selectedProInfo"
@
handleSingleSelectConfirm=
"handleSingleSelectConfirm"
@
handleSingleSelectClose=
"handleSingleSelectClose"
></select-single-pro-dialog>
<el-dialog
:visible
.
sync=
"isImgVisible"
>
<img
class=
"dialog-img"
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
/>
<!-- 在线客服 -->
<!-- <glsx-dialog title="在线客服" :isVisible.sync="isConsultantVisible" @confirmDialog="handleConsultantConfirm" @closeDialog="handleConsultantClose">
</glsx-dialog> -->
<el-dialog
v-if=
"isImgVisible"
:visible
.
sync=
"isImgVisible"
class=
"dialog-look"
>
<video
v-if=
"dialogObj.uploadType == 'video'"
class=
"dialog-video"
controls
>
<source
:src=
"dialogObj.url"
type=
"video/mp4"
>
</video>
<img
v-else
class=
"dialog-img"
width=
"100%"
:src=
"dialogObj.url"
alt=
""
/>
</el-dialog>
</div>
</template>
...
...
@@ -85,9 +137,14 @@ export default {
return
{
footerLeft
:
'0'
,
footerWidth
:
'0'
,
size
:
'small'
,
userInfo
:
{},
// 查看大图
isImgVisible
:
false
,
dialogImageUrl
:
''
,
dialogObj
:
{
url
:
''
,
uploadType
:
'img'
},
// 商品选择
isSingleSelectVisible
:
false
,
curBanner
:
{
...
...
@@ -95,22 +152,47 @@ export default {
targetItem
:
{}
},
selectedProInfo
:
{},
// 在线客服
customerServerList
:
[],
tableParams
:
{
tableOption
:
false
,
tableColumns
:
[
{
label
:
'姓名'
,
prop
:
'customerServerName'
},
{
label
:
'跟进专员类型'
,
prop
:
'customerServerUserTitle'
}
]
},
// 表单
editForm
:
{
merchantQrcode
:
''
,
noticeContent
:
''
,
preferentialPolicy
:
''
,
bannerList
:
[]
},
bannerItem
:
{
bannerImg
:
''
,
goodsId
:
''
,
bannerType
:
'0'
,
linkUrl
:
''
,
videoLinkUrl
:
''
,
imgLinkUrl
:
''
,
goods
:
{
id
:
''
,
goodsName
:
''
,
goodsImage
:
''
}
},
labelWidth
:
'110px'
,
bannerRadioList
:
[
{
confId
:
'1'
,
confName
:
'商品'
},
{
confId
:
'2'
,
confName
:
'图文介绍'
},
{
confId
:
'3'
,
confName
:
'视频介绍'
}
],
labelWidth
:
'90px'
,
externalFormList
:
[
{
title
:
'门店小程序码'
,
...
...
@@ -145,54 +227,115 @@ export default {
label
:
'门店公告'
,
name
:
'noticeContent'
,
type
:
'input'
,
rows
:
'4'
,
inputType
:
'textarea'
,
maxlength
:
'50'
}
]
},
{
title
:
'新车优惠政策'
,
editFormData
:
[
{
label
:
'优惠政策'
,
name
:
'preferentialPolicy'
,
type
:
'input'
,
rows
:
'4'
,
inputType
:
'textarea'
,
maxlength
:
'300'
}
]
},
{
title
:
'在线客服'
,
editFormData
:
[
{
label
:
'在线客服'
,
name
:
'customerServerUserId'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'userOneid'
,
optionLabel
:
'staffName'
,
optionsName
:
'consultantList'
,
isClear
:
true
,
changeAttr
:
(
value
,
targetItem
)
=>
{
var
tempObj
=
{
customerServerName
:
''
,
customerServerUserTitle
:
''
}
this
.
customerServerList
=
[]
this
.
editForm
.
customerServerId
=
''
this
.
editForm
.
customerServerName
=
''
this
.
editForm
.
customerServerUserTitle
=
''
if
(
value
)
{
tempObj
=
this
.
baseData
.
consultantList
.
find
(
item
=>
item
.
userOneid
==
value
)
this
.
editForm
.
customerServerId
=
tempObj
.
id
this
.
editForm
.
customerServerName
=
tempObj
.
staffName
this
.
editForm
.
customerServerUserTitle
=
tempObj
.
staffTitle
this
.
customerServerList
.
push
({
customerServerName
:
tempObj
.
staffName
,
customerServerUserTitle
:
tempObj
.
staffTitle
,
})
}
}
}
// {
// label: '',
// addHtml: 'serviceTable'
// }
]
}
// {
// title: '新车优惠政策',
// editFormData: [
// {
// label: '优惠政策',
// name: 'police',
// type: 'input',
// inputType: 'textarea',
// width: '320px',
// maxlength: '300'
// }
// ]
// },
// {
// title: '在线客服',
// editFormData: [
// {
// label: '',
// addHtml: 'onlineService'
// }
// ]
// }
]
],
// 基本信息
baseData
:
{
consultantList
:
[]
}
}
},
mounted
()
{
this
.
userInfo
=
this
.
$globalState
.
session
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
getInfo
()
this
.
getConsultant
()
},
methods
:
{
getInfo
()
{
this
.
$apis
.
homeSet
.
getHomeInfoListApi
({}).
then
(
res
=>
{
// console.log(res)
this
.
editForm
.
bannerList
=
[]
this
.
editForm
.
noticeContent
=
res
.
noticeContent
this
.
editForm
.
merchantQrcode
=
res
.
merchantQrcode
if
(
res
.
bannerList
.
length
)
{
this
.
editForm
.
preferentialPolicy
=
res
.
preferentialPolicy
// 在线客服
this
.
customerServerList
=
[]
if
(
res
.
customerServerUserId
)
{
this
.
editForm
.
customerServerUserId
=
res
.
customerServerUserId
this
.
editForm
.
customerServerId
=
res
.
customerServerId
this
.
editForm
.
customerServerName
=
res
.
customerServerName
this
.
editForm
.
customerServerUserTitle
=
res
.
customerServerUserTitle
this
.
customerServerList
.
push
({
customerServerName
:
res
.
customerServerName
,
customerServerUserTitle
:
res
.
customerServerUserTitle
})
}
if
(
res
.
bannerList
&&
res
.
bannerList
.
length
)
{
res
.
bannerList
.
forEach
(
item
=>
{
var
params
=
{
bannerImg
:
item
.
bannerImg
,
goodsId
:
item
.
goods
?
item
.
goods
.
id
:
''
goodsId
:
item
.
goods
?
item
.
goods
.
id
:
''
,
bannerType
:
item
.
bannerType
+
''
,
linkUrl
:
item
.
linkUrl
,
imgLinkUrl
:
''
,
videoLinkUrl
:
''
}
if
(
item
.
bannerType
==
'2'
)
{
params
.
imgLinkUrl
=
item
.
linkUrl
}
if
(
item
.
bannerType
==
'3'
)
{
params
.
videoLinkUrl
=
item
.
linkUrl
}
if
(
item
.
goods
)
{
params
.
goods
=
{
...
...
@@ -223,9 +366,13 @@ export default {
})
},
// 图片查看
handleImgLook
(
src
)
{
handleImgLook
(
src
,
uploadType
)
{
this
.
isImgVisible
=
true
this
.
dialogImageUrl
=
src
// this.dialogImageUrl = src
this
.
dialogObj
=
{
url
:
src
,
uploadType
:
uploadType
||
'img'
}
},
handleBannerAdd
()
{
if
(
this
.
editForm
.
bannerList
.
length
>=
4
)
{
...
...
@@ -242,6 +389,7 @@ export default {
},
handleProDelete
(
idx
)
{
this
.
editForm
.
bannerList
[
idx
].
goodsId
=
''
this
.
editForm
.
bannerList
[
idx
].
bannerType
=
'0'
this
.
editForm
.
bannerList
[
idx
].
goods
=
{}
},
handleImgChange
(
e
,
idx
)
{
...
...
@@ -266,12 +414,80 @@ export default {
})
}
},
// 商品选择
handleBnnerLinkClick
(
targetItem
,
idx
)
{
this
.
curBanner
.
idx
=
idx
this
.
curBanner
.
targetItem
=
targetItem
switch
(
this
.
editForm
.
bannerList
[
idx
].
bannerType
)
{
case
'1'
:
this
.
handleSinglePro
(
targetItem
,
idx
)
break
;
case
'2'
:
break
;
case
'3'
:
console
.
log
(
'视频介绍'
)
break
;
}
},
// banner - 图片上传
handleUploadChange
(
e
)
{
var
reader
=
new
FileReader
()
var
file
=
e
.
srcElement
.
files
[
0
]
var
uploadType
=
'img'
// 默认1MB
const
limitSize
=
30
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
const
isType
=
[
'image/jpeg'
,
'image/png'
,
'image/jpg'
].
includes
(
file
.
type
)
if
(
!
isType
)
{
this
.
$message
.
error
(
'上传图片不是jpg、jpeg或png的格式!'
)
return
true
}
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传图片大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
.
bannerList
[
this
.
curBanner
.
idx
].
imgLinkUrl
=
res
})
}
},
// 视频上传
handleUploadVideoChange
(
e
)
{
var
reader
=
new
FileReader
()
var
file
=
e
.
srcElement
.
files
[
0
]
// 默认1MB
const
limitSize
=
200
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
const
isType
=
[
'video/mp4'
].
includes
(
file
.
type
)
if
(
!
isType
)
{
this
.
$message
.
error
(
'上传视频不是MP4的格式!'
)
return
true
}
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传视频大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadVideoApi
({
file
:
base64
}).
then
(
res
=>
{
this
.
editForm
.
bannerList
[
this
.
curBanner
.
idx
].
videoLinkUrl
=
res
})
}
},
handleBannerItemDelete
(
idx
,
linkName
)
{
this
.
editForm
.
bannerList
[
idx
][
linkName
]
=
''
this
.
editForm
.
bannerList
[
idx
].
bannerType
=
'0'
},
// 商品选择-start
handleSinglePro
(
targetItem
,
idx
)
{
this
.
curBanner
.
idx
=
idx
this
.
curBanner
.
targetItem
=
targetItem
this
.
selectedProInfo
=
this
.
editForm
.
bannerList
[
idx
].
goods
?
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
.
bannerList
[
idx
].
goods
)
:
{}
// this.editForm[targetItem.name][idx].goods ? (this.selectedProInfo = this.$common.utils.deepClone(this.editForm[targetItem.name][idx].goods)) : ''
this
.
selectedProInfo
=
this
.
editForm
.
bannerList
[
this
.
curBanner
.
idx
].
goods
?
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
.
bannerList
[
this
.
curBanner
.
idx
].
goods
)
:
{}
this
.
handleSingleSelectClose
()
},
handleSingleSelectConfirm
(
selectedProInfo
)
{
...
...
@@ -283,20 +499,67 @@ export default {
handleSingleSelectClose
()
{
this
.
isSingleSelectVisible
=
!
this
.
isSingleSelectVisible
},
// 商品选择-end
// 在线客服-start
// handleConsultantClose() {
// this.isConsultantVisible = !this.isConsultantVisible
// },
getConsultant
()
{
this
.
$apis
.
homeSet
.
getConsultantListApi
({
merchantId
:
this
.
userInfo
.
merchantId
,
followType
:
3
}).
then
(
res
=>
{
// console.log(res)
this
.
baseData
.
consultantList
=
res
this
.
externalFormList
[
4
].
editFormData
[
0
].
optionList
=
res
})
},
// 在线客服-end
handleConfirm
()
{
this
.
$apis
.
homeSet
.
updateHomeApi
(
this
.
editForm
).
then
(
res
=>
{
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
params
.
bannerList
=
[]
this
.
editForm
.
bannerList
.
forEach
((
item
,
idx
)
=>
{
params
.
bannerList
.
push
({
bannerImg
:
item
.
bannerImg
,
goodsId
:
''
,
bannerType
:
+
item
.
bannerType
,
linkUrl
:
''
,
goods
:
{}
})
if
(
item
.
bannerType
==
'1'
&&
item
.
goodsId
)
{
params
.
bannerList
[
idx
].
goodsId
=
item
.
goodsId
params
.
bannerList
[
idx
].
goods
=
{
id
:
item
.
goods
.
id
,
goodsName
:
item
.
goods
.
goodsName
,
goodsImage
:
item
.
goods
.
goodsImage
}
}
if
(
item
.
bannerType
==
'2'
&&
item
.
imgLinkUrl
)
{
params
.
bannerList
[
idx
].
linkUrl
=
item
.
imgLinkUrl
}
if
(
item
.
bannerType
==
'3'
&&
item
.
videoLinkUrl
)
{
params
.
bannerList
[
idx
].
linkUrl
=
item
.
videoLinkUrl
}
if
((
item
.
bannerType
==
'1'
&&
!
item
.
goodsId
)
||
(
item
.
bannerType
==
'2'
&&
!
item
.
imgLinkUrl
)
||
(
item
.
bannerType
==
'3'
&&
!
item
.
videoLinkUrl
))
{
params
.
bannerList
[
idx
].
bannerType
=
0
}
})
// console.log(params)
this
.
$apis
.
homeSet
.
updateHomeApi
(
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
})
this
.
getInfo
()
})
}
}
}
</
script
>
<
style
scoped
>
.home-set
.container
{
padding
:
30px
;
/* .home-set .container {
padding: 20px 24px 20px 0;
} */
.home-set
.home-img-w-h
{
width
:
264px
;
height
:
108px
;
}
/* .wechat-container {
width: 375px;
...
...
@@ -313,20 +576,66 @@ export default {
border-radius: 2px;
} */
.home-set
.banner-upload-box
{
width
:
140px
;
margin-bottom
:
10px
;
width
:
264px
;
/* margin: 0 10px 10px 0; */
margin-right
:
10px
;
}
.home-set
.edit-tips
{
line-height
:
18px
;
font-size
:
13px
;
color
:
#666666
;
width
:
240px
;
width
:
300px
;
}
.home-set
.show-pro-box
{
padding
:
8px
12px
;
}
.home-set
.img-56
{
width
:
56px
;
height
:
56px
;
/* margin-right: 12px; */
}
.home-set
.m-t-8
{
margin-top
:
8px
;
}
.home-set
.show-pro-box
.pro-txt
{
margin-left
:
20px
;
width
:
200px
;
width
:
154px
;
text-align
:
left
;
margin-left
:
12px
;
}
.home-set
.p-t-12
{
padding-top
:
12px
;
}
.home-set
.banner-link
{
width
:
246px
;
margin-left
:
20px
;
}
.home-set
.banner-link
.el-radio
{
margin-right
:
17px
;
}
.home-set
.banner-link
.el-radio
:last-child
{
margin-right
:
0
;
}
.home-set
.link-block
{
width
:
100%
;
height
:
72px
;
text-align
:
center
;
background-color
:
#F7F7F7
;
border
:
1px
solid
#DCDFE6
;
}
.home-set
.link-block
.banner-btn
{
position
:
relative
;
margin-top
:
12px
;
}
.home-set
.link-block
.upload-btn
{
position
:
absolute
;
width
:
62px
;
height
:
32px
;
left
:
0
;
top
:
0
;
opacity
:
0
;
cursor
:
pointer
;
}
.home-set
.link-block
.banner-tips-txt
{
color
:
#999999
;
}
</
style
>
src/views/memberCenter/center.vue
View file @
3dbf241
...
...
@@ -32,13 +32,15 @@
</el-form-item>
<el-form-item
label=
"售价"
size=
"small"
prop=
"price"
style=
"width: 300px"
>
<el-input
v-model=
"ruleForm.price"
size=
"small"
placeholder=
"请输入合理价格"
@
keyup
.
native=
"ruleForm.price = oninput(ruleForm.price)"
>
<template
slot=
"append"
>
元
</
template
>
<!--
<template
slot=
"append"
>
元
</
template
>
-->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
<el-form-item
label=
"市场价"
prop=
"marketPrice"
size=
"small"
style=
"width: 300px"
>
<!-- :onkeyup="(ruleForm.marketPrice = ruleForm.marketPrice.replace(/[^\-\d.]/g, ''))" -->
<el-input
v-model=
"ruleForm.marketPrice"
size=
"small"
placeholder=
"请输入合理价格"
@
keyup
.
native=
"ruleForm.marketPrice = oninput(ruleForm.marketPrice)"
>
<
template
slot=
"append"
>
元
</
template
>
<!-- <template slot="append">元</template> -->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
</el-form>
...
...
src/views/memberCenter/serviceAddUpdateLook.vue
View file @
3dbf241
...
...
@@ -77,12 +77,14 @@
</el-form-item>
<el-form-item
size=
"small"
label=
"会员价"
prop=
"vipPrice"
style=
"width: 315px"
>
<el-input
size=
"small"
:disabled=
"disabledContent"
maxlength=
"9"
v-model=
"ruleForm.vipPrice"
placeholder=
"请输入"
@
keyup
.
native=
"ruleForm.vipPrice = oninput(ruleForm.vipPrice)"
>
<template
slot=
"append"
>
元
</
template
>
<!--
<template
slot=
"append"
>
元
</
template
>
-->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
<el-form-item
size=
"small"
label=
"门店价"
prop=
"shopPrice"
style=
"width: 315px"
>
<el-input
size=
"small"
:disabled=
"disabledContent"
maxlength=
"9"
v-model=
"ruleForm.shopPrice"
placeholder=
"请输入"
@
keyup
.
native=
"ruleForm.shopPrice = oninput(ruleForm.shopPrice)"
>
<
template
slot=
"append"
>
元
</
template
>
<!-- <template slot="append">元</template> -->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
<el-form-item
size=
"small"
label=
"库存"
prop=
"stock"
style=
"width: 315px"
>
...
...
src/views/memberCenter/setmeal.vue
View file @
3dbf241
...
...
@@ -12,6 +12,7 @@
</span>
<span
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<template
v-if=
"scope.scope.state === 0"
>
<el-button
type=
"text"
@
click=
"handleEdit(scope.scope)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"handleUpOption(scope.scope)"
>
上架
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
删除
</el-button>
</
template
>
...
...
@@ -20,6 +21,7 @@
<el-button
type=
"text"
@
click=
"handleEdit(scope.scope)"
>
编辑
</el-button>
</
template
>
<
template
v-else
>
<el-button
type=
"text"
@
click=
"handleEdit(scope.scope)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"handleUpOption(scope.scope)"
>
上架
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
删除
</el-button>
</
template
>
...
...
src/views/memberCenter/setmealAddUpdate.vue
View file @
3dbf241
...
...
@@ -28,7 +28,8 @@
<el-form-item
size=
"small"
label=
"售价"
prop=
"packagePrice"
style=
"width: 315px"
>
<el-input
size=
"small"
v-model=
"ruleForm.packagePrice"
placeholder=
"请输入"
@
keyup
.
native=
"ruleForm.packagePrice = oninput(ruleForm.packagePrice)"
>
<template
slot=
"append"
>
元
</
template
>
<!--
<template
slot=
"append"
>
元
</
template
>
-->
<span
slot=
"suffix"
class=
"suffix-label"
>
元
</span>
</el-input>
</el-form-item>
...
...
src/views/orderComment/commentDetail.vue
View file @
3dbf241
<!-- 评论详情 -->
<
template
>
<div
class=
"comment-detail marketing"
>
<div
class=
"comment-detail marketing
p-t-20 edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<div
class=
"comment-container"
>
...
...
src/views/orderComment/index.vue
View file @
3dbf241
<!-- 评价管理-->
<
template
>
<div
class=
"marketing"
>
<div
class=
"marketing
p-t-20
"
>
<div
class=
"container"
>
<div>
<glsx-combi-form
ref=
"showSearch"
labelWidth=
"90px"
:formObj=
"searchForm"
:formData=
"searchFormData"
>
...
...
src/views/orderManage/index.vue
View file @
3dbf241
<!-- 订单管理 -->
<
template
>
<div
class=
"marketing"
>
<div
class=
"marketing
p-t-20
"
>
<div
class=
"container"
>
<div
class=
"list-tips"
>
<img
class=
"tips-img"
src=
"@/assets/icon-info.png"
/>
...
...
@@ -551,7 +551,7 @@ export default {
submitExamine
(
params
)
{
this
.
$apis
.
orderManage
.
examineAllowApi
(
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
'操作失败'
,
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
,
customClass
:
'message-Z-zinde'
})
...
...
src/views/orderManage/orderDetail.vue
View file @
3dbf241
<!-- 订单详情 -->
<
template
>
<div
class=
"order-detail marketing"
>
<div
class=
"order-detail marketing
p-t-20 edit-box
"
>
<div
class=
"container m-b-20"
>
<p
class=
"edit-title"
>
订单信息
</p>
<el-form
label-width=
"100px"
:inline=
"true"
>
...
...
@@ -18,15 +18,19 @@
<span>
{{
detailForm
.
deliveryCompany
}}
{{
detailForm
.
deliveryNumber
}}
</span>
</el-form-item>
</el-form>
<div
v-if=
"orderGoods.length"
>
<div
v-if=
"orderGoods.length"
class=
"p-l-40"
>
<table
class=
"show-table"
>
<tbody>
<tr
v-for=
"(item, index) in orderGoods"
:key=
"index"
>
<tr
v-for=
"(item, index) in orderGoods"
:key=
"index"
style=
"height: 70px;"
>
<td><img
:src=
"item.goodsImage"
class=
"img-60"
/></td>
<td>
{{
item
.
goodsName
}}
</td>
<td>
{{
item
.
specificationData
}}
</td>
<td>
{{
item
.
activityPrice
?
item
.
activityPrice
:
item
.
retailPrice
}}
元 *
{{
item
.
goodsNumber
}}
</td>
</tr>
<tr
v-if=
"detailForm.subOrderCoupon"
style=
"height: 40px;"
>
<td
style=
"text-align: left;"
colspan=
"3"
>
优惠券
</td>
<td>
{{
detailForm
.
subOrderCoupon
.
discountAmount
}}
元
</td>
</tr>
</tbody>
</table>
</div>
...
...
@@ -175,12 +179,16 @@ export default {
},
getInfo
()
{
this
.
$apis
.
orderManage
.
getOrderDetailApi
({
orderCode
:
this
.
routeInfo
.
orderCode
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
detailForm
=
res
this
.
orderRefund
=
res
.
orderRefund
||
null
if
(
this
.
orderRefund
)
{
this
.
orderRefund
.
refundTypeName
=
this
.
baseData
.
refundTypeList
.
map
(
item
=>
item
.
confId
).
includes
(
res
.
orderRefund
.
refundType
+
''
)
?
this
.
baseData
.
refundTypeList
.
find
(
item
=>
item
.
confId
==
res
.
orderRefund
.
refundType
).
confName
:
'-'
this
.
orderRefund
.
createdDateStr
=
dayjs
(
this
.
orderRefund
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
if
(
this
.
detailForm
.
subOrderCoupon
)
{
this
.
detailForm
.
subOrderCoupon
.
discountAmount
=
(
this
.
detailForm
.
subOrderCoupon
.
discountAmount
/
100
).
toFixed
(
2
)
}
this
.
orderGoods
=
res
.
orderGoods
||
[]
this
.
detailForm
.
payPrice
=
res
.
payPrice
?
(
res
.
payPrice
+
'元'
)
:
'-'
this
.
detailForm
.
orderSourceName
=
this
.
baseData
.
orderSourceList
.
map
(
item
=>
item
.
confId
).
includes
(
res
.
orderSource
+
''
)
?
this
.
baseData
.
orderSourceList
.
find
(
item
=>
item
.
confId
==
res
.
orderSource
).
confName
:
'-'
...
...
src/views/orderShare/editShare.vue
View file @
3dbf241
<!-- 编辑晒单 -->
<
template
>
<div
class=
"edit-share marketing"
>
<div
class=
"edit-share marketing
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container
m-r-20
"
ref=
"editFormRef"
labelWidth=
"140px"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"selectPro"
slot-scope=
"scope"
>
<el-button
type=
"primary"
@
click=
"handleRelateProClose(scope)"
>
{{
editForm
.
goodsId
?
'更换'
:
'请选择'
}}
</el-button>
<div
class=
"m-t-10"
v-show=
"editForm.goodsId"
>
...
...
src/views/productGroup/editProduct.vue
View file @
3dbf241
<!-- 编辑商品 -->
<
template
>
<div
class=
"edit-pro marketing p-t-20"
>
<div
class=
"edit-pro marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<div
class=
"flex m-t-20"
>
<div
class=
"wechat-container"
>
<div
class=
"wechat-box"
>
<img
class=
"w-100-per"
src=
"./images/pro-header.png"
/>
<!--
<div
class=
"home-banner wechant-conf-box home-bg"
style=
"border: none;margin-top: 0;"
>
<ul
ng-show=
"wechatImgList.length != 0"
class=
"home-banner-box wechant-config"
:style=
"
{'width':wechatImgList.length * 100 + '%'}">
<li
ng-repeat=
"item in wechatImgList"
ng-show=
"item.content"
>
<video
ng-show=
"item.resType == 3"
class=
"videoUpload"
ng-src=
"
{{
trustUrl
(
formData
.
goodsVideo
)
}}
" controls="controls">
</video>
<img
ng-show=
"item.resType == 1"
ng-src=
"
{{
item
.
content
}}
" />
</li>
</ul>
<img
ng-show=
"(wechatImgList.length == 1 && !wechatImgList[0].content) || wechatImgList.length == 0 || !wechatImgList"
style=
"width: 100%;height: 100%;"
src=
"images/upload.png"
alt=
""
>
<ul
class=
"indicator-dots-box align-center"
ng-show=
"wechatImgList[0].length != 0 && wechatImgList.length != 1"
>
<li
class=
"indicator-dots-box-radius"
ng-show=
"item.content"
ng-class=
"
{'active':$index == 0}" ng-click="bannerClick($index, 0)" ng-repeat="item in wechatImgList">
</li>
</ul>
</div>
-->
<!--
<div
class=
"wechat-box"
>
<span
ng-show=
"!specificationDetailList.length"
>
<span
class=
"price"
>
¥
{{
formData
.
retailPrice
}}
</span>
</span>
<span
ng-show=
"specificationDetailList.length"
>
<span
class=
"price"
>
¥
{{
minRetailPrice
}}
</span>
<span
ng-show=
"specificationDetailList.length > 1"
>
起
</span>
</span>
<span
class=
"old"
ng-show=
"formData.originalPrice"
>
{{
formData
.
originalPrice
}}
</span>
<p
class=
"good-name txt-ellipsis"
>
{{
formData
.
goodsName
}}
</p>
<p>
<span
class=
"txt-tips"
>
剩余:
</span>
<span
class=
"txt-tips"
style=
"margin-left: 20px;"
>
销售:0
</span>
</p>
</div>
<div
class=
"wechat-box"
>
<div
class=
"line right-arrow"
ng-if=
"nameToValSpecsList.length"
>
<span
class=
"line-label"
>
已选
</span>
<span
class=
"line-txt"
>
{{
nameToValSpecsList
[
0
].
specificationData
}}
</span>
</div>
<div
class=
"line right-arrow"
style=
"display: flex;"
>
<span
class=
"line-label"
>
配送
</span>
<div>
<div
style=
"height: 25px; line-height: 30px;"
class=
"line-txt"
>
填写地址
</div>
<div
style=
"height: 25px; line-height: 18px;"
class=
"line-txt"
>
支付后,预计48小时内发货
</div>
</div>
</div>
<div
class=
"line"
>
<span
class=
"line-label"
>
运费
</span>
<span
ng-show=
"formData.deliveryType == 1"
class=
"line-txt"
>
免运费
</span>
<span
ng-show=
"formData.deliveryType == 2"
class=
"line-txt"
>
{{
formData
.
expressFee
}}
元
</span>
</div>
</div>
<div
class=
"wechat-box"
style=
"margin-bottom: 0;"
>
<div
style=
"word-wrap: break-word;"
>
{{
formData
.
describe
}}
</div>
<div
ng-repeat=
"item in textAndput"
>
<img
ng-show=
"item.content"
ng-src=
"
{{
item
.
content
}}
">
</div>
</div>
-->
</div>
</div>
<!--
<p
class=
"edit-title"
>
{{
title
}}
</p>
-->
<div
class=
"flex"
>
<div
class=
"home-set-form flex-grow"
>
<div
v-for=
"(item, index) in externalFormList"
:key=
"index"
>
<p
class=
"edit-
sub-
title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<p
class=
"edit-title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container
p-l-40 m-b-60
"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<template
slot=
"describeBtn"
>
<el-button
:disabled=
"isDisabled"
type=
"primary"
@
click=
"handleDescribeImgAdd"
>
添加图片
</el-button>
</
template
>
...
...
@@ -167,7 +111,7 @@
<div
slot=
"selectMerchant"
slot-scope=
"scope"
class=
"select-merchant"
>
<el-button
:disabled=
"isDisabled"
type=
"primary"
@
click=
"handleRelateStoreClose(scope)"
>
{{ editForm.supplyMerchantList.length ? '更换' : '请选择' }}
</el-button>
</div>
<div
slot=
"merchantTable"
class=
"select-merchant"
>
<div
slot=
"merchantTable"
class=
"select-merchant"
:style=
"{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }"
>
<GLTable
v-show=
"editForm.supplyMerchantList.length"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.supplyMerchantList"
>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
:disabled=
"isDisabled"
type=
"text"
@
click=
"handleMerchantDelete(scope)"
>
删除
</el-button>
...
...
@@ -177,6 +121,62 @@
</glsx-combi-form>
</div>
</div>
<div
class=
"wechat-container m-r-20"
>
<div
class=
"wechat-box"
>
<img
class=
"w-100-per"
src=
"./images/pro-header.png"
/>
<!-- <div class="home-banner wechant-conf-box home-bg" style="border: none;margin-top: 0;">
<ul ng-show="wechatImgList.length != 0" class="home-banner-box wechant-config" :style="{'width':wechatImgList.length * 100 + '%'}">
<li ng-repeat="item in wechatImgList" ng-show="item.content">
<video ng-show="item.resType == 3" class="videoUpload" ng-src="{{trustUrl(formData.goodsVideo)}}" controls="controls"></video>
<img ng-show="item.resType == 1" ng-src="{{item.content}}" />
</li>
</ul>
<img ng-show="(wechatImgList.length == 1 && !wechatImgList[0].content) || wechatImgList.length == 0 || !wechatImgList" style="width: 100%;height: 100%;" src="images/upload.png" alt="">
<ul class="indicator-dots-box align-center" ng-show="wechatImgList[0].length != 0 && wechatImgList.length != 1">
<li class="indicator-dots-box-radius" ng-show="item.content" ng-class="{'active':$index == 0}" ng-click="bannerClick($index, 0)" ng-repeat="item in wechatImgList"></li>
</ul>
</div> -->
<!-- <div class="wechat-box">
<span ng-show="!specificationDetailList.length">
<span class="price">¥{{formData.retailPrice}}</span>
</span>
<span ng-show="specificationDetailList.length">
<span class="price">¥{{minRetailPrice}}</span>
<span ng-show="specificationDetailList.length > 1">起</span>
</span>
<span class="old" ng-show="formData.originalPrice">{{formData.originalPrice}}</span>
<p class="good-name txt-ellipsis">{{formData.goodsName}}</p>
<p>
<span class="txt-tips">剩余:</span>
<span class="txt-tips" style="margin-left: 20px;">销售:0</span>
</p>
</div>
<div class="wechat-box">
<div class="line right-arrow" ng-if="nameToValSpecsList.length">
<span class="line-label">已选</span>
<span class="line-txt">{{nameToValSpecsList[0].specificationData}}</span>
</div>
<div class="line right-arrow" style="display: flex;">
<span class="line-label">配送</span>
<div>
<div style="height: 25px; line-height: 30px;" class="line-txt">填写地址</div>
<div style="height: 25px; line-height: 18px;" class="line-txt">支付后,预计48小时内发货</div>
</div>
</div>
<div class="line">
<span class="line-label">运费</span>
<span ng-show="formData.deliveryType == 1" class="line-txt">免运费</span>
<span ng-show="formData.deliveryType == 2" class="line-txt">{{formData.expressFee}}元</span>
</div>
</div>
<div class="wechat-box" style="margin-bottom: 0;">
<div style="word-wrap: break-word;">{{formData.describe}}</div>
<div ng-repeat="item in textAndput">
<img ng-show="item.content" ng-src="{{item.content}}">
</div>
</div> -->
</div>
</div>
</div>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
...
...
@@ -189,11 +189,11 @@
<glsx-dialog
title=
"规格"
:isVisible
.
sync=
"isSpescVisible"
width=
"70%"
@
confirmDialog=
"handleSpescConfirm"
@
closeDialog=
"handleSpescClose"
>
<el-form
label-width=
"120px"
:model=
"spescEditForm"
:rules=
"spescRules"
ref=
"spescRef"
>
<el-form-item
label=
"规格名:"
prop=
"specificationName"
>
<el-input
class=
"w-320"
:size=
"size"
v-model=
"spescEditForm.specificationName"
placeholder=
"请输入规格名"
></el-input>
<el-input
class=
"w-320"
:size=
"size"
maxlength=
"10"
v-model=
"spescEditForm.specificationName"
placeholder=
"请输入规格名"
></el-input>
</el-form-item>
<el-form-item
label=
"规格值:"
prop=
"specificationValueList"
>
<el-tag
style=
"margin-right: 10px;"
v-for=
"(tag, i) in spescEditForm.specificationValueList"
:key=
"i"
closable
:type=
"tag.type"
@
close=
"handleSpescDelete(tag)"
>
{{ tag.specificationValue }}
</el-tag>
<el-input
class=
"input-new-tag"
v-if=
"specsInputVisible"
v-model=
"spescInputVal"
ref=
"saveSpescInput"
:size=
"size"
@
keyup
.
enter
.
native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
></el-input>
<el-input
class=
"input-new-tag"
v-if=
"specsInputVisible"
v-model=
"spescInputVal"
ref=
"saveSpescInput"
maxlength=
"30"
:size=
"size"
@
keyup
.
enter
.
native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
></el-input>
<el-button
v-else
class=
"button-new-tag"
size=
"small"
@
click=
"showInput"
>
+ 规格值
</el-button>
</el-form-item>
</el-form>
...
...
@@ -581,7 +581,7 @@ export default {
},
// 库存
'editForm.goodsStock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
goodsStock
=
limitPrice
(
newValue
,
oldValue
,
10
,
0
,
0
,
10000000000
,
'
n
umReg'
)
this
.
editForm
.
goodsStock
=
limitPrice
(
newValue
,
oldValue
,
10
,
0
,
0
,
10000000000
,
'
zN
umReg'
)
},
// 运费
'editForm.expressFee'
(
newValue
,
oldValue
)
{
...
...
@@ -677,7 +677,7 @@ export default {
if
(
e
.
key
!=
'Backspace'
&&
newValue
.
length
>
1
)
{
oldValue
=
newValue
.
slice
(
0
,
newValue
.
length
-
1
)
}
this
.
nameToValSpecsList
[
idx
].
stock
=
limitPrice
(
newValue
,
oldValue
,
10
,
0
,
0
,
10000000000
,
'
n
umReg'
)
this
.
nameToValSpecsList
[
idx
].
stock
=
limitPrice
(
newValue
,
oldValue
,
10
,
0
,
0
,
10000000000
,
'
zN
umReg'
)
},
// 二次确认
secondSimpleConfirm
(
title
,
txt
,
fn
)
{
...
...
@@ -807,9 +807,9 @@ export default {
handleInputConfirm
()
{
let
spescInputVal
=
this
.
spescInputVal
if
(
this
.
spescEditForm
.
specificationValueList
.
length
==
8
)
{
if
(
this
.
spescEditForm
.
specificationValueList
.
length
==
20
)
{
this
.
$message
({
message
:
'规格值最多不能超过
8
个'
,
message
:
'规格值最多不能超过
20
个'
,
type
:
'error'
,
customClass
:
'message-Z-zinde'
})
...
...
@@ -1031,7 +1031,7 @@ export default {
if
(
i
==
1
)
{
for
(
var
j
=
0
;
j
<
this
.
nameToValSpecsList
.
length
;
j
++
)
{
var
item
=
this
.
nameToValSpecsList
[
j
]
if
(
!
item
.
retailPrice
||
!
item
.
stock
)
{
if
(
!
item
.
retailPrice
||
!
(
item
.
stock
+
''
)
)
{
this
.
whereToGo
(
'specificationDetailList'
)
isJump
=
true
break
...
...
src/views/productGroup/index.vue
View file @
3dbf241
...
...
@@ -114,6 +114,7 @@ export default {
{
label
:
'浏览量(次)'
,
name
:
'goodsStatistics'
,
width
:
'180'
,
formatter
:
cellValue
=>
{
return
cellValue
.
goodsStatistics
?
cellValue
.
goodsStatistics
.
viewAmount
||
'0'
:
'0'
}
...
...
@@ -128,6 +129,7 @@ export default {
{
label
:
'零售价(元)'
,
name
:
'retailPrice'
,
width
:
'180'
,
formatter
:
cellValue
=>
{
return
(
cellValue
.
retailPrice
/
100
).
toFixed
(
2
)
}
...
...
src/views/productStore/editProductDh.vue
View file @
3dbf241
...
...
@@ -148,7 +148,7 @@ export default {
this
.
routeInfo
=
this
.
$route
.
params
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
isDisabled
=
this
.
routeInfo
.
addOrEdit
==
3
this
.
editFormData
[
0
].
isDisabled
=
t
rue
this
.
editFormData
[
0
].
isDisabled
=
t
his
.
isDisabled
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
},
...
...
src/views/productStore/index.vue
View file @
3dbf241
...
...
@@ -118,6 +118,7 @@ export default {
{
label
:
'浏览量(次)'
,
name
:
'goodsStatistics'
,
width
:
'180'
,
formatter
:
cellValue
=>
{
return
cellValue
.
goodsStatistics
?
cellValue
.
goodsStatistics
.
viewAmount
||
'0'
:
'0'
}
...
...
@@ -132,6 +133,7 @@ export default {
{
label
:
'零售价(元)'
,
name
:
'retailPrice'
,
width
:
'180'
,
formatter
:
cellValue
=>
{
return
(
cellValue
.
retailPrice
/
100
).
toFixed
(
2
)
}
...
...
src/views/seckillActivity/editActivity.vue
View file @
3dbf241
<!-- 编辑代金券 -->
<
template
>
<div
class=
"edit-share marketing p-t-20"
>
<div
class=
"edit-share marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
秒杀活动
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px
"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth
"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<template
slot=
"activityTimeHtml"
>
<!--
<el-form-item>
-->
<el-date-picker
v-model=
"editForm.activityTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions"
:default-time=
"['00:00:00', '23:59:59']"
:disabled=
"isDisabled"
clearable
>
</el-date-picker>
<!--
</el-form-item>
-->
<!--
<el-form-item>
-->
<el-date-picker
v-model=
"editForm.activityTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions"
:default-time=
"['00:00:00', '23:59:59']"
:disabled=
"isDisabled"
clearable
></el-date-picker>
<!--
</el-form-item>
-->
</
template
>
<div
slot=
"goodsHtml"
>
<el-button
type=
"primary"
v-if=
"apear!='see'"
@
click=
"handleRelateProClose"
>
选择商品
</el-button>
<div
v-if=
"selectedProInfo.id && !specificationDetailList.length"
style=
"margin-top:10px"
>
<p>
<img
class=
"img-60"
:src=
"selectedProInfo.goodsImage"
/>
零售价 {{(selectedProInfo.retailPrice/100).toFixed(2)}}元
商品库存 {{selectedProInfo.goodsStock}}件
</p>
<el-form-item
label=
"设置秒杀价"
prop=
"activityPrice"
>
<el-input
v-model=
"editForm.activityPrice"
style=
"width: 150px"
:disabled=
"isDisabled"
><span
slot=
"append"
>
元
</span></el-input>
</el-form-item>
<el-form-item
label=
"活动库存"
prop=
"goodsStock"
>
<el-input
v-model=
"editForm.goodsStock"
style=
"width: 150px"
:disabled=
"isDisabled"
><span
slot=
"append"
>
件
</span></el-input>
</el-form-item>
</div>
<div
v-if=
"specificationDetailList.length"
class=
"flex"
style=
"margin-top: 20px;"
id=
"specificationDetailList"
>
<span
class=
"spesc-label"
:style=
"{ width: labelWidth }"
>
规格明细:
</span>
<div
style=
"width: calc(100% - 100px);"
>
<table
class=
"table-spesc"
>
<tbody>
<tr>
<td
:style=
"{ width: specsWidth }"
v-for=
"(subItem, subIndex) in specificationDetailList"
:key=
"subIndex"
>
{{ subItem.specificationName }}
</td>
<td
:style=
"{ width: specsWidth }"
>
零售价(元)
</td>
<td
:style=
"{ width: specsWidth }"
>
库存
</td>
<td
:style=
"{ width: specsWidth }"
>
设置秒杀价
</td>
<td
:style=
"{ width: specsWidth }"
>
活动库存
</td>
</tr>
</tbody>
</table>
<table
class=
"table-spesc"
style=
"max-height: 400px;"
>
<tbody>
<tr
style=
"border-bottom: 1px solid rgb(235, 235, 235);"
v-for=
"(item, index) in nameToValSpecsList"
:key=
"index"
>
<td
:style=
"{ width: specsWidth }"
v-for=
"(n, idx) in item.specsValueList"
:key=
"idx"
>
{{ n }}
</td>
<td
:style=
"{ width: specsWidth }"
>
{{ item.retailPrice }}元
</td>
<td
:style=
"{ width: specsWidth }"
>
{{ item.stock }}件
</td>
<!-- <td :style="{ width: specsWidth }">
<el-button
type=
"primary"
v-if=
"apear != 'see'"
@
click=
"handleRelateProClose"
>
选择商品
</el-button>
<div
v-if=
"selectedProInfo.id && !specificationDetailList.length"
style=
"margin-top:10px"
>
<p>
<img
class=
"img-60"
:src=
"selectedProInfo.goodsImage"
/>
零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元
商品库存 {{ selectedProInfo.goodsStock }}件
</p>
<el-form-item
label=
"设置秒杀价"
prop=
"activityPrice"
>
<el-input
v-model=
"editForm.activityPrice"
style=
"width: 150px"
:disabled=
"isDisabled"
><span
slot=
"append"
>
元
</span></el-input>
</el-form-item>
<el-form-item
label=
"活动库存"
prop=
"goodsStock"
>
<el-input
v-model=
"editForm.goodsStock"
style=
"width: 150px"
:disabled=
"isDisabled"
><span
slot=
"append"
>
件
</span></el-input>
</el-form-item>
</div>
<div
v-if=
"specificationDetailList.length"
class=
"flex"
style=
"margin-top: 20px;"
id=
"specificationDetailList"
>
<span
class=
"spesc-label"
:style=
"{ width: labelWidth }"
>
规格明细:
</span>
<div
style=
"width: calc(100% - 100px);"
>
<table
class=
"table-spesc"
>
<tbody>
<tr>
<td
:style=
"{ width: specsWidth }"
v-for=
"(subItem, subIndex) in specificationDetailList"
:key=
"subIndex"
>
{{ subItem.specificationName }}
</td>
<td
:style=
"{ width: specsWidth }"
>
零售价(元)
</td>
<td
:style=
"{ width: specsWidth }"
>
库存
</td>
<td
:style=
"{ width: specsWidth }"
>
设置秒杀价
</td>
<td
:style=
"{ width: specsWidth }"
>
活动库存
</td>
</tr>
</tbody>
</table>
<table
class=
"table-spesc"
:style=
"{ 'max-height': '400px', 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }"
>
<tbody>
<tr
style=
"border-bottom: 1px solid rgb(235, 235, 235);"
v-for=
"(item, index) in nameToValSpecsList"
:key=
"index"
>
<td
:style=
"{ width: specsWidth }"
v-for=
"(n, idx) in item.specsValueList"
:key=
"idx"
>
{{ n }}
</td>
<td
:style=
"{ width: specsWidth }"
>
{{ item.retailPrice }}元
</td>
<td
:style=
"{ width: specsWidth }"
>
{{ item.stock }}件
</td>
<!-- <td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" :class="{ 'border-red': (!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted }" placeholder="零售价" v-model="item.retailPrice" @input.native="e => handleInput(e, index)">
<el-popover v-show="(!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="!(item.retailPrice + '') ? '零售价是必填项' : '零售价要大于供货价'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td> -->
<td
:style=
"{ width: specsWidth }"
>
<el-input
:disabled=
"isDisabled"
placeholder=
"秒杀价"
v-model=
"item.activityPrice"
@
input=
"item.activityPrice = activityPrice_input($event,
item.retailPrice)"
>
<!-- <span slot="append">元</span> -->
</el-input>
</td>
<td
:style=
"{ width: specsWidth }"
>
<el-input
:disabled=
"isDisabled"
placeholder=
"活动库存"
v-model=
"item.goodsStock"
@
input=
"item.goodsStock = goodsStock_input($event,
item.stock)"
>
<!-- <span slot="append">件</span> -->
</el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- <glsx-combi-form v-if="!specificationDetailList.length" class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> -->
<td
:style=
"{ width: specsWidth }"
>
<el-input
:disabled=
"isDisabled"
placeholder=
"秒杀价"
v-model=
"item.activityPrice"
@
input=
"item.activityPrice = activityPrice_input($event,
item.retailPrice)"
>
<!-- <span slot="append">元</span> -->
</el-input>
</td>
<td
:style=
"{ width: specsWidth }"
>
<el-input
:disabled=
"isDisabled"
placeholder=
"活动库存"
v-model=
"item.goodsStock"
@
input=
"item.goodsStock = goodsStock_input($event,
item.stock)"
>
<!-- <span slot="append">件</span> -->
</el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- <glsx-combi-form v-if="!specificationDetailList.length" class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> -->
</div>
</glsx-combi-form>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"default"
v-if=
"apear
!=
'see'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'see'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'see'"
@
click=
"handleCancel"
>
返回
</el-button>
<el-button
type=
"default"
v-if=
"apear
!=
'see'"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
v-if=
"apear
!=
'see'"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"default"
v-if=
"apear
==
'see'"
@
click=
"handleCancel"
>
返回
</el-button>
</div>
<select-single-pro-dialog
v-if=
"isSingleSelectVisible"
:isSingleSelectVisible=
"isSingleSelectVisible"
:selectedProInfo=
"selectedProInfo"
@
handleSingleSelectConfirm=
"handleSingleSelectConfirm"
@
handleSingleSelectClose=
"handleSingleSelectClose"
></select-single-pro-dialog>
</div>
...
...
@@ -106,9 +93,11 @@ export default {
footerLeft
:
'0'
,
footerWidth
:
'0'
,
editChildRef
:
'editChildRef'
,
labelWidth
:
'140px'
,
pickerOptions
:
{
disabledDate
(
v
)
{
//禁用当前之前的日期
return
v
.
getTime
()
<
new
Date
().
getTime
()
-
86400000
;
disabledDate
(
v
)
{
//禁用当前之前的日期
return
v
.
getTime
()
<
new
Date
().
getTime
()
-
86400000
}
},
routeInfo
:
{
...
...
@@ -137,7 +126,7 @@ export default {
activityTime
:
[],
activityPrice
:
''
,
goodsStock
:
''
,
goodsId
:
''
goodsId
:
''
},
//商品列表
tableParams
:
{
...
...
@@ -170,7 +159,7 @@ export default {
activityTime
:
[{
required
:
true
,
message
:
'活动时间不能为空'
,
trigger
:
'change'
}],
activityPrice
:
[{
required
:
true
,
message
:
'请设置秒杀价'
,
trigger
:
'change'
}],
goodsStock
:
[{
required
:
true
,
message
:
'请设置活动库存'
,
trigger
:
'change'
}],
goodsId
:
[{
required
:
true
,
message
:
'请选择商品'
,
trigger
:
[
'change'
,
'blur'
]
}]
,
goodsId
:
[{
required
:
true
,
message
:
'请选择商品'
,
trigger
:
[
'change'
,
'blur'
]
}]
},
editFormData
:
[
{
...
...
@@ -178,7 +167,7 @@ export default {
name
:
'activityName'
,
width
:
'320px'
,
type
:
'input'
,
maxlength
:
20
,
maxlength
:
20
},
{
label
:
'活动宣传图'
,
...
...
@@ -213,7 +202,7 @@ export default {
label
:
'商品'
,
name
:
'goodsId'
,
addHtml
:
'goodsHtml'
}
,
}
]
}
},
...
...
@@ -227,34 +216,33 @@ export default {
var
id
=
this
.
routeInfo
.
id
var
addOrEdit
=
this
.
routeInfo
.
addOrEdit
if
(
id
)
{
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'see'
;
this
.
title
=
'查看'
;
if
(
addOrEdit
==
3
)
{
this
.
apear
=
'see'
this
.
title
=
'查看'
this
.
isDisabled
=
true
this
.
editFormData
[
0
].
isDisabled
=
true
this
.
editFormData
[
1
].
isDisabled
=
true
this
.
editFormData
[
2
].
isDisabled
=
true
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'edit'
;
this
.
title
=
'编辑'
;
}
else
if
(
addOrEdit
==
2
)
{
this
.
apear
=
'edit'
this
.
title
=
'编辑'
}
}
else
{
this
.
apear
=
'add'
;
this
.
title
=
'创建'
;
this
.
apear
=
'add'
this
.
title
=
'创建'
}
},
watch
:
{
'editForm.activityPrice'
(
newValue
,
oldValue
){
this
.
editForm
.
activityPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
,
0
,
this
.
selectedProInfo
.
retailPrice
/
100
)
'editForm.activityPrice'
(
newValue
,
oldValue
)
{
this
.
editForm
.
activityPrice
=
limitPrice
(
newValue
,
oldValue
,
5
,
2
,
0
,
this
.
selectedProInfo
.
retailPrice
/
100
)
},
'editForm.goodsStock'
(
newValue
,
oldValue
){
'editForm.goodsStock'
(
newValue
,
oldValue
)
{
this
.
editForm
.
goodsStock
=
limitPrice
(
newValue
,
oldValue
,
5
,
0
,
0
,
this
.
selectedProInfo
.
goodsStock
)
}
},
methods
:
{
limitPriceForInput
(
val
,
intergerDigit
,
pointDigit
,
minValue
,
maxValue
,
regRule
)
{
var
_regRule
=
regRule
||
'priceReg'
// if (val && (minValue && (val < minValue)) || (maxValue && (val > maxValue))) {
...
...
@@ -262,12 +250,12 @@ export default {
// return maxValue ? maxValue : (minValue?minValue:'')
// }
if
(
val
&&
this
.
reg
[
_regRule
].
test
(
val
+
''
))
{
maxValue
=
typeof
(
maxValue
)
==
'string'
?
parseFloat
(
maxValue
):
maxValue
minValue
=
typeof
(
minValue
)
==
'string'
?
parseFloat
(
minValue
):
minValue
if
(
val
&&
(
minValue
&&
(
val
<
minValue
))
||
(
maxValue
&&
(
val
>
maxValue
)
))
{
return
maxValue
?
maxValue
:
(
minValue
?
minValue
:
''
)
maxValue
=
typeof
maxValue
==
'string'
?
parseFloat
(
maxValue
)
:
maxValue
minValue
=
typeof
minValue
==
'string'
?
parseFloat
(
minValue
)
:
minValue
if
(
(
val
&&
minValue
&&
val
<
minValue
)
||
(
maxValue
&&
val
>
maxValue
))
{
return
maxValue
?
maxValue
:
minValue
?
minValue
:
''
}
if
(
(
/
\.
/
)
.
test
(
val
))
{
if
(
/
\.
/
.
test
(
val
))
{
val
=
val
+
''
var
interger
=
val
.
split
(
'.'
)[
0
]
var
point
=
val
.
split
(
'.'
)[
1
]
...
...
@@ -297,7 +285,7 @@ export default {
// this.editForm.goodsName = selectedProInfo.goodsName
// this.editForm.goodsImage = selectedProInfo.goodsImage
this
.
handleSingleSelectClose
()
if
(
selectedProInfo
)
{
if
(
selectedProInfo
)
{
this
.
editForm
.
goodsId
=
selectedProInfo
.
id
this
.
getGoodInfo
(
selectedProInfo
.
id
)
}
...
...
@@ -325,12 +313,12 @@ export default {
// this.mainImgUrl = this.editForm.goodsDetailImageList[0].content
// this.moveNum = this.editForm.goodsDetailImageList.length > 4 ? this.editForm.goodsDetailImageList.length - 4 : 0
this
.
selectedProInfo
=
this
.
$common
.
utils
.
deepClone
(
res
)
console
.
log
(
this
.
selectedProInfo
)
;
if
(
this
.
selectedProInfo
.
specificationDetailList
.
length
)
{
console
.
log
(
this
.
selectedProInfo
)
if
(
this
.
selectedProInfo
.
specificationDetailList
.
length
)
{
// this.specificationDetailList = this.$common.utils.deepClone(res.specificationList)
this
.
specificationDetailList
=
this
.
selectedProInfo
.
specificationList
this
.
recoverySpec
()
}
else
{
}
else
{
this
.
nameToValSpecsList
=
[]
this
.
specificationDetailList
=
[]
}
...
...
@@ -394,11 +382,11 @@ export default {
}
}
if
(
this
.
activityInfo
&&
this
.
activityInfo
.
specificationDetailWithGoodsList
)
{
if
(
this
.
activityInfo
&&
this
.
activityInfo
.
specificationDetailWithGoodsList
)
{
for
(
var
k
=
0
;
k
<
this
.
activityInfo
.
specificationDetailWithGoodsList
.
length
;
k
++
)
{
var
templ
=
this
.
activityInfo
.
specificationDetailWithGoodsList
[
k
]
if
(
templ
.
specificationData
==
item
.
specificationData
)
{
item
.
activityPrice
=
(
templ
.
retailPrice
/
100
).
toFixed
(
2
)
item
.
activityPrice
=
(
templ
.
retailPrice
/
100
).
toFixed
(
2
)
item
.
goodsStock
=
templ
.
stock
break
}
...
...
@@ -407,7 +395,6 @@ export default {
})
}
// console.log(this.nameToValSpecsList);
},
setLocaleCompare
(
params
)
{
let
keys
=
[]
...
...
@@ -427,13 +414,13 @@ export default {
},
//规格-秒杀价输入控制
activityPrice_input
(
val
,
maxValue
)
{
return
this
.
limitPriceForInput
(
val
,
5
,
2
,
0
,
maxValue
)
activityPrice_input
(
val
,
maxValue
)
{
return
this
.
limitPriceForInput
(
val
,
5
,
2
,
0
,
maxValue
)
},
//规格-活动库存输入控制
goodsStock_input
(
val
,
maxValue
)
{
return
this
.
limitPriceForInput
(
val
,
5
,
0
,
0
,
maxValue
)
goodsStock_input
(
val
,
maxValue
)
{
return
this
.
limitPriceForInput
(
val
,
5
,
0
,
0
,
maxValue
)
},
getInfo
()
{
...
...
@@ -444,20 +431,20 @@ export default {
form
.
activityName
=
info
.
activityName
form
.
activityImg
=
info
.
activityImg
form
.
promotion
=
info
.
promotion
form
.
activityTime
=
[
info
.
startTime
,
info
.
endTime
]
form
.
activityTime
=
[
info
.
startTime
,
info
.
endTime
]
this
.
getGoodInfo
(
info
.
goodsId
)
if
(
info
.
activityPrice
!=
null
&&
info
.
goodsStock
!=
null
)
{
form
.
activityPrice
=
(
info
.
activityPrice
/
100
).
toFixed
(
2
)
if
(
info
.
activityPrice
!=
null
&&
info
.
goodsStock
!=
null
)
{
form
.
activityPrice
=
(
info
.
activityPrice
/
100
).
toFixed
(
2
)
form
.
goodsStock
=
info
.
goodsStock
}
})
},
validateRules
(){
if
(
this
.
specificationDetailList
.
length
)
{
validateRules
()
{
if
(
this
.
specificationDetailList
.
length
)
{
this
.
editRule
.
activityPrice
[
0
].
required
=
false
this
.
editRule
.
goodsStock
[
0
].
required
=
false
}
else
{
}
else
{
this
.
editRule
.
activityPrice
[
0
].
required
=
true
this
.
editRule
.
goodsStock
[
0
].
required
=
true
}
...
...
@@ -467,36 +454,36 @@ export default {
var
_this
=
this
var
param
=
this
.
editForm
// param.activityPrice = (param.activityPrice*100).toFixed(2) //存的分,需乘100
param
.
activityPrice
=
param
.
activityPrice
*
100
//存的分,需乘100
if
(
this
.
routeInfo
.
id
)
{
param
.
activityPrice
=
param
.
activityPrice
*
100
//存的分,需乘100
if
(
this
.
routeInfo
.
id
)
{
param
.
id
=
this
.
routeInfo
.
id
}
const
d
=
param
.
activityTime
if
(
d
&&
d
.
length
>
0
)
{
param
.
startTime
=
d
[
0
]
;
param
.
endTime
=
d
[
1
]
;
param
.
startTime
=
d
[
0
]
param
.
endTime
=
d
[
1
]
}
param
.
goodsId
=
this
.
selectedProInfo
.
id
if
(
this
.
nameToValSpecsList
.
length
>
0
)
{
if
(
this
.
nameToValSpecsList
.
length
>
0
)
{
delete
param
.
activityPrice
delete
param
.
goodsStock
param
.
specificationDetailList
=
[]
this
.
nameToValSpecsList
.
forEach
(
function
(
item
)
{
this
.
nameToValSpecsList
.
forEach
(
function
(
item
)
{
var
obj
=
{
// retailPrice : (item.activityPrice*100).toFixed(0), //存的分,需乘100
retailPrice
:
item
.
activityPrice
*
100
,
//存的分,需乘100
stock
:
item
.
goodsStock
,
specificationData
:
item
.
specificationData
,
specificationKey
:
item
.
specificationKey
// retailPrice : (item.activityPrice*100).toFixed(0), //存的分,需乘100
retailPrice
:
item
.
activityPrice
*
100
,
//存的分,需乘100
stock
:
item
.
goodsStock
,
specificationData
:
item
.
specificationData
,
specificationKey
:
item
.
specificationKey
}
if
(
_this
.
routeInfo
.
id
)
{
if
(
_this
.
routeInfo
.
id
)
{
obj
.
activityId
=
_this
.
routeInfo
.
id
}
param
.
specificationDetailList
.
push
(
obj
)
})
}
return
param
;
return
param
},
handleConfirm
()
{
...
...
@@ -509,39 +496,39 @@ export default {
// })
// flag = false
// }
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
var
list
=
this
.
nameToValSpecsList
for
(
var
key
=
0
;
key
<
list
.
length
;
key
++
)
{
var
item
=
list
[
key
]
if
(
!
item
.
activityPrice
){
this
.
$message
({
message
:
'有未设置秒杀价的项'
,
type
:
'error'
})
flag
=
false
break
}
if
(
!
item
.
goodsStock
){
this
.
$message
({
message
:
'有未设置活动库存的项'
,
type
:
'error'
})
flag
=
false
break
}
var
item
=
list
[
key
]
if
(
!
item
.
activityPrice
)
{
this
.
$message
({
message
:
'有未设置秒杀价的项'
,
type
:
'error'
})
flag
=
false
break
}
if
(
!
item
.
goodsStock
)
{
this
.
$message
({
message
:
'有未设置活动库存的项'
,
type
:
'error'
})
flag
=
false
break
}
}
}
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
!
flag
)
{
if
(
!
flag
)
{
return
false
}
var
params
=
this
.
getCouponInfoParams
()
console
.
log
(
params
)
;
console
.
log
(
params
)
this
.
$apis
.
seckillActivity
.
addOrUpdateActivityApi
(
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
(
res
.
message
?
res
.
message
:
'操作失败'
)
,
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
?
res
.
message
:
'操作失败'
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
})
if
(
res
.
code
==
'0'
)
{
...
...
src/views/zoneList/editZone.vue
View file @
3dbf241
<!-- 编辑专区 -->
<
template
>
<div
class=
"edit-zone marketing p-t-20"
>
<div
class=
"edit-zone marketing p-t-20
edit-box
"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container
"
ref=
"editFormRef"
labelWidth=
"140px
"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"edit-form-container
m-r-20"
ref=
"editFormRef"
:labelWidth=
"labelWidth
"
defaultWidth=
"320px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<div
slot=
"selectMerchant"
slot-scope=
"scope"
class=
"select-merchant"
>
<el-button
type=
"
primary"
@
click=
"handleRelateStoreClose(scope)"
>
{{
editForm
.
merchantList
.
length
?
'更换'
:
'请选择
'
}}
</el-button>
<el-button
type=
"
default"
@
click=
"handleRelateStoreClose(scope)"
>
{{
editForm
.
merchantList
.
length
?
'更换门店'
:
'+选择门店
'
}}
</el-button>
</div>
<div
slot=
"merchantTable"
class=
"select-merchant
"
>
<div
slot=
"merchantTable"
:style=
"
{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }
">
<GLTable
v-show=
"editForm.merchantList.length"
ref=
"warehousListRef"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.merchantList"
>
<span
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleMerchantDelete(scope)"
>
删除
</el-button>
...
...
@@ -57,6 +57,7 @@ export default {
addOrEdit
:
1
,
id
:
''
},
labelWidth
:
'140px'
,
editForm
:
{
// 专区类型(1发现频道,2商城专区)
zoneType
:
'2'
,
...
...
@@ -98,7 +99,7 @@ export default {
addHtml
:
'selectMerchant'
},
{
// label: '
门店
',
// label: '',
name
:
''
,
addHtml
:
'merchantTable'
}
...
...
src/views/zoneList/index.vue
View file @
3dbf241
...
...
@@ -19,9 +19,6 @@
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleEdit(2, scope.scope)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
删除
</el-button>
<!--
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
隐藏
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
显示
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
置顶
</el-button>
-->
</div>
</GLTable>
<!-- 表格区域 end -->
...
...
@@ -75,10 +72,6 @@ export default {
return
dayjs
(
cellValue
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
}
// {
// label: '专区来源',
// prop: ''
// }
]
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
}
...
...
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