|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="context">
|
|
|
<div class="panel">
|
|
|
- <h5>消费记录1</h5>
|
|
|
+ <h5>消费记录</h5>
|
|
|
<div class="panel-body">
|
|
|
<div class="panel_control">
|
|
|
<el-row :gutter="20">
|
|
|
@@ -11,9 +11,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<em>手机号:</em>
|
|
|
- <el-input v-model="panel.phone" placeholder="请输入手机号" type="number" ></el-input>
|
|
|
+ <el-input v-model="panel.phone" placeholder="请输入手机号" type="number"></el-input>
|
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-col :span="6">
|
|
|
<em>日期:</em>
|
|
|
<el-date-picker
|
|
|
v-model="panel.timeScope"
|
|
|
@@ -34,6 +34,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <em>消费类型:</em>
|
|
|
+ <el-select v-model="panel.CostType">
|
|
|
+ <el-option
|
|
|
+ v-for="item in CostType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus">查询</el-button>
|
|
|
</el-col>
|
|
|
@@ -55,89 +66,161 @@
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="index"
|
|
|
+ width="60dp"
|
|
|
label="序号"
|
|
|
- align="center"
|
|
|
-
|
|
|
- width="50">
|
|
|
+ align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="Name"
|
|
|
label="会员名"
|
|
|
+ min-width="80dp"
|
|
|
+ align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="Phone"
|
|
|
label="手机号"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="ClassName"
|
|
|
label="课程"
|
|
|
- width="110"
|
|
|
+ align="center"
|
|
|
+ min-width="110"
|
|
|
sortable
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<span class="lessons" :style="{ background:scope.row.ClassColor }">{{ scope.row.ClassName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="NormalHour"
|
|
|
- label="消费课时"
|
|
|
- sortable
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="PreNormalhour"
|
|
|
- label="消费前课时"
|
|
|
- sortable
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="充值课时">
|
|
|
+ <el-table-column
|
|
|
+ prop="NormalHour"
|
|
|
+ label="此次消费"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1" style="color:red;"> {{ scope.row.NormalHour }}</span>
|
|
|
+ <span v-else>{{ scope.row.NormalHour }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column-->
|
|
|
+ <!-- prop="PreNormalhour"-->
|
|
|
+ <!-- label="消费前课时"-->
|
|
|
+ <!-- sortable-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column
|
|
|
+ prop="AfterNormalhour"
|
|
|
+ label="消费后"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1" style="color:red;"> {{ scope.row.AfterNormalhour }}</span>
|
|
|
+ <span v-else>{{ scope.row.AfterNormalhour }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="AfterNormalhour"
|
|
|
- label="消费后课时"
|
|
|
- sortable
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="赠送课时">
|
|
|
+ <el-table-column
|
|
|
+ prop="GiftHour"
|
|
|
+ label="此次消费"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1" style="color:red;"> {{ scope.row.GiftHour }}</span>
|
|
|
+ <span v-else>{{ scope.row.GiftHour }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column-->
|
|
|
+ <!-- prop="PreGifthour"-->
|
|
|
+ <!-- label="消费前赠送"-->
|
|
|
+ <!-- sortable-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column
|
|
|
+ prop="AfterGifthour"
|
|
|
+ label="消费后"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1" style="color:red;"> {{ scope.row.AfterGifthour }}</span>
|
|
|
+ <span v-else>{{ scope.row.AfterGifthour }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="GiftHour"
|
|
|
- label="消费赠送"
|
|
|
- sortable
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="PreGifthour"
|
|
|
- label="消费前赠送"
|
|
|
+ label="本店消费"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
sortable
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1"
|
|
|
+ style="color:red;"> {{ scope.row.SelfGiftHour + scope.row.SelfNormalHour }}</span>
|
|
|
+ <span v-else>{{ scope.row.SelfGiftHour + scope.row.SelfNormalHour }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="AfterGifthour"
|
|
|
- label="消费后赠送"
|
|
|
+ label="消费明细"
|
|
|
+ min-width="110dp"
|
|
|
+ align="center"
|
|
|
sortable
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.AcrossConsume == 1" style="color:red;">
|
|
|
+ <el-popover
|
|
|
+ placement="left"
|
|
|
+ title="消费明细"
|
|
|
+ width="450"
|
|
|
+ trigger="click"
|
|
|
+ content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
|
|
|
+ <el-table :data="CostDetail">
|
|
|
+ <el-table-column property="NormalHour" label="正常课时扣费 :"></el-table-column>
|
|
|
+ <el-table-column property="GiftHour" label="赠送课时扣费 :"></el-table-column>
|
|
|
+ <el-table-column property="ShopName" label="课时扣费门店 :"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-button slot="reference" @click="getCostDetail(scope.row.ConId)">查看明细</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="ShopName"
|
|
|
label="所处门店"
|
|
|
+ min-width="170dp"
|
|
|
+ align="center"
|
|
|
sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <!--<el-table-column-->
|
|
|
- <!--prop="RemainHour"-->
|
|
|
- <!--label="是否跨店"-->
|
|
|
- <!--width="110"-->
|
|
|
- <!--sortable-->
|
|
|
- <!-->-->
|
|
|
- <!--<template slot-scope="scope">-->
|
|
|
- <!--<span v-if="scope.row.Status == ''" style="color:red;">跨店</span>-->
|
|
|
- <!--<span v-else style="color: #000">本店用户</span>-->
|
|
|
- <!--</template>-->
|
|
|
- <!--</el-table-column>-->
|
|
|
+ <!--<el-table-column-->
|
|
|
+ <!--prop="RemainHour"-->
|
|
|
+ <!--label="是否跨店"-->
|
|
|
+ <!--min-width="110"-->
|
|
|
+ <!--sortable-->
|
|
|
+ <!-->-->
|
|
|
+ <!--<template slot-scope="scope">-->
|
|
|
+ <!--<span v-if="scope.row.Status == ''" style="color:red;">跨店</span>-->
|
|
|
+ <!--<span v-else style="color: #000">本店用户</span>-->
|
|
|
+ <!--</template>-->
|
|
|
+ <!--</el-table-column>-->
|
|
|
<el-table-column
|
|
|
prop="CreatedAt"
|
|
|
label="时间"
|
|
|
- width="180"
|
|
|
+ min-width="170"
|
|
|
+ align="center"
|
|
|
:formatter="filterFmtDate"
|
|
|
sortable
|
|
|
>
|
|
|
@@ -248,6 +331,7 @@ import {
|
|
|
testTable,
|
|
|
testSelect,
|
|
|
ClassListQuery,
|
|
|
+ VipUserConsumeDetailQuery,
|
|
|
} from "../api/getApiRes";
|
|
|
|
|
|
let qs = require('qs');
|
|
|
@@ -268,6 +352,7 @@ export default {
|
|
|
name: '',
|
|
|
phone: '',
|
|
|
classId: '',
|
|
|
+ CostType: '',
|
|
|
usercode: '',
|
|
|
username: '',
|
|
|
timeScope: globalBt2(7),
|
|
|
@@ -314,6 +399,12 @@ export default {
|
|
|
{value: 1, label: '年会员'},
|
|
|
{value: 2, label: '充值会员'},
|
|
|
],
|
|
|
+ CostType: [
|
|
|
+ {value: "", label: '全部类型'},
|
|
|
+ {value: "1", label: '跨店消费'},
|
|
|
+ {value: "0", label: '本店消费'},
|
|
|
+ ],
|
|
|
+ CostDetail: [],
|
|
|
tableData: []
|
|
|
}
|
|
|
},
|
|
|
@@ -413,14 +504,14 @@ export default {
|
|
|
getSummaries(param) {
|
|
|
const {columns, data} = param;
|
|
|
const sums = [];
|
|
|
+ let that = this;
|
|
|
columns.forEach((column, index) => {
|
|
|
if (index === 0) {
|
|
|
sums[index] = '合计';
|
|
|
return;
|
|
|
}
|
|
|
const values = data.map(item => Number(item[column.property]));
|
|
|
- if (!values.every(value => isNaN(value)) && index != 0 && index != 1 && index != 2 && index != 5 && index != 6
|
|
|
- && index != 8 && index != 9
|
|
|
+ if (!values.every(value => isNaN(value)) && index != 0 && index != 1 && index != 2 && index != 5 && index != 7 && index != 8 && index != 9
|
|
|
) {
|
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
|
const value = Number(curr);
|
|
|
@@ -433,7 +524,15 @@ export default {
|
|
|
sums[index] += '';
|
|
|
sums[index] = parseInt(sums[index]);
|
|
|
} else {
|
|
|
- sums[index] = '';
|
|
|
+ if (index == 8) {
|
|
|
+ let sumTemp = 0
|
|
|
+ that.tableData.forEach((row) => {
|
|
|
+ sumTemp += (parseInt(row.SelfNormalHour) + parseInt(row.SelfGiftHour))
|
|
|
+ })
|
|
|
+ sums[index] = sumTemp
|
|
|
+ } else {
|
|
|
+ sums[index] = '';
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
return sums;
|
|
|
@@ -786,7 +885,7 @@ export default {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
- classType:1//去掉午休
|
|
|
+ classType: 1//去掉午休
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
ClassListQuery(postdata).then(res => {
|
|
|
@@ -864,6 +963,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 查询消费详情
|
|
|
+ getCostDetail(conId) {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ conId: conId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ VipUserConsumeDetailQuery(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+
|
|
|
+ if (json.Code == 0) {
|
|
|
+ if (json.Rs != '') {
|
|
|
+ that.CostDetail = json.Rs;
|
|
|
+ } else {
|
|
|
+ that.CostDetail = [];
|
|
|
+ console.log('getCostDetailResponseNull');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
@@ -900,6 +1024,7 @@ export default {
|
|
|
classId: that.panel.classId,
|
|
|
name: that.panel.name,
|
|
|
phone: that.panel.phone,
|
|
|
+ acrossConsume: that.panel.CostType,
|
|
|
bt: nonTfmtDatetoLength(that.panel.timeScope[0], 10) + ' 00:00:01',
|
|
|
et: nonTfmtDatetoLength(that.panel.timeScope[1], 10) + ' 23:59:59',
|
|
|
start: 1,//
|