优惠卷弹窗

master
Wangxubin 3 years ago
parent e7ef6de911
commit 6a3e6a11c1

@ -0,0 +1,92 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="1500px">
<el-table :data="list" max-height="800" @row-click="rowClick" v-loading="listLoading" :element-loading-text="elementLoadingText" class="margin-top-xs" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}">
<el-table-column width="30px">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
</el-radio>
</template>
</el-table-column>
<el-table-column label="优惠卷名称"></el-table-column>
<el-table-column label="优惠方式"></el-table-column>
<el-table-column label="优惠限制(是否满减)" width="150px"></el-table-column>
<el-table-column label="优惠金额/折扣"></el-table-column>
<el-table-column label="适用门店"></el-table-column>
<el-table-column label="适用项目"></el-table-column>
<el-table-column label="有效日期(固定)"></el-table-column>
<el-table-column label="是否领取"></el-table-column>
<el-table-column label="领取日期"></el-table-column>
<el-table-column label="领取几天生效"></el-table-column>
<el-table-column label="过期时间"></el-table-column>
</el-table>
<div class="block" style="margin-top:15px;">
<!-- 分页组件 -->
<el-pagination align="left" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryForm.pageNum" :page-sizes="[10,20,30,40,50]" :page-size="queryForm.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="handleEmpty"> </el-button>
<el-button size="mini" type="primary" @click="handleCoupons">
</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props:{
title:{
type:String,
default:"优惠卷"
}
},
data () {
return {
dialogVisible:true,
listLoading:false,
elementLoadingText:"数据加载中",
list:[{id:1},{id:2}],
radio:null,
selectTabArr:[],
total:0,
queryForm: {
pageSize: 10,
pageNum: 1,
},
}
},
methods:{
//
handleEmpty(){
// //
this.dialogVisible = false
this.radio = null
this.selectTabArr = null
},
updataIshow(){
this.dialogVisible = true
},
//
handleCoupons(){
// this.$emit('',this.selectTabArr)
// this.handleEmpty()
},
//
rowClick(row){
this.radio = row.id
this.selectTabArr = [{...row}]
},
//
handleSizeChange(val) {
this.queryForm.pageSize = val;
},
//
handleCurrentChange(val) {
this.queryForm.pageNum = val;
},
},
}
</script>
<style scoped>
</style>

@ -938,28 +938,28 @@ export default {
name: "优惠券",
index: "100",
icon: "el-icon-s-ticket",
number: "1000",
number: "800",
menuLists: [
{
name: "建立",
icon: "el-icon-s-promotion",
route: "/couponIssue",
index: "couponIssue",
number: "1000100",
number: "800100",
},
{
name: "管理",
icon: "el-icon-s-operation",
route: "/couponMane",
index: "couponMane",
number: "1000200",
number: "800200",
},
{
name: "领取消费",
icon: "el-icon-time",
route: "/couponRecord",
index: "couponRecord",
number: "1000300",
number: "800300",
},
],
},

