| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484 |
- <?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-input size="small" style="width: 200px" v-model="search.keyword" placeholder="请输入会员昵称、id、手机号"></el-input>
- </div>
- <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">
- <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
- </el-button>
- <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="exportHandle">导出
- </el-button>
- </div>
- </el-form>
- <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="grant_id" align="center"></el-table-column>
- <!-- <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column> -->
- <!-- <el-table-column-->
- <!-- prop="avatar_url,nickname"-->
- <!-- label="会员"-->
- <!-- min-width="200">-->
- <!-- <template slot-scope="scope">-->
- <!-- <div flex="box:first">-->
- <!-- <div style="padding-right: 10px;">-->
- <!-- <com-image mode="aspectFill" :src="scope.row.avatar_url"></com-image>-->
- <!-- </div>-->
- <!-- <div flex="cross:top cross:center">-->
- <!-- {{scope.row.nickname}} :{{scope.row.user_id}}-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column label="基本信息" width="200px">
- <template slot-scope="scope">
- <div class="user_img" flex="cross:center">
- <el-image class="table-info-img circle" :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="table-info-text" style="margin-left:5px;">
- <div class="uer-nickname over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div>ID:{{scope.row.user_id}}</div>
- </div>
- <!-- <div class="uer-nickname over1" >ID:{{scope.row.user_id}}</div> -->
- </div>
- </template>
- </el-table-column>
- <el-table-column label="手机号" prop="mobile" align="center" >
- <template slot-scope="scope">
- <div>{{scope.row.user.mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="发放时间" prop="created_at" min-width="160" align="center">
- <template slot-scope="scope">
- <div >{{scope.row.grantLog.settlement_time|dateTimeFormat('Y-m-d H:i:s')}}</div>
- </template>
- </el-table-column>
- <el-table-column label="总业绩(元)" prop="achievement_sum" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.achievement_sum?scope.row.achievement_sum:'0.00'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="团队业绩(元)" prop="team_achievement" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.team_achievement?scope.row.team_achievement:'0.00'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="个人业绩(元)" prop="personal_achievement" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.grantLog.is_team_achievement != 1">{{scope.row.personal_achievement?scope.row.personal_achievement:'0.00'}}</div>
- <div v-else>0.00</div>
- </template>
- </el-table-column>
- <el-table-column label="奖励比例" prop="award_proportion" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.award_proportion?scope.row.award_proportion:'0.00'}}%</div>
- </template>
- </el-table-column>
- <el-table-column label="平级奖励" prop="equal_money" align="center">
- <template slot-scope="scope">
- <div class="award-money" v-if="scope.row.equal_money*1>0">+{{scope.row.equal_money}}</div>
- <div class="award-money" v-if="scope.row.equal_money*1<0">-{{scope.row.equal_money}}</div>
- <div class="award-money" v-if="scope.row.equal_money*1==0">{{'0.00'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="结算金额" prop="edit_award_money" align="center">
- <template slot-scope="scope">
- <div class="award-money" v-if="scope.row.edit_award_money*1>0">+{{scope.row.edit_award_money}}</div>
- <div class="award-money" v-if="scope.row.edit_award_money*1<0">-{{scope.row.edit_award_money}}</div>
- <div class="award-money" v-if="scope.row.edit_award_money*1==0">{{'0.00'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="现结算金额" prop="award_money" align="center">
- <template slot-scope="scope">
- <div class="award-money" v-if="scope.row.award_money*1>0">+{{scope.row.award_money}}</div>
- <div class="award-money" v-if="scope.row.award_money*1<0">-{{scope.row.award_money}}</div>
- <div class="award-money" v-if="scope.row.award_money*1==0">{{'0.00'}}</div>
- </template>
- </el-table-column>
- <el-table-column label="结算状态" prop="is_settlement" align="center">
- <template slot-scope="scope">
- <div>
- {{
- scope.row.is_skip_settlement === 1
- ? '不结算'
- : scope.row.is_settlement === 1
- ? '已结算'
- : '未结算'
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- label="操作"
- align="center"
- min-width="120">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.grantLog.is_wait == 1
- && scope.row.grantLog.is_settlement == 0
- && !scope.row.updateLog
- && scope.row.is_skip_settlement == 0
- && scope.row.grantLog.is_award_need_confirm == 1
- && scope.row.grantLog.is_leader_first_month_no_award == 1"
- @click="toUpdateAwardMoney(scope.row)"
- type="text"
- size="small"
- >
- 修改结算金额
- </el-button>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="总计" prop="award_sum" align="center">-->
- <!-- <template slot-scope="scope">-->
- <!-- <div>{{scope.row.award_sum?scope.row.award_sum:'0.00'}}</div>-->
- <!-- </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>
- <!-- 修改结算金额 -->
- <el-dialog :visible.sync="editDialogVisible" title="修改业绩结算金额" @close="editDialogVisible = false" width="30%">
- <div style="text-align: center">
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" size="small">
- <el-form-item label="" prop="custom_name">
- <el-input placeholder="请输入奖励金额" size="small" style="width:300px;"
- v-model="ruleForm.award_money"
- type="text"
- onInput="value=toNumber(value,2)"
- autocomplete="off">
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="sendUpdateAwardMoney">确定</el-button>
- </span>
- </el-dialog>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- page:1,
- time:[], //本地存时间,请求时不发送
- search: {
- grant_id : '',
- keyword:'',
- date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
- date_start : '',
- },
- loading: false,
- activeName: '-1',
- list: [], //列表数据
- pagination: null,
- editDialogVisible: false,
- ruleForm: {
- 'id': null,
- 'award_money': null
- },
- rules: {
- },
- },
- mounted() {
- this.search.grant_id = getQuery('id');
- // 获取列表首页数据
- this.loadData(this.page,this.search); //获取列表数据
- },
- methods: {
- // 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/list',
- page: page,
- ...others, //其他搜索字段
- },
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.list = e.data.data.list;
- this.pagination = e.data.data.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);
- },
- toUpdateAwardMoney(data){
- this.editDialogVisible = true;
- this.ruleForm.id = data.id;
- this.ruleForm.award_money = data.award_money;
- },
- sendUpdateAwardMoney(){
- this.detaillLoading = true;
- request({
- params: {
- r: 'achievement/default/update-grant-award',
- },
- method: 'post',
- data: {
- id: this.ruleForm.id,
- award_money: this.ruleForm.award_money,
- },
- }).then(e => {
- this.detaillLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- this.editDialogVisible = false;
- this.searchs();
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- exportHandle(){
- request({
- method: 'post',
- params: {
- r: 'achievement/default/list',
- },
- data: {
- flag: 'EXPORT',
- ...this.search, //其他搜索字段
- },
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- },
- }
- });
- </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;
- }
- .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;
- }
- .award-money{
- color: #BC0100;
- }
- .table-info-img{
- width:50px;
- }
- </style>
|