This commit is contained in:
cun-nan 2024-03-08 17:42:10 +08:00
parent 7f990d9b34
commit 5d2a87edb7
2 changed files with 66 additions and 28 deletions

View File

@ -638,6 +638,7 @@
import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable,looklook,looklooklook } from "@/api/EventMarketing/activeConsumption"; 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 {listUserGrade} from "@/api/staff/user/usergrade";
import {getOilNameList} from "@/api/order/oilnumgun"; import {getOilNameList} from "@/api/order/oilnumgun";
import {updateExchange} from "@/api/EventMarketing/cardExchange";
export default { export default {
name: "ActiveConsumption", name: "ActiveConsumption",
@ -1150,17 +1151,25 @@ export default {
}); });
}, },
handleDeletexia(row){ handleDeletexia(row){
getActiveConsumption(row.id).then(response => { // getActiveConsumption(row.id).then(response => {
// this.form = response.data; // // this.form = response.data;
let data = response.data // let data = response.data
data.isonline = 1 // data.isonline = 1
updateActiveConsumption(data).then(response => { // updateActiveConsumption(data).then(response => {
this.$modal.msgSuccess("下线成功"); // this.$modal.msgSuccess("线");
this.open = false; // this.open = false;
this.getList(); // 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){ qiyong(row){
if(row.isonline == 1){ if(row.isonline == 1){

View File

@ -186,8 +186,9 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品数量" prop="productCount"> <el-form-item label="商品数量" prop="productCount" v-if="form.type==0">
<el-input type="number" placeholder="请输入商品数量" v-model="form.productCount"> <el-input placeholder="请输入商品数量" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="form.productCount" :min="0" :max="stock" @input="goodsStock">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -242,6 +243,8 @@ import {
updateExchange, updateExchange,
getqueryGoods, exchangeInfo getqueryGoods, exchangeInfo
} from '@/api/EventMarketing/cardExchange' } from '@/api/EventMarketing/cardExchange'
import {delFavorable} from "@/api/EventMarketing/cardFavorable";
import {getLJGoods} from "@/api/convenienceStore/ljgoods";
export default { export default {
name: 'Exchange', name: 'Exchange',
@ -288,6 +291,7 @@ export default {
}, },
// //
form: {}, form: {},
stock:1,
// //
rules: { rules: {
name: [ name: [
@ -305,9 +309,9 @@ export default {
useInstructions: [ useInstructions: [
{ required: true, message: '请输入使用说明', trigger: 'change' } { required: true, message: '请输入使用说明', trigger: 'change' }
], ],
productCount: [ // productCount: [
{ required: true, message: '请输入礼品数量', trigger: 'change' } // { required: true, message: '', trigger: 'change' }
], // ],
/*count: [ /*count: [
{ required: true, message: '请输入参与次数', trigger: 'change' } { required: true, message: '请输入参与次数', trigger: 'change' }
],*/ ],*/
@ -326,7 +330,20 @@ export default {
change(e){ change(e){
console.log(e) console.log(e)
this.form.giftId = 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) { qrcodelook(url) {
this.loadingdialog = true this.loadingdialog = true
@ -445,20 +462,32 @@ export default {
handleXia(row) { handleXia(row) {
let data = row let data = row
data.isonline = 1 data.isonline = 1
updateExchange(data).then(res => { // updateExchange(data).then(res => {
if (res.code == 200) { // if (res.code == 200) {
this.$message.success('下线成功') // this.$message.success('线')
this.getList() // this.getList()
} // }
}) // })
this.$modal.confirm('确定下线此条兑换券信息?').then(function() {
return updateExchange(data);
}).then(() => {
this.$message.success('下线成功')
this.getList()
}).catch(() => {});
}, },
handleDelete(data){ handleDelete(data){
delExchange(data.id).then(res => { // delExchange(data.id).then(res => {
if (res.code == 200) { // if (res.code == 200) {
this.$message.success('删除成功') // this.$message.success('')
this.getList() // this.getList()
} // }
}) // })
this.$modal.confirm('确定删除此条兑换券信息?').then(function() {
return delExchange(data.id);
}).then(() => {
this.$message.success('删除成功')
this.getList()
}).catch(() => {});
}, },
/** 上线操作 */ /** 上线操作 */