262 lines
8.8 KiB
HTML
262 lines
8.8 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;
|
||
}
|
||
</style>
|
||
{/block}
|
||
|
||
{block name="main"}
|
||
<div id="vueContent">
|
||
<el-card class="box-card">
|
||
<!--表格信息-->
|
||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%">
|
||
<el-table-column label="ID" prop="id" min-width="50" align="center"></el-table-column>
|
||
<el-table-column label="归属店铺" min-width="230" align="left" v-if="is_admin">
|
||
<template slot-scope="scope">
|
||
店铺名称:{{ scope.row.site_name || '' }}<br />
|
||
联系人:{{ scope.row.contacts_name || '' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="总佣金" prop="total_commission" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="已退款金额" prop="refund_money" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="结算金额" prop="reality_money" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="总权重值" prop="total_weight_value" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="分佣人数" prop="total_people" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="时间段" min-width="320" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.start_time | formatDate }} ~ {{ scope.row.end_time | formatDate }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="处理时间" prop="create_time" min-width="150" align="center"></el-table-column>
|
||
<el-table-column label="操作" min-width="150" align="center">
|
||
<template slot-scope="scope">
|
||
<el-button @click="seeDetailRecord(scope.row)">查看明细</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<!--分页-->
|
||
<div class="pagination">
|
||
<el-pagination :current-page="tableFrom.page" hide-on-single-page :total="tableData.total" @current-change="pageChange"></el-pagination>
|
||
</div>
|
||
</el-card>
|
||
<!--变更记录弹框-->
|
||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" :before-close="handleClose" append-to-body>
|
||
<el-table v-loading="dialogLoading" :data="dialogTableData.data" style="width: 100%">
|
||
<el-table-column label="ID" prop="id" min-width="60" align="center"></el-table-column>
|
||
<el-table-column label="用户信息" min-width="230" align="center">
|
||
<template slot-scope="scope">
|
||
<div class="user-content">
|
||
<div class="user-avatar">
|
||
<img :src="scope.row.headimg || '/public/static/img/default_img/head.png'" />
|
||
</div>
|
||
<div class="user-info">
|
||
<div class="nickname">{{ scope.row.nickname || scope.row.username }}</div>
|
||
<div class="user-id">UID:{{ scope.row.member_id }}</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="分红佣金" prop="money" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="截至当前周期持有的权重值" prop="total_contribution" min-width="200" align="center"></el-table-column>
|
||
<el-table-column label="分红比例" prop="proportion" min-width="80" align="center"></el-table-column>
|
||
<el-table-column label="是否结算" min-width="120" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.is_settlement == 1" type="success" effect="dark">已结算</el-tag>
|
||
<el-tag v-else effect="dark">待结算</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="处理时间" prop="create_time" min-width="150" align="center"></el-table-column>
|
||
</el-table>
|
||
<div class="block">
|
||
<el-pagination :current-page="dialogTableFrom.page" hide-on-single-page :total="dialogTableData.total" @current-change="seeDetailPageChange"></el-pagination>
|
||
</div>
|
||
</el-dialog>
|
||
</div>
|
||
{/block}
|
||
|
||
{block name="script"}
|
||
<script>
|
||
new Vue({
|
||
el:'#vueContent',
|
||
data(){
|
||
return {
|
||
is_admin: false,
|
||
listLoading: true,
|
||
tableData: {
|
||
data: [],
|
||
total: 0,
|
||
},
|
||
tableFrom: {
|
||
page: 1,
|
||
member_id: '',
|
||
},
|
||
// 明细相关
|
||
dialogTitle: '分红记录',
|
||
dialogVisible: false,
|
||
dialogLoading: true,
|
||
currentRow: {},
|
||
dialogTableData: {
|
||
data: [],
|
||
total: 0,
|
||
},
|
||
dialogTableFrom: {
|
||
page: 1,
|
||
site_id: '',
|
||
member_id: '',
|
||
level_id: '',
|
||
},
|
||
|
||
};
|
||
},
|
||
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.getList('');
|
||
},
|
||
methods: {
|
||
// 获取列表
|
||
getList(num) {
|
||
let _this = this;
|
||
_this.listLoading = true;
|
||
_this.tableFrom.page = num ? num : this.tableFrom.page;
|
||
$.ajax({
|
||
url: ns.url("commission://shop/index/partner"),
|
||
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('');
|
||
},
|
||
// 点击查看明细
|
||
seeDetailRecord(row){
|
||
let _this = this;
|
||
_this.currentRow = Object.assign({}, row);
|
||
// 并且显示弹框
|
||
_this.dialogLoading = true;
|
||
_this.dialogVisible = true;
|
||
// 生成搜索条件 并且进行搜索
|
||
_this.dialogTableFrom.cycle_id = row.id;
|
||
$.ajax({
|
||
url: ns.url("commission://shop/index/partnerLog"),
|
||
data: _this.dialogTableFrom,
|
||
dataType: 'JSON',
|
||
type: 'POST',
|
||
success: function(res) {
|
||
if(Number(res.code) === 0){
|
||
let data = res.data || {};
|
||
_this.dialogTableData.data = data.list || {};
|
||
_this.dialogTableData.total = data.count || 0;
|
||
_this.is_admin = data.is_admin || false;
|
||
_this.dialogLoading = false;
|
||
}
|
||
}
|
||
});
|
||
},
|
||
seeDetailPageChange(page) {
|
||
this.dialogTableFrom.page = page;
|
||
this.seeDetailRecord(this.currentRow);
|
||
},
|
||
// 关闭弹框
|
||
handleClose() {
|
||
let defaultInfo = this.$options.data();
|
||
this.dialogTableData = Object.assign({}, defaultInfo.dialogTableData);
|
||
this.dialogTableFrom = Object.assign({}, defaultInfo.dialogTableFrom);
|
||
|
||
this.dialogVisible = false
|
||
},
|
||
|
||
|
||
}
|
||
});
|
||
</script>
|
||
{/block} |