Commit be98a03b authored by xd's avatar xd

添加优惠券修改

parent cb89e75f
......@@ -58,15 +58,13 @@ export default {
getDetail() {
let params = {
oyStallCode: this.oyStallCode
}
console.log(this.oyStallCode,'专柜code2');
}
getStoreDetail(params).then(res => {
if(res.data.stallInfo != null) {
this.info = 2
console.log(res,'专柜信息');
this.carousel = res.data.carousel
this.storeInfo = res.data.stallInfo
sessionStorage.setItem("barName", res.data.stallInfo.name)
}else {
this.info = 1
}
......
......@@ -3,6 +3,39 @@
<div>
<div class="title bTitle">优惠券配置</div>
<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;">
<template slot="default">
<van-field
......@@ -13,7 +46,7 @@
/>
</template>
</van-cell>
<van-cell title="优惠券类型" style="font-size:14px;">
<van-cell title="优惠券类型" style="font-size:14px;">
<template slot="default">
<div class="npbr">
<van-field
......@@ -239,8 +272,12 @@ export default {
unitShow: false,
beginDate: '',
endDate: '',
cxsh: '',
cxshShow: false,
//
addForm: {
cxcode: '',
cxsh: '',
name: "",
begin_date: '',
end_date: '',
......@@ -254,26 +291,21 @@ export default {
salesAmount: '',
usageAmount: '',
usageMax: '',
deptId: ''
deptId: '',
cxcode: ''
},
typeList: ['现金券']
typeList: ['现金券'],
storeList: [
{"keyId":'CS',"text":"超市"},
{"keyId":'BG',"text":"百购"},
{"keyId":'BH',"text":"百货"}
]
};
},
mounted() {
this.addForm.deptId = Number(sessionStorage.getItem("oyStallCode"))
// this.addForm.deptId = 3
},
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) {
let year = 1900 + time.getYear();
let month = "0" + (time.getMonth() + 1);
......@@ -306,16 +338,36 @@ export default {
this.typeShow = false
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() {
this.$router.push('coupon')
},
handleSave() {
if(!this.addForm.cxcode ){
this.$toast("请输入欧亚活动编码")
return false
}
if(!this.addForm.cxsh){
this.$toast("请选择商户类型")
return false
}
if(!this.addForm.name ){
this.$toast("请输入优惠券名称")
return false
}
if(!this.addForm.type){
this.$toast("请输入优惠券类型")
this.$toast("请选择优惠券类型")
return false
}
if(!this.addForm.unit){
......@@ -358,9 +410,11 @@ export default {
addCoupon(this.addForm).then(res => {
console.log(res,'res')
if(res.result == 'success') {
this.$router.push('coupon')
}
if(res.errorCode == "fail") {
this.$toast("活动编码不能重复!")
}else {
this.$router.push('coupon')
}
})
}
}
......
......@@ -237,7 +237,7 @@ export default {
this.flag = sessionStorage.getItem('role')
}
}else {
this.zReadyUserId()
// this.zReadyUserId()
this.zTestGetNowUrlInfo()
}
},
......
......@@ -39,6 +39,7 @@
v-model="addForm.oyStallCode"
placeholder="请输入门店Id"
style="width: 50%;"
type='number'
/>
</el-form-item>
<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