@ -175,11 +175,11 @@ export default {
this.listLoading = false;
if (code == "000000") {
pageInfo.list.forEach(function (item) {
item.forEach(function (items) {
if (items.docType == 'platform_coupon_huizhi') {
item.imgPath = partten.imagePath + items.filePath + '/' + items.fileName
// item.forEach(function (items) {
if (item.docType == 'platform_coupon_huizhi') {
item.imgPath = partten.imagePath + item.filePath + '/' + item.fileName
}
});
// });
});
this.list = Array.from(pageInfo.list);
this.total = pageInfo.total;

@ -295,9 +295,11 @@
<repayment ref="repayment" @repaymentData="inputMember"></repayment>
<addmember ref="addmember"></addmember>
<orders ref="orders"></orders>
<!-- <Coupons ref="Coupons" /> -->
</div>
</template>
<script>
import Coupons from '@/components/Coupons'
import addmember from "@/components/member/edit/index";
import {
selectList,
@ -336,6 +338,7 @@ export default {
repayment,
recash,
orders,
Coupons
},
data() {
return {
@ -393,7 +396,6 @@ export default {
},
methods: {
selectindex(row) {
console.log(row)
},
changeMember() {
if (this.cashNumber == 1) {
@ -506,7 +508,7 @@ export default {
form.discoutMoney =
(form.spendMoney /( form.discount / 100)).toFixed(2) * 1;
} else {
不可以打
//
form.discoutMoney = form.spendMoney;
}
form.discoutGiftMoney=0
@ -546,40 +548,6 @@ export default {
//console.log(num)
this.form.collectionCashAmounts = num;
this.sumNum();
// this.rowRecList.splice(index, 1, form);
// ---------------------------------------------------------------------------------------------------------------
// if (!row.spendMoney) {
// row.spendMoney = 0;
// }
// row.spendMoney = row.spendMoney * 1;
// if (0 <= row.spendMoney * 1 > row.cardOver * 1) {
// this.$message.info({
// message: "!",
// });
// } else {
// this.recIndex = -1;
// if (row.spendMoney * 1 < 0) {
// } else {
// if (this.recForm.noDiscount == 0) {
// row.discoutMoney =
// ((row.spendMoney * 1) / ((row.discount * 1) / 100)).toFixed(2) * 1;
// } else {
// row.discoutMoney = row.spendMoney;
// }
// row.cardOvers =
// (row.cardOver * 1 - row.spendMoney * 1).toFixed(2) * 1;
// row.cardGiftOvers =
// (row.giftConsumeMoney * 1 - row.giftSpendMoney * 1).toFixed(2) * 1;
// }
// if (row.spendMoney == 0) {
// row.discoutGiftMoney = 0;
// }
// }
// let res = { ...row };
// this.rowRecList.splice(index, 1, res);
// this.sumNum();
},
sumNum() {
let spendMoney = 0;
@ -663,7 +631,6 @@ export default {
this.recForm = JSON.parse(JSON.stringify(row));
this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList));
this.editProIndex = row.index;
console.log( this.editProIndex)
},
recashData(v) {
this.list = v.list;
@ -853,7 +820,7 @@ export default {
this.$refs.project.show(this.memberForm);
},
projectData(v) {
//console.log(v);
console.log(v)
if (!v.courseAccountId) {
v.courseAccountId = null;
v.courseProjectId = v.id;
@ -863,6 +830,7 @@ export default {
}
this.setProOne(v);
},
// cashAmount
setProOne(row) {
if (row.courseAccountId == null) {
row.courseMoney = 0;
@ -926,7 +894,6 @@ export default {
numberTimes: 1,
minumumTimes: res.data.minumumTimes,
};
//console.log(form);
this.setRecList(form);
if (this.cashNumber == 1) {
if (row.courseAccountId == null) {
@ -1044,6 +1011,7 @@ export default {
flag = false;
}
let sumMoney = 0;
console.log(this.list)
this.list.forEach((item, index) => {
if (item.courseAccountId == null) {
sumMoney +=
@ -1053,16 +1021,6 @@ export default {
item.collectionIntegralAmount
).toFixed(2) * 1;
}
// if (!(item.sex == 0 || item.sex == 1)) {
// this.$alert("", "", {
// confirmButtonText: "",
// confirmButtonClass: "confirmbtnFalses",
// type: "warning",
// center: true,
// callback: (action) => {},
// });
// flag = false;
// }
});
if (
@ -1189,6 +1147,7 @@ export default {
})
console.log(list)
this.formData.append("cashListRequestList", JSON.stringify(list));
console.log(this.formData)
addCash(this.formData).then((res) => {
if (res.code == "000000") {
this.$message.success({
@ -1244,6 +1203,7 @@ export default {
this.list.push(list);
},
delPro(row) {
console.log('会执行到这里吗');
// this.czRecList(row);
this.list.splice(row.index, 1);
//console.log(row)
@ -1255,29 +1215,6 @@ export default {
});
this.sumAmont()
},
// czRecList(row) {
// let list = [];
// row.rechargeAccountList.forEach((item) => {
// if (item.spendMoney > 0) {
// list.push(item);
// }
// });
// this.recListCopy.forEach((item) => {
// list.forEach((items) => {
// if (item.id == items.id) {
// //console.log(item);
// //console.log(item.giftConsumeMoney);
// //console.log(item.giftSpendMoney);
// item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1;
// item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1;
// item.cardGiftOvers =
// (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
// item.giftConsumeMoney =
// (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
// }
// });
// });
// },
//
openMember() {
this.cashNumber = 1;
@ -1728,6 +1665,7 @@ export default {
}
});
},
// cashAmount
sumAmont() {
let money = 0;
var payMoneys = 0;
@ -1771,11 +1709,10 @@ export default {
}
collectionRechargeAmountg += (item.collectionRechargeAmount).toFixed(2) * 1;
});
console.log(money,collectionRechargeAmountg)
//
this.form.cashAmount = (money.toFixed(2) * 1) + (collectionRechargeAmountg.toFixed(2) * 1)
this.form.collectionCashAmounts = (money.toFixed(2) * 1)
console.log(this.form.collectionCashAmounts)
console.log(this.form.cashAmount)
this.list.forEach((item) => {
if (
this.form.cashAmount == this.form.collectionCashAmount &&

Loading…
Cancel
Save