| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <div id="app" class="contents" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
- <div slot="header">
- <div>
- <span>提成明细</span>
- <div style="float:right;margin:-6px 0px">
- </div>
- </div>
- </div>
- <el-row :gutter="10" style="margin-bottom: 10px">
- <el-col :span="8">
- <el-card shadow="hover">
- <div slot="header">
- 总提成金额
- </div>
- <div>
- ¥<strong style="font-size: 24px">{{total_commission | amount}}</strong>
- </div>
- </el-card>
- </el-col>
- <el-col :span="8">
- <el-card shadow="hover">
- <div slot="header">
- 今日提成金额
- </div>
- <div>
- ¥<strong style="font-size: 24px">{{today_commission | amount}}</strong>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <div class="table-body">
- <el-form size="small" :inline="true" flex="dir:left cross:center">
- <div class="item-box" flex="dir:left cross:center">
- <el-date-picker @change="selectedDateTime" size="small"
- v-model="selectTime" type="daterange" value-format="yyyy-MM-dd"
- range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="padding-left: 10px">
- <el-input size="small" style="width: 200px" v-model="searchData.member" placeholder="请输入会员昵称/ID"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button size="small" type="primary" style="padding: 9px 15px !important;margin-right: 5px; margin-left: 25px;" @click="search">搜索
- </el-button>
- </div>
- <div class="item-box" flex="dir:left cross:center" v-if="searchData.date_start || searchData.date_end || searchData.member">
- <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearch">清除搜索条件
- </el-button>
- </div>
- </el-form>
- <el-table v-loading=" listLoading" :data="list" stripe style="width: 100%">
- <el-table-column label="序号" prop="id" width="100"> </el-table-column>
- <el-table-column label="会员信息" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div style="color:#000;">{{scope.row.user.nickname}}</div>
- <div style="font-size: 12px;">id:{{scope.row.user.id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="提成金额" align="center" width="200">
- <template slot-scope="scope">
- <span>{{scope.row.commission | amount}}</span>
- </template>
- </el-table-column>
- <el-table-column label="提成说明" align="left">
- <template slot-scope="scope">
- <span>{{scope.row.intro}}</span>
- </template>
- </el-table-column>
- <el-table-column label="更新时间" align="center" width="200">
- <template slot-scope="scope">
- {{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <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>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- list: [],
- listLoading: false,
- page: 1,
- level: 1,
- pageCount: 0,
- page_size: 15,
- searchData: {
- date_start: '',
- date_end: '',
- member: ''
- },
- selectTime: [],
- // 导出
- exportList: [],
- statusMap: [],
- today_commission: 0,
- total_commission: 0
- },
- mounted: function() {
- this.getList();
- },
- methods: {
- //搜索
- search() {
- this.page = 1;
- this.getList();
- },
- clearSearch() {
- this.searchData.memeber = '';
- this.searchData.date_end = '';
- this.searchData.date_start = '';
- this.selectTime = [];
- this.getList();
- },
- // 时间搜索触发
- selectedDateTime(params) {
- if (params != null) {
- this.searchData.date_start = params[0];
- this.searchData.date_end = params[1];
- } else {
- this.searchData.date_start = '';
- this.searchData.date_end = '';
- }
- this.getList()
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList() {
- this.listLoading = true;
- request({
- params: {
- r: 'business-activity/commission/index',
- pagesize: 10,
- page: this.page,
- ...this.searchData,
- },
- method: 'get',
- }).then(e => {
- this.listLoading = false;
- if (e.data.code == 0) {
- this.statusMap = e.data.data.status_map;
- this.list = e.data.data.list;
- this.pageCount = e.data.data.page_count;
- this.total_commission = e.data.data.total_commission
- this.today_commission = e.data.data.today_commission
- } else {
- this.$message.error(e.data.msg)
- }
- }).catch(e => {
- console.log(e);
- });
- }
- },
- filters: {
- amount: function(val) {
- return parseFloat(val / 100).toFixed(2)
- }
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px;
- }
- .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;
- }
- /* .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- */
- .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-button--mini.is-circle {
- padding: 3px;
- }
- .contents .el-button+.el-button {
- margin-left: 0px;
- }
- </style>
|