305 lines
11 KiB
HTML
305 lines
11 KiB
HTML
{layout name="layout1" /}
|
|
<style>
|
|
.layui-table-cell {
|
|
height:auto;
|
|
}
|
|
.goods-content>div:not(:last-of-type) {
|
|
border-bottom:1px solid #DCDCDC;
|
|
}
|
|
.goods-data::after{
|
|
display: block;
|
|
content: '';
|
|
clear: both;
|
|
}
|
|
.goods_name_hide{
|
|
overflow:hidden;
|
|
white-space:nowrap;
|
|
text-overflow: ellipsis;
|
|
}
|
|
.operation-btn {
|
|
margin: 5px;
|
|
}
|
|
.table-operate{
|
|
text-align: left;
|
|
font-size:14px;
|
|
padding:0 5px;
|
|
height:auto;
|
|
overflow:visible;
|
|
text-overflow:inherit;
|
|
white-space:normal;
|
|
word-break: break-all;
|
|
}
|
|
</style>
|
|
|
|
<div class="layui-fluid">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
|
<div class="layui-colla-content layui-show">
|
|
<p>*哆啦猫内部员工列表,对员工档案进行编辑,账户调整,资料查看等操作。</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
|
|
|
<ul class="layui-tab-title">
|
|
<li data-type='' class="layui-this">全部</li>
|
|
</ul>
|
|
|
|
<div class="layui-tab-item layui-show">
|
|
<div class="layui-card">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
|
<div class="layui-row">
|
|
|
|
|
|
<div class="layui-inline" style="width: 24%;">
|
|
<label class="layui-form-label">员工姓名:</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="name" id="name" placeholder="请输入员工姓名"
|
|
autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-inline" style="width: 24%;">
|
|
<label class="layui-form-label">手机号码:</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="mobile" id="mobile" placeholder="请输入客户手机号码"
|
|
autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline" style="width: 24%;">
|
|
<label class="layui-form-label">员工编号:</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="name" id="name" placeholder="请输入员工编号"
|
|
autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="layui-inline" style="margin-left: 30px;">
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
|
|
lay-filter="user-search">查询
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
|
|
lay-filter="user-clear-search">清空查询
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-card-body">
|
|
<table id="order-lists" lay-filter="order-lists"></table>
|
|
<script type="text/html" id="number">
|
|
<div style="text-align: left">
|
|
<p>{{d.distance}}km</p>
|
|
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" id="user-operation">
|
|
|
|
|
|
|
|
{{# if(d.static == 0){ }}
|
|
<a class="layui-btn layui-btn-normal layui-btn-sm" style="background-color: #16b777;" id="transit" lay-event="transit">回复数据</a>
|
|
{{# }else{ }}
|
|
<a class="layui-btn layui-btn-normal layui-btn-sm" style="background-color: brown;" id="transit">删除订单</a>
|
|
{{#} }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
layui.config({
|
|
version:"{$front_version}",
|
|
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
|
}).extend({
|
|
index: 'lib/index' //主入口模块
|
|
}).use(['index', 'table', 'like', 'laydate'], function () {
|
|
var $ = layui.$
|
|
, form = layui.form
|
|
, table = layui.table
|
|
, like = layui.like
|
|
, element = layui.element
|
|
, laydate = layui.laydate;
|
|
var listType = '';
|
|
|
|
//图片放大
|
|
$(document).on('click', '.image-show', function () {
|
|
var src = $(this).attr('src');
|
|
like.showImg(src,600);
|
|
});
|
|
|
|
//监听搜索
|
|
form.on('submit(order-search)', function (data) {
|
|
var field = data.field;
|
|
//执行重载
|
|
table.reload('order-lists', {
|
|
where: field,
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
//清空查询
|
|
form.on('submit(order-clear-search)', function () {
|
|
$('#keyword').val('');
|
|
$('#order_status').val('');
|
|
$('#goods_name').val('');
|
|
$('#pay_way').val('');
|
|
$('#order_type').val('');
|
|
$('#order_source').val('');
|
|
$('#start_time').val('');
|
|
$('#end_time').val('');
|
|
$('#delivery_type').val('');
|
|
form.render('select');
|
|
//刷新列表
|
|
table.reload('order-lists', {
|
|
where: [],
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
//日期时间范围
|
|
laydate.render({
|
|
elem: '#start_time'
|
|
,type: 'datetime'
|
|
,trigger: 'click'
|
|
});
|
|
|
|
|
|
laydate.render({
|
|
elem: '#end_time'
|
|
,type: 'datetime'
|
|
,trigger: 'click'
|
|
});
|
|
|
|
//获取列表
|
|
getList(listType);
|
|
//切换列表
|
|
element.on('tab(tab-all)', function (data) {
|
|
$('#keyword').val('');
|
|
$('#order_status').val('');
|
|
$('#goods_name').val('');
|
|
$('#pay_way').val('');
|
|
$('#order_type').val('');
|
|
$('#start_time').val('');
|
|
$('#end_time').val('');
|
|
$('#delivery_type').val('');
|
|
form.render('select');
|
|
listType = $(this).attr('data-type');
|
|
getList(listType);
|
|
if (listType !== ''){
|
|
$('.order_status').hide();
|
|
}else {
|
|
$('.order_status').show();
|
|
}
|
|
});
|
|
|
|
function getList(type) {
|
|
table.render({
|
|
elem: '#order-lists'
|
|
,url: '{:url("Number/list")}'//模拟接口
|
|
, cols: [[
|
|
{type: 'checkbox'}
|
|
,{field: 'id', width: 80, title: 'ID', sort: true, }
|
|
,{field: 'card_name', title: '套餐名称',align: 'center',}
|
|
,{field: 'mobile', title: '电话'}
|
|
|
|
,{fixed: 'right', title: '操作', width: 185,toolbar: '#user-operation'}
|
|
]]
|
|
, page: true
|
|
, text: {none: '暂无数据!'}
|
|
, parseData: function (res) {
|
|
return {
|
|
"code": res.code,
|
|
"msg": res.msg,
|
|
"count": res.data.count,
|
|
"data": res.data.lists,
|
|
};
|
|
}
|
|
,done: function(res, curr, count){
|
|
// 解决操作栏因为内容过多换行问题
|
|
$(".layui-table-main tr").each(function (index, val) {
|
|
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
|
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
//监听工具条
|
|
table.on('tool(order-lists)', function (obj) {
|
|
var id = obj.data.id;
|
|
if(obj.event === 'edit'){
|
|
var id = obj.data.id;
|
|
layer.prompt({title: '增加配置距离', formType: 2, value:0}, function(value, index){
|
|
if(!isNaN(value)){
|
|
$.ajax({
|
|
url: '{:url("Configura/distance")}'
|
|
, data: {'id': id, "number": value }
|
|
, type: 'post'
|
|
, success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg, {
|
|
offset: '15px'
|
|
, icon: 1
|
|
, time: 1000
|
|
});
|
|
layer.close(index); //关闭弹层
|
|
table.reload('order-lists');
|
|
}
|
|
}
|
|
});
|
|
|
|
}else{
|
|
layui.layer.msg('距离只能输入数字')
|
|
}
|
|
});
|
|
}
|
|
if(obj.event === 'transit'){
|
|
var id = obj.data.id;
|
|
layer.confirm('确定恢复数据', {
|
|
btn: ['确认','取消'] //按钮
|
|
}, function(){
|
|
like.ajax({
|
|
url: '{:url("Number/date")}'
|
|
, data: {'id': id}
|
|
, type: 'post'
|
|
, success: function (res) {
|
|
if (res.code == 1) {
|
|
layui.layer.msg(res.msg, {
|
|
offset: '15px'
|
|
, icon: 1
|
|
, time: 1000
|
|
},function () {
|
|
table.reload('order-lists');
|
|
});
|
|
}
|
|
},
|
|
});
|
|
});
|
|
}
|
|
|
|
});
|
|
});
|
|
</script> |