Commit 14f7225b by wuwx

修改服务券显示,优化编辑优惠券屏蔽

1 parent e5ffceb5
...@@ -18,9 +18,9 @@ module.exports = { ...@@ -18,9 +18,9 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn/', // baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/', // baseURL: 'http://192.168.2.42:8064/',
// baseURL: 'http://scrm.dev.glsx.com.cn/', baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -67,11 +67,11 @@ ...@@ -67,11 +67,11 @@
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span> <span class="promptCopy">仅代金券在小程序被客户直接领取,折扣券和兑换券需员工在企微端选择客户发送</span>
</div> </div>
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio> <el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span> <span class="promptCopy">仅能被创建定向礼包时选取</span>
</div> </div>
<div v-if="editForm.useChannel != 1"> <div v-if="editForm.useChannel != 1">
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
...@@ -347,12 +347,7 @@ export default { ...@@ -347,12 +347,7 @@ export default {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
} }
const stockIndex = this.editFormData.findIndex(val => val.name == 'stock') this.editCoupon(['stock', 'couponName', 'anticipatedCost'])
const couponNameIndex = this.editFormData.findIndex(val => val.name == 'couponName')
const anticipatedCostIdx = this.editFormData.findIndex(val => val.name == 'anticipatedCost')
this.editFormData[couponNameIndex].isDisabled = true
this.editFormData[anticipatedCostIdx].isDisabled = true
this.editFormData[stockIndex].isDisabled = true
this.userDisable = true this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
...@@ -461,6 +456,12 @@ export default { ...@@ -461,6 +456,12 @@ export default {
}, },
methods: { methods: {
editCoupon(attribute) {
attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`)
this.editFormData[index].isDisabled = true
})
},
haveChange() { haveChange() {
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime() let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime() let timeStamp = new Date().getTime()
......
...@@ -84,11 +84,11 @@ ...@@ -84,11 +84,11 @@
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span> <span class="promptCopy">仅代金券在小程序被客户直接领取,折扣券和兑换券需员工在企微端选择客户发送</span>
</div> </div>
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio> <el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span> <span class="promptCopy">仅能被创建定向礼包时选取</span>
</div> </div>
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
discountIntensity: [{ required: true, message: '请输入优惠内容', trigger: 'change' }], discountIntensity: [{ required: true, message: '请输入优惠内容', trigger: 'change' }],
useBarriers: [{ required: true, message: '请选择使用限制', trigger: 'change' }], useBarriers: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
full: [{ required: true, message: '请输入金额', trigger: 'blur' }], full: [{ required: true, message: '请输入99999.99以内的金额', trigger: 'blur' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }], effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
...@@ -282,15 +282,7 @@ export default { ...@@ -282,15 +282,7 @@ export default {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
} }
this.isDisabled = true this.editCoupon(['couponName', 'anticipatedCost', 'stock', 'discountIntensity'])
const couponNameIndex = this.editFormData.findIndex(val => val.name == 'couponName')
const anticipatedCostIndex = this.editFormData.findIndex(val => val.name == 'anticipatedCost')
const stockIndex = this.editFormData.findIndex(val => val.name == 'stock')
const discountIndex = this.editFormData.findIndex(val => val.name == 'discountIntensity')
this.editFormData[couponNameIndex].isDisabled = this.isDisabled
this.editFormData[anticipatedCostIndex].isDisabled = this.isDisabled
this.editFormData[stockIndex].isDisabled = this.isDisabled
this.editFormData[discountIndex].isDisabled = this.isDisabled
this.userDisable = true this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
...@@ -345,6 +337,12 @@ export default { ...@@ -345,6 +337,12 @@ export default {
} }
}, },
methods: { methods: {
editCoupon(attribute) {
attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`)
this.editFormData[index].isDisabled = true
})
},
loseFocus() { loseFocus() {
if (this.editForm.full <= 0 || this.editForm.full > 99999.99) { if (this.editForm.full <= 0 || this.editForm.full > 99999.99) {
this.editForm.full = '' this.editForm.full = ''
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 630px; position: relative"> <div class="container edit-container" style="height: 650px; position: relative">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="slider"> <div class="slider">
...@@ -57,11 +57,11 @@ ...@@ -57,11 +57,11 @@
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span> <span class="promptCopy">仅代金券在小程序被客户直接领取,折扣券和兑换券需员工在企微端选择客户发送</span>
</div> </div>
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio> <el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span> <span class="promptCopy">仅能被创建定向礼包时选取</span>
</div> </div>
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
...@@ -227,13 +227,7 @@ export default { ...@@ -227,13 +227,7 @@ export default {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
} }
this.isDisabled = true this.editCoupon(['couponName', 'anticipatedCost', 'stock'])
const couponNameIndex = this.editFormData.findIndex(val => val.name == 'couponName')
const anticipatedCostIndex = this.editFormData.findIndex(val => val.name == 'anticipatedCost')
const stockIndex = this.editFormData.findIndex(val => val.name == 'stock')
this.editFormData[couponNameIndex].isDisabled = this.isDisabled
this.editFormData[anticipatedCostIndex].isDisabled = this.isDisabled
this.editFormData[stockIndex].isDisabled = this.isDisabled
this.userDisable = true this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
...@@ -276,6 +270,12 @@ export default { ...@@ -276,6 +270,12 @@ export default {
}, },
methods: { methods: {
editCoupon(attribute) {
attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`)
this.editFormData[index].isDisabled = true
})
},
haveChange() { haveChange() {
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime() let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime() let timeStamp = new Date().getTime()
......
...@@ -290,13 +290,15 @@ export default { ...@@ -290,13 +290,15 @@ export default {
}, },
limitText() { limitText() {
if (this.ruleForm.customUseLimit == 0) { if (this.ruleForm.customUseLimit == 0) {
return `不限制使用次数` return `不限次数`
} else if (this.ruleForm.customUseLimit == 1) { } else if (this.ruleForm.customUseLimit == 1) {
return `有效期内可使用${this.ruleForm.limitTime1}次` return `有效期内可使用${this.ruleForm.limitTime1}次`
} else if (this.ruleForm.customUseLimit == 2) { } else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType != 3) {
return `有效期内每${this.ruleForm.limitDays}天内可使用${this.ruleForm.limitTime2}次` return `有效期内每${this.ruleForm.limitDays}天内可使用${this.ruleForm.limitTime2}次`
} else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType == 3) {
return '不限次数'
} }
return '不限制使用次数' return '不限次数'
}, },
effectiveRangeText() { effectiveRangeText() {
if (this.ruleForm.effectiveType == 1) { if (this.ruleForm.effectiveType == 1) {
......
...@@ -427,7 +427,7 @@ export default { ...@@ -427,7 +427,7 @@ export default {
}, },
mounted() { mounted() {
this.getCount() // this.getCount()
this.getOptionsList('searchFormData1') this.getOptionsList('searchFormData1')
this.getOptionsList('searchFormData2') this.getOptionsList('searchFormData2')
this.getOptionsList('searchFormData3') this.getOptionsList('searchFormData3')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!