| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- <style>
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>核销收益</span>
- </div>
- <div class="container">
- <template v-for="val in topData">
- <div class="item">
- <el-skeleton :rows="3" :animated="true" :loading="topDataLoading">
- <p class="num">{{val.value}}</p>
- <p class="title">{{val.text}}</p>
- </el-skeleton>
- </div>
- </template>
- </div>
- <div class="search-box">
- <!-- 搜索 -->
- <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
- <el-form-item label="使用时间">
- <el-date-picker size="small" v-model="searchForm.usage_time" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="使用者会员ID">
- <el-input placeholder="会员ID" v-model="searchForm.user_id"></el-input>
- </el-form-item>
- <el-form-item label="使用者会员昵称">
- <el-input placeholder="昵称/手机号" v-model="searchForm.user_name"></el-input>
- </el-form-item>
- <el-form-item label="核销员ID">
- <el-input placeholder="核销员ID" v-model="searchForm.clerk_user_id"></el-input>
- </el-form-item>
- <el-form-item label="核销员会员昵称">
- <el-input placeholder="昵称/手机号" v-model="searchForm.check_user_name"></el-input>
- </el-form-item>
- <el-form-item label="电子券名称">
- <el-input placeholder="请输入电子券名称" v-model="searchForm.e_coupon_name"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toSearch">搜索</el-button>
- <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table-body">
- <el-tabs v-model="activeName">
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
- <el-table-column prop="id" min-width="30" label="ID" align="center"></el-table-column>
- <el-table-column label="会员">
- <template slot-scope="scope">
- <div class="user_img" flex="cross:center">
- <el-image class="default-avatar" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
- </div>
- </el-image>
- <div class="uer-nickname over1" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div class="uer-nickname over1" v-else>ID:{{scope.row.user_id}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="e_coupon_id" label="电子券ID" align="center"></el-table-column>
- <el-table-column prop="e_coupon_name" label="电子券名称" align="center"></el-table-column>
- <el-table-column prop="num" label="兑换数量" align="center"></el-table-column>
- <el-table-column label="电话" prop="mobile"></el-table-column>
- <el-table-column label="使用者" min-width="120">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;">
- <el-image fit="cover" :src="scope.row.user.avatar_url ? scope.row.user.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
- <div>
- <div>{{scope.row.user.nickname}}</div>
- <div>ID {{scope.row.user.id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="专有者" min-width="120">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;" v-if="scope.row.proper_user.id">
- <el-image fit="cover" :src="scope.row.proper_user.avatar_url ? scope.row.proper_user.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
- <div>
- <div>{{scope.row.proper_user.nickname}}</div>
- <div>ID {{scope.row.proper_user.id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="核销员" min-width="120">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;" v-if="scope.row.clerk_user.id">
- <el-image fit="cover" :src="scope.row.clerk_user.avatar_url ? scope.row.clerk_user.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
- <div>
- <div>{{scope.row.clerk_user.nickname}}</div>
- <div>ID {{scope.row.clerk_user.id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="核销金额" prop="amount"></el-table-column>
- <el-table-column label="核销收益" prop="income"></el-table-column>
- <el-table-column label="核销时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- </el-tabs>
- <div flex="box:last cross:center">
- <div></div>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- searchForm: {
- user_id: '',
- user_name: '', //会员昵称/手机号
- store_id: 0,
- usage_time: '',
- e_coupon_name: null,
- check_user_name: null,
- clerk_user_id: '',
- },
- store_id: 0,
- list: [],
- pageCount: 0,
- edit_visible: false,
- loading: false,
- activeName: '-1',
- page: 1,
- topData: {
- total_time: {
- value: 0,
- text: "核销次数",
- },
- total_amount: {
- value: 0,
- text: "已核销金额",
- },
- total_income: {
- value: 0,
- text: "收益总额",
- },
- },
- topDataLoading: true,
- },
- computed: {
- show_clear_search_btn: function() {
- return this.searchForm.usage_time != null ||
- this.searchForm.user_id != null ||
- this.searchForm.check_user_name != null ||
- this.searchForm.user_name != null ||
- this.searchForm.e_coupon_name != null ||
- this.searchForm.clerk_user_id != null
- },
- },
- mounted() {
- this.loadData();
- },
- methods: {
- toSearch() { // 清空查询条件
- this.page = 1;
- this.loadData(this.searchForm);
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.loadData();
- },
- resetSearch() { // 清空查询条件
- this.searchForm.usage_time = ''
- this.searchForm.user_id = ''
- this.searchForm.check_user_name = ''
- this.searchForm.user_name = ''
- this.searchForm.e_coupon_name = ''
- this.searchForm.clerk_user_id = ''
- this.page = 1;
- this.loadData();
- },
- getTopData() {
- let params = {
- r: 'electron-coupon/store-log/get-top-data'
- };
- params = Object.assign(params, this.searchForm);
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- let topData = e.data.data;
- for (index in this.topData) {
- this.topData[index]['value'] = parseFloat(topData[index] ? topData[index] : 0)
- // this.topData[index]['value'] = this.topData[index]['value'].toLocaleString('zh-cn', {
- // minimumFractionDigits: 2,
- // maximumFractionDigits: 2,
- // })
- }
- } else {
- this.$message.error(e.data.msg);
- }
- this.topDataLoading = false;
- }).catch(e => {
- this.topDataLoading = false;
- });
- },
- loadData() {
- let self = this;
- self.loading = true;
- let basic_params = {
- page: self.page,
- };
- let params = Object.assign(basic_params, {});
- params = Object.assign(params, this.searchForm);
- request({
- params: {
- r: 'electron-coupon/store-log/detail'
- },
- method: 'post',
- data: params
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- this.list = e.data.data.page_data.list;
- self.pageCount = e.data.data.page_data.page_count;
- self.getTopData();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- pageChange(page) {
- this.page = page;
- this.loadData();
- },
- },
- created: function() {
- this.searchForm.store_id = getQuery('id');
- },
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- /*.input-item .el-input__inner {*/
- /* border-right: 0;*/
- /*}*/
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- /*border-right: 0;*/
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- /*border-right: 0;*/
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .table1 .el-table__footer-wrapper,
- .table1 .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .user_img {
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .default-avatar {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .container {
- display: grid;
- text-align: center;
- grid-template-columns: repeat(auto-fill, minmax(33.333%, 1fr));
- padding: 5px 0;
- background-color: #fff;
- margin-bottom: 10px;
- }
- .container .item {
- background-color: #E3EFFA;
- margin: 10px;
- padding: 20px 0;
- border-radius: 3px;
- }
- .container .item .num {
- font-size: 22px;
- font-weight: bold;
- margin-bottom: 10px;
- }
- .container .item .title {
- font-size: 16px;
- font-weight: bold;
- }
- </style>
|