| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * 名片
- * Author: james
- * Date: 2020-07-10
- * Time: 15:48
- */
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>奖励总计</span>
- </div>
- <div class="table-body">
- <el-form size="small" :inline="true" flex="dir:left cross:center">
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">发放时间:</div>
- <el-date-picker
- size="small"
- v-model="time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">奖励金额:</div>
- <el-input size="small" style="width: 200px" type="number" v-model="search.min_money" placeholder="请输入最小奖励金额"></el-input>
- <div class="symbol"> - </div>
- <el-input size="small" style="width: 200px" type="number" v-model="search.max_money" placeholder="请输入最大奖励金额"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
- </el-button>
- </div>
- </el-form>
- <div style="display: flex;margin: 20px 0">
- 共奖励金额:<div class="price_col">¥{{sum.award_money}}</div>,发放次数:<div class="price_col">{{sum.grant_num}}</div>,奖励人数:<div class="price_col">{{sum.award_user}}</div>
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-table :data="list" v-loading="loading" size="small" style="margin-bottom: 15px;"
- @selection-change="handleSelectionChange">
- <el-table-column label="周期ID" prop="id" align="center"></el-table-column>
- <el-table-column label="计算方式" prop="settlement_mode" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.settlement_mode == 0">不含极差</div>
- <div v-if="scope.row.settlement_mode == 1">含极差</div>
- <div v-if="scope.row.settlement_mode == 2">业绩极差</div>
- </template>
- </el-table-column>
- <el-table-column label="统计方式" prop="statistical_methods" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.statistical_methods == 0">订单完成</div>
- <div v-else>支付完成</div>
- </template>
- </el-table-column>
- <el-table-column label="添加时间" prop="created_at" min-width="160" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
- </template>
- </el-table-column>
- <el-table-column label="发放时间" prop="created_at" min-width="160" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.settlement_time|dateTimeFormat('Y-m-d H:i:s')}}</div>
- </template>
- </el-table-column>
- <el-table-column label="总业绩(元)" prop="total_performance" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.total_performance}}</div>
- </template>
- </el-table-column>
- <el-table-column label="会员数量" prop="user_num" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.user_num}}</div>
- </template>
- </el-table-column>
- <el-table-column label="奖励金额(元)" prop="award_money" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.award_money}}</div>
- </template>
- </el-table-column>
- <el-table-column label="奖励比例" prop="award_proportion" align="center" >
- <template slot-scope="scope">
- <el-button type="text" @click="dialogOpen(scope.row)">比例</el-button>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- label="操作"
- align="center"
- width="300">
- <template slot-scope="scope">
- <el-button @click="toDetails(scope.row.id,scope.$index)" type="text" size="small">查看详情
- </el-button>
- <el-button
- v-if="scope.row.is_wait == 1
- && scope.row.is_settlement == 0
- && scope.row.is_award_need_confirm == 1
- && scope.row.settlement_time <= new Date().getTime()"
- @click="toGrantAchievement(scope.row)"
- type="text"
- size="small">待审核
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tabs>
- <!-- 分页器 -->
- <div flex="box:last cross:center">
- <div></div>
- <div>
- <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.totalCount">
- </el-pagination>
- </div>
- </div>
- </div>
- <!-- 这个是复制用的容器,已隐藏 -->
- <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
- <el-dialog
- :title="title"
- :visible.sync="dialogVisible"
- width="30%"
- >
- <div v-for="(item,index) in award_proportion">团队业绩达到{{item.money}}元 奖励 {{item.proportion}}%</div>
- <div style="margin-top: 20px;margin-bottom:10px;">商品订单奖励比例</div>
- <div v-loading='detaillLoading'>
- <el-table :data="tableData" ref="multipleTable" key='user' border
- style="width: 100%">
- <el-table-column prop="order_no" label="订单编号" width="300" align='center'>
- </el-table-column>
- <el-table-column prop="price" label="订单金额" align='center'>
- </el-table-column>
- <el-table-column prop="alone_bonus" label="奖励金额" align='center'>
- </el-table-column>
- </el-table>
- <div class="check_pagination flex">
- <el-pagination @current-change="detailPagination" background layout="prev, pager, next"
- :page-count="detailPageCount"></el-pagination>
- </div>
- </div>
- </el-dialog>
- <el-dialog :visible.sync="confirmDialogVisible" title="业绩审核" @close="confirmDialogVisible = false" width="50%">
- <div style="text-align: center">
- <h2>确认发放待结算金额</h2>
- <h4>{{awardMoney}}元</h4>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="confirmDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="sendGrantAchievement">确定</el-button>
- </span>
- </el-dialog>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- page:1,
- avatar: '',
- nickname: '',
- time:[], //本地存时间,请求时不发送
- search: {
- // id : '',
- // keyword:0,
- // user_id : '',
- // goods_id : '',
- // related_type : '', //否 int 关联类型1:关联商品 2:关联店铺 3:关联地址
- // nickname : '',
- // title : '',
- date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
- date_start : '',
- min_money : '', //最小金额
- max_money : '', //最大金额
- },
- loading: false,
- activeName: '-1',
- list: [], //列表数据
- sum: {
- award_money:0,
- award_user:0,
- grant_num:0,
- },
- pagination: null,
- dialogVisible: false,
- award_proportion: [],
- title: '',
- tableData:null,
- detailPage: 1,
- detailPageCount: 0,
- detaillLoading:false,
- grant_id:0,
- confirmDialogVisible: false,
- awardMoney: 0,
- achievement_grant_id: null,
- },
- watch: {
- dialogVisible: function (newVal) {
- if (newVal) {
- this.getDetail();
- }
- },
- },
- mounted() {
- // 获取列表首页数据
- this.loadData(this.page,this.search); //获取列表数据
- },
- methods: {
- dialogOpen(row){
- this.award_proportion = row.award_proportion;
- this.title = '周期id:'+row.id+'奖励比例';
- this.grant_id = row.id;
- this.dialogVisible = true;
- },
- //1.0 跳转详情
- toDetails(id,index){
- this.$navigate({
- r: 'achievement/default/list',
- id: id
- })
- },
- // 1.0 获取视频列表
- loadData(page,others) {
- this.loading = true;
- console.log(this.search);
- if(!this.time){
- this.search.date_start = '';
- this.search.date_end = '';
- }else{
- this.search.date_start = this.time[0];
- this.search.date_end = this.time[1];
- }
- request({
- method: 'get',
- params: {
- r: 'achievement/default/index',
- page: page,
- ...others, //其他搜索字段
- },
- }).then(e => {
- this.loading = false;
- console.log(e.data.data.list)
- if (e.data.code === 0) {
- this.list = e.data.data.list.list;
- this.sum = e.data.data.sum;
- this.pagination = e.data.data.list.pagination;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- },
- pageChange(page) {
- this.page = page;
- this.loadData(this.page,this.search);
- },
- handleClick(tab, event) {
- this.page = 1;
- this.search.status = this.activeName;
- this.loadData(this.page,this.search)
- },
- handleSelectionChange(val) {
- let self = this;
- self.choose_list = [];
- val.forEach(function (item) {
- self.choose_list.push(item.id);
- })
- },
- searchs() {
- this.page = 1;
- this.loadData(this.page,this.search);
- },
- getDetail() {
- this.detaillLoading = true;
- this.tableData = null;
- request({
- params: {
- r: 'achievement/default/order-list',
- page: this.detailPage,
- limit: 10,
- grant_id: this.grant_id,
- },
- method: 'get',
- }).then(e => {
- this.detaillLoading = false;
- if (e.data.code == 0) {
- this.tableData = e.data.data.list;
- this.detailPageCount = e.data.data.page_count;
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- detailPagination(currentPage) {
- let self = this;
- self.detailPage = currentPage;
- self.getDetail();
- },
- toGrantAchievement(data) {
- this.confirmDialogVisible = true;
- this.awardMoney = data.award_money;
- this.achievement_grant_id = data.id;
- },
- sendGrantAchievement() {
- this.detaillLoading = true;
- request({
- params: {
- r: 'achievement/default/to-grant-achievement',
- },
- method: 'post',
- data: {
- id: this.achievement_grant_id,
- },
- }).then(e => {
- this.detaillLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- this.confirmDialogVisible = false;
- this.searchs();
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- }
- });
- </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;
- }
- .item-box{
- margin-right: 20px;
- }
- .item-box .label{
- margin-right: 8px;
- }
- .item-box .symbol{
- margin: 0 6px;
- }
- .form-nickname{
- width: 180px;
- white-space:nowrap;
- overflow:hidden;
- text-overflow:ellipsis;
- }
- .index-video-url{
- width: 300px;
- }
- .index-video-url video{
- width: 100%;
- }
- .index-related-info{
- width: 500px;
- }
- .video-top{
- width: 100%;
- display: flex;
- align-items: flex-start;
- box-sizing: border-box;
- padding: 20px;
- /* opacity: .5; */
- background-color: #FFFFFF;
- }
- .video-top .top-right{
- line-height: 26px;
- }
- .video-top .top-right .top-title{
- font-size: 18px;
- white-space:nowrap;
- overflow:hidden;
- text-overflow:ellipsis;
- width: 360px;
- }
- .video-top .top-right .wrapper{
- display: flex;
- /* align-items: flex-start; */
- }
- .video-top .top-right .wrapper .to-copy{
- /* color: #03C5FF; */
- margin-left: 20px;
- }
- .video-top .top-right .detail-price{
- color: #BC0100;
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- }
- /* .atooltip {
- background: #FFFFFF !important;
- border: none !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;
- }
- .price_col{
- color: #FF5D05;
- }
- </style>
|