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

261 lines
8.4 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;
}
</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-model="tableFrom.member_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>
</div>
</div>
<!--表格信息-->
<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="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="归属店铺" 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="level_name" min-width="100" align="center"></el-table-column>
<el-table-column label="持有数量" prop="quantity" min-width="100" 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="变更前持有数量" prop="change_front" min-width="150" align="center"></el-table-column>
<el-table-column label="变更类型" min-width="150" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.change_type == 1" type="success" effect="dark">增加</el-tag>
<el-tag v-else type="danger" effect="dark">减少</el-tag>
</template>
</el-table-column>
<el-table-column label="变更数量" prop="change_quantity" min-width="150" align="center"></el-table-column>
<el-table-column label="变更后持有数量" prop="change_after" min-width="150" align="center"></el-table-column>
<el-table-column label="变更时间" prop="create_time" min-width="120" align="center"></el-table-column>
<el-table-column label="备注" prop="remark" 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: 0,
member_id: 0,
level_id: 0,
},
};
},
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/weightValue"),
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);
// 修改弹框标题 并且显示弹框
let nickname = row.nickname || row.username;
_this.dialogTitle = nickname + ' 的权重值变更明细';
_this.dialogLoading = true;
_this.dialogVisible = true;
// 生成搜索条件 并且进行搜索
_this.dialogTableFrom.site_id = row.site_id;
_this.dialogTableFrom.member_id = row.member_id;
_this.dialogTableFrom.level_id = row.level_id;
$.ajax({
url: ns.url("commission://shop/index/weightValueLog"),
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}