456 lines
17 KiB
HTML
456 lines
17 KiB
HTML
{extend name="app/shop/view/base.html"/}
|
||
{block name="resources"}
|
||
<link rel="stylesheet" href="__STATIC__/element-ui/index.css">
|
||
<script src="STATIC_JS/vue.js"></script>
|
||
<script src="__STATIC__/element-ui/index.js"></script>
|
||
<style>
|
||
.pagination{
|
||
text-align: right!important;
|
||
padding-top: 20px!important;
|
||
}
|
||
.cell{
|
||
padding: 0!important;
|
||
}
|
||
.user-content{
|
||
width: 100%;
|
||
display: inline-flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
.user-content .user-avatar{
|
||
height: 65px;
|
||
width: 65px;
|
||
display: inline-flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
.user-content .user-avatar img{
|
||
height: 80%!important;
|
||
width: 80%!important;
|
||
border-radius: 50% !important;
|
||
}
|
||
.user-content .user-info{
|
||
width: calc(100% - 70px) !important;
|
||
display: inline-flex;
|
||
flex-direction: column;
|
||
flex-wrap: nowrap;
|
||
justify-content: center;
|
||
align-items: flex-start;
|
||
}
|
||
.user-content .user-info .nickname{
|
||
font-size: 15px;
|
||
font-weight: bold;
|
||
height: 30px;
|
||
line-height: 30px;
|
||
width: 100%;
|
||
text-align: left;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.user-content .user-info .user-id{
|
||
font-size: 13px;
|
||
height: 25px;
|
||
line-height: 25px;
|
||
width: 100%;
|
||
text-align: left;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.rate-num{
|
||
margin-top: 5px!important;
|
||
}
|
||
.selWidth {
|
||
width: 350px !important;
|
||
margin-bottom: 5px;
|
||
}
|
||
|
||
.one {
|
||
background: #e4ecff;
|
||
}
|
||
.two {
|
||
background: #fff3e0;
|
||
}
|
||
.three {
|
||
background: #eaf9e1;
|
||
}
|
||
.four {
|
||
background: #ffeaf4;
|
||
}
|
||
.five {
|
||
background: #f1e4ff;
|
||
}
|
||
.one1 {
|
||
background: #4d7cfe;
|
||
}
|
||
.two1 {
|
||
background: #ffab2b;
|
||
}
|
||
.three1 {
|
||
background: #6dd230;
|
||
}
|
||
.four1 {
|
||
background: #ff85c0;
|
||
}
|
||
.five1 {
|
||
background: #b37feb;
|
||
}
|
||
.card_box {
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 25px;
|
||
box-sizing: border-box;
|
||
border-radius: 4px;
|
||
background: #f5f7f9;
|
||
margin-bottom: 10px;
|
||
}
|
||
.card_box .card_box_cir{
|
||
width: 60px;
|
||
height: 60px;
|
||
border-radius: 50%;
|
||
margin-right: 20px;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
.card_box .card_box_cir .card_box_cir1{
|
||
width: 48px;
|
||
height: 48px;
|
||
border-radius: 50%;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
color: #fff;
|
||
}
|
||
.card_box .card_box_txt{}
|
||
.card_box .card_box_txt .sp1{
|
||
display: block;
|
||
color: #252631;
|
||
font-size: 24px;
|
||
line-height: 37px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.card_box .card_box_txt .sp2{
|
||
display: block;
|
||
color: #98a9bc;
|
||
font-size: 12px;
|
||
}
|
||
</style>
|
||
{/block}
|
||
|
||
{block name="main"}
|
||
<div id="vueContent">
|
||
<el-card class="box-card">
|
||
<!-- 顶部统计 -->
|
||
<div slot="header" class="clearfix">
|
||
<div class="container">
|
||
<el-row align="middle" :gutter="10" class="ivu-mt">
|
||
<el-col v-for="(item, index) in cardLists" :key="index" :xl="4" :lg="8" :md="12" :sm="24" :xs="24" class="ivu-mb mb10">
|
||
<div class="card_box">
|
||
<div class="card_box_cir" :class="{'one':index%5==0,'two':index%5==1,'three':index%5==2,'four':index%5==3,'five':index%5==4}">
|
||
<div class="card_box_cir1" :class="{'one1':index%5==0,'two1':index%5==1,'three1':index%5==2,'four1':index%5==3,'five1':index%5==4}">
|
||
<i :class="item.className" style="font-size: 24px;"></i>
|
||
</div>
|
||
</div>
|
||
<div class="card_box_txt">
|
||
<span class="sp1" v-text="item.count || 0"></span>
|
||
<span class="sp2" v-text="item.name"></span>
|
||
</div>
|
||
</div>
|
||
</el-col>
|
||
</el-row>
|
||
</div>
|
||
</div>
|
||
<!--列表信息-->
|
||
<el-tabs v-model="activeName" @tab-click="changeTabs">
|
||
<el-tab-pane label="周期信息" name="cycle_list">
|
||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%">
|
||
<el-table-column prop="id" label="ID" min-width="60" align="center"></el-table-column>
|
||
<el-table-column prop="total_integral_money" label="积分总金额" min-width="100" align="center"></el-table-column>
|
||
<el-table-column prop="refund_money" label="已退款金额" min-width="100" align="center"></el-table-column>
|
||
<el-table-column prop="reality_money" label="实际结算金额" min-width="100" align="center"></el-table-column>
|
||
<el-table-column prop="legumes_price" label="豆豆价格" min-width="100" align="center"></el-table-column>
|
||
<el-table-column prop="legumes_num" label="豆豆数量" min-width="100" align="center"></el-table-column>
|
||
<el-table-column label="周期时间段" min-width="300" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.start_time | formatDate }} ~ {{ scope.row.end_time | formatDate }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="create_time" label="处理时间" min-width="150" align="center"></el-table-column>
|
||
<el-table-column label="状态" min-width="100" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.status == 1" type="success" effect="dark">已分配</el-tag>
|
||
<el-tag v-else type="info" effect="dark">待分配</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作" min-width="150" align="center">
|
||
<template slot-scope="scope">
|
||
<el-button type="primary" @click="seeDetailRecord(scope.row.id)">分配明细</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
</el-tab-pane>
|
||
<el-tab-pane label="分配明细" name="list">
|
||
<!--顶部搜索栏-->
|
||
<div class="clearfix">
|
||
<div class="container">
|
||
<el-form inline size="small" label-width="80px">
|
||
<el-form-item label="搜索:">
|
||
<el-select v-model="tableFrom.status" placeholder="请选择" class="filter-item selWidth" clearable>
|
||
<el-option label="冻结中" :value="0"></el-option>
|
||
<el-option label="可使用" :value="1"></el-option>
|
||
<el-option label="已失效" :value="2"></el-option>
|
||
</el-select>
|
||
<el-input v-model="tableFrom.member_id" placeholder="请输入用户ID" class="selWidth" clearable>
|
||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="clickSearch"></el-button>
|
||
</el-input>
|
||
</el-form-item>
|
||
<el-form-item class="width100">
|
||
<!--<el-button size="small" type="primary" @click="exports">导出</el-button>-->
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
</div>
|
||
<!--表单列表-->
|
||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" >
|
||
<el-table-column prop="id" label="ID" min-width="60" align="center"></el-table-column>
|
||
<el-table-column label="用户信息" prop="nickname" min-width="230" align="center">
|
||
<template slot-scope="scope">
|
||
<div class="user-content">
|
||
<div class="user-avatar">
|
||
<img :src="scope.row.headimg || moren" />
|
||
</div>
|
||
<div class="user-info">
|
||
<div class="nickname">{{ scope.row.nickname || '' }}</div>
|
||
<div class="user-id">ID:{{ scope.row.member_id }}</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="订单金额" align="center">
|
||
<el-table-column prop="order_money" label="总金额" min-width="80" align="center"></el-table-column>
|
||
<el-table-column prop="refund_order_money" label="退款减少" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="剩余" min-width="80" align="center">
|
||
<template slot-scope="scope">
|
||
{{ (scope.row.order_money - scope.row.refund_order_money).toFixed(2) }}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table-column>
|
||
<el-table-column prop="order_money_rate" label="占比例(%)" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="获得豆" align="center">
|
||
<el-table-column prop="get_legumes" label="总获得" min-width="80" align="center"></el-table-column>
|
||
<el-table-column prop="refund_get_legumes" label="退款减少" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="剩余" min-width="80" align="center">
|
||
<template slot-scope="scope">
|
||
{{ (scope.row.get_legumes - scope.row.refund_get_legumes).toFixed(4) }}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table-column>
|
||
<el-table-column label="积分" align="center">
|
||
<el-table-column label="积分上限" min-width="80" align="center">
|
||
<template slot-scope="scope">
|
||
{{ (scope.row.order_money - scope.row.refund_order_money).toFixed(2) }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="get_integral" label="已获取积分" min-width="80" align="center"></el-table-column>
|
||
<el-table-column prop="use_integral" label="已使用积分" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="剩余可用" min-width="80" align="center">
|
||
<template slot-scope="scope">
|
||
{{ (scope.row.get_integral - scope.row.use_integral).toFixed(2) }}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table-column>
|
||
<el-table-column label="状态" min-width="100" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.status == 0" type="info" effect="dark">冻结中</el-tag>
|
||
<el-tag v-else-if="scope.row.status == 1" type="success" effect="dark">可使用</el-tag>
|
||
<el-tag v-else type="danger" effect="dark">已失效</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="create_time" label="处理时间" min-width="130" align="center"></el-table-column>
|
||
</el-table>
|
||
</el-tab-pane>
|
||
<el-tab-pane label="持有明细" name="hold_list">
|
||
<el-alert title="由于获取积分不能超过订单实际支付金额 + 抵扣积分;因此当前豆豆价格 * 持有的豆豆 ≠ 已获取积分!" type="warning" :closable="false" style="margin-bottom: 10px!important;" show-icon center></el-alert>
|
||
<!--顶部搜索栏-->
|
||
<div class="clearfix">
|
||
<div class="container">
|
||
<el-form inline size="small" label-width="80px">
|
||
<el-form-item label="搜索:">
|
||
<el-input v-model="tableFrom.member_id" placeholder="请输入用户ID" class="selWidth" clearable>
|
||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="clickSearch"></el-button>
|
||
</el-input>
|
||
</el-form-item>
|
||
<el-form-item class="width100">
|
||
<!--<el-button size="small" type="primary" @click="exports">导出</el-button>-->
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
</div>
|
||
<!--表单列表-->
|
||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="mini">
|
||
<el-table-column label="用户信息" prop="nickname" min-width="280" align="center">
|
||
<template slot-scope="scope">
|
||
<div class="user-content">
|
||
<div class="user-avatar">
|
||
<img :src="scope.row.headimg || moren" />
|
||
</div>
|
||
<div class="user-info">
|
||
<div class="nickname">{{ scope.row.nickname || '' }}</div>
|
||
<div class="user-id">ID:{{ scope.row.member_id }}</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="豆信息" min-width="300" align="center">
|
||
<el-table-column prop="total_get_legumes" label="总持有" min-width="100" align="center"></el-table-column>
|
||
<el-table-column prop="total_refund_get_legumes" label="退款减少" min-width="100" align="center"></el-table-column>
|
||
<el-table-column label="剩余" min-width="100" align="center">
|
||
<template slot-scope="scope">
|
||
{{ (scope.row.total_get_legumes - scope.row.total_refund_get_legumes).toFixed(2) }}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table-column>
|
||
<el-table-column label="已获取积分 / 积分上限" min-width="200" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag type="success" effect="dark">
|
||
{{ scope.row.total_get_integral }} / {{ (scope.row.total_order_money - scope.row.total_refund_order_money).toFixed(2) }}
|
||
</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="total_freeze_integral" label="冻结中积分" min-width="150" align="center"></el-table-column>
|
||
<el-table-column prop="total_use_integral" label="已使用积分" min-width="150" align="center"></el-table-column>
|
||
<el-table-column prop="surplus_use_integral" label="剩余可用积分" min-width="150" align="center"></el-table-column>
|
||
</el-table>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
<!--分页-->
|
||
<div class="pagination">
|
||
<el-pagination :current-page="tableFrom.page" hide-on-single-page :total="tableData.total" @current-change="pageChange"></el-pagination>
|
||
</div>
|
||
</el-card>
|
||
</div>
|
||
{/block}
|
||
|
||
{block name="script"}
|
||
<script>
|
||
new Vue({
|
||
el:'#vueContent',
|
||
data(){
|
||
return {
|
||
moren: '/public/static/img/default_img/head.png',
|
||
// 选项卡相关内容
|
||
activeName: 'cycle_list',
|
||
// 周期信息相关
|
||
listLoading: true,
|
||
tableData: {
|
||
data: [],
|
||
total: 0,
|
||
},
|
||
tableFrom: {
|
||
page: 1,
|
||
limit: 10,
|
||
member_id: '',
|
||
legumes_id: '',
|
||
status: '',
|
||
},
|
||
cardLists: [],
|
||
};
|
||
},
|
||
filters:{
|
||
formatDate(value){
|
||
if (!value) return '';
|
||
const date = new Date(value * 1000);
|
||
const year = date.getFullYear();
|
||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||
const day = date.getDate().toString().padStart(2, '0');
|
||
const hours = date.getHours().toString().padStart(2, '0');
|
||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||
}
|
||
},
|
||
mounted(){
|
||
this.getStatistics();
|
||
this.getList('');
|
||
},
|
||
methods: {
|
||
// 获取统计信息
|
||
getStatistics() {
|
||
let _this = this;
|
||
$.ajax({
|
||
url: ns.url("commission://shop/index/getLegumesStatistics"),
|
||
data: _this.tableFrom,
|
||
dataType: 'JSON',
|
||
type: 'POST',
|
||
success: function(res) {
|
||
if(Number(res.code) === 0){
|
||
_this.cardLists = res.data || [];
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 获取列表 列表分页
|
||
getList(num) {
|
||
let _this = this;
|
||
_this.listLoading = true;
|
||
_this.tableFrom.page = num ? num : this.tableFrom.page;
|
||
// 请求链接
|
||
let link = ns.url("commission://shop/index/legumes");
|
||
if(_this.activeName === 'list') link = ns.url("commission://shop/index/legumesLog");
|
||
else if(_this.activeName === 'hold_list') link = ns.url("commission://shop/index/legumesHoldList");
|
||
// 请求
|
||
$.ajax({
|
||
url: link,
|
||
data: _this.tableFrom,
|
||
dataType: 'JSON',
|
||
type: 'POST',
|
||
success: function(res) {
|
||
if(Number(res.code) === 0){
|
||
let data = res.data || {};
|
||
_this.tableData.data = data.list || {};
|
||
_this.tableData.total = data.count || 0;
|
||
_this.is_admin = data.is_admin || false;
|
||
_this.listLoading = false;
|
||
}
|
||
}
|
||
});
|
||
},
|
||
pageChange(page) {
|
||
this.tableFrom.page = page;
|
||
this.getList('');
|
||
},
|
||
handleSizeChange(val) {
|
||
this.tableFrom.limit = val;
|
||
this.getList('');
|
||
},
|
||
// 点击搜索
|
||
clickSearch(){
|
||
this.getList(1);
|
||
},
|
||
// 点击变更选项卡
|
||
changeTabs(tab, event){
|
||
this.tableFrom.legumes_id = '';
|
||
this.tableFrom.member_id = '';
|
||
this.getList(1);
|
||
},
|
||
// 查看周期明细
|
||
seeDetailRecord(legumes_id){
|
||
this.tableFrom.legumes_id = legumes_id;
|
||
this.activeName = 'list';
|
||
this.getList(1);
|
||
},
|
||
|
||
|
||
}
|
||
});
|
||
</script>
|
||
{/block} |