Commit 232d624c authored by 邓春圆's avatar 邓春圆

修改商品报错,bug修复2

parent 6d9de9f5
......@@ -221,11 +221,11 @@
<!-- <el-option v-for="item in preferentialList" :value="item.couponId" :label="item.titleZh" :key="item.couponId" :disabled="item.mandatory">{{item.titleZh}}</el-option>-->
<!-- </el-select>-->
<div style="width: 300px;height: 400px;border: 1px solid;overflow-y: auto">
<div @click="selectMoveAbout(item)" style="display: flex;justify-content: space-between; align-items: center;" :style="{'cursor':item.mandatory ? 'no-drop' : 'pointer' }" v-for="item in preferentialList">
<div @click="selectMoveAbout(item)" style="display: flex;justify-content: space-between; align-items: center;" :style="{'cursor':item.mandatory ? 'no-drop' : 'pointer' }" v-for="item in preferentialList" :key="item.couponId" >
<div>
{{$l(item, 'title')}}
</div>
<i v-if="form.couponIds.includes(item.couponId)" style="margin-right: 20px;" class="el-icon-check"></i>
<i v-if="form.couponIds.includes(item.couponId)" style="margin-right: 20px;" class="el-icon-check"></i>
</div>
</div>
</el-form-item>
......@@ -609,9 +609,8 @@ export default {
});
},
selectMoveAbout(val){
console.log(val,'val')
if(!val.mandatory){
let index = this.form.couponIds.findIndex(i => val.couponId == i)
let index = this.form.couponIds.findIndex(i => val.couponId == i)
if(index >= 0){
this.$confirm(this.$t(`您确定要将商品从优惠活动${this.$l(val,'title')}中移出吗?`), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
......@@ -619,6 +618,7 @@ export default {
type: 'warning'
}).then(() => {
this.form.couponIds.splice(index,1)
this.$forceUpdate()
}).catch(() => {
});
......@@ -629,6 +629,7 @@ export default {
type: 'warning'
}).then(() => {
this.form.couponIds.push(val.couponId)
this.$forceUpdate()
}).catch(() => {
});
......
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