484 lines
22 KiB
Plaintext
484 lines
22 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
|
<%@page import="com.sipai.entity.work.Scheduling" %>
|
|
<% request.setAttribute("Status_UnSucceeded", Scheduling.Status_UnSucceeded); %>
|
|
<% request.setAttribute("Status_Succeeded", Scheduling.Status_Succeeded); %>
|
|
<% request.setAttribute("Status_Handovered", Scheduling.Status_Handovered); %>
|
|
<%@page import="com.sipai.entity.work.GroupContentForm" %>
|
|
<% request.setAttribute("Showtextst_TRUE", GroupContentForm.Showtextst_TRUE); %>
|
|
<% request.setAttribute("Showtextst_FALSE", GroupContentForm.Showtextst_FALSE); %>
|
|
<!DOCTYPE html>
|
|
<!-- <html lang="zh-CN"> -->
|
|
<!-- BEGIN HEAD -->
|
|
|
|
<head>
|
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
|
</title>
|
|
<!-- 引用页头及CSS页-->
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
|
|
<script type="text/javascript">
|
|
var bizid = "";
|
|
var groupType = "";
|
|
var sdt = "";
|
|
var edt = "";
|
|
var groupDetailId = "";
|
|
var nowSchedulingId = "";
|
|
var lastSchedulingId = "";
|
|
|
|
$(function () {
|
|
if ('${param.unitId}' != null && '${param.unitId}' != '') {
|
|
bizid = '${param.unitId}';
|
|
} else {
|
|
bizid = unitId;
|
|
}
|
|
getNowGroupType();
|
|
});
|
|
|
|
function doSucceed(st) {
|
|
// console.log("doSucceed in "+st);
|
|
if (st == '1') {
|
|
$.post(ext.contextPath + '/work/scheduling/succeed.do', {
|
|
nowSchedulingId: nowSchedulingId,
|
|
succeedremark: $('#succeedremark').val(),
|
|
workpeople: $('#workpeople').val()
|
|
}, function (data) {
|
|
if (data.code == 1) {
|
|
showAlert('s', '接班成功');
|
|
getNowGrouptime(bizid, groupType);
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '接班失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
|
|
} else if (st == '2') {
|
|
$.post(ext.contextPath + '/work/scheduling/succeed2.do', {
|
|
nowSchedulingId: nowSchedulingId,
|
|
succeedremark: $('#succeedremark').val(),
|
|
workpeople: $('#workpeople').val()
|
|
}, function (data) {
|
|
if (data.code == 1) {
|
|
showAlert('s', '接班成功');
|
|
getNowGrouptime(bizid, groupType);
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '接班失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
|
|
} else if (st == '3') {//当前无排班,直接添加记录
|
|
$.post(ext.contextPath + '/work/scheduling/succeed3.do', {
|
|
unitId: bizid,
|
|
groupTime: $('#grouptime').val(),
|
|
groupType: groupType,
|
|
sdt: sdt,
|
|
edt: edt,
|
|
succeedremark: $('#succeedremark').val(),
|
|
groupDetailId: groupDetailId,
|
|
workpeople: $('#workpeople').val()
|
|
}, function (data) {
|
|
if (data.code == 1) {
|
|
showAlert('s', '接班成功');
|
|
getNowGrouptime(bizid, groupType);
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '接班失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
}
|
|
|
|
function goSucceed() {
|
|
if (groupType == '') {
|
|
showAlert('d', '您必须属于某个班组才能接班!');
|
|
return;
|
|
}
|
|
swal({
|
|
text: "您确定要接班?",
|
|
dangerMode: true,
|
|
buttons: {
|
|
cancel: {
|
|
text: "取消",
|
|
value: null,
|
|
visible: true,
|
|
className: "btn btn-default btn-sm",
|
|
closeModal: true,
|
|
},
|
|
confirm: {
|
|
text: "确定",
|
|
value: true,
|
|
visible: true,
|
|
className: "btn btn-success btn-sm",
|
|
closeModal: true
|
|
}
|
|
}
|
|
})
|
|
.then(function (willConfrim) {
|
|
if (willConfrim) {
|
|
$.post(ext.contextPath + '/work/scheduling/isGroupDetailUser.do', {
|
|
bizid: bizid,
|
|
groupTime: $('#grouptime').val(),
|
|
groupType: groupType,
|
|
sdt: sdt,
|
|
edt: edt
|
|
}, function (data) {
|
|
if (data.res == 1) {
|
|
// showAlert('s', '属于班组成员');
|
|
doSucceed('1');
|
|
} else if (data.res == 2) {
|
|
swal({
|
|
text: "您并非当班人员,确认接班?",
|
|
dangerMode: true,
|
|
buttons: {
|
|
cancel: {
|
|
text: "取消",
|
|
value: null,
|
|
visible: true,
|
|
className: "btn btn-default btn-sm",
|
|
closeModal: true,
|
|
},
|
|
confirm: {
|
|
text: "确定",
|
|
value: true,
|
|
visible: true,
|
|
className: "btn btn-success btn-sm",
|
|
closeModal: true
|
|
}
|
|
}
|
|
})
|
|
.then(function (willConfrim) {
|
|
if (willConfrim) {
|
|
doSucceed('2');
|
|
}
|
|
|
|
});
|
|
} else if (data.res == 3) {
|
|
doSucceed('3');
|
|
// swal({
|
|
// text: "当前无排班,确认接班?",
|
|
// dangerMode: true,
|
|
// buttons: {
|
|
// cancel: {
|
|
// text: "取消",
|
|
// value: null,
|
|
// visible: true,
|
|
// className: "btn btn-default btn-sm",
|
|
// closeModal: true,
|
|
// },
|
|
// confirm: {
|
|
// text: "确定",
|
|
// value: true,
|
|
// visible: true,
|
|
// className: "btn btn-success btn-sm",
|
|
// closeModal: true
|
|
// }
|
|
// }
|
|
// })
|
|
// .then(function (willConfrim) {
|
|
// if (willConfrim) {
|
|
// doSucceed('3');
|
|
// }
|
|
//
|
|
// });
|
|
}
|
|
}, 'json');
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function getNowGroupType() {
|
|
$.post(ext.contextPath + '/work/groupType/getNowGroupType.do', {
|
|
bizid: bizid
|
|
}, function (data) {
|
|
if (data != null && data != '') {
|
|
groupType = data[0].id;
|
|
getNowGrouptime(bizid, data[0].id);
|
|
|
|
if (data.length == 1) {
|
|
$('#grouptypeName').css('display', 'block');
|
|
$('#grouptype').css('display', 'none');
|
|
$('#grouptypeName').text(data[0].text);
|
|
} else {
|
|
var select = $("#grouptype").select2({
|
|
data: data,
|
|
placeholder: '请选择',//默认文字提示
|
|
allowClear: false,//允许清空
|
|
escapeMarkup: function (markup) {
|
|
return markup;
|
|
}, // 自定义格式化防止xss注入
|
|
language: "zh-CN",
|
|
minimumInputLength: 0,
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|
formatResult: function formatRepo(repo) {
|
|
return repo.text;
|
|
}, // 函数用来渲染结果
|
|
formatSelection: function formatRepoSelection(repo) {
|
|
return repo.text;
|
|
} // 函数用于呈现当前的选择
|
|
});
|
|
$("#grouptype").on("select2:select", function (e) {
|
|
var ckdata = e.params.data;
|
|
groupType = $('#grouptype').val();
|
|
getNowGrouptime(bizid, groupType);
|
|
});
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
|
if (data.length != 0) {
|
|
select.val(data[0].id).trigger("change");//设置选中
|
|
} else {
|
|
select.val("").trigger("change");//设置选中
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 'json');
|
|
}
|
|
|
|
function getNowGrouptime(bizid, groupType) {
|
|
$.ajax({
|
|
url: ext.contextPath
|
|
+ "/work/groupTime/getNowGrouptimeForSucceed.do",
|
|
type: "post",
|
|
cache: false,
|
|
data: {bizid: bizid, groupType: groupType},
|
|
dataType: "json",
|
|
async: true,
|
|
success: function (datas) {
|
|
// console.log(datas)
|
|
if (datas != null && datas != '') {
|
|
let data = datas.data;
|
|
lastSchedulingId = datas.lastSchedulingId;
|
|
sdt = data[0].sdt;
|
|
edt = data[0].edt;
|
|
|
|
nowSchedulingId = data[0].nowSchedulingId;
|
|
groupDetailId = data[0].groupDetailId;
|
|
$('#workpeople').val(data[0].workpeople);
|
|
$('#_workpeople').val(data[0]._workpeople);
|
|
$('#succeedremark').val(data[0].succeedremark);
|
|
if (data[0].schedulingSt == '') {
|
|
$('#succeedBtn').css('display', 'block');
|
|
} else {
|
|
$('#succeedBtn').css('display', 'none');
|
|
}
|
|
$('#grouptimeName').text(data[0].text);
|
|
$('#grouptime').val(data[0].id);
|
|
}
|
|
|
|
getLastGroup();
|
|
}
|
|
});
|
|
}
|
|
|
|
function getLastGroup() {//lastContent
|
|
$.post(ext.contextPath + '/work/groupContent/getLastGroup.do', {
|
|
unitId: bizid,
|
|
groupType: groupType,
|
|
schedulingId: lastSchedulingId
|
|
}, function (data) {
|
|
// console.log(data)
|
|
var html = "<table style='width: 100%;text-align: center;border-collapse: collapse;' >";
|
|
for (var i = 0; i < data.length; i++) {
|
|
var r = data[i];
|
|
html += "<tr >"
|
|
if (r.nodes != '') {
|
|
for (var j = 0; j < r.nodes.length; j++) {
|
|
var c = r.nodes[j];
|
|
var width = "";
|
|
if (c.width != '' && c.width != null) {
|
|
width = c.width;
|
|
} else {
|
|
width = "60px";
|
|
}
|
|
var height = c.height;
|
|
if (c.height != '' && c.height != null) {
|
|
height = c.height;
|
|
} else {
|
|
height = "100px";
|
|
}
|
|
var fontsize = "";
|
|
if (c.fontsize != '' && c.fontsize != null) {
|
|
fontsize = c.fontsize;
|
|
} else {
|
|
fontsize = "16px";
|
|
}
|
|
var fontweight = "";
|
|
if (c.fontweight != '' && c.fontweight != null) {
|
|
fontweight = c.fontweight;
|
|
} else {
|
|
fontweight = "400";
|
|
}
|
|
var fontcolor = "";
|
|
if (c.fontcolor != '' && c.fontcolor != null) {
|
|
fontcolor = c.fontcolor;
|
|
} else {
|
|
fontcolor = "#000000";
|
|
}
|
|
var backgroundcolor = "";
|
|
if (c.backgroundcolor != '' && c.backgroundcolor != null) {
|
|
backgroundcolor = c.backgroundcolor;
|
|
} else {
|
|
backgroundcolor = "#FFFFFF";
|
|
}
|
|
var textalign = "";
|
|
if (c.textalign != '' && c.textalign != null) {
|
|
textalign = c.textalign;
|
|
} else {
|
|
textalign = "center";
|
|
}
|
|
|
|
var showText = "";
|
|
if (c.showtextst == '${Showtextst_FALSE}') {
|
|
showText = c.showText;
|
|
} else if (c.showtextst == '${Showtextst_TRUE}') {
|
|
showText = "<textarea id='" + c.id + "' name='" + c.id + "' class='form-control' type='text' style='width: 100%;height: 100%;resize: none;background-color: #FFFFFF;border:0px;" +
|
|
"font-size: "+fontsize+";font-weight: "+fontweight+";color: "+fontcolor+";background-color: "+backgroundcolor+";text-align: "+textalign+";' readonly>" + c.showText + "</textarea>";
|
|
}
|
|
|
|
html += "<td rowspan=" + c.rows + " colspan=" + c.columns + " style='border:1px solid #d2d6de;width:" + width + ";height:" + height + ";padding:2px;" +
|
|
"font-size: "+fontsize+";font-weight: "+fontweight+";color: "+fontcolor+";background-color: "+backgroundcolor+";text-align: "+textalign+";'>" + showText + "</td>";
|
|
}
|
|
}
|
|
html += "</tr>"
|
|
}
|
|
html += "</table>"
|
|
$('#lastContent').html(html);
|
|
}, 'json');
|
|
}
|
|
|
|
var showUser4SelectsFun2 = function () {
|
|
var userIds = $("#workpeople").val();
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
|
formId: "subForm",
|
|
hiddenId: "workpeople",
|
|
textId: "_workpeople",
|
|
userIds: userIds,
|
|
companyId: unitId
|
|
}, function (data) {
|
|
$("#user4SelectDiv").html(data);
|
|
openModal("user4SelectModal");
|
|
});
|
|
};
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
|
<div class="wrapper">
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1 id="head_title"></h1>
|
|
<ol class="breadcrumb">
|
|
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
|
<!-- <li class="active">Here</li> -->
|
|
</ol>
|
|
</section>
|
|
<!-- Main content -->
|
|
<section class="content container-fluid">
|
|
<div id="alertDiv"></div>
|
|
<div id="subDiv"></div>
|
|
<div id="user4SelectDiv"></div>
|
|
|
|
<div>
|
|
<form class="form-horizontal" id="subForm">
|
|
<!-- /. box -->
|
|
<div class="box box-primary">
|
|
<div class="box-header with-border">
|
|
<%-- <h3 class="box-title">接班</h3>--%>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<div class="box-body">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">班组:</label>
|
|
<div class="col-sm-4">
|
|
<label id="grouptypeName" name="grouptypeName"
|
|
style="display:none;line-height: 34px;"></label>
|
|
<select class="form-control select2 " id="grouptype"
|
|
name="grouptype" style="width: 220px;display:block;"></select>
|
|
</div>
|
|
<label class="col-sm-2 control-label">班次:</label>
|
|
<div class="col-sm-4">
|
|
<label id="grouptimeName" name="grouptimeName"
|
|
style="line-height: 34px;"></label>
|
|
<input id="grouptime" name="grouptime" type="hidden"/>
|
|
<%-- <select class="form-control select2 " id="grouptime"--%>
|
|
<%-- name="grouptime" style="width: 220px;"></select>--%>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">值班人员</label>
|
|
<div class="col-sm-8">
|
|
<input class="form-control" id="workpeople" name="workpeople" type="hidden"
|
|
value="${groupDetail.members}"/>
|
|
<textarea class="form-control" type="text" style="height: 60px;"
|
|
id="_workpeople"
|
|
name="_workpeople" onclick="showUser4SelectsFun2();"
|
|
placeholder="选择人员" readonly></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">备注</label>
|
|
<div class="col-sm-8">
|
|
<textarea class="form-control" type="text" style="height: 80px;" id="succeedremark"
|
|
name="succeedremark" placeholder="备注..."></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="col-sm-1"></div>
|
|
<div class="col-sm-10" style="padding-top: 8px;">
|
|
<div style="float:left">
|
|
<button type="button" class="btn btn-success" id="succeedBtn"
|
|
style="display: none;"
|
|
onclick="goSucceed()">接班
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box box-solid">
|
|
<%-- <div class="box-header with-border">--%>
|
|
<%-- <h3 class="box-title">交接班情况</h3>--%>
|
|
|
|
<%-- <div class="box-tools pull-right">--%>
|
|
<%-- </div>--%>
|
|
<%-- </div>--%>
|
|
|
|
<div class="box-body ">
|
|
<div style="padding-left: 60px;padding-right: 60px;">
|
|
<div style="float: left;width: 100%;height: 60px;line-height: 50px;text-align: center;font-size: 18px;font-weight: bold;">
|
|
交接班情况
|
|
</div>
|
|
<div id="lastContent" style="float: left;width: 100%;padding-bottom: 30px;">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</section>
|
|
<!-- /.content -->
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |