| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * Created by PhpStorm
- * Author: ganxiaohao
- * Date: 2020-05-13
- * Time: 14:21
- */
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
- ?>
- <style>
- .order_stat{
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title{
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- display: flex;
- justify-content: space-between;
- }
- .order_stat > .title > .time{
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details{
- padding: 30px 0;
- display: flex;
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- </style>
- <div id="app" v-cloak>
- <div class="order_stat">
- <div class="title">
- <span>佣金明细</span>
- <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>
- </div>
- <div class="el-card is-never-shadow" style="border: 0px; min-width: 800px; margin-bottom: 10px;">
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</div>
- <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
- <i class="el-icon-question stat_icon"></i>
- </el-tooltip>
- </div>
- <div class="price">
- {{item.value}}
- </div>
- </div>
- </div>
- </div>
- </div>
- <el-card shadow="never" style="border:0;min-width: 800px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="table-body">
- <!-- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员id" v-model="searchData.user_id" clearable >
- </el-input>
- </div> -->
- <div class="input-item">
- <div flex>
- <div flex="cross:center" class="input-search">
- <div class="input-item-name">结算期数:</div>
- <div>
- <el-input placeholder="请输入结算期数" v-model="searchData.num_text" size="small"></el-input>
- </div>
- </div>
- <div flex="cross:center" class="input-search" style='margin-left:10px;'>
- <div class="input-item-name"> 创建日期:</div>
- <div>
- <el-date-picker style="margin-top: 1px;"
- @change="changeTime"
- v-model="datetime"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- size="small"
- :default-time="['00:00:00', '23:59:59']">
- </el-date-picker>
- </div>
- </div>
- <div flex="cross:center" class="input-search" style='margin-left:10px;'>
- <div class="input-item-name">结算状态:</div>
- <div>
- <el-select v-model="searchData.status" placeholder="请选择" size="small">
- <el-option
- v-for="(item,index) in statusArr"
- :key="index"
- :label="item"
- :value="index">
- </el-option>
- </el-select>
- </div>
- </div>
- <div style="margin-left:30px;margin-top: 0px;">
- <el-button type="primary" size="small" @click="search">搜索</el-button>
- <el-button type="warning" @click="clereSearch" v-if="searchData.num_text || searchData.status || searchData.start || searchData.end" style="padding: 9px 15px !important;">清除搜索条件</el-button>
- </div>
- </div>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading" @selection-change="scFormTab" @sort-change="HandleSortChange">
- <el-table-column type="selection" width="50"></el-table-column>
- <!-- <el-table-column label="ID" prop="id" align="center" width="50"></el-table-column> -->
- <el-table-column label="期数" prop="num" align="center" sortable="custom" ></el-table-column>
- <el-table-column label="业务类型" prop="settle_method" align="center" >
- <template slot-scope="scope">
- <div>{{scope.row.settle_method==0?'积分占比分配':'权重占比分配'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="分红用户数" prop="bonus_num" align="center" sortable="custom"></el-table-column>
- <el-table-column label="结算金额" prop="settle_price" align="center" sortable="custom"></el-table-column>
- <el-table-column label="周期分红池总额" prop="bonus_price" align="center" sortable="custom"></el-table-column>
- <el-table-column label="总权重" prop="total_weight" align="center" sortable="custom"></el-table-column>
- <el-table-column label="周期总积分" prop="total_score" align="center" sortable="custom"></el-table-column>
- <el-table-column label="结算状态" prop="status" align="center">
- <template slot-scope="scope">
- <el-tag effect="plain" type="success" v-if="scope.row.status==1">成功</el-tag>
- <el-tag effect="plain" type="danger" v-if="scope.row.status==0">失败</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="结算时间" prop="created_at" align="center" sortable="custom">
- <template slot-scope="scope">
- {{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
- </template>
- </el-table-column>
- <el-table-column label="结算周期" prop="bonus_circle" align="center" >
- <template slot-scope="scope">
- {{ bonusCircleData[scope.row.bonus_circle] }}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button type="text" @click="handle('check',scope.row)">查看</el-button>
- <!-- <el-button type="text" @click="handle('delete',scope.row)">删除</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 批量操作和分页-->
- <el-col :span="24" class="toolbar">
- <el-input v-model="page" placeholder="" size="small" @keyup.enter.native="pageSearch" style="width:50px; margin-top: 100px; float: right; text-align: center; margin-top: 15px; padding: 0;"></el-input>
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="pageChange"
- :page-size="pageSize"
- :current-page="currentPage"
- :total="pagination.totalCount"
- style="float:right;margin-top:15px; margin-bottom: 50px;"
- v-if="pagination">
- </el-pagination>
- </el-col>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- start: null,
- end: null,
- num_text: null,
- status: null,
- orderBy: null,
- id_str: '',
- },
- datetime: [],
- export_url: 'score-bonus/default/index',
- exportList:{},
- statusArr:{
- 0: '失败',
- 1: '成功',
- },
- form: [],
- bonusCircleData:{},
- selFormArr: [],
- page:1,
- pagination: null,
- listLoading: false,
- orderTotalArr: [
- {
- type: 'bonus_price',
- name: '本期分红池总额',
- value: '0.00',
- prompt: '分红池金额:营业额*N%=分红池金额',
- },{
- type: 'total_score',
- name: '当前总积分额',
- value: '0.00',
- prompt: '平台总积分',
- },
- // {
- // type: 'settled_commission_total',
- // name: '已结算佣金',
- // value: '0.00',
- // prompt: '所有会员已结算的佣金',
- // },
- {
- type: 'total_bonus_price',
- name: '已结算分红总额',
- value: '0.00',
- prompt: '基于当前已结算的金额',
- }
- ],
- pageSize: 20,
- };
- },
- methods: {
- scFormTab(sel){
- // console.info(sel);
- if(sel.length == this.form.length){
- this.checkedAll = true;
- }else {
- this.checkedAll = false;
- }
- this.selFormArr = sel;
- let id_str = '';
- this.selFormArr.forEach(v => {
- if (this.searchData.id_str === '') {
- this.searchData.id_str = v.id;
- } else {
- this.searchData.id_str = this.searchData.id_str + "," + v.id;
- }
- })
- // console.log(this.searchData.id_str);
- },
- // exportConfirm() {
- // this.search.status = this.status
- // },
- pageChange(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- search() {
- this.page = 1;
- this.getList();
- },
- clereSearch() {
- this.searchData.start = null;
- this.searchData.end = null;
- this.searchData.status = null;
- this.searchData.num_text = null;
- this.datetime = [];
- this.getList();
- },
- changeTime(e) {
- // console.log(e)
- this.searchData.start = e[0]
- this.searchData.end = e[1]
- },
- pageSearch(){
- this.page_count = 1;
- this.getList();
- },
- getList() {
- let params = {
- r: 'score-bonus/default/index',
- page: this.page,
- num_text: this.searchData.num_text,
- status: this.searchData.status,
- start: this.searchData.start,
- end: this.searchData.end,
- orderBy: this.searchData.orderBy,
- };
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- this.pageSize = e.data.data.page_size;
- this.form = e.data.data.list;
- // this.searchData.date = e.data.data.date;
- this.pagination = e.data.data.pagination;
- if(this.page_count !=1) this.pageCount = e.data.data.page_count;
- this.currentPage = parseInt(this.page);
- this.bonusCircleData = e.data.data.bonus_circle;
- this.exportList = e.data.data.export_list;
-
- // this.searchData.date = e.data.data.date;
- for (const key in e.data.data.statistics_data) {
- let info = this.orderTotalArr.filter(v => v.type == key); //订单概况
- if(info.length){
- let index = this.orderTotalArr.findIndex(v => v.type==info[0].type);
- this.orderTotalArr[index].value = Number(e.data.data.statistics_data[key]).toFixed(2);
- }
- }
- } else {
-
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- },
- HandleSortChange({ column, prop, order }){
- console.log(`排序属性: ${prop}, 排序方向: ${order}`);
- let orderBy = '';
- switch (order) {
- case 'ascending':
- orderBy = prop + " asc";
- break;
-
- case 'descending':
- orderBy = prop + " desc";
- break;
- }
- this.searchData.orderBy = orderBy;
- this.getList();
- },
- exportData(){
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'score-bonus/default/index',
- num_text: this.searchData.num_text,
- status: this.searchData.status,
- start: this.searchData.start,
- end: this.searchData.end,
- orderBy: this.searchData.orderBy,
- flag: 'EXPORT'
- },
- }).then(e => {
- // console.log(e);return null;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- self.listLoading = false;
- }).catch(e => {
- self.listLoading = false;
- });
- },
- handle(type, data = null) {
- let id = data ? parseInt(data.id) : '';
- let params = {};
- switch (type) {
- case 'check':
- params = {
- r: 'score-bonus/default/user-settle-data'
- };
- if (id) params = Object.assign(params, {
- id: id
- });
- navigateTo(params);
- break;
- }
- },
- },
- mounted: function() {
- this.getList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- /* .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px 20px;
- } */
- .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;
- }
- .statistical ul {
- float: left;
- }
- .statistical ul li.ul-li {
- width: 33%;
- float: left;
- list-style-type :none;
- padding-bottom: 10px;
- }
- .stat_details{
- /* padding-bottom: 30px; */
- padding-top: 20px;
- display: flex;
- }
- .order_module{
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module:last-child{
- margin-right: 0;
- }
- .order_module:first-child{
- margin-left: 0;
- }
- .price{
- font-size: 22px;
- font-weight: bold;
- }
- .oirder_modul_title{
- font-size: 12px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .oirder_modul_title .text{
- margin-right: 10px;
- }
- .stat_icon{
- font-size: 19px;
- color: #BFBFBF;
- }
- .tag-diff{
- display: inline-block;
- background-color: rgba(112, 182, 3, 1);
- color: #fff;
- border-radius: 42px;
- line-height: 22px;
- height: 22px;
- padding: 0 6px;
- }
- </style>
|