298 lines
9.7 KiB
HTML
298 lines
9.7 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;
|
|
}
|
|
.flexs{
|
|
display:flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
}
|
|
.w-left{
|
|
/* width: 300px; */
|
|
width: 17%;
|
|
border: 1px solid #f1f1f1;
|
|
/* width: 220px; */
|
|
}
|
|
#calendar{
|
|
width: 80%;
|
|
}
|
|
.w-left{
|
|
height: 86vh;
|
|
overflow-y: scroll;
|
|
}
|
|
.w-left p{
|
|
line-height: 1.2;
|
|
text-align: center;
|
|
}
|
|
.w-l-i{
|
|
padding: 10px;
|
|
margin: 3px auto;
|
|
border-bottom: 1px solid #f1f1f1;
|
|
}
|
|
.w-l-a{
|
|
background-color: #eaf9ff;
|
|
}
|
|
.w-l-d{
|
|
color: #999;
|
|
}
|
|
#search_text{
|
|
border: 1px solid #c1c1c1;
|
|
height: 35px;
|
|
line-height: 35px;
|
|
padding: 0 10px;
|
|
border-radius: 5px;
|
|
}
|
|
#s_btn{
|
|
background: #1E9FFF !important;
|
|
outline: none;
|
|
border: none;
|
|
height: 37px;
|
|
line-height: 37px;
|
|
width: 80px;
|
|
color: #fff;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
border-radius: 5px;
|
|
}
|
|
</style>
|
|
<script src="/static/webjs/date.js"></script>
|
|
|
|
|
|
<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>
|
|
<p>*订单的状态又执行成功,等待执行,请勿删除执行</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
|
|
|
|
|
<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-form-item">
|
|
<div style="margin:10px 0">
|
|
<input type="text" id="search_text" value="" placeholder="请输入名字或者电话搜索" />
|
|
<button type="button" id="s_btn" onclick="search_fun()">搜索</button>
|
|
</div>
|
|
<div class="flexs">
|
|
<div class="w-left">
|
|
<div></div>
|
|
</div>
|
|
<div id="calendar"></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/static/webjs/jquery.min.js"></script>
|
|
<script>
|
|
function initday(events = [],now){
|
|
let calendarEl = document.getElementById('calendar');
|
|
let calendar = new FullCalendar.Calendar(calendarEl, {
|
|
eventClick: function(info) {
|
|
let d = info.event._def
|
|
if(d.publicId){
|
|
let arr = d.publicId.split('_')
|
|
console.log(arr);
|
|
if(arr[0] == 'pb'){
|
|
console.log(layer.alert('订单编号:'+arr[1]+'<br>'+'客户姓名:'+arr[2]+'<br>'+'客户电话:'+arr[3]+'<br>'+'房屋地址:'+arr[4]))
|
|
}
|
|
|
|
}
|
|
// alert('Clicked on: ' +info);
|
|
},
|
|
|
|
// 自定义头部工具
|
|
headerToolbar: {
|
|
start: 'title',
|
|
center: '',
|
|
end: 'today prev,next'
|
|
},
|
|
|
|
now: now, // 自定义当前时间,只用于显示使用,正常不需要这个参数
|
|
|
|
height: "auto", // 定义表格高度
|
|
allDaySlot: false, // 是否显示表头的全天事件栏
|
|
// initialView: 'timeGridWeek',
|
|
locale: 'zh-cn', // 区域本地化
|
|
firstDay: 1, // 每周的第一天: 0:周日
|
|
|
|
|
|
|
|
|
|
events: events
|
|
});
|
|
calendar.render();
|
|
}
|
|
function binduidclick(){
|
|
$('.w-l-i').off()
|
|
$('.w-l-i').click(function(){
|
|
$('.w-l-i').removeClass('w-l-a')
|
|
$(this).addClass('w-l-a')
|
|
|
|
var uid = $(this).attr('uid')
|
|
console.log(uid)
|
|
$.get('/admin/staff/Scheduling',{uid:uid},function(e){
|
|
console.log(e)
|
|
if(e.code == 1 && e.data){
|
|
let pb = e.data.pb
|
|
let qj = e.data.qj
|
|
let qj2 = e.data.qj2
|
|
let events = []
|
|
//循环排班和请假的
|
|
for(let d of pb){
|
|
events.push({
|
|
id:'pb_'+d.id+'_'+d.custom+'_'+d.mobile+'_'+d.address,
|
|
color:'red',
|
|
title:(d.type == 3 ?'固定':'非固定')+'-'+(d.addtime == 1 ?'上午':'下午')+'--'+(d.lock == 1 ?'锁定':'未锁定'),
|
|
start:d.date,
|
|
end:d.date
|
|
})
|
|
|
|
}
|
|
for(let d of qj){
|
|
events.push({
|
|
color:(d.addtime == 1 ?'red':'green'),
|
|
title:'占用'+'-'+(d.addtime == 1 ?'上午':'下午'),
|
|
start:d.time,
|
|
end:d.time
|
|
})
|
|
}
|
|
for(let d of qj2){
|
|
if(d.addtime == 2){
|
|
events.push({
|
|
color:'green',
|
|
title:'请假-上午',
|
|
start:d.time,
|
|
end:d.time
|
|
})
|
|
events.push({
|
|
color:'red',
|
|
title:'请假-下午',
|
|
start:d.time,
|
|
end:d.time
|
|
})
|
|
}else{
|
|
events.push({
|
|
color:(d.addtime == 1 ?'red':'green'),
|
|
title:'请假'+'-'+(d.addtime == 0 ?'上午':'下午'),
|
|
start:d.time,
|
|
end:d.time
|
|
})
|
|
}
|
|
|
|
}
|
|
initday(events,e.data.now)
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
}
|
|
layui.config({
|
|
version:"{$front_version}",
|
|
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
|
}).extend({
|
|
index: 'lib/index' //主入口模块
|
|
}).use(['index', 'element', 'jquery', 'like', 'likeedit'], function () {
|
|
|
|
|
|
})
|
|
|
|
|
|
window.onload = ()=>{
|
|
//初始化日历
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.post('/admin/staff/stafflist',{},function(e){
|
|
console.log(e)
|
|
var html = ''
|
|
if(e.code == 1 && e.data.length){
|
|
for(let p of e.data){
|
|
html += `<div class="w-l-i" uid="`+p.id+`">
|
|
<p>`+p.mobile+'-'+p.name+`</p>
|
|
<p class="w-l-d" style="margin:5px">`+'地址:'+p.addr+`</p>
|
|
<p class="w-l-d" style="margin:5px">`+'服务总订单:'+p.marry+'单'+`</p>
|
|
</div>`
|
|
}
|
|
}
|
|
$('.w-left').html(html)
|
|
binduidclick()
|
|
|
|
$('.w-l-i').eq(0).trigger('click')
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
function search_fun(){
|
|
|
|
$.post('/admin/staff/stafflist',{txt:$('#search_text').val()},function(e){
|
|
var html = ''
|
|
if(e.code == 1 && e.data.length){
|
|
for(let p of e.data){
|
|
html += `<div class="w-l-i" uid="`+p.id+`">
|
|
<p>`+p.mobile+'-'+p.name+`</p>
|
|
<p class="w-l-d" style="margin:5px">`+'地址:'+p.addr+`</p>
|
|
<p class="w-l-d" style="margin:5px">`+'服务总订单:'+p.marry+'单'+`</p>
|
|
</div>`
|
|
}
|
|
}
|
|
$('.w-left').html(html)
|
|
binduidclick()
|
|
$('.w-l-i').eq(0).trigger('click')
|
|
})
|
|
}
|
|
</script>
|
|
|