first commit
This commit is contained in:
415
WebRoot/jsp/work/schedulingHandover.jsp
Normal file
415
WebRoot/jsp/work/schedulingHandover.jsp
Normal file
@ -0,0 +1,415 @@
|
||||
<%@ 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 expandsdt = "";
|
||||
var expandedt = "";
|
||||
var schedulingId = "";
|
||||
|
||||
$(function () {
|
||||
if ('${param.unitId}' != null && '${param.unitId}' != '') {
|
||||
bizid = '${param.unitId}';
|
||||
} else {
|
||||
bizid = unitId;
|
||||
}
|
||||
getNowRecord();
|
||||
});
|
||||
|
||||
var nowGroupTypeJson = [];
|
||||
|
||||
function getNowRecord() {
|
||||
nowGroupTypeJson = [];
|
||||
$.ajax({
|
||||
url: ext.contextPath
|
||||
+ "/work/scheduling/getNowRecord.do",
|
||||
type: "post",
|
||||
cache: false,
|
||||
data: {unitId: bizid},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (datas) {
|
||||
// console.log(datas);
|
||||
if (datas != null && datas != '') {
|
||||
for (var i = 0; i < datas.length; i++) {
|
||||
var data = datas[i];
|
||||
nowGroupTypeJson.push({
|
||||
id: data.groupTypeId,
|
||||
text: data.groupTypeName,
|
||||
groupTimeName: data.groupTimeName,
|
||||
groupTimeId: data.groupTimeId,
|
||||
workPeople: data.workPeople,
|
||||
workPeopleName: data.workPeopleName,
|
||||
expandsdt: data.expandsdt,
|
||||
expandedt: data.expandedt,
|
||||
handovered: data.handovered,
|
||||
schedulingId: data.id
|
||||
});
|
||||
}
|
||||
}
|
||||
getNowContent(nowGroupTypeJson);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getNowContent(data) {
|
||||
if (data != '' && data != null) {
|
||||
// console.log(data)
|
||||
$('#grouptimeName').text(data[0].groupTimeName);
|
||||
$('#grouptime').val(data[0].groupTimeId);
|
||||
$('#workpeople').val(data[0].workPeople);
|
||||
$('#_workpeople').val(data[0].workPeopleName);
|
||||
|
||||
groupType = data[0].id;
|
||||
schedulingId = data[0].schedulingId;
|
||||
getLastGroup();
|
||||
expandsdt = data[0].expandsdt;
|
||||
expandedt = data[0].expandedt;
|
||||
|
||||
if (data[0].handovered == 'true') {
|
||||
$('#handoverBtn').css('display', 'none');
|
||||
} else if (data[0].handovered == 'false') {
|
||||
$('#handoverBtn').css('display', 'block');
|
||||
}
|
||||
|
||||
$('#noGroup').css('display', 'none');
|
||||
|
||||
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;
|
||||
|
||||
$('#grouptimeName').text(ckdata.groupTimeName);
|
||||
$('#grouptime').val(ckdata.groupTimeId);
|
||||
$('#workpeople').val(ckdata.workPeople);
|
||||
$('#_workpeople').val(ckdata.workPeopleName);
|
||||
|
||||
if (ckdata.handovered == 'true') {
|
||||
$('#handoverBtn').css('display', 'none');
|
||||
} else if (ckdata.handovered == 'false') {
|
||||
$('#handoverBtn').css('display', 'block');
|
||||
}
|
||||
|
||||
groupType = ckdata.id;
|
||||
schedulingId = ckdata.schedulingId;
|
||||
getLastGroup();
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
if (data.length != 0) {
|
||||
select.val(data[0].id).trigger("change");//设置选中
|
||||
} else {
|
||||
select.val("").trigger("change");//设置选中
|
||||
}
|
||||
} else {
|
||||
$('#noGroup').css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function goHandover(saveSt) {
|
||||
var nowTime = getNowTime();
|
||||
var compareTime1 = getCompareTime(expandsdt, nowTime);
|
||||
var compareTime2 = getCompareTime(expandedt, nowTime);
|
||||
var text = "";
|
||||
if (saveSt == '1') {
|
||||
if (compareTime1 <= '0' && compareTime2 >= '0') {
|
||||
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/handover.do', decodeURIComponent($("#subForm2").serialize(), true) +
|
||||
"&groupType=" + groupType + "&unitId=" + bizid + "&schedulingId=" + schedulingId + "&workpeople=" + $('#workpeople').val() + "&saveSt=" + saveSt+"&math="+Math.random(), function (data) {
|
||||
getNowRecord();
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '未到交班时间,当前班次时间为:' + expandsdt + '至' + expandedt);
|
||||
}
|
||||
} else if (saveSt == '2') {
|
||||
swal({
|
||||
text: "当前操作只进行保存,并非交班!",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-success btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willConfrim) {
|
||||
if (willConfrim) {
|
||||
$.post(ext.contextPath + '/work/scheduling/handover.do', decodeURIComponent($("#subForm2").serialize(), true) +
|
||||
"&groupType=" + groupType + "&unitId=" + bizid + "&schedulingId=" + schedulingId + "&workpeople=" + $('#workpeople').val() + "&saveSt=" + saveSt, function (data) {
|
||||
getNowRecord();
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getLastGroup() {//lastContent
|
||||
$.post(ext.contextPath + '/work/groupContent/getLastGroup.do', {
|
||||
unitId: bizid,
|
||||
groupType: groupType,
|
||||
schedulingId: schedulingId
|
||||
}, 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 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;' >" + c.showText + "</textarea>";
|
||||
}
|
||||
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 + ";' >" + 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>
|
||||
<!-- /. box -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<%-- <h3 class="box-title">接班</h3>--%>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<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-10">
|
||||
<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>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-1"></div>
|
||||
<div class="col-sm-10" style="border-top:solid 1px #E0E0E0;padding-top: 8px;">
|
||||
<div style="float:left">
|
||||
<div id="handoverBtn" style="display: none;">
|
||||
<button type="button" class="btn btn-success" onclick="goHandover('1')">交班
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" onclick="goHandover('2')">保存
|
||||
</button>
|
||||
</div>
|
||||
<span id="noGroup" style="display: none;">当前无可接班次,请先接班!</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<form id='subForm2'>
|
||||
<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>
|
||||
Reference in New Issue
Block a user