diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index 710ee3577..67c563479 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -638,6 +638,7 @@ import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable,looklook,looklooklook } from "@/api/EventMarketing/activeConsumption"; import {listUserGrade} from "@/api/staff/user/usergrade"; import {getOilNameList} from "@/api/order/oilnumgun"; +import {updateExchange} from "@/api/EventMarketing/cardExchange"; export default { name: "ActiveConsumption", @@ -1150,17 +1151,25 @@ export default { }); }, handleDeletexia(row){ - getActiveConsumption(row.id).then(response => { - // this.form = response.data; - let data = response.data - data.isonline = 1 - updateActiveConsumption(data).then(response => { - this.$modal.msgSuccess("下线成功"); - this.open = false; - this.getList(); - }); + // getActiveConsumption(row.id).then(response => { + // // this.form = response.data; + // let data = response.data + // data.isonline = 1 + // updateActiveConsumption(data).then(response => { + // this.$modal.msgSuccess("下线成功"); + // this.open = false; + // this.getList(); + // }); + // + // }); - }); + this.$modal.confirm('确定下线此条修改消费有礼活动信息?').then(function() { + return updateActiveConsumption({id:row.id,isonline:1}); + }).then(() => { + this.$modal.msgSuccess("下线成功"); + this.open = false; + this.getList(); + }).catch(() => {}); }, qiyong(row){ if(row.isonline == 1){ diff --git a/fuintAdmin/src/views/EventMarketing/cardExchange/index.vue b/fuintAdmin/src/views/EventMarketing/cardExchange/index.vue index 270db060f..ff9ae54c2 100644 --- a/fuintAdmin/src/views/EventMarketing/cardExchange/index.vue +++ b/fuintAdmin/src/views/EventMarketing/cardExchange/index.vue @@ -186,8 +186,9 @@ - - + + @@ -242,6 +243,8 @@ import { updateExchange, getqueryGoods, exchangeInfo } from '@/api/EventMarketing/cardExchange' +import {delFavorable} from "@/api/EventMarketing/cardFavorable"; +import {getLJGoods} from "@/api/convenienceStore/ljgoods"; export default { name: 'Exchange', @@ -288,6 +291,7 @@ export default { }, // 表单参数 form: {}, + stock:1, // 表单校验 rules: { name: [ @@ -305,9 +309,9 @@ export default { useInstructions: [ { required: true, message: '请输入使用说明', trigger: 'change' } ], - productCount: [ - { required: true, message: '请输入礼品数量', trigger: 'change' } - ], + // productCount: [ + // { required: true, message: '请输入礼品数量', trigger: 'change' } + // ], /*count: [ { required: true, message: '请输入参与次数', trigger: 'change' } ],*/ @@ -326,7 +330,20 @@ export default { change(e){ console.log(e) this.form.giftId = e - + getLJGoods(e).then(res => { + this.form.productCount = res.data.stock + this.stock = res.data.stock + this.$forceUpdate() + console.log(res.data.stock,111,this.form.productCount) + }) + }, + goodsStock(val){ + console.log(val) + this.$forceUpdate() + if (this.form.productCount>this.stock){ + this.form.productCount = this.stock + return + } }, qrcodelook(url) { this.loadingdialog = true @@ -445,20 +462,32 @@ export default { handleXia(row) { let data = row data.isonline = 1 - updateExchange(data).then(res => { - if (res.code == 200) { - this.$message.success('下线成功') - this.getList() - } - }) + // updateExchange(data).then(res => { + // if (res.code == 200) { + // this.$message.success('下线成功') + // this.getList() + // } + // }) + this.$modal.confirm('确定下线此条兑换券信息?').then(function() { + return updateExchange(data); + }).then(() => { + this.$message.success('下线成功') + this.getList() + }).catch(() => {}); }, handleDelete(data){ - delExchange(data.id).then(res => { - if (res.code == 200) { - this.$message.success('删除成功') - this.getList() - } - }) + // delExchange(data.id).then(res => { + // if (res.code == 200) { + // this.$message.success('删除成功') + // this.getList() + // } + // }) + this.$modal.confirm('确定删除此条兑换券信息?').then(function() { + return delExchange(data.id); + }).then(() => { + this.$message.success('删除成功') + this.getList() + }).catch(() => {}); }, /** 上线操作 */