jh-admin/addon/commission/shop/view/index/index.html

453 lines
18 KiB
HTML
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.

{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-form inline size="small" label-width="80px">
<el-form-item label="搜索">
<el-input v-if="is_admin" v-model="tableFrom.site_id" placeholder="请输入店铺ID" class="selWidth" clearable></el-input>
<el-input v-model="tableFrom.member_id" placeholder="请输入下单用户ID" class="selWidth" clearable></el-input>
<el-input v-model="tableFrom.order_no" placeholder="请输入订单号" class="selWidth" clearable></el-input>
<el-input v-model="tableFrom.goods_id" placeholder="请输入商品ID" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)"></el-button>
</el-input>
</el-form-item>
</el-form>
<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-table v-loading="listLoading" :data="tableData.data" style="width: 100%">
<el-table-column prop="id" label="ID" min-width="50" 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" />
</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="归属店铺" min-width="200" align="center" 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="商品信息" min-width="280" align="center">
<template slot-scope="scope">
<div class="user-content" v-if="scope.row.order_type == 1">
<div class="user-avatar">
<img :src="goodsImgHandle(scope.row.goods_image)" />
</div>
<div class="user-info">
<div class="nickname">{{ scope.row.goods_name || '' }}</div>
<div class="user-id">订单号:{{ scope.row.order_no || '' }}</div>
<div class="user-id">商品ID{{ scope.row.goods_id || '' }}</div>
</div>
</div>
<div class="user-content" v-else-if="scope.row.order_type == 5">
<div class="user-info">
<div class="nickname">在线买单</div>
<div class="user-id">订单号:{{ scope.row.order_no || '' }}</div>
</div>
</div>
<div class="user-content" v-else>-</div>
</template>
</el-table-column>
<el-table-column label="抽成和佣金" align="center">
<template slot="header" slot-scope="scope">
抽成和佣金 <br />
<el-tag type="info" effect="plain" class="rate-num" size="small">总金额</el-tag>
<el-tag effect="plain" class="rate-num" size="small">占有比例</el-tag>
<el-tag type="danger" effect="plain" class="rate-num" size="small">退款减少金额</el-tag>
<el-tag type="success" effect="plain" size="small">实际有效金额</el-tag>
</template>
<el-table-column label="订单金额" min-width="95" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.real_goods_money || '0.00' }}元</el-tag>
</template>
</el-table-column>
<el-table-column label="积分" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.integral_money || '0.00' }}元</el-tag>
<br />
<el-tag effect="plain" class="rate-num" size="small" v-if="scope.row.integral_rate >= 0">{{ scope.row.integral_rate || '0' }}%</el-tag>
<el-tag effect="plain" class="rate-num" size="small" v-else>固定金额</el-tag>
<br />
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.integral_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br />
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.integral_money) - (Number(scope.row.integral_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2) }}元
</el-tag>
</template>
</el-table-column>
<el-table-column label="运营" align="center">
<el-table-column label="合计" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.operations_money || '0.00' }}元</el-tag>
<br />
<el-tag effect="plain" class="rate-num" size="small" v-if="scope.row.operations_rate >= 0">{{ scope.row.operations_rate || '0' }}%</el-tag>
<el-tag effect="plain" class="rate-num" size="small" v-else>固定金额</el-tag>
<br />
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br />
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_money) - (Number(scope.row.operations_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2) }}元
</el-tag>
</template>
</el-table-column>
<el-table-column label="技术" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.operations_technology_money || '0.00' }}元</el-tag>
<br/>
<el-tag effect="plain" class="rate-num" size="small">20%</el-tag>
<br/>
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_technology_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br/>
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_technology_money) - (Number(scope.row.operations_technology_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2)}}元
</el-tag>
</template>
</el-table-column>
<el-table-column label="平台" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.operations_platform_money || '0.00' }}元</el-tag>
<br/>
<el-tag effect="plain" class="rate-num" size="small">80%</el-tag>
<br/>
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_technology_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br/>
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.operations_technology_money) - (Number(scope.row.operations_technology_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2)}}元
</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="合伙人" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.partner_money || '0.00' }}元</el-tag>
<br />
<el-tag effect="plain" class="rate-num" size="small" v-if="scope.row.partner_rate >= 0">{{ scope.row.partner_rate || '0' }}%</el-tag>
<el-tag effect="plain" class="rate-num" size="small" v-else>固定金额</el-tag>
<br />
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.partner_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br/>
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.partner_money) - (Number(scope.row.partner_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2)}}元
</el-tag>
<br />
<el-tag v-if="scope.row.partner_status == 0" type="info" effect="dark" class="rate-num" size="small">待结算</el-tag>
<el-tag v-else-if="scope.row.partner_status == 1" type="success" effect="dark" class="rate-num" size="small">已结算</el-tag>
<el-tag v-else-if="scope.row.partner_status == 2" type="danger" effect="dark" class="rate-num" size="small">无合伙人</el-tag>
</template>
</el-table-column>
<el-table-column label="招商员" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.merchants_money || '0.00' }}元</el-tag>
<br />
<el-tag effect="plain" class="rate-num" size="small" v-if="scope.row.merchants_rate >= 0">{{ scope.row.merchants_rate || '0' }}%</el-tag>
<el-tag effect="plain" class="rate-num" size="small" v-else>固定金额</el-tag>
<br />
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.merchants_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br/>
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.merchants_money) - (Number(scope.row.merchants_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2)}}元
</el-tag>
<br />
<el-tag v-if="scope.row.merchants_status == 0" type="info" effect="dark" class="rate-num" size="small">待结算</el-tag>
<el-tag v-else-if="scope.row.merchants_status == 1" type="success" effect="dark" class="rate-num" size="small">已结算</el-tag>
<el-tag v-else-if="scope.row.merchants_status == 2" type="danger" effect="dark" class="rate-num" size="small">无招商员</el-tag>
</template>
</el-table-column>
<el-table-column label="推广员" min-width="80" align="center">
<template slot-scope="scope">
<el-tag type="info" effect="plain" size="small">{{ scope.row.promoter_money || '0.00' }}元</el-tag>
<br />
<el-tag effect="plain" class="rate-num" size="small" v-if="scope.row.promoter_rate >= 0">{{ scope.row.promoter_rate || '0' }}%</el-tag>
<el-tag effect="plain" class="rate-num" size="small" v-else>固定金额</el-tag>
<br />
<el-tag type="danger" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.promoter_money) * Number(scope.row.refund_ratio) / 100).toFixed(2) }}元
</el-tag>
<br/>
<el-tag type="success" effect="plain" class="rate-num" size="small">
{{ Number(Number(scope.row.promoter_money) - (Number(scope.row.promoter_money) * Number(scope.row.refund_ratio) / 100)).toFixed(2)}}元
</el-tag>
<br />
<el-tag v-if="scope.row.promoter_status == 0" type="info" effect="dark" class="rate-num" size="small">待结算</el-tag>
<el-tag v-else-if="scope.row.promoter_status == 1" type="success" effect="dark" class="rate-num" size="small">已结算</el-tag>
<el-tag v-else-if="scope.row.promoter_status == 2" type="danger" effect="dark" class="rate-num" size="small">无推广员</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="记录时间" prop="create_time" min-width="150" align="center"/>
</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>
</div>
{/block}
{block name="script"}
<script>
new Vue({
el:'#vueContent',
data(){
return {
is_admin: false,
listLoading: true,
tableData: {
data: [],
total: 0,
},
tableFrom: {
page: 1,
limit: 10,
member_id: '',
site_id: '',
order_no: '',
goods_id: ''
},
cardLists: [],
};
},
mounted(){
this.getStatistics();
this.getList('');
},
methods: {
// 获取统计信息
getStatistics() {
let _this = this;
$.ajax({
url: ns.url("commission://shop/index/recordStatistics"),
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;
$.ajax({
url: ns.url("commission://shop/index/index"),
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('');
},
// 处理商品图片
goodsImgHandle(goods_image){
let imgArr = goods_image.split(',')
return imgArr[0] || '/public/static/img/default_img/article.png';
}
}
});
</script>
{/block}