Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/process/libraryRoutineWorkList4Choice.jsp

335 lines
15 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="com.sipai.entity.process.LibraryRoutineWork" %>
<% request.setAttribute("Frequency_Type_Day", LibraryRoutineWork.Frequency_Type_Day); %>
<% request.setAttribute("Frequency_Type_Month", LibraryRoutineWork.Frequency_Type_Month); %>
<% request.setAttribute("Frequency_Type_Year", LibraryRoutineWork.Frequency_Type_Year); %>
<% request.setAttribute("Type_Run", LibraryRoutineWork.Type_Run); %>
<% request.setAttribute("Type_Manage", LibraryRoutineWork.Type_Manage); %>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchSelect4L = function () {
$("#table_library").bootstrapTable('refresh');
};
function doSelect() {
var typestr = $('#typestr').val();
var checkedItems = $("#table_library").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems, function (index, item) {
//datas+=item.id+",";
datas += item.id;
});
if (datas == "") {
showAlert('d', '请先选择记录', 'mainAlertdiv2');
} else {
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-danger btn-sm",
closeModal: true
}
}
})
.then(function (willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/process/routineWork/doCreate.do', {
libraryId: datas,
unitId: unitId,
typestr: typestr
}, function (data) {
if (data.code == 1) {
$("#table").bootstrapTable('refresh');
closeModal("librarySelectModal");
} else {
showAlert('d', '生成失败', 'mainAlertdiv2');
}
}, 'json');
}
});
}
// $('#${param.formId} #${param.hiddenId}').val(row.id);
// $('#${param.formId} #${param.text1}').val(row.workCode);
// $('#${param.formId} #${param.text2}').val(row.workName);
// closeModal("librarySelectModal");
};
function queryParams(params) {
var typestr = $('#typestr').val();
var temp = {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
unitId: unitId,
typestr: typestr,
search_name: $('#search_name').val()
};
return temp;
}
$(function () {
$("#search_name").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
//回车执行查询
doSearchSelect4L();
event.stopPropagation();
}
});
$("#table_library").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/process/libraryRoutineWork/getList.do', // 获取表格数据的url
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20], // 设置页面可以显示的数据条数
pageSize: 20, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: queryParams,
queryParamsType: "limit",
singleSelect: false,//单选多选
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
/* showColumns: true,
showRefresh: true, */
columns: [
{
checkbox: true, // 显示一个勾选框
// radio: true
},
/*{
field: '', // 返回json数据中的name
title: '类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
if (row.type == '${Type_Run}') {
return '运行';
}
if (row.type == '${Type_Manage}') {
return '行政';
}
}
},*/
{
field: '', // 返回json数据中的name
title: '岗位类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return row.ppositionType;
}
},
{
field: '', // 返回json数据中的name
title: '工作类型名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return row.pworkTypeName;
}
},
{
field: '', // 返回json数据中的name
title: '工作编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return row.workCode;
}
},
{
field: '', // 返回json数据中的name
title: '工作名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
formatter: function (value, row, index) {
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.workName + "'>" + row.workName + "</span>";
}
},
{
field: '', // 返回json数据中的name
title: '工作内容', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
formatter: function (value, row, index) {
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.workContent + "'>" + row.workContent + "</span>";
}
},
{
field: '', // 返回json数据中的name
title: '作业频率', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
if (row.workFrequencyType == '${Frequency_Type_Day}') {
return '每日';
}
if (row.workFrequencyType == '${Frequency_Type_Month}') {
return '每月';
}
if (row.workFrequencyType == '${Frequency_Type_Year}') {
return '每年';
}
}
},
{
field: '', // 返回json数据中的name
title: '定额工时(小时)', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return row.baseHours;
}
},
{
field: '', // 返回json数据中的name
title: '定额费用(元)', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return row.baseCost;
}
}
],
onCheck: function (row) {
// doSelect(row);
},
onLoadSuccess: function (row) { //加载成功时执行
adjustBootstrapTableView("table_library");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<%--<div class="modal fade" id="librarySelectModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div id="mainAlertdiv2"></div>
<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 " style="width:100%">
<div id="alertDiv"></div>
<div class="form-group form-inline">
<div class="form-group form-inline pull-right" style="padding-bottom: 5px;">
<div class="input-group input-group-sm" style="width: 250px;">
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="工作名称">
<div class="input-group-btn">
<button class="btn btn-default" onclick="doSearchSelect4L();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div>
<div id="table_library" style="height:600px;overflow:auto;width:100%"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>--%>
<div class="modal fade" id="librarySelectModal">
<div class="modal-dialog modal-xlg">
<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 " style="width:100%">
<div id="alertDiv"></div>
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
style="margin-right: 5px;">
<i class="fa fa-plus"></i></button>
</div>
<!-- /. tools -->
<i class="fa fa-search"></i>
</div>
<div class="box-body collapse">
<form class="form-horizontal " id="searchForm_Equ">
<div class="form-group" style="margin-right: 20px;">
<!-- <label class="col-sm-2 control-label">部门</label>
<div class="col-sm-4">
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
</div> -->
<label class="col-sm-2 control-label">工作名称</label>
<div class="col-sm-4">
<input type="text" id="search_name_equ" name="search_name_equ"
class="form-control input-sm"
placeholder="工作名称" style="width:170px;">
</div>
</div>
<div class="form-group" style="margin-right: 20px;">
<label class="col-sm-2 control-label">只看选中</label>
<div class="col-sm-4">
<div class="switch" data-on="primary" data-off="info">
<input id="switchBtn" type="checkbox"/>
</div>
</div>
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
<button type="button" class="btn btn-default btn-sm pull-right"
onclick="doSearchPatrolPoint();"><i
class="fa fa-search"> 搜索</i></button>
</div>
</div>
</form>
</div>
</div>
<div>
<div id="table_library" style="table-layout:fixed;"></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()">确认</button>
</div>
</div>
</div>
</div>