Commit be98a03b authored by xd's avatar xd

添加优惠券修改

parent cb89e75f
...@@ -59,14 +59,12 @@ export default { ...@@ -59,14 +59,12 @@ export default {
let params = { let params = {
oyStallCode: this.oyStallCode oyStallCode: this.oyStallCode
} }
console.log(this.oyStallCode,'专柜code2');
getStoreDetail(params).then(res => { getStoreDetail(params).then(res => {
if(res.data.stallInfo != null) { if(res.data.stallInfo != null) {
this.info = 2 this.info = 2
console.log(res,'专柜信息');
this.carousel = res.data.carousel this.carousel = res.data.carousel
this.storeInfo = res.data.stallInfo this.storeInfo = res.data.stallInfo
sessionStorage.setItem("barName", res.data.stallInfo.name)
}else { }else {
this.info = 1 this.info = 1
} }
......
...@@ -3,6 +3,39 @@ ...@@ -3,6 +3,39 @@
<div> <div>
<div class="title bTitle">优惠券配置</div> <div class="title bTitle">优惠券配置</div>
<van-cell-group class="all"> <van-cell-group class="all">
<van-cell title="欧亚活动编码" style="font-size:14px;">
<template slot="default">
<van-field
v-model="addForm.cxcode"
placeholder="请输入欧亚活动编码"
class="right"
style="font-size:14px;"
/>
</template>
</van-cell>
<van-cell title="商户类型" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
class="right"
v-model="cxsh"
placeholder="选择商户类型"
readonly="readonly"
@click="cxshShow = true"
/>
<van-popup v-model="cxshShow" position="bottom" :overlay="true">
<van-picker
show-toolbar
title="商户类型"
:columns="storeList"
@cancel="cxshShow = false"
@confirm="onConfirms"
@change="handleStoreTypeChange"
/>
</van-popup>
</div>
</template>
</van-cell>
<van-cell title="优惠券名称" style="font-size:14px;"> <van-cell title="优惠券名称" style="font-size:14px;">
<template slot="default"> <template slot="default">
<van-field <van-field
...@@ -239,8 +272,12 @@ export default { ...@@ -239,8 +272,12 @@ export default {
unitShow: false, unitShow: false,
beginDate: '', beginDate: '',
endDate: '', endDate: '',
cxsh: '',
cxshShow: false,
// //
addForm: { addForm: {
cxcode: '',
cxsh: '',
name: "", name: "",
begin_date: '', begin_date: '',
end_date: '', end_date: '',
...@@ -254,26 +291,21 @@ export default { ...@@ -254,26 +291,21 @@ export default {
salesAmount: '', salesAmount: '',
usageAmount: '', usageAmount: '',
usageMax: '', usageMax: '',
deptId: '' deptId: '',
cxcode: ''
}, },
typeList: ['现金券'] typeList: ['现金券'],
storeList: [
{"keyId":'CS',"text":"超市"},
{"keyId":'BG',"text":"百购"},
{"keyId":'BH',"text":"百货"}
]
}; };
}, },
mounted() { mounted() {
this.addForm.deptId = Number(sessionStorage.getItem("oyStallCode")) this.addForm.deptId = Number(sessionStorage.getItem("oyStallCode"))
// this.addForm.deptId = 3
}, },
methods: { methods: {
// timeFormat(time) {
// let year = 1900 + time.getYear();
// let month = "0" + (time.getMonth() + 1);
// let date = "0" + time.getDate();
// let hour = time.getHours()
// let minute = time.getMinutes()
// return (
// year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) + " " + hour + ":"+minute
// );
// },
timeFormat(time) { timeFormat(time) {
let year = 1900 + time.getYear(); let year = 1900 + time.getYear();
let month = "0" + (time.getMonth() + 1); let month = "0" + (time.getMonth() + 1);
...@@ -306,16 +338,36 @@ export default { ...@@ -306,16 +338,36 @@ export default {
this.typeShow = false this.typeShow = false
this.addForm.type = val this.addForm.type = val
}, },
// 商户类型确定
onConfirms(val,index) {
this.cxshShow = false
this.cxsh = val.text
this.addForm.cxsh = val.keyId
},
// 商户类型修改
handleStoreTypeChange(picker, value, index) {
this.cxshShow = false
this.cxsh = value.text
this.addForm.cxsh = value.keyId
},
handleCancel() { handleCancel() {
this.$router.push('coupon') this.$router.push('coupon')
}, },
handleSave() { handleSave() {
if(!this.addForm.cxcode ){
this.$toast("请输入欧亚活动编码")
return false
}
if(!this.addForm.cxsh){
this.$toast("请选择商户类型")
return false
}
if(!this.addForm.name ){ if(!this.addForm.name ){
this.$toast("请输入优惠券名称") this.$toast("请输入优惠券名称")
return false return false
} }
if(!this.addForm.type){ if(!this.addForm.type){
this.$toast("请输入优惠券类型") this.$toast("请选择优惠券类型")
return false return false
} }
if(!this.addForm.unit){ if(!this.addForm.unit){
...@@ -358,7 +410,9 @@ export default { ...@@ -358,7 +410,9 @@ export default {
addCoupon(this.addForm).then(res => { addCoupon(this.addForm).then(res => {
console.log(res,'res') console.log(res,'res')
if(res.result == 'success') { if(res.errorCode == "fail") {
this.$toast("活动编码不能重复!")
}else {
this.$router.push('coupon') this.$router.push('coupon')
} }
}) })
......
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
this.flag = sessionStorage.getItem('role') this.flag = sessionStorage.getItem('role')
} }
}else { }else {
this.zReadyUserId() // this.zReadyUserId()
this.zTestGetNowUrlInfo() this.zTestGetNowUrlInfo()
} }
}, },
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
v-model="addForm.oyStallCode" v-model="addForm.oyStallCode"
placeholder="请输入门店Id" placeholder="请输入门店Id"
style="width: 50%;" style="width: 50%;"
type='number'
/> />
</el-form-item> </el-form-item>
<el-form-item label="门店会员id:" prop="oyStallMemberId" v-if="detail == 1"> <el-form-item label="门店会员id:" prop="oyStallMemberId" v-if="detail == 1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment