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

修改商品报错,bug修复2

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