bztang-admin/plugins/cultural-space/views/area_bonus/index.blade.php

267 lines
11 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.base')
<style>
.user{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
overflow: hidden;
height: 80px;
}
.user .user-avatar{
height: 50px;
width: 50px;
margin-right: 5px;
border-radius: 50%;
overflow: hidden;
}
.user .user-avatar .avatar-image{
width: 100% !important;
height: 100% !important;
}
.user .user-info{
height: 50px;
text-align: left;
}
.user .user-info .user-nickname{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user .user-info .user-status{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-body .label{
display: inline-block;
margin-bottom: 2px;
border-radius: 2px;
font-size: 14px!important;
padding: 5px !important;
text-transform: uppercase;
font-weight: 700;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
}
.el-pagination{
text-align: right!important;
margin-top: 20px!important;
}
.panel-body{
padding-top: 0;
margin-bottom: 30px;
overflow: auto;
padding-right: 30px;
}
</style>
@section('content')
<div class="w1200 m0a" id="areaBonusIndexContent">
<div class="panel panel-default">
<div class="panel-body">
<el-tabs v-model="tabs_active" @tab-click="changeTabs">
<el-tab-pane label="周期信息" name="show_cycle">
<el-table :data="list" style="width: 100%" v-if="tabs_active == 'show_cycle'">
<el-table-column align="center" prop="id" label="ID" width="80"></el-table-column>
<el-table-column align="center" prop="total_price" label="周期总销售额"></el-table-column>
<el-table-column align="center" prop="allocation_price" label="总分配金额"></el-table-column>
<el-table-column align="center" prop="total_amount" label="周期总小区业绩"></el-table-column>>
<el-table-column align="center" label="统计时间段" width="350">
<template slot-scope="scope">
[[scope.row.start_time]] ~ [[scope.row.end_time]]
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="150">
<template slot-scope="scope">
<el-button type="primary" @click="seeChangeRecord(scope.row.id)">查看明细</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="分红明细" name="show_bonus">
{{--搜索--}}
<el-form :inline="true" :model="search_info">
{{--<el-form-item label="是否结算">--}}
{{-- <el-select v-model="search_info.status" placeholder="全部">--}}
{{-- <el-option label="全部" value=""></el-option>--}}
{{-- <el-option label="未结算" value="0"></el-option>--}}
{{-- <el-option label="已结算" value="1"></el-option>--}}
{{-- </el-select>--}}
{{--</el-form-item>--}}
<el-form-item label="会员ID">
<el-input v-model="search_info.uid" placeholder="请输入会员ID"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="clickSearch">查询</el-button>
</el-form-item>
</el-form>
{{--表单--}}
<el-table :data="list" style="width: 100%" v-if="tabs_active == 'show_bonus'">
<el-table-column align="center" prop="id" label="ID" width="100"></el-table-column>
<el-table-column align="center" label="用户信息" width="300">
<template slot-scope="scope">
<div class="user">
<div class="user-avatar">
<img class="avatar-image" :src="scope.row.member.avatar_image || ''" />
</div>
<div class="user-info">
<div class="user-nickname">昵称:[[scope.row.member.nickname || '']]</div>
<div class="user-status">ID[[scope.row.member.uid || '']]</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="area_amount" label="用户持有小区业绩"></el-table-column>
<el-table-column align="center" label="小区业绩占比">
<template slot-scope="scope">
[[scope.row.area_rate]]%
</template>
</el-table-column>
<el-table-column align="center" prop="get_amount" label="实际获得分红"></el-table-column>
{{--<el-table-column align="center" prop="status" label="是否结算">--}}
{{-- <template slot-scope="scope">--}}
{{-- <el-tag :type="scope.row.status == 0 ? 'danger' : 'success'" disable-transitions>--}}
{{-- [[scope.row.status == 0 ? '未结算' : '已结算']]--}}
{{-- </el-tag>--}}
{{-- </template>--}}
{{--</el-table-column>--}}
</el-table>
</el-tab-pane>
<el-tab-pane label="用户持有" name="show_hold">
{{--搜索--}}
<el-form :inline="true" :model="search_info">
<el-form-item label="会员ID">
<el-input v-model="search_info.uid" placeholder="请输入会员ID"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="clickSearch">查询</el-button>
</el-form-item>
</el-form>
{{--表单--}}
<el-table :data="list" style="width: 100%" v-if="tabs_active == 'show_hold'">
<el-table-column align="center" prop="id" label="ID" width="100"></el-table-column>
<el-table-column align="center" label="用户信息" width="300">
<template slot-scope="scope">
<div class="user">
<div class="user-avatar">
<img class="avatar-image" :src="scope.row.member.avatar_image || ''" />
</div>
<div class="user-info">
<div class="user-nickname">昵称:[[scope.row.member.nickname || '']]</div>
<div class="user-status">ID[[scope.row.member.uid || '']]</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="total_get_amount" label="实际获得分红总计"></el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
{{--分页--}}
<el-pagination
v-if="total_page > 1"
background
layout="prev, pager, next"
:page-count="total_page"
:current-page="page"
@current-change="changePage">
</el-pagination>
</div>
</div>
</div>
<script type="text/javascript">
new Vue({
el: '#areaBonusIndexContent',
delimiters: ['[[', ']]'],
name: 'cultural_space_index_content',
data() {
return {
tabs_active: 'show_cycle',
// 分页信息
page: 1,
total_page: 1,
list: [],
search_info: {
uid: '',
cycle_id: '',
status: '',
}
}
},
watch:{},
mounted () {
this.getData();
},
methods: {
// 获取数据 根据当前选项卡获取对应的信息
getData(){
let _this = this;
let loading = _this.showLoading();
// 请求获取数据
$.ajax({
url: "{!! yzWebUrl('plugin.cultural-space.admin.areaBonus.index') !!}",
type: "post",
data: {
page: _this.page,
search: _this.search_info,
tabs_active: _this.tabs_active,
},
success: function(result) {
let data = result.data;
if(parseInt(result.result) === 1){
// 处理数据
_this.list = data.data;
_this.total_page = data.last_page;
}
loading.close();
}
});
},
// 切换选项卡
changeTabs(){
this.page = 1;
this.total_page = 1;
this.list = [];
this.search_info = Object.assign({},this.$options.data().search_info);
this.getData();
},
// 数据分页
changePage(val){
this.page = val;
this.getData();
},
// 相关搜索
clickSearch(){
this.page = 1;
this.getData()
},
// 显示加载动画
showLoading(){
return this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
// 用户持有统计中查看某个用户的贡献值变更记录
seeChangeRecord(id){
this.page = 1;
this.total_page = 1;
this.list = [];
this.search_info = Object.assign({},this.$options.data().search_info);
this.search_info.cycle_id = id;
this.tabs_active = 'show_bonus';
this.getData()
},
},
})
</script>
@endsection