210 lines
8.4 KiB
HTML
210 lines
8.4 KiB
HTML
{layout name="layout1" /}
|
||
<div class="wrapper">
|
||
<div class="layui-card">
|
||
|
||
<div class="layui-form layui-card-header layuiadmin-card-header-auto" style="height:auto !important;">
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">会员信息:</label>
|
||
<div class="layui-input-inline" style="width: 200px;">
|
||
<input type="text" id="keyword" name="keyword" placeholder="请输入关键词" autocomplete="off" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">用户状态:</label>
|
||
<div class="layui-input-inline">
|
||
<select id="disable" name="disable" style="height:80px;width: 80px" >
|
||
<option value="">全部</option>
|
||
<option value="0">正常</option>
|
||
<option value="1">禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-inline">
|
||
<button class="layui-btn layui-btn-sm layuiadmin-btn-user {$view_theme_color}" lay-submit lay-filter="user-search">查询</button>
|
||
<button class="layui-btn layui-btn-sm layuiadmin-btn-user layui-btn-primary " lay-submit lay-filter="user-clear-search">重置</button>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="layui-card-body">
|
||
|
||
<table id="user-lists" lay-filter="user-lists"></table>
|
||
|
||
<script type="text/html" id="user-info">
|
||
<img src="{{d.avatar}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
|
||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||
<p>用户编号:{{d.u_id}}</p>
|
||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">用户昵称:{{d.nickname}}</p>
|
||
</div>
|
||
</script>
|
||
|
||
<script type="text/html" id="u_examine_state">
|
||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||
<p>{{# if(d.u_examine_state==1){}} 已审核{{# } }}
|
||
</p>
|
||
</div>
|
||
</script>
|
||
|
||
<script type="text/html" id="wholesale_state">
|
||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||
<p>{{# if(d.wholesale_state==2){}} 通过{{# } }}
|
||
{{# if(d.wholesale_state==3){}}拒绝{{# } }}
|
||
{{# if(d.wholesale_state==1){}}审核中{{# } }}
|
||
</p>
|
||
</div>
|
||
</script>
|
||
<script type="text/html" id="register-info">
|
||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||
<p>注册时间:{{d.u_dtime}}</p>
|
||
</div>
|
||
</script>
|
||
<script type="text/html" id="user-state">
|
||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||
<p>用户状态:
|
||
{{# if(d.u_state==0){}}
|
||
禁用
|
||
{{# }else{ }}
|
||
正常
|
||
{{# } }}</p>
|
||
</div>
|
||
</script>
|
||
<script type="text/html" id="user-operation">
|
||
<a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="info">资料</a>
|
||
{{# if(d.wholesale_state==1){}}
|
||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="examine">审批批发价</a>
|
||
{{# } }}
|
||
</script>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<style>
|
||
.layui-table-cell {
|
||
height: auto;
|
||
}
|
||
</style>
|
||
<script>
|
||
layui.config({
|
||
version:"{$front_version}",
|
||
base: '/static/lib/' //静态资源所在路径
|
||
}).use(['table','laydate'], function(){
|
||
var $ = layui.$
|
||
,form = layui.form
|
||
,table = layui.table
|
||
, laydate = layui.laydate;
|
||
|
||
//监听搜索
|
||
form.on('submit(user-search)', function(data){
|
||
var field = data.field;
|
||
//执行重载
|
||
table.reload('procurement-lists', {
|
||
where: field,
|
||
page: {
|
||
curr: 1 //重新从第 1 页开始
|
||
}
|
||
});
|
||
});
|
||
|
||
//清空查询
|
||
form.on('submit(user-clear-search)', function(){
|
||
$('#keyword').val(''); //清空输入框
|
||
$('#level').val(''); //清空输入框
|
||
$('#disable').val(''); //清空禁用状态
|
||
form.render('select');
|
||
//刷新列表
|
||
table.reload('procurement-lists', {
|
||
where: [],
|
||
page: {
|
||
curr: 1 //重新从第 1 页开始
|
||
}
|
||
});
|
||
});
|
||
$('.layui-btn.layuiadmin-btn-user').on('click', function(){
|
||
var type = $(this).data('type');
|
||
active[type] ? active[type].call(this) : '';
|
||
});
|
||
|
||
$(document).on('click', '.image-show', function () {
|
||
var src = $(this).attr('src');
|
||
like.showImg(src,600);
|
||
});
|
||
});
|
||
|
||
|
||
|
||
layui.define(['table', 'form'], function(exports){
|
||
var $ = layui.$
|
||
,table = layui.table
|
||
,form = layui.form;
|
||
|
||
table.render({
|
||
id:'user-lists'
|
||
,elem: '#user-lists'
|
||
,url: '{:url("procurement.procurement/lists")}' //模拟接口
|
||
,cols: [[
|
||
{type: 'checkbox'}
|
||
,{title: '用户信息',width: 370,align: 'center', templet: '#user-info'}
|
||
,{field: '是否审核集采会员', title: '是否审核集采会员',width: 120,templet: '#u_examine_state'}
|
||
,{field: '是否审核批发价', title: '是否审核批发价',width: 120,templet: '#wholesale_state'}
|
||
,{title: '注册信息',width: 300,align: 'center', templet: '#register-info'}
|
||
,{title: '状态',width: 370,align: 'center', templet: '#user-state'}
|
||
,{fixed: 'right', title: '操作', width: 420,toolbar: '#user-operation',align: 'center'}
|
||
]]
|
||
,page:true
|
||
,text: {none: '暂无数据!'}
|
||
,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
|
||
return {
|
||
"code":res.code,
|
||
"msg":res.msg,
|
||
"count": res.data.count, //解析数据长度
|
||
"data": res.data.lists, //解析数据列表
|
||
};
|
||
},
|
||
response: {
|
||
statusCode: 1
|
||
}
|
||
, done: function fix() {
|
||
$(".layui-table-main tr").each(function (index, val) {
|
||
$(".layui-table-fixed").each(function () {
|
||
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
||
});
|
||
});
|
||
$(".layui-table-header tr").each(function (index, val) {
|
||
$(".layui-table-fixed").each(function () {
|
||
$($(this).find(".layui-table-header thead tr")[index]).height($(val).height());
|
||
});
|
||
});
|
||
window.onresize = function () {
|
||
fix()
|
||
}
|
||
}
|
||
});
|
||
|
||
var moreShow = 0;
|
||
//监听工具条
|
||
table.on('tool(user-lists)', function(obj){
|
||
if(obj.event === 'info'){
|
||
var id = obj.data.u_id;
|
||
layer.open({
|
||
type: 2
|
||
,title: '会员资料'
|
||
,content: '{:url("procurement.procurement/info")}?id='+id
|
||
,area: ['90%','90%']
|
||
,btn: ['返回']
|
||
})
|
||
}
|
||
if(obj.event === 'examine'){
|
||
var id = obj.data.u_id;
|
||
layer.open({
|
||
type: 2
|
||
,title: '审批批发价'
|
||
,content: '{:url("procurement.procurement/wprice")}?id='+id
|
||
,area: ['90%','90%']
|
||
,btn: ['返回']
|
||
})
|
||
}
|
||
});
|
||
});
|
||
</script>
|