Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/work/schedulingEditChangeShiftsUser.jsp
2026-01-16 14:13:44 +08:00

266 lines
11 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" pageEncoding="UTF-8" %>
<%@ page import="com.sipai.tools.SessionManager" %>
<%
SessionManager sessionManager = new SessionManager();
%>
<%@page import="com.sipai.entity.scada.MPoint" %>
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
<!-- 引入daterangepicker-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/daterangepicker/daterangepicker-bs3.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/daterangepicker/moment.js"></script>
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript">
let beginTimeStore = "";
// let endTimeStore = "";
var doSearchUser = function () {
$("#table_user").bootstrapTable('refresh');
};
function doselect(dialog, grid) {
$.post(ext.contextPath + '/user/getUsersByIds.do', {userIds: checkedItem.id}, function (resp) {
$.post(ext.contextPath + '/work/scheduling/changeShiftsUserDo.do', {
id: '${param.schedulingId}',
userId: resp[0].id,
type: '${param.type}',
time: $('#reservationtime').val(),
unitId: unitId
}, function (data) {
// console.log(data)
if (data.res == '-2') {
showAlert('d', '该员工不属于班组成员,无法修改!','ualert');
} else if (data.res == '0') {
showAlert('d', '修改失败','ualert');
} else {
closeModal("user4SelectModal");
closeModal("schedulingEditModal");
}
<%--$('#${param.formId} #${param.hiddenId}').val(resp[0].id);--%>
<%--$('#${param.formId} #${param.textId}').val(resp[0].caption);--%>
}, 'json');
}, 'json');
};
//显示已经勾选的数据
function stateFormatter(value, row, index) {
var flag = false;
if (row.id == '${userId}') {
flag = true;
checkedItem = "";
}
if (flag)
return {
checked: true//设置选中
};
return value;
}
var $table;
function queryParams(params) {
var temp = {
pid: params.pid,
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
search_name: $('#search_name_user').val(),
search_pid: '${param.companyId}'
};
/* var status =$('#switchBtn').bootstrapSwitch('state')
if(status){
temp.checkedIds=getCheckedIds();
}
*/
return temp;
}
$(function () {
$table = $("#table_user").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/user/getUsers.do', // 获取表格数据的url
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
clickToSelect: true,
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
/* showColumns: true,
showRefresh: true, */
columns: [
{
checkbox: true, // 显示一个勾选框
formatter: stateFormatter
}, {
field: 'caption',
title: "姓名",
align: 'center',
valign: 'middle',
width: '30%'
}, {
field: '_pname',
title: "部门",
align: 'center',
valign: 'middle',
width: '70%'
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_user");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
//绑定选中事件、取消事件、全部选中、全部取消
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
if ('check' == e.type) {
$('#table_user .checked').removeClass("checked");
obj.parent().addClass("checked");
checkedItem = rows;
} else {
obj.parent().removeClass("checked");
checkedItem = "";
}
});
let format = "YYYY-MM-DD HH:mm";
let separator = " ~ ";
let calendarMode = "day";
var locale = {
"format": format,
"separator": separator,
"applyLabel": "确定",
"cancelLabel": "取消",
"fromLabel": "起始时间",
"toLabel": "结束时间",
"customRangeLabel": "自定义",
"weekLabel": "W",
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"firstDay": 1
};
if('${param.time}'!=''){
beginTimeStore = '${param.time}';
}else{
beginTimeStore = getNowTime().substring(0,16);
}
$('#reservationtime').val(beginTimeStore);
$('#reservationtime').daterangepicker({
startDate: beginTimeStore,
endDate: "",
singleDatePicker: true, //单日历
// minDate: '1937-01-01',
// maxDate: moment(),
// dateLimit: {
// days: 14000
// },
calendarMode: calendarMode,
showDropdowns: false,
showWeekNumbers: false,
timePicker: true,
timePickerIncrement: 1,
timePicker12Hour: false,
linkedCalendars: false,
autoUpdateInput: false,
timePickerSeconds: false,
// buttonClasses: ['btn'],
// applyClass: 'green',
// cancelClass: 'default',
format: format,
separator: separator,
// alwaysShowCalendars:true,
// autoApply:true,
// ranges: {
// // '今日': [moment(), moment().subtract(-1, 'days')],
// '昨日': [moment().subtract(1, 'days'), moment()],
// '最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
// '本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
// },
locale: locale
}, function (start, end, label) {
beginTimeStore = start.format(format);
// endTimeStore = end.format(format);
});
});
</script>
<div class="modal fade" id="user4SelectModal">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择人员</h4>
</div>
<div class="modal-body">
<div id="ualert"></div>
<div id="modal-body">
<!-- <div class="form-group">
<label class="form-label" id="companylabel">水厂:</label>
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
</div> -->
<div class="form-group " style="margin-bottom:10px;">
<input id="search_code" name="search_code" type="hidden"/>
<span id="company"
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
</div>
<div class="form-group pull-left form-inline">
<div class="input-group input-group-sm " style="float: left;">
<label class="pull-left" style="line-height: 30px;">时间:</label>
<input type="text" id="reservationtime" name="reservationtime"
class="form-control pull-left" style="width: 120px;" autocomplete="off">
</div>
</div>
<div class="form-group pull-right form-inline">
<div class="input-group input-group-sm " style="float: right;">
<input type="text" id="search_name_user" name="search_name_user" class="form-control "
style="width: 150px;"
placeholder="姓名">
<div class="input-group-btn">
<button class="btn btn-default" onclick="doSearchUser();"><i class="fa fa-search"></i>
</button>
</div>
</div>
</div>
<div class="table-scrollable">
<table class="table table-bordered table-striped" style="overflow:auto;width:100%"
id="table_user"></table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doselect()" id="btn_save">确定</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>