first commit
This commit is contained in:
876
WebRoot/jsp/equipment/EequipmentRemindCardList.jsp
Normal file
876
WebRoot/jsp/equipment/EequipmentRemindCardList.jsp
Normal file
@ -0,0 +1,876 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%@ 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"%>
|
||||
<%request.setAttribute("UNIT_TYPE_BIZ",com.sipai.tools.CommString.UNIT_TYPE_BIZ);%>
|
||||
<%request.setAttribute("UNIT_TYPE_COMPANY",com.sipai.tools.CommString.UNIT_TYPE_COMPANY);%>
|
||||
<%request.setAttribute("UNIT_TYPE_DEPT",com.sipai.tools.CommString.UNIT_TYPE_DEPT);%>
|
||||
|
||||
<%request.setAttribute("Flag_Active",com.sipai.tools.CommString.Flag_Active);%>
|
||||
<%request.setAttribute("Flag_Unactive",com.sipai.tools.CommString.Flag_Unactive);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<style type="text/css">
|
||||
.ztree li a.level0 span {font-size: 150%;}
|
||||
.ztree li a.level1 span {font-size: 150%;}
|
||||
.ztree li a.level2 span {font-size: 150%;}
|
||||
.ztree li a.level3 span {font-size: 150%;}
|
||||
.ztree li a.level4 span {font-size: 150%;}
|
||||
/*隐藏百度地图底部文字*/
|
||||
.anchorBL{display:none;}
|
||||
.main-header{display:none;}
|
||||
.content-header{display:none;}
|
||||
.main-footer{display:none;}
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
/* var showMaintenanceList = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subMaintenanceModal');
|
||||
});
|
||||
}; */
|
||||
|
||||
/* var showHandleDetailList = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
}; */
|
||||
|
||||
/* var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
|
||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
|
||||
$("#subEquipmentDiv").html(data);
|
||||
openModal('subEquipmentModal');
|
||||
});
|
||||
}; */
|
||||
|
||||
//导出设备表,要用get请求的方式
|
||||
function downloadFun() {
|
||||
var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
if(checkedItems.length > 0){
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
|
||||
var equipmentBelongId =$("#equipmentBelongId").val();
|
||||
window.open(ext.contextPath + "/finance/placeClass/downloadPlaceEquipmentCompanyExcel.do?equipmentIds="+datas+"&equipmentBelongId="+equipmentBelongId);
|
||||
|
||||
}
|
||||
|
||||
//导入设备列表
|
||||
function importFun(){
|
||||
console.log(123);
|
||||
$.post(ext.contextPath + '/finance/placeClass/importComPanyEquipmentCard.do', {} , function(data) {
|
||||
console.log(123);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//新增设备卡片
|
||||
/* var addFun = function() {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d','请先选择厂区','mainAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/equipment/doadd.do', {companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
}; */
|
||||
|
||||
//清零时间
|
||||
var editFun = function(id,cleartime) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/finance/placeClass/upReminddate.do', {id:id,cleartime:cleartime} , function(data) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
};
|
||||
|
||||
//查看设备详情
|
||||
/* var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}; */
|
||||
|
||||
//删除一条资产类型数据
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/equipment/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}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 + '/equipment/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
|
||||
initFun();
|
||||
initTreeView();
|
||||
$("#search_dept").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
dosearch();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
var typeStatusArr = [
|
||||
{"id":"1","text":"是"},
|
||||
{"id":"2","text":"否"},
|
||||
|
||||
];
|
||||
//$("#typeStatus").empty();
|
||||
var selelct12 =$("#typeStatus").select2({
|
||||
data: typeStatusArr,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct12.val('').trigger("change");
|
||||
selelct12.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
//设备类型搜索
|
||||
// $.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {}, function(data) {
|
||||
// var selelct =$("#equipmentCardClass").select2({
|
||||
// data: data,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
// selelct.val('').trigger("change");
|
||||
// selelct.on("change",function(e){
|
||||
// dosearch();
|
||||
// });
|
||||
// },'json');
|
||||
|
||||
//2020-07-13 start
|
||||
//设备归属
|
||||
/* $.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelongForSelect.do", {}, function(data) {
|
||||
var selelct =$("#equipmentBelongId").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json'); */
|
||||
|
||||
|
||||
//台账类型
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardTypeForSelect.do", {}, function(data) {
|
||||
var selelct =$("#equipmentCardType").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
//2020-07-13 end
|
||||
|
||||
});
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
searchInfo['rows']=params.limit;
|
||||
searchInfo['page']=params.offset/params.limit+1;
|
||||
searchInfo['sort']=params.sort;
|
||||
searchInfo['order']=params.order;
|
||||
searchInfo['equipmentCardType']=$("#equipmentCardType").val();
|
||||
searchInfo['ratedPower']=$("#ratedPower").val();
|
||||
searchInfo['likeSea']=$("#likeSea").val();
|
||||
searchInfo['unitId']= unitId;
|
||||
//设备名称
|
||||
searchInfo['search_name'] = $("#search_name").val();
|
||||
searchInfo['equipmentBelongId'] = $("#equipmentBelongId").val();
|
||||
searchInfo['processSection']=$("#processSection").val(); //工艺段
|
||||
searchInfo['equipmentLevel']=$("#equipmentLevel").val(); //ABC分类
|
||||
searchInfo['typeStatus']=$("#typeStatus").val(); //状态
|
||||
searchInfo['equipmentstatus']=$("#equipmentstatus").val(); //状态
|
||||
searchInfo['search_pid1']=$("#search_pid1").val(); //设备类型
|
||||
searchInfo['search_pid2']=$("#search_pid2").val(); //资产类型
|
||||
// searchInfo['equipmentCardClass'] = $("#equipmentCardClass").val();
|
||||
return searchInfo;
|
||||
|
||||
};
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function(){
|
||||
//工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
//abc分类
|
||||
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevel4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#equipmentLevel").empty();
|
||||
var selelct_ =$("#equipmentLevel").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
//资产类型
|
||||
// $.post(ext.contextPath + "/equipment/assetClass/getAssetClass4Select.do", {companyId:companyId}, function(data) {
|
||||
// $("#assetClass").empty();
|
||||
// var selelct_ =$("#assetClass").select2({
|
||||
// data: data,
|
||||
// cache : false,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
// selelct_.val('').trigger("change");
|
||||
// selelct_.on("change",function(e){
|
||||
// dosearch();
|
||||
// });
|
||||
// },'json');
|
||||
//状态
|
||||
$.post(ext.contextPath + "/equipment/equipmentStatusManagement/getEquipmentstatus4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#equipmentstatus").empty();
|
||||
var selelct_ =$("#equipmentstatus").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
//设备类型树
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getEquipmentClassJsonForTree.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("设备类型:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 1
|
||||
});
|
||||
$('#companytree1').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum==0){
|
||||
$("#search_pid1").val(data.id);
|
||||
$("#cname_input1").val(data.text);
|
||||
document.getElementById('company_select1').style.display = "none";
|
||||
$("ul#company_select1").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select1").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select1").hide();
|
||||
});
|
||||
|
||||
|
||||
//资产类型树
|
||||
$.post(ext.contextPath + '/equipment/assetClass/getAssetClassJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid2").val(data[0].id);
|
||||
$("#companyselect2").hide();
|
||||
$("#companyName2").text("资产类型:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree2').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 1
|
||||
});
|
||||
$('#companytree2').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum==0){
|
||||
$("#search_pid2").val(data.id);
|
||||
$("#cname_input2").val(data.text);
|
||||
document.getElementById('company_select2').style.display = "none";
|
||||
$("ul#company_select2").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select2").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select2").hide();
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/finance/placeClass/getRemindList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams:queryParamsFun,
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
|
||||
{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'equipmentCardProp.runTime', // 返回json数据中的name
|
||||
title: '累计运行时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'equipmentSetTime', // 返回json数据中的name
|
||||
title: '设定时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'equipmentClearTime', // 返回json数据中的name
|
||||
title: '清零时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
|
||||
buts+= '<button class="btn btn-default btn-sm" title="清零" onclick="editFun(\'' + row.id + '\',\''+row.equipmentCardProp.runTime+'\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 清零</span></button>';
|
||||
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
var searchInfo={};
|
||||
var zTreeObj='';
|
||||
var setting = {
|
||||
callback: {
|
||||
onClick: zTreeOnClick
|
||||
},
|
||||
view:{
|
||||
dblClickExpand: false,
|
||||
},
|
||||
};
|
||||
var zNodes=[];
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/initEquipmentCardTree.do', { ng: '',unitId:unitId }, function (data) {
|
||||
zNodes=data;
|
||||
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
|
||||
}, 'json');
|
||||
};
|
||||
//查看设备详情
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
function zTreeOnClick(event, treeId, treeNode) {
|
||||
var pid=treeNode.id;
|
||||
//
|
||||
newUnitId = treeNode.id;
|
||||
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentCardNodes.do', { ng: '',pid:pid }, function (data) {
|
||||
|
||||
//console.log({data});
|
||||
var newNodes=[];
|
||||
|
||||
if(data.length >0){
|
||||
|
||||
zTreeObj = $.fn.zTree.getZTreeObj("treeDemo");
|
||||
var nodes = zTreeObj.getSelectedNodes();
|
||||
var pidNode= nodes[0]
|
||||
$.each(data,function(index,value){
|
||||
|
||||
var marKey=value.id;
|
||||
var isExist=zTreeObj.getNodesByParam('id',marKey,pidNode);
|
||||
|
||||
if(isExist.length <=0){
|
||||
newNodes.push(value);
|
||||
}
|
||||
})
|
||||
|
||||
if(newNodes.length>0){
|
||||
zTreeObj.addNodes(pidNode, newNodes);
|
||||
zTreeObj.reAsyncChildNodes(pidNode, "refresh");
|
||||
|
||||
//根据点击的节点查询相关的设备台账
|
||||
var id=treeNode.id;
|
||||
var flag=treeNode.flag;
|
||||
equipmentCardTreeSearchInfo['id']=id;
|
||||
equipmentCardTreeSearchInfo['pid']=pid;
|
||||
equipmentCardTreeSearchInfo['flag']=flag;
|
||||
$("#table").bootstrapTable('destroy');
|
||||
//console.log({equipmentCardTreeSearchInfo});
|
||||
newUnitId = id;
|
||||
getEquipmentCardByCondition();
|
||||
}else{
|
||||
//根据点击的节点查询相关的设备台账
|
||||
var id=treeNode.id;
|
||||
var flag=treeNode.flag;
|
||||
equipmentCardTreeSearchInfo['id']=id;
|
||||
equipmentCardTreeSearchInfo['pid']=pid;
|
||||
equipmentCardTreeSearchInfo['flag']=flag;
|
||||
$("#table").bootstrapTable('destroy');
|
||||
//console.log({equipmentCardTreeSearchInfo});
|
||||
newUnitId = id;
|
||||
getEquipmentCardByCondition();
|
||||
}
|
||||
}else{
|
||||
//根据点击的节点查询相关的设备台账
|
||||
var id=treeNode.id;
|
||||
var flag=treeNode.flag;
|
||||
equipmentCardTreeSearchInfo['id']=id;
|
||||
equipmentCardTreeSearchInfo['pid']=pid;
|
||||
equipmentCardTreeSearchInfo['flag']=flag;
|
||||
$("#table").bootstrapTable('destroy');
|
||||
//console.log({equipmentCardTreeSearchInfo});
|
||||
newUnitId = id;
|
||||
getEquipmentCardByCondition();
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subEquipmentDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="maintenanceDiv"></div>
|
||||
<div id="maintenanceDetailDiv"></div>
|
||||
<div id="equipmentLevelSubDiv"></div>
|
||||
<div id="equipmentProcessSectionSubDiv"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentBelongSubDiv"></div>
|
||||
<div id="equipmentCodeRuleSubDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="subEditViewDiv"></div>
|
||||
<div id="MpointDiv"></div>
|
||||
<div id="ivSubDiv"></div>
|
||||
<div id="subFileDiv"></div>
|
||||
<div id="subRepairDiv"></div>
|
||||
<div id="subMaintainDiv"></div>
|
||||
<div id="subAttachedDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" >
|
||||
<input type="hidden" id="equipmentBelongId" value="${equipmentBelongId}" >
|
||||
<div class="form-group" style="padding:0;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group pull-left form-inline" style="width: 100%;">
|
||||
|
||||
|
||||
<div id="div1" class="input-group input-group-sm pull-left" style="margin-top: -0.6%;">
|
||||
<input id="search_pid1" name="search_pid1" type="hidden" />
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul id="companyselect1" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select1').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 6px;border-bottom-left-radius: 6px;font-weight:bold">设备类型:</span>
|
||||
<input class="form-control " id="cname_input1" name="cname_input1" style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select1" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree1" style="width: 275px;overflow:auto;">
|
||||
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="selectnode();"><i class="fa fa-cloud-upload"></i>确定</button> -->
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="div2" class="input-group input-group-sm pull-left" style="margin-top: -0.6%;">
|
||||
<input id="search_pid2" name="search_pid2" type="hidden" />
|
||||
<span id="companyName2" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul id="companyselect2" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select2').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">资产类型:</span>
|
||||
<input class="form-control " id="cname_input2" name="cname_input2" style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select2" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree2" style="width: 275px;overflow:auto;">
|
||||
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="selectnode();"><i class="fa fa-cloud-upload"></i>确定</button> -->
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">状态:</label>
|
||||
<select class="form-control select2 " id="equipmentstatus" name ="equipmentstatus" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">ABC分类:</label>
|
||||
<select class="form-control select2 " id="equipmentLevel" name ="equipmentLevel" style="width: 100px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left" style="margin-right: 1%;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">资产编号是否存在:</label>
|
||||
<select class="form-control select2 " id="typeStatus" name ="typeStatus" style="width: 100px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 270px;float: left;">
|
||||
<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="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<%-- <script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
</script> --%>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!-- 本ak仅限珠海水控自来水项目临时使用,公司申请商业ak后替换更新。后续项目请使用公司商业ak -->
|
||||
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=NZhMekYms7kucYQ2ZeSlauu1E868uS4F"></script>
|
||||
</html>
|
||||
1089
WebRoot/jsp/equipment/EequipmentRunLifeCardList.jsp
Normal file
1089
WebRoot/jsp/equipment/EequipmentRunLifeCardList.jsp
Normal file
File diff suppressed because it is too large
Load Diff
1085
WebRoot/jsp/equipment/EequipmentRunTimeCardList.jsp
Normal file
1085
WebRoot/jsp/equipment/EequipmentRunTimeCardList.jsp
Normal file
File diff suppressed because it is too large
Load Diff
369
WebRoot/jsp/equipment/EquipmentScrapPrint.jsp
Normal file
369
WebRoot/jsp/equipment/EquipmentScrapPrint.jsp
Normal file
@ -0,0 +1,369 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
|
||||
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||
<title></title>
|
||||
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/LodopFuncs.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button type="button" style="margin-left:5px;margin-top:5px" class="btn btn-default btn-sm" onclick="prn1_preview();"><i class="fa fa-print"></i>打印</button>
|
||||
<h2><font color="#009999">固定资产报废审批表</font>
|
||||
</h2>
|
||||
<input type="hidden" id="pid" name="pid" value="${id}">
|
||||
<form id="form10">
|
||||
<table border=1 style="border:solid 1px black;border-collapse:collapse">
|
||||
<tr style="height:60px;">
|
||||
<td style="width:60px;" >资产</br> 编号</td>
|
||||
<td style="width:100px;" id="zcbh"></td>
|
||||
<td style="width:60px;">资产</br>名称</td>
|
||||
<td style="width:100px;" id="zcmc"></td>
|
||||
<td style="width:60px;">规格</br>型号</td>
|
||||
<td style="width:100px;" id="ggxh"></td>
|
||||
<td style="width:60px;">制造</br>厂家</td>
|
||||
<td style="width:100px;" id="zzcj"></td>
|
||||
<td style="width:60px;">报废</br>数量</td>
|
||||
<td style="width:100px;" id="bfsl">1</td>
|
||||
</tr >
|
||||
<tr style="height:60px;">
|
||||
<td style="width:60px;" >出厂</br> 年月</td>
|
||||
<td style="width:100px;" id="ccny"></td>
|
||||
<td style="width:60px;">启用</br>年月</td>
|
||||
<td style="width:100px;" id="qyny"></td>
|
||||
<td style="width:60px;">已使用</br>年月</td>
|
||||
<td style="width:100px;" id="ysyny"></td>
|
||||
<td style="width:60px;">使用</br>部门</td>
|
||||
<td style="width:100px;" id="sybm"></td>
|
||||
<td style="width:60px;">使用</br>地点</td>
|
||||
<td style="width:100px;" id="sydd"></td>
|
||||
</tr>
|
||||
</tr style="height:120px;">
|
||||
<td colspan="10" ><div style="height:90px;" id="bfyy" >报废原因</div>
|
||||
<div style="height:30%;text-align:center" id="bfyy1" > </div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr style="height:120px;">
|
||||
|
||||
<td colspan="7" ><div style="height:90px;" id="bmyj" >部门意见</div>
|
||||
<div style="height:30%;text-align:center" id="bmyj1" > </div>
|
||||
</td>
|
||||
|
||||
<td colspan="3" ><div style="height:90px;" id="bmfgldyj" >部门分管领导意见</div>
|
||||
<div style="height:30%;text-align:center" id="bmfgldyj1" > </div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr style="height:120px;">
|
||||
|
||||
<td colspan="2" ><div style="height:90px;" id="shyj" >审核意见</div>
|
||||
<div style="height:30%;text-align:center" id="shyj1" > </div>
|
||||
</td>
|
||||
|
||||
<td colspan="2" ><div style="height:90px;" id="yxglkyj" >运行管理科意见</div>
|
||||
<div style="height:30%;text-align:center" id="yxglkyj1" > </div>
|
||||
</td>
|
||||
|
||||
<td colspan="3" ><div style="height:90px;" id="crkyj" >财务科意见</div>
|
||||
<div style="height:30%;text-align:center" id="crkyj1" > </div>
|
||||
</td>
|
||||
<td colspan="3"id="zgld"></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-left:540px;margin-top:5px;" id="_applyTime"> </div>
|
||||
</form>
|
||||
|
||||
<div id="tablefrom"></div>
|
||||
<ul style="margin-left:200px" class="pagination">
|
||||
|
||||
</ul>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
var currentpage=0;
|
||||
$(function() {
|
||||
getData(currentpage);
|
||||
});
|
||||
|
||||
|
||||
|
||||
var pageno = function(j) {
|
||||
|
||||
//var idval=this.id; <a style="margin-left:20px"href="javascript:prn1_print()">全部打印</a>
|
||||
//currentpage=idval.substr(6);
|
||||
|
||||
getData(j);
|
||||
};
|
||||
|
||||
//下一页
|
||||
|
||||
var nextpage = function() {
|
||||
currentpage=currentpage+1;
|
||||
getData(currentpage);
|
||||
};
|
||||
|
||||
//上一页
|
||||
|
||||
var previosepage = function() {
|
||||
currentpage=currentpage-1;
|
||||
getData(currentpage);
|
||||
};
|
||||
//首页
|
||||
|
||||
var firstpage = function() {
|
||||
currentpage=0;
|
||||
getData(currentpage);
|
||||
};
|
||||
function getData(currentpage) {
|
||||
|
||||
|
||||
var pid = $("#pid").val()
|
||||
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/getprintList.do', {id:pid} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
console.log(arr);
|
||||
var eCard ;
|
||||
var totalPagesnumber=arr.equipmentScrapApplyDetail.length;
|
||||
for(var i=1+10;i<totalPagesnumber+10;i++){
|
||||
eCard = arr.equipmentScrapApplyDetail[i-10].equipmentCard;
|
||||
|
||||
$("#tablefrom").append('<form id="form1'+i+'">'
|
||||
+'<table border=1 style="border:solid 1px black;border-collapse:collapse">'
|
||||
+ '<tr style="height:60px;">'
|
||||
+ '<td style="width:60px;" >资产</br> 编号</td>'
|
||||
+' <td style="width:100px;" id="zcbh'+i+'"></td>'
|
||||
+ ' <td style="width:60px;">资产</br>名称</td>'
|
||||
+ '<td style="width:100px;" id="zcmc'+i+'"></td>'
|
||||
+'<td style="width:60px;">规格</br>型号</td>'
|
||||
+ ' <td style="width:100px;" id="ggxh'+i+'"></td>'
|
||||
+ '<td style="width:60px;">制造</br>厂家</td>'
|
||||
+' <td style="width:100px;" id="zzcj'+i+'"></td>'
|
||||
+' <td style="width:60px;">报废</br>数量</td>'
|
||||
+ ' <td style="width:100px;" id="bfsl'+i+'">1</td>'
|
||||
+ ' </tr >'
|
||||
+ '<tr style="height:60px;">'
|
||||
+' <td style="width:60px;" >出厂</br> 年月</td>'
|
||||
+' <td style="width:100px;" id="ccny'+i+'"></td>'
|
||||
+' <td style="width:60px;">启用</br>年月</td>'
|
||||
+ '<td style="width:100px;" id="qyny'+i+'"></td>'
|
||||
+ '<td style="width:60px;">已使用</br>年月</td>'
|
||||
+ ' <td style="width:100px;" id="ysyny'+i+'"></td>'
|
||||
+' <td style="width:60px;">使用</br>部门</td>'
|
||||
+ ' <td style="width:100px;" id="sybm'+i+'"></td>'
|
||||
+ '<td style="width:60px;">使用</br>地点</td>'
|
||||
+ ' <td style="width:100px;" id="sydd'+i+'"></td>'
|
||||
+ '</tr>'
|
||||
+ '</tr style="height:120px;">'
|
||||
+ ' <td colspan="10" ><div style="height:90px;" id="bfyy'+i+'" >报废原因</div>'
|
||||
+ ' <div style="height:30%;text-align:center" id="bfyy1'+i+'" > </div>'
|
||||
+ ' </td>'
|
||||
+ ' </tr>'
|
||||
+ ' </tr style="height:120px;">'
|
||||
|
||||
+ ' <td colspan="7" ><div style="height:90px;" id="bmyj'+i+'" >部门意见</div>'
|
||||
+ '<div style="height:30%;text-align:center" id="bmyj1'+i+'" > </div>'
|
||||
+ ' </td>'
|
||||
|
||||
+ ' <td colspan="3" ><div style="height:90px;" id="bmfgldyj'+i+'" >部门分管领导意见</div>'
|
||||
+ ' <div style="height:30%;text-align:center" id="bmfgldyj1'+i+'" > </div>'
|
||||
+ ' </td>'
|
||||
+ '</tr>'
|
||||
+ ' </tr style="height:120px;">'
|
||||
|
||||
+ ' <td colspan="2" ><div style="height:90px;" id="shyj'+i+'" >审核意见</div>'
|
||||
+ ' <div style="height:30%;text-align:center" id="shyj1'+i+'" > </div>'
|
||||
+ '</td>'
|
||||
|
||||
+ ' <td colspan="2" ><div style="height:90px;" id="yxglkyj'+i+'" >运行管理科意见</div>'
|
||||
+ '<div style="height:30%;text-align:center" id="yxglkyj1'+i+'" > </div>'
|
||||
+ ' </td>'
|
||||
|
||||
+ ' <td colspan="3" ><div style="height:90px;" id="crkyj'+i+'" >财务科意见</div>'
|
||||
+ ' <div style="height:30%;text-align:center" id="crkyj1'+i+'" > </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td colspan="3"id="zgld'+i+'"></td>'
|
||||
|
||||
+ ' </tr>'
|
||||
+ ' </table>'
|
||||
+ ' <div style="margin-left:540px;margin-top:5px;" id="_applyTime'+i+'"> </div>'
|
||||
+ ' </form> ');
|
||||
|
||||
|
||||
$("#zcbh"+i).html(eCard.assetnumber);
|
||||
$("#zcmc"+i).html(eCard.equipmentname);
|
||||
$("#ggxh"+i).html(eCard.equipmentmodelname);
|
||||
$("#zzcj"+i).html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny"+i).html(eCard.productiondate);
|
||||
$("#qyny"+i).html(eCard.usedate);
|
||||
$("#ysyny"+i).html(arr.equipmentScrapApplyDetail[i-10]._tousedate);
|
||||
$("#sybm"+i).html(arr.equipmentScrapApplyDetail[i-10]._unit);
|
||||
$("#sydd"+i).html(eCard.areaid);
|
||||
$("#bfyy"+i).html(arr._user0);
|
||||
$("#bfyy1"+i).html(arr._auditopinion0);
|
||||
$("#bmyj"+i).html(arr._user1);
|
||||
$("#bmyj1"+i).html(arr._auditopinion1);
|
||||
$("#bmfgldyj"+i).html(arr._user2);
|
||||
$("#bmfgldyj1"+i).html(arr._auditopinion2);
|
||||
$("#shyj"+i).html(arr._user3);
|
||||
$("#shyj1"+i).html(arr._auditopinion3);
|
||||
$("#yxglkyj"+i).html(arr._user4);
|
||||
$("#yxglkyj1"+i).html(arr._auditopinion4);
|
||||
$("#crkyj"+i).html(arr._user5);
|
||||
$("#crkyj1"+i).html(arr._auditopinion5);
|
||||
$("#zgld"+i).html(arr._user6);
|
||||
$("#zgld1"+i).html(arr._auditopinion6);
|
||||
$("#_applyTime"+i).html(arr._applyTime);
|
||||
}
|
||||
|
||||
|
||||
eCard = arr.equipmentScrapApplyDetail[0].equipmentCard;
|
||||
|
||||
$("#zcbh").html(eCard.assetnumber);
|
||||
$("#zcmc").html(eCard.equipmentname);
|
||||
$("#ggxh").html(eCard.equipmentmodelname);
|
||||
$("#zzcj").html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny").html(eCard.productiondate);
|
||||
$("#qyny").html(eCard.usedate);
|
||||
$("#ysyny").html(arr.equipmentScrapApplyDetail[0]._tousedate);
|
||||
$("#sybm").html(arr.equipmentScrapApplyDetail[0]._unit);
|
||||
$("#sydd").html(eCard.areaid);
|
||||
$("#bfyy").html(arr._user0);
|
||||
$("#bfyy1").html(arr._auditopinion0);
|
||||
$("#bmyj").html(arr._user1);
|
||||
$("#bmyj1").html(arr._auditopinion1);
|
||||
$("#bmfgldyj").html(arr._user2);
|
||||
$("#bmfgldyj1").html(arr._auditopinion2);
|
||||
$("#shyj").html(arr._user3);
|
||||
$("#shyj1").html(arr._auditopinion3);
|
||||
$("#yxglkyj").html(arr._user4);
|
||||
$("#yxglkyj1").html(arr._auditopinion4);
|
||||
$("#crkyj").html(arr._user5);
|
||||
$("#crkyj1").html(arr._auditopinion5);
|
||||
$("#zgld").html(arr._user6);
|
||||
$("#zgld1").html(arr._auditopinion6);
|
||||
$("#_applyTime").html(arr._applyTime);
|
||||
|
||||
/* $(".pagination").empty();
|
||||
$(".pagination").append('<li class=""><a class="page-link" href="#" onclick="firstpage();" id="firstpage">首页</a></li>');
|
||||
$(".pagination").append('<li class=""><a class="page-link" href="#" onclick="previosepage();" id="previosepage">上一页</a></li>');
|
||||
for(var j=0;j<totalPagesnumber;j++){
|
||||
$(".pagination").append(' <li class="page-item" onclick="pageno('+j+');" id="pageno'+j+'"><a class="page-link" href="#">'+(j+1)+'</a></li>');
|
||||
}
|
||||
$(".pagination").append(' <li class=""><a class="page-link" href="#" onclick="nextpage();" id="nextpage">下一页</a></li>');
|
||||
//把当前页,颜色变成蓝色
|
||||
$(".page-item").removeClass("active");
|
||||
$("#pageno"+currentpage).addClass("active");
|
||||
|
||||
if(totalPagesnumber<2){
|
||||
$(".pagination").hide();;
|
||||
}*/
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var LODOP; //声明为全局变量
|
||||
function prn1_preview() {
|
||||
var pid = $("#pid").val();
|
||||
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/getprintList.do', {id:pid} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
var totalPagesnumber=arr.equipmentScrapApplyDetail.length;
|
||||
LODOP=getLodop();
|
||||
CreateOneFormPage(totalPagesnumber);
|
||||
LODOP.SET_PRINT_PAGESIZE(2,0,0,"A4");
|
||||
LODOP.PREVIEW();
|
||||
});
|
||||
};
|
||||
function prn1_print() {
|
||||
var pid = $("#pid").val()
|
||||
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/getprintList.do', {id:pid} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
var totalPagesnumber=arr.equipmentScrapApplyDetail.length;
|
||||
//console.log(arr);
|
||||
/* for(var i=0;i<arr.equipmentScrapApplyDetail.length;i++){
|
||||
var eCard = arr.equipmentScrapApplyDetail[i].equipmentCard
|
||||
$("#zcbh").html(eCard.assetnumber);
|
||||
$("#zcmc").html(eCard.equipmentname);
|
||||
$("#ggxh").html(eCard.equipmentmodelname);
|
||||
$("#zzcj").html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny").html(eCard.productiondate);
|
||||
$("#qyny").html(eCard.usedate);
|
||||
$("#ysyny").html(eCard.equipmentmodelname);
|
||||
$("#sybm").html(eCard.usedate);
|
||||
$("#sydd").html(eCard.areaid);
|
||||
$("#bfyy").html(arr._user0);
|
||||
$("#bmyj").html(arr._user1);
|
||||
$("#bmfgldyj").html(arr._user2);
|
||||
$("#shyj").html(arr._user3);
|
||||
$("#yxglkyj").html(arr._user4);
|
||||
$("#crkyj").html(arr._user5);
|
||||
$("#zgld").html(arr._user6);
|
||||
$("#_applyTime").html(arr._applyTime);
|
||||
}*/
|
||||
LODOP=getLodop();
|
||||
CreateOneFormPage(totalPagesnumber);
|
||||
LODOP.SET_PRINT_PAGESIZE(2,0,0,"A4");
|
||||
LODOP.PRINTA();
|
||||
|
||||
});
|
||||
};
|
||||
function prn1_printA() {
|
||||
CreateOneFormPage();
|
||||
LODOP.SET_PRINT_PAGESIZE(2,0,0,"A4");
|
||||
LODOP.PRINTA();
|
||||
};
|
||||
function CreateOneFormPage(totalPagesnumber){
|
||||
LODOP.NewPage();
|
||||
LODOP.SET_PRINT_STYLE("FontSize",18);
|
||||
LODOP.SET_PRINT_STYLE("Bold",1);
|
||||
LODOP.ADD_PRINT_TEXT("20mm","100mm","97mm",39,"固定资产报废审批表");
|
||||
LODOP.ADD_PRINT_HTM("40mm","45mm","257mm","131mm",document.getElementById("form10").innerHTML);
|
||||
for(var i=11;i<totalPagesnumber+10;i++){
|
||||
LODOP.NewPage();
|
||||
LODOP.SET_PRINT_STYLE("FontSize",18);
|
||||
LODOP.SET_PRINT_STYLE("Bold",1);
|
||||
LODOP.ADD_PRINT_TEXT("20mm","100mm","97mm",39,"固定资产报废审批表");
|
||||
LODOP.ADD_PRINT_HTM("40mm","45mm","257mm","131mm",document.getElementById("form1"+i).innerHTML);
|
||||
}
|
||||
};
|
||||
function prn2_preview() {
|
||||
CreateTwoFormPage();
|
||||
LODOP.PREVIEW();
|
||||
};
|
||||
function prn2_manage() {
|
||||
CreateTwoFormPage();
|
||||
LODOP.PRINT_SETUP();
|
||||
};
|
||||
function CreateTwoFormPage(){
|
||||
LODOP=getLodop();
|
||||
LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_表单二");
|
||||
LODOP.ADD_PRINT_RECT(70,27,634,242,0,1);
|
||||
LODOP.ADD_PRINT_TEXT(29,236,279,38,"页面内容改变布局打印");
|
||||
LODOP.SET_PRINT_STYLEA(2,"FontSize",18);
|
||||
LODOP.SET_PRINT_STYLEA(2,"Bold",1);
|
||||
LODOP.ADD_PRINT_HTM(88,40,321,185,document.getElementById("form1").innerHTML);
|
||||
LODOP.ADD_PRINT_HTM(87,355,285,187,document.getElementById("form2").innerHTML);
|
||||
LODOP.ADD_PRINT_TEXT(319,58,500,30,"注:其中《表单一》按显示大小,《表单二》在程序控制宽度(285px)内自适应调整");
|
||||
};
|
||||
function prn3_preview(){
|
||||
LODOP=getLodop();
|
||||
LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_全页");
|
||||
LODOP.ADD_PRINT_HTM(0,0,"100%","100%",document.documentElement.innerHTML);
|
||||
LODOP.PREVIEW();
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
377
WebRoot/jsp/equipment/EquipmentTransfersPrint.jsp
Normal file
377
WebRoot/jsp/equipment/EquipmentTransfersPrint.jsp
Normal file
@ -0,0 +1,377 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
|
||||
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style>
|
||||
$('.M-box3').pagination({
|
||||
pageCount:50,
|
||||
jump:true,
|
||||
coping:true,
|
||||
homePage:'首页',
|
||||
endPage:'末页',
|
||||
prevContent:'上页',
|
||||
nextContent:'下页'
|
||||
});
|
||||
|
||||
.pagination a{
|
||||
padding:5px 10px;
|
||||
border-radius:10px;
|
||||
background-color:#ccc;
|
||||
}
|
||||
.current{
|
||||
padding:5px 10px;
|
||||
border-radius:10px;
|
||||
background-color:red;
|
||||
color:#fff;
|
||||
}
|
||||
.prev,.next{
|
||||
|
||||
|
||||
background-color: #ccc!important;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/LodopFuncs.js" charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button type="button" style="margin-left:5px;margin-top:5px" class="btn btn-default btn-sm" onclick="prn1_preview();"><i class="fa fa-print"></i>打印</button>
|
||||
<h2><font style="margin-left:200px" >固定资产调拨审批表</font>
|
||||
</h2>
|
||||
<input type="hidden" id="pid" name="pid" value="${id}">
|
||||
<form style="float:center;margin-left:100px" class="content container-fluid" id="formxx">
|
||||
<table border=1 style="border:solid 1px black;border-collapse:collapse">
|
||||
<tr style="height:60px;">
|
||||
<td style="width:100px;">资产名称</td>
|
||||
<td style="width:140px;" id="zcmc"></td>
|
||||
<td style="width:90px;">规格型号</td>
|
||||
<td colspan="3" style="width:140px;" id="ggxh"></td>
|
||||
</tr >
|
||||
<tr style="height:60px;">
|
||||
<td style="width:90px;">制造厂家</td>
|
||||
<td style="width:140px;" id="zzcj"></td>
|
||||
<td style="width:90px;">单位</td>
|
||||
<td style="width:45px;" id="dw"></td>
|
||||
<td style="width:45px;">数量</td>
|
||||
<td style="width:50px;" id="bfsl">1</td>
|
||||
</tr>
|
||||
<tr style="height:60px;">
|
||||
<td style="width:90px;">调出部门</br>(旧地点)</td>
|
||||
<td style="width:140px;" id="dcbm"></td>
|
||||
<td style="width:90px;">调入部门</br>(新地点)</td>
|
||||
<td colspan="3" style="width:140px;" id="drbm"></td>
|
||||
</tr>
|
||||
<tr style="height:180px;">
|
||||
<td style="text-align:center" >申</br>请</br>理</br>由</td>
|
||||
<td colspan="6" ><div style="height:140px;" id="sqlu" >申请理由 </div>
|
||||
<div ><div style="height:30%;float:left" id="sqlu1" > </div><div style="float:right" id="sqlu2" > </div> </div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="height:180px;">
|
||||
<td style="text-align:center">运</br>管</br>管</br>理</br>科</br>意</br>见</td>
|
||||
<td colspan="6" ><div style="height:140px;" id="ygglkyj" >运管科意见 </div>
|
||||
<div ><div style="height:30%;float:left" id="ygglkyj1" > </div><div style="float:right" id="ygglkyj2" > </div> </div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="height:180px;">
|
||||
<td style="text-align:center" >分</br>管</br>处</br>长</br>意</br>见</td>
|
||||
<td colspan="6" ><div style="height:140px;" id="fgczyj" >分管处长意见</div>
|
||||
<div style="height:30%;" id="fgczyj1" > </div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<div id="tablefrom"></div>
|
||||
|
||||
<ul style="margin-left:200px" class="pagination">
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function print(){
|
||||
$("#form1").jqprint({
|
||||
debug: false,
|
||||
importCSS: true,
|
||||
printContainer: true,
|
||||
operaSupport: false
|
||||
});
|
||||
}
|
||||
var currentpage=0;
|
||||
$(function() {
|
||||
|
||||
|
||||
// var totalPagesnumber=0;
|
||||
//动态设置分页
|
||||
getData(currentpage);
|
||||
});
|
||||
$(".page-item").click(function(){
|
||||
|
||||
var idval=this.id;
|
||||
currentpage=idval.substr(6);
|
||||
|
||||
getData(currentpage);
|
||||
});
|
||||
var pageno = function(j) {
|
||||
|
||||
//var idval=this.id;
|
||||
//currentpage=idval.substr(6);
|
||||
|
||||
getData(j);
|
||||
};
|
||||
|
||||
//下一页
|
||||
$("#nextpage").click(function(){
|
||||
var curr= new Number(currentpage);
|
||||
currentpage=curr+1;
|
||||
getData(currentpage);
|
||||
});
|
||||
var nextpage = function() {
|
||||
currentpage=currentpage+1;
|
||||
getData(currentpage);
|
||||
};
|
||||
|
||||
//上一页
|
||||
$("#previosepage").click(function(){
|
||||
var curr= new Number(currentpage);
|
||||
currentpage=curr-1;
|
||||
getData(currentpage);
|
||||
});
|
||||
var previosepage = function() {
|
||||
currentpage=currentpage-1;
|
||||
getData(currentpage);
|
||||
};
|
||||
//首页
|
||||
$("#firstpage").click(function(){
|
||||
currentpage=0;
|
||||
getData(currentpage);
|
||||
});
|
||||
var firstpage = function() {
|
||||
currentpage=0;
|
||||
getData(currentpage);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function getData(currentpage) {
|
||||
var pid = $("#pid").val()
|
||||
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/getprintList.do', {id:pid} , function(data) {
|
||||
|
||||
var arr= JSON.parse(data);
|
||||
console.log(arr);
|
||||
var eCard ;
|
||||
var totalPagesnumber=arr.equipmentTransfersApplyDetails.length;
|
||||
|
||||
|
||||
for(var i=1+10;i<totalPagesnumber+10;i++){
|
||||
eCard = arr.equipmentTransfersApplyDetails[i-10].equipmentCard;
|
||||
$("#tablefrom").append('<form style="float:center;margin-left:100px" class="content container-fluid" id="form'+i+'">'
|
||||
+' <table border=1 style="border:solid 1px black;border-collapse:collapse"> '
|
||||
+'<tr style="height:60px;"> '
|
||||
+'<td style="width:100px;">资产名称</td>'
|
||||
+'<td style="width:140px;" id="zcmc'+i+"d"+'"></td>'
|
||||
+'<td style="width:90px;">规格型号</td>'
|
||||
+' <td colspan="3" style="width:140px;" id="ggxh'+i+"d"+'"></td> '
|
||||
+' </tr >'
|
||||
+' <tr style="height:60px;">'
|
||||
+' <td style="width:90px;">制造厂家</td>'
|
||||
+' <td style="width:140px;" id="zzcj'+i+"d"+'"></td>'
|
||||
+'<td style="width:90px;">单位</td>'
|
||||
+' <td style="width:45px;" id="dw'+i+"d"+'"></td>'
|
||||
+'<td style="width:45px;">数量</td>'
|
||||
+' <td style="width:50px;" id="bfsl'+i+"d"+'">1</td>'
|
||||
+' </tr>'
|
||||
+' <tr style="height:60px;">'
|
||||
+'<td style="width:90px;">调出部门</br>(旧地点)</td>'
|
||||
+' <td style="width:140px;" id="dcbm'+i+"d"+'"></td>'
|
||||
+' <td style="width:90px;">调入部门</br>(新地点)</td>'
|
||||
+' <td colspan="3" style="width:140px;" id="drbm'+i+"d"+'"></td> '
|
||||
+' </tr>'
|
||||
+' <tr style="height:180px;">'
|
||||
+' <td style="text-align:center" >申</br>请</br>理</br>由</td>'
|
||||
+' <td colspan="6" ><div style="height:140px;" id="sqlu'+i+"d"+'" >申请理由 </div>'
|
||||
+' <div ><div style="height:30%;float:left" id="sqlu1'+i+"d"+'" > </div><div style="float:right" id="sqlu2'+i+"d"+'" > </div> </div>'
|
||||
+' </td>'
|
||||
+' </tr>'
|
||||
|
||||
+' <tr style="height:180px;">'
|
||||
+' <td style="text-align:center">运</br>管</br>管</br>理</br>科</br>意</br>见</td>'
|
||||
+' <td colspan="6" ><div style="height:140px;" id="ygglkyj'+i+"d"+'" >运管科意见 </div>'
|
||||
+' <div ><div style="height:30%;float:left" id="ygglkyj1'+i+"d"+'" > </div><div style="float:right" id="ygglkyj2'+i+"d"+'" > </div> </div>'
|
||||
+' </td>'
|
||||
+' </tr>'
|
||||
|
||||
+' <tr style="height:180px;">'
|
||||
+' <td style="text-align:center" >分</br>管</br>处</br>长</br>意</br>见</td>'
|
||||
+' <td colspan="6" ><div style="height:140px;" id="fgczyj'+i+"d"+'" >分管处长意见</div>'
|
||||
+' <div style="height:30%;" id="fgczyj1'+i+"d"+'" > </div>'
|
||||
+' </td>'
|
||||
+' </tr>'
|
||||
|
||||
+' </table>'
|
||||
|
||||
+'</form>');
|
||||
|
||||
|
||||
|
||||
|
||||
$("#zcbh"+i+"d").html(eCard.assetnumber);
|
||||
$("#zcmc"+i+"d").html(eCard.equipmentname);
|
||||
$("#ggxh"+i+"d").html(eCard.equipmentmodelname);
|
||||
$("#zzcj"+i+"d").html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny"+i+"d").html(eCard.productiondate);
|
||||
$("#qyny"+i+"d").html(eCard.usedate);
|
||||
$("#ysyny"+i+"d").html(eCard.equipmentmodelname);
|
||||
$("#sybm"+i+"d").html(eCard.usedate);
|
||||
$("#dcbm"+i+"d").html(arr.sendToBizName);
|
||||
$("#drbm"+i+"d").html(arr.companyName);
|
||||
$("#dw"+i+"d").html(eCard.unit);
|
||||
|
||||
$("#sqlu"+i+"d").html(arr.transfersInstr);
|
||||
$("#sqlu1"+i+"d").html(arr._data4);
|
||||
$("#sqlu2"+i+"d").html(arr._data5);
|
||||
$("#ygglkyj"+i+"d").html(arr._data6);
|
||||
$("#ygglkyj1"+i+"d").html(arr._data7);
|
||||
$("#ygglkyj2"+i+"d").html(arr._data8);
|
||||
$("#fgczyj"+i+"d").html(arr._data9);
|
||||
$("#fgczyj1"+i+"d").html(arr._data10);
|
||||
|
||||
}
|
||||
eCard = arr.equipmentTransfersApplyDetails[0].equipmentCard;
|
||||
$("#zcbh").html(eCard.assetnumber);
|
||||
$("#zcmc").html(eCard.equipmentname);
|
||||
$("#ggxh").html(eCard.equipmentmodelname);
|
||||
$("#zzcj").html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny").html(eCard.productiondate);
|
||||
$("#qyny").html(eCard.usedate);
|
||||
$("#ysyny").html(eCard.equipmentmodelname);
|
||||
$("#sybm").html(eCard.usedate);
|
||||
$("#dcbm").html(arr.sendToBizName);
|
||||
$("#drbm").html(arr.companyName);
|
||||
$("#dw").html(eCard.unit);
|
||||
|
||||
$("#sqlu").html(arr.transfersInstr);
|
||||
$("#sqlu1").html(arr._data4);
|
||||
$("#sqlu2").html(arr._data5);
|
||||
$("#ygglkyj").html(arr._data6);
|
||||
$("#ygglkyj1").html(arr._data7);
|
||||
$("#ygglkyj2").html(arr._data8);
|
||||
$("#fgczyj").html(arr._data9);
|
||||
$("#fgczyj1").html(arr._data10);
|
||||
|
||||
});
|
||||
};
|
||||
var LODOP; //声明为全局变量
|
||||
|
||||
|
||||
|
||||
function prn1_preview() {
|
||||
var pid = $("#pid").val()
|
||||
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/getprintList.do', {id:pid} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
var totalPagesnumber=arr.equipmentTransfersApplyDetails.length;
|
||||
console.log(totalPagesnumber);
|
||||
|
||||
LODOP=getLodop();
|
||||
CreateOneFormPage(totalPagesnumber);
|
||||
LODOP.SET_PRINT_PAGESIZE(1,0,0,"A4");
|
||||
LODOP.PREVIEW();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
function prn1_print() {
|
||||
var pid = $("#pid").val()
|
||||
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/getprintList.do', {id:pid} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
//console.log(arr);
|
||||
for(var i=0;i<arr.equipmentTransfersApplyDetails.length;i++){
|
||||
var eCard = arr.equipmentTransfersApplyDetails[i].equipmentCard
|
||||
$("#zcbh").html(eCard.assetnumber);
|
||||
$("#zcmc").html(eCard.equipmentname);
|
||||
$("#ggxh").html(eCard.equipmentmodelname);
|
||||
$("#zzcj").html(eCard.equipmentmanufacturer);
|
||||
//$("#bfsl").html(eCard.equipmentmodelname);
|
||||
$("#ccny").html(eCard.productiondate);
|
||||
$("#qyny").html(eCard.usedate);
|
||||
$("#ysyny").html(eCard.equipmentmodelname);
|
||||
$("#sybm").html(eCard.usedate);
|
||||
$("#dcbm").html(arr.sendToBizName);
|
||||
$("#drbm").html(arr.companyName);
|
||||
$("#dw").html(eCard.unit);
|
||||
|
||||
$("#sqlu").html(arr.transfersInstr);
|
||||
$("#sqlu1").html(arr._data4);
|
||||
$("#sqlu2").html(arr._data5);
|
||||
$("#ygglkyj").html(arr._data6);
|
||||
$("#ygglkyj1").html(arr._data7);
|
||||
$("#ygglkyj2").html(arr._data8);
|
||||
$("#fgczyj").html(arr._data9);
|
||||
$("#fgczyj1").html(arr._data10);
|
||||
|
||||
CreateOneFormPage();
|
||||
LODOP.PRINTA();
|
||||
}
|
||||
});
|
||||
};
|
||||
function prn1_printA() {
|
||||
CreateOneFormPage();
|
||||
LODOP.PRINTA();
|
||||
};
|
||||
function CreateOneFormPage(totalPagesnumber){
|
||||
LODOP.NewPage();
|
||||
|
||||
LODOP.SET_PRINT_STYLE("FontSize",18);
|
||||
LODOP.SET_PRINT_STYLE("Bold",1);
|
||||
LODOP.ADD_PRINT_TEXT(50,261,260,39,"固定资产调拨审批表");
|
||||
LODOP.ADD_PRINT_HTM("10%","16.5%", "100%","80%",document.getElementById("formxx").innerHTML);
|
||||
for(var i=11;i<totalPagesnumber+10;i++){
|
||||
LODOP.NewPage();
|
||||
|
||||
LODOP.SET_PRINT_STYLE("FontSize",18);
|
||||
LODOP.SET_PRINT_STYLE("Bold",1);
|
||||
LODOP.ADD_PRINT_TEXT(50,261,260,39,"固定资产调拨审批表");
|
||||
LODOP.ADD_PRINT_HTM("10%","16.5%", "100%","80%",document.getElementById("form"+i).innerHTML);
|
||||
}
|
||||
};
|
||||
|
||||
function prn3_preview(){
|
||||
LODOP=getLodop();
|
||||
LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_全页");
|
||||
LODOP.ADD_PRINT_HTM(0,0,"100%","100%",document.documentElement.innerHTML);
|
||||
LODOP.PREVIEW();
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
597
WebRoot/jsp/equipment/accountOverview.jsp
Normal file
597
WebRoot/jsp/equipment/accountOverview.jsp
Normal file
@ -0,0 +1,597 @@
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var viewHeight=jQuery(window).height();
|
||||
$('#main').css('height',(viewHeight-20)+'px');
|
||||
|
||||
chart1();
|
||||
chart2();
|
||||
chart3();
|
||||
chart4();
|
||||
var chart5Data=[[320, 302, 301, 334, 390, 330, 320,320, 302, 301, 334],[120, 132, 101, 134, 90, 230, 210,320, 302, 301, 334],[220, 182, 191, 234, 290, 330, 310,320, 302, 301, 334]]
|
||||
chart5(chart5Data);
|
||||
});
|
||||
|
||||
function chart1(){
|
||||
var mychart=echarts.init(document.getElementById('chart1'));
|
||||
var option = {
|
||||
title: {
|
||||
text: "95%",
|
||||
textStyle: {
|
||||
color: '#01c4a3',
|
||||
fontSize: 24
|
||||
},
|
||||
subtext: '设备完好率',
|
||||
subtextStyle: {
|
||||
color: '#909090',
|
||||
fontSize: 18
|
||||
},
|
||||
itemGap: 5, // 主副标题距离
|
||||
left: 'center',
|
||||
top: 'center'
|
||||
},
|
||||
angleAxis: {
|
||||
max: 100, // 满分
|
||||
clockwise: false, // 逆时针
|
||||
// 隐藏刻度线
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
radiusAxis: {
|
||||
type: 'category',
|
||||
// 隐藏刻度线
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
polar: {
|
||||
center: ['50%', '55%'],
|
||||
radius: '140%' //图形大小
|
||||
},
|
||||
series: [{
|
||||
type: 'bar',
|
||||
data: [{
|
||||
name: '百分比',
|
||||
value: 95,
|
||||
itemStyle: {
|
||||
color: '#00A5FF'
|
||||
},
|
||||
}],
|
||||
coordinateSystem: 'polar',
|
||||
roundCap: true,
|
||||
barWidth: 20,
|
||||
barGap: '-100%', // 两环重叠
|
||||
z: 2,
|
||||
},{ // 灰色环
|
||||
type: 'bar',
|
||||
data: [{
|
||||
value: 100,
|
||||
itemStyle: {
|
||||
color: '#F0EFEF',
|
||||
shadowColor: 'rgba(0, 0, 0, 0.2)',
|
||||
shadowBlur: 5,
|
||||
shadowOffsetY: 2
|
||||
}
|
||||
}],
|
||||
coordinateSystem: 'polar',
|
||||
roundCap: true,
|
||||
barWidth: 20,
|
||||
barGap: '-100%', // 两环重叠
|
||||
z: 1
|
||||
}]
|
||||
};
|
||||
mychart.setOption(option,true);
|
||||
}
|
||||
|
||||
function chart2(){
|
||||
var mychart=echarts.init(document.getElementById('chart2'));
|
||||
var color=['#5DB1FF','#59D4D4','#4ECB73']
|
||||
var option = {
|
||||
color:color,
|
||||
title: {
|
||||
text: "ABC类占比",
|
||||
textStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
left: 'center',
|
||||
top: 'top'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
bottom: '10%',
|
||||
data: ['A类', 'B类', 'C类'],
|
||||
// formatter: function (name) {
|
||||
// return name+'\n'+'13';
|
||||
// }
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '设备占比',
|
||||
type: 'pie',
|
||||
center: ['50%', '43%'],
|
||||
radius: ['50%', '78%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'inner',
|
||||
formatter: '{d}%',
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{value: 289, name: 'A类'},
|
||||
{value: 972, name: 'B类'},
|
||||
{value: 1157, name: 'C类'}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
mychart.setOption(option,true);
|
||||
}
|
||||
|
||||
function chart3(){
|
||||
var mychart=echarts.init(document.getElementById('chart3'));
|
||||
var color=['#23AFFC','#5BDDDA','#4CD077','#FFCE26','#F27474']
|
||||
var option = {
|
||||
color:color,
|
||||
title: {
|
||||
text: "大区设备数总览",
|
||||
textStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
left: 'center',
|
||||
top: 'top'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
data: ['北部','中部','西部','东部','南部']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['2010','2011','2012','2013','2014','2015','2016','2017','2018','2019','2020']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
show: true
|
||||
},
|
||||
axisLine:{
|
||||
show:false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: true,//是否显示分隔线。默认数值轴显示,类目轴不显示。
|
||||
lineStyle:{
|
||||
color:'#DBDBDB',
|
||||
type:'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '北部',
|
||||
type: 'bar',
|
||||
stack: '总量',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'insideRight'
|
||||
},
|
||||
data: [320, 302, 301, 334, 390, 330, 320,320, 302, 301, 334]
|
||||
},
|
||||
{
|
||||
name: '中部',
|
||||
type: 'bar',
|
||||
stack: '总量',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'insideRight'
|
||||
},
|
||||
data: [120, 132, 101, 134, 90, 230, 210,320, 302, 301, 334]
|
||||
},
|
||||
{
|
||||
name: '西部',
|
||||
type: 'bar',
|
||||
stack: '总量',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'insideRight'
|
||||
},
|
||||
data: [220, 182, 191, 234, 290, 330, 310,320, 302, 301, 334]
|
||||
},
|
||||
{
|
||||
name: '东部',
|
||||
type: 'bar',
|
||||
stack: '总量',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'insideRight'
|
||||
},
|
||||
data: [150, 212, 201, 154, 190, 330, 410,320, 302, 301, 334]
|
||||
},
|
||||
{
|
||||
name: '南部',
|
||||
type: 'bar',
|
||||
stack: '总量',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'insideRight'
|
||||
},
|
||||
data: [820, 832, 901, 934, 1290, 1330, 1320,320, 302, 301, 334]
|
||||
}
|
||||
]
|
||||
};
|
||||
mychart.setOption(option,true);
|
||||
}
|
||||
|
||||
function chart4(){
|
||||
var mychart=echarts.init(document.getElementById('chart4'));
|
||||
var color=['#23AFFC','#5BDDDA','#4CD077','#FFCE26','#F27474']
|
||||
var option = {
|
||||
color:color,
|
||||
title: {
|
||||
text: "2020年度",
|
||||
textStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
left: 'center',
|
||||
top: 'top'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
bottom: '10%',
|
||||
data: ['北部', '中部', '西部', '东部', '南部'],
|
||||
// formatter: function (name) {
|
||||
// return name+'\n'+'13';
|
||||
// }
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '设备占比',
|
||||
type: 'pie',
|
||||
center: ['50%', '43%'],
|
||||
radius: ['50%', '78%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'inner',
|
||||
formatter: '{d}%',
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{value: 589, name: '北部'},
|
||||
{value: 972, name: '中部'},
|
||||
{value: 1157, name: '西部'},
|
||||
{value: 687, name: '东部'},
|
||||
{value: 1260, name: '南部'}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
mychart.setOption(option,true);
|
||||
}
|
||||
|
||||
function chart5(data){
|
||||
var mychart=echarts.init(document.getElementById('chart5'));
|
||||
var color=['#00A5FF','#2DC85F','#B3E4FF']
|
||||
var option = {
|
||||
color:color,
|
||||
title: {
|
||||
text: "设备价值曲线",
|
||||
textStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
left: 'center',
|
||||
top: 'top'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
data: ['原值','净值','设备总数']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['2010','2011','2012','2013','2014','2015','2016','2017','2018','2019','2020']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
show: true
|
||||
},
|
||||
axisLine:{
|
||||
show:false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: true,//是否显示分隔线。默认数值轴显示,类目轴不显示。
|
||||
lineStyle:{
|
||||
color:'#DBDBDB',
|
||||
type:'dashed'
|
||||
}
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '原值',
|
||||
type: 'line',
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: data[0]
|
||||
},
|
||||
{
|
||||
name: '净值',
|
||||
type: 'line',
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: data[1]
|
||||
},
|
||||
{
|
||||
name: '设备总数',
|
||||
type: 'bar',
|
||||
barWidth:30,
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: data[2]
|
||||
}
|
||||
]
|
||||
};
|
||||
mychart.setOption(option,true);
|
||||
}
|
||||
|
||||
function bkchange(obj){
|
||||
$('#bk1').css('border','0px solid #00A5FF');
|
||||
$('#bk2').css('border','0px solid #00A5FF');
|
||||
$('#bk3').css('border','0px solid #00A5FF');
|
||||
$('#bk4').css('border','0px solid #00A5FF');
|
||||
$('#bk5').css('border','0px solid #00A5FF');
|
||||
$('#'+obj).css('border','1px solid #00A5FF');
|
||||
var chart5Data="";
|
||||
if(obj=='bk1'){
|
||||
chart5Data=[[320, 302, 301, 334, 390, 330, 320,320, 302, 301, 334],[120, 132, 101, 134, 90, 230, 210,320, 302, 301, 334],[220, 182, 191, 234, 290, 330, 310,320, 302, 301, 334]];
|
||||
}else{
|
||||
chart5Data=[[350, 262, 311, 341, 246, 380, 310,370, 322, 341, 234],[120, 132, 101, 134, 90, 230, 210,320, 302, 301, 334],[220, 182, 191, 234, 290, 330, 310,320, 302, 301, 334]];
|
||||
}
|
||||
chart5(chart5Data);
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
||||
<div class="content-wrapper" >
|
||||
<div id="main" style="padding: 20px;">
|
||||
<div style="float: left;width: 100%;height:50%;padding: 10px;background-color: #ffffff;border-radius:12px;">
|
||||
<div style="float: left;width: 15%;height:100%;">
|
||||
<div id="chart1" style="float: left;width:100%;height:80%;"></div>
|
||||
<div style="float: left;width:100%;height:20%;">
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td width="25%" align="center">闲置</td>
|
||||
<td width="25%" align="center">在用</td>
|
||||
<td width="25%" align="center">库存</td>
|
||||
<td width="25%" align="center">待报废</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" align="center">23</td>
|
||||
<td width="25%" align="center">543</td>
|
||||
<td width="25%" align="center">67</td>
|
||||
<td width="25%" align="center">23</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left;width: 15%;height:100%;padding-top:10px;padding-bottom:10px;">
|
||||
<div id="chart2" style="float: left;width:100%;height:100%;border-right:1px dashed #DBDBDB;"></div>
|
||||
</div>
|
||||
<div style="float: left;width: 55%;height:100%;">
|
||||
<div id="chart3" style="float: left;width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<div style="float: left;width: 15%;height:100%;padding-top:10px;">
|
||||
<div id="chart4" style="float: left;width:100%;height:100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left;width: 100%;height:50%;padding: 10px;background-color: #ffffff;border-radius:12px;margin-top: 20px;">
|
||||
<div style="float: left;width: 30%;height:100%;padding-top:10px;padding-bottom:10px;">
|
||||
<div style="float: left;width: 100%;height: 16.6%;">
|
||||
<table style="width: 100%;">
|
||||
<tr style="width: 100%;">
|
||||
<td align="center" style="font-weight: 600;">设备总价值(万元)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="bk1" style="float: left;width: 100%;height: 16.6%;cursor: pointer;border-radius:12px;border: 1px solid #00A5FF;" onclick="bkchange(this.id);">
|
||||
<table style="width: 100%;height:100%;">
|
||||
<tr style="width: 100%;height:100%;">
|
||||
<td align="center" style="width: 25%;height:100%;">东部大区</td>
|
||||
<td align="center" style="width: 50%;height: 100%;vertical-align:middle;">
|
||||
<div style="float: left;width:75%;height:25px;background-color: #FFC500;border-radius: 20px 0px 0px 20px;"></div>
|
||||
<div style="float: left;width:25%;height:25px;background-color: #E0EFF4;border-radius: 0px 20px 20px 0px;"></div>
|
||||
</td>
|
||||
<td align="center" style="width: 25%;height:100%;">2,230</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="bk2" style="float: left;width: 100%;height: 16.6%;cursor: pointer;border-radius:12px;" onclick="bkchange(this.id);">
|
||||
<table style="width: 100%;height:100%;">
|
||||
<tr style="width: 100%;height:100%;">
|
||||
<td align="center" style="width: 25%;height:100%;">北部大区</td>
|
||||
<td align="center" style="width: 50%;height: 100%;vertical-align:middle;">
|
||||
<div style="float: left;width:42%;height:25px;background-color: #00A5FF;border-radius: 20px 0px 0px 20px;"></div>
|
||||
<div style="float: left;width:58%;height:25px;background-color: #E0EFF4;border-radius: 0px 20px 20px 0px;"></div>
|
||||
</td>
|
||||
<td align="center" style="width: 25%;height:100%;">1,440</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="bk3" style="float: left;width: 100%;height: 16.6%;cursor: pointer;border-radius:12px;" onclick="bkchange(this.id);">
|
||||
<table style="width: 100%;height:100%;">
|
||||
<tr style="width: 100%;height:100%;">
|
||||
<td align="center" style="width: 25%;height:100%;">北部大区</td>
|
||||
<td align="center" style="width: 50%;height: 100%;vertical-align:middle;">
|
||||
<div style="float: left;width:39%;height:25px;background-color: #2DC85F;border-radius: 20px 0px 0px 20px;"></div>
|
||||
<div style="float: left;width:61%;height:25px;background-color: #E0EFF4;border-radius: 0px 20px 20px 0px;"></div>
|
||||
</td>
|
||||
<td align="center" style="width: 25%;height:100%;">1,200</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="bk4" style="float: left;width: 100%;height: 16.6%;cursor: pointer;border-radius:12px;" onclick="bkchange(this.id);">
|
||||
<table style="width: 100%;height:100%;">
|
||||
<tr style="width: 100%;height:100%;">
|
||||
<td align="center" style="width: 25%;height:100%;">北部大区</td>
|
||||
<td align="center" style="width: 50%;height: 100%;vertical-align:middle;">
|
||||
<div style="float: left;width:68%;height:25px;background-color: #3ED7D4;border-radius: 20px 0px 0px 20px;"></div>
|
||||
<div style="float: left;width:32%;height:25px;background-color: #E0EFF4;border-radius: 0px 20px 20px 0px;"></div>
|
||||
</td>
|
||||
<td align="center" style="width: 25%;height:100%;">1,630</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="bk5" style="float: left;width: 100%;height: 16.6%;cursor: pointer;border-radius:12px;" onclick="bkchange(this.id);">
|
||||
<table style="width: 100%;height:100%;">
|
||||
<tr style="width: 100%;height:100%;">
|
||||
<td align="center" style="width: 25%;height:100%;">北部大区</td>
|
||||
<td align="center" style="width: 50%;height: 100%;vertical-align:middle;">
|
||||
<div style="float: left;width:81%;height:25px;background-color: #F05C5C;border-radius: 20px 0px 0px 20px;"></div>
|
||||
<div style="float: left;width:19%;height:25px;background-color: #E0EFF4;border-radius: 0px 20px 20px 0px;"></div>
|
||||
</td>
|
||||
<td align="center" style="width: 25%;height:100%;">3,230</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left;width: 50%;height:100%;padding-top:10px;padding-bottom:10px;">
|
||||
<div id="chart5" style="float: left;width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<div style="float: left;width: 20%;height:100%;padding-top:10px;padding-bottom:10px;">
|
||||
<div style="float: left;width:100%;height:50%;">
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td align="center" style="vertical-align:middle;width: 25px;height: 25px;">
|
||||
<div style="float: left;width:25px;height:25px;background-color: #00A5FF;"></div>
|
||||
</td>
|
||||
<td align="left" style="vertical-align:middle;padding-left: 10px;">原值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="vertical-align:middle;width: 25px;height: 25px;">
|
||||
<div style="float: left;width:25px;height:25px;background-color: #2DC85F;"></div>
|
||||
</td>
|
||||
<td align="left" style="vertical-align:middle;padding-left: 10px;">净值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="vertical-align:middle;width: 25px;height: 25px;">
|
||||
<div style="float: left;width:25px;height:25px;background-color: #B3E4FF;"></div>
|
||||
</td>
|
||||
<td align="left" style="vertical-align:middle;padding-left: 10px;">设备总数</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="float: left;width:100%;height:50%;">
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td align="left" style="vertical-align:middle;">
|
||||
本年度设备总价值(万元)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" style="vertical-align:bottom;color: #F05C5C;font-size: 20px;">
|
||||
<div style="float: left;width:50%;">+ 13%</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" style="vertical-align:middle;color:#00A5FF;font-size: 40px;font-size: 600;">
|
||||
<div style="float: left;width:50%;">2,300</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
123
WebRoot/jsp/equipment/assetClass4Tree.jsp
Normal file
123
WebRoot/jsp/equipment/assetClass4Tree.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var unitId = "";
|
||||
|
||||
var addFun = function () {
|
||||
var node = $('#tree').treeview('getSelected');
|
||||
var pid = "";
|
||||
if (node != null && node.length > 0) {
|
||||
pid = node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/assetClass/doadd.do', {pid: pid}, function (data) {
|
||||
// console.log(data);
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/equipment/assetClass/doedit.do', {id: id}, function (data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/assetClass/getTreeJson.do', {unitId: unitId}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 2});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id);
|
||||
});
|
||||
}, 'json');
|
||||
$("#menuBox").html("");
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/importEquipmentClass.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/equipment/equipmentClass/doExport.do?unitId=" + unitId);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
unitId = unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"></h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:750px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="menuBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
265
WebRoot/jsp/equipment/assetClassAdd.jsp
Normal file
265
WebRoot/jsp/equipment/assetClassAdd.jsp
Normal file
@ -0,0 +1,265 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/assetClass/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
//closeModal('subModal');
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
showAlert('s', '保存成功');
|
||||
initTreeView();
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
//设备所属--常排项目用
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelong4Select.do", {companyId: unitId}, function (data) {
|
||||
$("#equipmentBelongId").empty();
|
||||
var selelct_ = $("#equipmentBelongId").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
|
||||
selelct_.val('').trigger("change");
|
||||
}, 'json');
|
||||
//设备类型树
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getEquipmentClassJsonForTree.do', {
|
||||
ng: '',
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#classId").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("设备类型:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#classId").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 1
|
||||
});
|
||||
$('#companytree1').on('nodeSelected', function (event, data) {
|
||||
//只能点最底层
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#classId").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select1').style.display = "none";
|
||||
// $("ul#company_select1").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
$("#classId").val(data.id);
|
||||
$("#cname_input1").val(data.text);
|
||||
document.getElementById('company_select1').style.display = "none";
|
||||
$("ul#company_select1").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
}
|
||||
;
|
||||
}, 'json');
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
assetclassnumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '资产类型编号不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/assetClass/checkExist.do',//验证地址
|
||||
message: '编号已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
assetclassnumber: $('#assetclassnumber').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
assetclassname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '资产类型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//工艺线
|
||||
var selectEquipmentBelong = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentBelong/showEquipmentBelongForSelect.do', {equipmentBelongId: $('#equipmentBelongId').val}, function (data) {
|
||||
$("#equipmentBelongSubDiv").html(data);
|
||||
openModal('equipmentBelongSubModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="equipmentBelongSubDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*资产类型编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassnumber" name="assetclassnumber"
|
||||
placeholder="编号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*资产类型名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassname" name="assetclassname" placeholder="名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧年限</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="depreciablelife" name="depreciablelife"
|
||||
placeholder="年限">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">净残值比例</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="netsalvageratio" name="netsalvageratio"
|
||||
placeholder="净残值比例">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">年折旧率</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="yeardepreciation" name="yeardepreciation"
|
||||
placeholder="折旧率">
|
||||
</div>
|
||||
</div>
|
||||
<c:if test='${param.pid==""}'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">关联设备归属/工艺线</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2 " multiple="multiple" id="equipmentBelongId"
|
||||
name="equipmentBelongId">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="div1" class="input-group input-group-sm pull-left" style="margin-top: -0.6%;">
|
||||
<input id="classId" name="classId" type="hidden"/>
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul id="companyselect1"
|
||||
style="list-style-type:none;padding-left:10px;margin-top:8px;width:190px;">
|
||||
<li class="dropdown messages-menu">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select1').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon"
|
||||
style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">设备类型:</span>
|
||||
<input class="form-control " id="cname_input1" name="cname_input1"
|
||||
style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly/>
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select1" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree1" style="width: 275px;overflow:auto;max-height:500px;">
|
||||
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="selectnode();"><i class="fa fa-cloud-upload"></i>确定</button> -->
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark" placeholder="备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
299
WebRoot/jsp/equipment/assetClassEdit.jsp
Normal file
299
WebRoot/jsp/equipment/assetClassEdit.jsp
Normal file
@ -0,0 +1,299 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/assetClass/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
// closeModal('subModal');
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
showAlert('s', '修改成功');
|
||||
// initTreeView();
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '修改失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
var dodel = function (id) {
|
||||
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 + '/equipment/assetClass/dodelete.do', {id: id}, function (data) {
|
||||
var result = data;
|
||||
if (result === 1) {
|
||||
$("#menuBox").html('');
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//设备所属--常排项目用
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelong4Select.do", {companyId: unitId}, function (data) {
|
||||
$("#equipmentBelongId").empty();
|
||||
var selelct_ = $("#equipmentBelongId").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
var select_id = '${assetClass.equipmentBelongId}';
|
||||
var arr = select_id.split(",");
|
||||
selelct_.val(arr).trigger("change");
|
||||
}, 'json');
|
||||
//设备类型树
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getEquipmentClassJsonForTree.do', {
|
||||
ng: '',
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#classId").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("设备类型:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#classId").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 1
|
||||
});
|
||||
$('#companytree1').on('nodeSelected', function (event, data) {
|
||||
//只能点最底层
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#classId").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select1').style.display = "none";
|
||||
// $("ul#company_select1").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
$("#classId").val(data.id);
|
||||
$("#cname_input1").val(data.text);
|
||||
document.getElementById('company_select1').style.display = "none";
|
||||
$("ul#company_select1").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
}
|
||||
;
|
||||
}, 'json');
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
assetclassnumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '资产类型编号不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/assetClass/checkExist.do',//验证地址
|
||||
message: '编号已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
assetclassnumber: $('#assetclassnumber').val(),
|
||||
id: $("#id").val()
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
assetclassname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '资产类型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#active").select2({minimumResultsForSearch: 10}).val("${assetClass.active}").trigger("change");
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">详情</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel('${assetClass.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="${assetClass.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*资产类型编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassnumber" name="assetclassnumber"
|
||||
placeholder="编号" value="${assetClass.assetclassnumber}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*资产类型名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassname" name="assetclassname" placeholder="名称"
|
||||
value="${assetClass.assetclassname}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧年限</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="depreciablelife" name="depreciablelife" placeholder="年限"
|
||||
value="${assetClass.depreciablelife}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">净残值比例</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="netsalvageratio" name="netsalvageratio"
|
||||
placeholder="净残值比例" value="${assetClass.netsalvageratio}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">年折旧率</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="yeardepreciation" name="yeardepreciation"
|
||||
placeholder="折旧率" value="${assetClass.yeardepreciation}">
|
||||
</div>
|
||||
</div>
|
||||
<c:if test='${param.pid=="-1"}'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">关联设备归属/工艺线</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2 " multiple="multiple" id="equipmentBelongId"
|
||||
name="equipmentBelongId">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 100%;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备类型</label>
|
||||
<div class="col-sm-6">
|
||||
<div id="div1" class="input-group input-group-sm pull-left" style="margin-top: -0.6%;">
|
||||
<input id="classId" name="classId" type="hidden"/>
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul id="companyselect1"
|
||||
style="list-style-type:none;padding-left:10px;margin-top:8px;width:190px;">
|
||||
<li class="dropdown messages-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select1').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<input class="form-control " id="cname_input1" name="cname_input1"
|
||||
style="height:28px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
value="${assetClass.equipmentClass.name}"
|
||||
readonly/>
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select1" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<div id="companytree1" style="width: 827px;overflow:auto;max-height:500px;">
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark"
|
||||
placeholder="备注...">${assetClass.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
285
WebRoot/jsp/equipment/assetClassList.jsp
Normal file
285
WebRoot/jsp/equipment/assetClassList.jsp
Normal file
@ -0,0 +1,285 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增资产类型
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/equipment/assetClass/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑资产类型
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/assetClass/doedit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看资产类型
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/assetClass/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条资产类型数据
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/equipment/assetClass/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}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 + '/equipment/assetClass/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function() {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/assetClass/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'assetclassnumber', // 返回json数据中的name
|
||||
title: '资产类型编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'assetclassname', // 返回json数据中的name
|
||||
title: '资产类型名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'depreciablelife', // 返回json数据中的name
|
||||
title: '折旧年限', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'netsalvageratio', // 返回json数据中的name
|
||||
title: '净残值比例', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'yeardepreciation', // 返回json数据中的name
|
||||
title: '年折旧率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<security:authorize buttonUrl="equipment/assetClass/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="equipment/assetClass/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
|
||||
<div >
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/assetClass/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right" >
|
||||
<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="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
85
WebRoot/jsp/equipment/assetClassView.jsp
Normal file
85
WebRoot/jsp/equipment/assetClassView.jsp
Normal file
@ -0,0 +1,85 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
if("${assetClass.active}" == 0){
|
||||
$("#active").val("禁用");
|
||||
}else{
|
||||
$("#active").val("启用");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看资产类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value= "${assetClass.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产类型编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassnumber" name ="assetclassnumber" value= "${assetClass.assetclassnumber}" disabled="disabled" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产类型名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="assetclassname" name ="assetclassname" value= "${assetClass.assetclassname}" disabled="disabled" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧年限</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="depreciablelife" name ="depreciablelife" value= "${assetClass.depreciablelife}" disabled="disabled" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">净残值比例</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="netsalvageratio" name ="netsalvageratio" value= "${assetClass.netsalvageratio}" disabled="disabled" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">年折旧率</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="yeardepreciation" name ="yeardepreciation" value= "${assetClass.yeardepreciation}" disabled="disabled" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="active" name ="active" disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" disabled="disabled">${assetClass.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
228
WebRoot/jsp/equipment/attachedEquipmentView.jsp
Normal file
228
WebRoot/jsp/equipment/attachedEquipmentView.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); %>
|
||||
<%request.setAttribute("Status_Finish", MaintenanceDetail.Status_Finish); %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var status = "${equipmentCard.equipmentstatus}";
|
||||
switch (status){
|
||||
case '${Status_OFF}':
|
||||
$("#equipmentstatus").html("封存");
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
$("#equipmentstatus").html("在用");
|
||||
break;
|
||||
case '${Status_Fault}':
|
||||
$("#equipmentstatus").html("故障");
|
||||
break;
|
||||
case '${Status_Transfer}':
|
||||
$("#equipmentstatus").html("调拨");
|
||||
break;
|
||||
case '${Status_Scrap}':
|
||||
$("#equipmentstatus").html("报废");
|
||||
break;
|
||||
default:
|
||||
$("#equipmentstatus").html("");
|
||||
break;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subAttachedModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">附属设备信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.processSection.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%-- <label class="col-sm-2 control-label">统一编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.id}</p>
|
||||
</div> --%>
|
||||
<label class="col-sm-2 control-label">设备编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">资产类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.assetClass.assetclassname}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentname}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备型号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentTypeNumber.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentClass.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">资产类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.assetClass.assetclassname}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备级别:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentLevel.levelname}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="equipmentstatus" class="form-control-static" ></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCard.assetnumber}">无</c:if>
|
||||
${equipmentCard.assetnumber}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属设备:</label>
|
||||
<div class="col-sm-4 ">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCard.equipmentPid.equipmentname}">无</c:if>
|
||||
${equipmentCard.equipmentPid.equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产原值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${not empty equipmentCard.equipmentvalue}">${equipmentCard.equipmentvalue}元</c:if>
|
||||
<c:if test="${empty equipmentCard.equipmentvalue}">无</c:if>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">额定功率:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${not empty equipmentCard.ratedpower}">${equipmentCard.ratedpower}KW</c:if>
|
||||
<c:if test="${empty equipmentCard.ratedpower}">无</c:if>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">制造厂家:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCard.equipmentmanufacturer}">无</c:if>
|
||||
${equipmentCard.equipmentmanufacturer}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装地点:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCard.areaid}">无</c:if>
|
||||
${equipmentCard.areaid}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">主要参数:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCard.majorparameter}">无</c:if>
|
||||
${equipmentCard.majorparameter}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采购费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${not empty equipmentCardProp.purchaseMoney}">${equipmentCardProp.purchaseMoney}元</c:if>
|
||||
<c:if test="${empty equipmentCardProp.purchaseMoney}">无</c:if>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">人工费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${not empty equipmentCardProp.laborMoney}">${equipmentCardProp.laborMoney}元</c:if>
|
||||
<c:if test="${empty equipmentCardProp.laborMoney}">无</c:if>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCardProp.technicalLife}">无</c:if>
|
||||
<c:if test="${not empty equipmentCardProp.technicalLife}">${equipmentCardProp.technicalLife}年</c:if>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物理寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCardProp.physicalLife}">无</c:if>
|
||||
<c:if test="${not empty equipmentCardProp.physicalLife}">${equipmentCardProp.physicalLife}年</c:if>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">残值率</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${empty equipmentCardProp.residualValueRate}">无</c:if>
|
||||
<fmt:formatNumber value="${equipmentCardProp.residualValueRate}" type="percent"/>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">安装时间</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${empty equipmentCardProp.installDate}">无</c:if>
|
||||
<p class="form-control-static" >${equipmentCardProp.installDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
1829
WebRoot/jsp/equipment/dosageModel.jsp
Normal file
1829
WebRoot/jsp/equipment/dosageModel.jsp
Normal file
File diff suppressed because it is too large
Load Diff
407
WebRoot/jsp/equipment/dosageModelCQ_BF.jsp
Normal file
407
WebRoot/jsp/equipment/dosageModelCQ_BF.jsp
Normal file
@ -0,0 +1,407 @@
|
||||
<%@ 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"%>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />
|
||||
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"/> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts5.0.2.js" charset="utf-8"></script>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/iconfont-pump/iconfont.css" />
|
||||
<style type="text/css">
|
||||
.bgimg-map{
|
||||
width: 949px;
|
||||
height: 887px;
|
||||
background-image: url(<%=request.getContextPath()%>/IMG/pump/dosage.png) ;
|
||||
background-repeat: no-repeat;
|
||||
background-position:top center;
|
||||
position: relative;
|
||||
border-right: 3px solid #e1e1e1;
|
||||
}
|
||||
.bg_color{
|
||||
background: #2d2d2d;
|
||||
border:0;
|
||||
}
|
||||
.thumbnail, .nav>li>a {
|
||||
padding: 0px;
|
||||
}
|
||||
.nav-tabs-custom>.nav-tabs {
|
||||
border: 0;
|
||||
border-bottom-color: #2d2d2d;
|
||||
}
|
||||
.nav-tabs-custom > .nav-tabs > li {
|
||||
width: 170px;
|
||||
height: 35px;
|
||||
margin-bottom: 0;
|
||||
margin-right: 20px;
|
||||
border: 0;
|
||||
}
|
||||
.nav-tabs-custom>.nav-tabs>li.active {
|
||||
opacity: 1;
|
||||
background: linear-gradient(180deg,rgba(0,238,255,0.00), rgba(0,246,251,0.15) 46%, #00fff6);
|
||||
}
|
||||
.nav-tabs-custom>.nav-tabs>li>a {
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
font-size: 20px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN-Bold;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
border: 0;
|
||||
}
|
||||
.nav-tabs-custom>.nav-tabs>li.active>a, .nav-tabs-custom>.nav-tabs>li.active:hover>a {
|
||||
color: #ffffff;
|
||||
background-color: inherit;
|
||||
}
|
||||
.pump-text{
|
||||
font-size: 22px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN-Regular;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
}
|
||||
.pump-text-small{
|
||||
font-size: 18px;
|
||||
}
|
||||
.pump-text-white{
|
||||
font-size: 22px;
|
||||
color: #ffffff;
|
||||
padding: 0 11%;
|
||||
}
|
||||
.pump-text-blue{
|
||||
color: #30d4ff;
|
||||
}
|
||||
.pump-text-red{
|
||||
color: #d19bff;
|
||||
}
|
||||
label {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var heightV =1;
|
||||
$(function () {
|
||||
getInitialization();
|
||||
var tab1_ul_children = $("#tab1_ul").children(".active");
|
||||
$("#jsp_id").val(tab1_ul_children.find("a").attr("id"));
|
||||
if(unitId==null || unitId=='' || unitId==undefined){
|
||||
unitId = '${unitId}';
|
||||
}
|
||||
var search_pid = unitId;
|
||||
$("#tab1_ul li a").click(function(){
|
||||
var href = $(this).attr('href');
|
||||
if(!$(href+"_1").hasClass("active")){
|
||||
$(href+"_1").addClass("active");
|
||||
}
|
||||
$(href+"_1").siblings().removeClass("active");
|
||||
$("#jsp_id").val($(this).attr("id"));
|
||||
getData(search_pid);
|
||||
});
|
||||
getData(search_pid);
|
||||
$(window).resize(function() {
|
||||
getInitialization();
|
||||
getData(search_pid);
|
||||
});
|
||||
});
|
||||
function getInitialization(){
|
||||
heightV = $(window).height()/1080;
|
||||
$(".bgimg-map").css("height",887*heightV+30);
|
||||
$(".bgimg-map").css("background-size",""+(949*heightV)+"px "+(887*heightV)+"px");
|
||||
$(".chart_line").css("height",170*heightV);
|
||||
}
|
||||
function getData(bizid){
|
||||
var jsp_id = $('#jsp_id').val();
|
||||
var time_input = $('#time_input').val();
|
||||
$.post(ext.contextPath + '/equipment/pump/getDosageData.do', {bizid:bizid,time:time_input,jsp_id:jsp_id} , function(data) {
|
||||
var arr= JSON.parse(data);
|
||||
console.log(arr);
|
||||
var low_dosage_dataseries=[];
|
||||
var low_dosage_dataxAxis=[];
|
||||
var low_WaterQuality_dataseries=[];
|
||||
var low_WaterQuality_dataxAxis=[];
|
||||
if(arr.rows!=null && arr.rows!=undefined && arr.rows!=''){
|
||||
for(var i=0;i<arr.rows.length;i++){
|
||||
var value =0;
|
||||
var numtail=0;
|
||||
var dataMax=0;
|
||||
if(arr.rows[i].visualCacheData.value!=null
|
||||
&& arr.rows[i].visualCacheData.value!=undefined
|
||||
&& arr.rows[i].visualCacheData.value!=''){
|
||||
value = arr.rows[i].visualCacheData.value;
|
||||
if(arr.rows[i].visualCacheData.numtail!=null){
|
||||
numtail = arr.rows[i].visualCacheData.numtail;
|
||||
}
|
||||
}else{
|
||||
var mPoint = arr.rows[i].mPoint;
|
||||
if(mPoint!=null ){
|
||||
if(mPoint.parmvalue!=null){
|
||||
value = mPoint.parmvalue;
|
||||
}
|
||||
if(mPoint.alarmmax!=null){
|
||||
dataMax = mPoint.alarmmax;
|
||||
}
|
||||
if(mPoint.numtail!=null){
|
||||
numtail = mPoint.numtail;
|
||||
}
|
||||
}
|
||||
}
|
||||
value = parseFloat(value).toFixed(numtail);
|
||||
if($("."+arr.rows[i].elementCode).length > 0){
|
||||
$("."+arr.rows[i].elementCode).html(toThousands(value));
|
||||
}
|
||||
if(arr.rows[i].elementCode=='low_dosage'){
|
||||
var mPointHistory = arr.rows[i].mPointHistory;
|
||||
var dataseries =[];
|
||||
for(var m=0;m<mPointHistory.length;m++){
|
||||
var mPointData =[];
|
||||
mPointData.push(mPointHistory[m].measuredt.substring(11,16));
|
||||
mPointData.push(mPointHistory[m].parmvalue.toFixed(numtail));
|
||||
dataseries.push(mPointData);
|
||||
}
|
||||
low_dosage_dataseries[0]=dataseries;
|
||||
}
|
||||
if(arr.rows[i].elementCode=='low_dosage_forecast'){
|
||||
var mPointHistory = arr.rows[i].mPointHistory;
|
||||
var dataseries =[];
|
||||
for(var m=0;m<mPointHistory.length;m++){
|
||||
low_dosage_dataxAxis.push(mPointHistory[m].measuredt.substring(11,16));
|
||||
var mPointData =[];
|
||||
mPointData.push(mPointHistory[m].measuredt.substring(11,16));
|
||||
mPointData.push(mPointHistory[m].parmvalue.toFixed(numtail));
|
||||
dataseries.push(mPointData);
|
||||
}
|
||||
low_dosage_dataseries[1]=dataseries;
|
||||
}
|
||||
if(arr.rows[i].elementCode=='low_WaterQuality'){
|
||||
var mPointHistory = arr.rows[i].mPointHistory;
|
||||
var dataseries =[];
|
||||
for(var m=0;m<mPointHistory.length;m++){
|
||||
dataseries.push(mPointHistory[m].parmvalue.toFixed(numtail));
|
||||
}
|
||||
low_WaterQuality_dataseries[0]=dataseries;
|
||||
}
|
||||
if(arr.rows[i].elementCode=='low_WaterQuality_forecast'){
|
||||
var mPointHistory = arr.rows[i].mPointHistory;
|
||||
var dataseries =[];
|
||||
for(var m=0;m<mPointHistory.length;m++){
|
||||
low_WaterQuality_dataxAxis.push(mPointHistory[m].measuredt.substring(11,16));
|
||||
dataseries.push(mPointHistory[m].parmvalue.toFixed(numtail));
|
||||
}
|
||||
low_WaterQuality_dataseries[1]=dataseries;
|
||||
}
|
||||
}
|
||||
}
|
||||
showDoubleLine('low_dosage',low_dosage_dataxAxis,low_dosage_dataseries);
|
||||
showDoubleLine('low_WaterQuality',low_WaterQuality_dataxAxis,low_WaterQuality_dataseries);
|
||||
});
|
||||
}
|
||||
function showDoubleLine(id,dataxAxis,dataseries){
|
||||
var option = {
|
||||
color: ['#30d4ff', '#d19bff'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
grid: {
|
||||
top:'5%',
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: dataxAxis,
|
||||
splitLine: {
|
||||
show: true ,
|
||||
lineStyle: {
|
||||
color: ['#aaa'] ,
|
||||
type: 'dashed' ,
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
show: true ,
|
||||
lineStyle: {
|
||||
color: ['#aaa'] ,
|
||||
type: 'dashed' ,
|
||||
}
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '实时值',
|
||||
type: 'line',
|
||||
areaStyle: {},
|
||||
data: dataseries[0]
|
||||
},
|
||||
{
|
||||
name: '预测值',
|
||||
type: 'line',
|
||||
data: dataseries[1]
|
||||
},
|
||||
]
|
||||
};
|
||||
var myChart = echarts.init(document.getElementById(id));
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
function showBar(id,data,dataMax){
|
||||
var option = {
|
||||
grid: {
|
||||
left: 0 ,
|
||||
top: 0 ,
|
||||
right: 0 ,
|
||||
bottom: 0 ,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
max:dataMax,
|
||||
},
|
||||
series: [{
|
||||
data: [data],
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1,
|
||||
[
|
||||
{offset: 0, color: '#94EBFF'},
|
||||
{offset: 0.5, color: '#62D1FF'},
|
||||
{offset: 1, color: '#2AB4FF'}
|
||||
]
|
||||
)
|
||||
},
|
||||
}]
|
||||
};
|
||||
var myChart = echarts.init(document.getElementById(id));
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
//添加千分位符合
|
||||
function toThousands(num) {
|
||||
var nums =num;
|
||||
var re=/\d{1,3}(?=(\d{3})+$)/g;
|
||||
var n1=0;
|
||||
if(nums!=null && nums!='' && nums!=undefined){
|
||||
n1=nums.toString().replace(/^(\d+)((\.\d+)?)$/,function(s,s1,s2){return s1.replace(re,"$&,")+s2;});
|
||||
}
|
||||
return n1;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper bg_color" style=" overflow-x: auto;padding:10px 20px 0px 20px;">
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<input type="hidden" name="todayAddnum" value="${todayAddnum}">
|
||||
<input type="hidden" name="todonum" value="${todonum}">
|
||||
<input type="hidden" name="donownum" value="${donownum}">
|
||||
<input type="hidden" name="jsp_id" id="jsp_id" value="">
|
||||
<input type="hidden" name="time_input" id="time_input" value="${nowDate}">
|
||||
<div class="row" >
|
||||
<div class="col-lg-7 col-md-7 col-sm-12 col-xs-12">
|
||||
<div class="bgimg-map">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
|
||||
<div class="floattop_div_1 thumbnail bg_color" style="overflow:hidden;">
|
||||
<div class="nav-tabs-custom bg_color" style="margin-bottom:0px;">
|
||||
<ul class="nav nav-tabs" id="tab1_ul" >
|
||||
<li id="tab_1_li" role="presentation" class="active" >
|
||||
<a href="#tab_1" role="tab" data-toggle="tab" aria-expanded="true" id="CQBYT_Dosage">加药量计算</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content" style="padding: 10px;">
|
||||
<div role="tabpanel" class="tab-pane active" id="tab_1">
|
||||
<div class="row" >
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-blue">输入参数</label>
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-red">计算结果</label>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-blue">总原水流量<span class="pump-text-white low_TotalRawWaterFlow_input">0</span>m³/h</label>
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-red">加药量<span class="pump-text-white low_dosage_calculation">0</span>mg/l</label>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-blue">原水浊度<span class="pump-text-white low_RawWaterTurbidity_input">0</span>NTU</label>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-blue">滤后水浊度<span class="pump-text-white low_TurbidityOfFilteredWater_input">0</span>NTU</label>
|
||||
</div>
|
||||
<div class="row" style="padding-top: 70px;">
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-blue"><i class="iconfont iconshishigailan pump-text-small"></i> 实时值</label>
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-red"><i class="iconfont iconyuce pump-text-small"></i> 预测值</label>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-blue">加药量<span class="pump-text-white low_dosage">0</span>L/h</label>
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-red">加药量<span class="pump-text-white low_dosage_forecast">25</span>L/h</label>
|
||||
</div>
|
||||
<div class="chart_line" id="low_dosage" style="width: 650px;height: 150px;"></div>
|
||||
<div class="row" style="padding-top: 40px;">
|
||||
<label class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pump-text pump-text-small pump-text-blue">水质曲线</label>
|
||||
</div>
|
||||
<div class="chart_line" id="low_WaterQuality" style="width: 650px;height: 150px;"></div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tab_2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<div id="AbnormalView" style="display:none;height: 400px"></div>
|
||||
<div id="AbnormalDetails" style="display:none;height: 600px"></div>
|
||||
</html>
|
||||
1802
WebRoot/jsp/equipment/dosageModelSK.jsp
Normal file
1802
WebRoot/jsp/equipment/dosageModelSK.jsp
Normal file
File diff suppressed because it is too large
Load Diff
246
WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
246
WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
@ -0,0 +1,246 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
/* $.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'",'+
|
||||
'"equipmentclass":"'+item.equipmentclass.name +'","geographyarea":"'+item.geographyarea.name +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]"; */
|
||||
//alert(datas)
|
||||
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
var checkedItems = $('#grid').datagrid('getRows');
|
||||
var datas="";
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
|
||||
var grid;
|
||||
var dialogT;
|
||||
var equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var arrangework = function(id){
|
||||
//alert(id)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:800,
|
||||
height:450,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}],
|
||||
onDestroy:function(){
|
||||
$('#grid').datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
function dblClickFun(rowIndex){
|
||||
|
||||
rowData=grid.datagrid('getData').rows[rowIndex];
|
||||
//console.info(rowData)
|
||||
equiparrange=rowData.equipmentArrangements;
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(rowData.equipmentArrangements);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=' +rowData.id +'&plandate=${param.plandate}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
rowData.equipmentArrangements=temp;
|
||||
//$('#grid').datagrid('updateRow',{index:rowIndex,row:rowData});
|
||||
$('#grid').datagrid('refreshRow',rowIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
|
||||
|
||||
$("#lineid").combobox({
|
||||
url : ext.contextPath + '/work/line/getLineListForSelect.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var val = $("#lineid").combobox("getData");
|
||||
var i=0;
|
||||
for(i=0;i<val.length;i++){
|
||||
//console.log("${param.taskid}")
|
||||
if(val[i].serial=="${param.taskid}"){
|
||||
$("#lineid").combobox('select',val[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i==val.length){
|
||||
$("#lineid").combobox('select',val[0].id);
|
||||
}
|
||||
|
||||
} ,
|
||||
onSelect:function(){
|
||||
var lineid=$("#lineid").combobox("getValue");
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardForDistrictWork.do?arrangementdate=${param.plandate}&workorderid=${param.workorderid}&taskid=${param.taskid}&equipmentid=${param.equipmentid}&lineid='+lineid,
|
||||
striped : true,
|
||||
nowrap:false,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '80', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass.name;
|
||||
} },
|
||||
{width : '100', title : '设备产能', field: 'capacity', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass._capacity;
|
||||
} },
|
||||
{width : '100', title : '当前状态', field: 'equipmentstatus', sortable : true, halign:'center'},
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row,rowindex) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="设备分配" onclick="dblClickFun(\''+rowindex+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备已分配情况" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
if(data){
|
||||
var userids='${userids}';
|
||||
var userid;
|
||||
if(userids!=""){
|
||||
userid=userids.split(',');
|
||||
}
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checkflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
},
|
||||
onDblClickRow :function (rowIndex, rowData){
|
||||
dblClickFun(rowIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td><input id="lineid" name="lineid" class="easyui-combobox" style="width: 180px;" data-options="validType:'isBlank'"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
228
WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
228
WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectEquipment(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 800,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var editFun = function(index) {
|
||||
var row =grid.datagrid("getRows")[index];
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
equiparrange=row.equipmentArrangements_;
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(equiparrange);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=${param.equipmentid}&plandate=${dt}',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
temp=JSON.stringify(temp);
|
||||
// alert(temp);
|
||||
$.post(ext.contextPath + '/equipment/doupdateEquipArrangement.do', {arrangestr:temp} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','修改失败','info');
|
||||
}
|
||||
});
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_equ.do', {ids:datas,workorderid:'${workorderid}',taskid:'${taskid}',arrangementdate:'${requestScope.plandate}'} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize());
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
nowrap:false,
|
||||
idField : 'taskid',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '工单编号', field : 'workorderno_', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务编码', field : 'id', sortable : false, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements_);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row,index) {
|
||||
var str = '';
|
||||
//var arr=JSON.stringify(row.equipmentArrangements_);
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+index+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
/* if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
} */
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
|
||||
<td>日期</td>
|
||||
<td><input id="dt" name="dt" class="Wdate" value="${dt}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
readonly></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
561
WebRoot/jsp/equipment/equipmentAcceptanceApplyAdd.jsp
Normal file
561
WebRoot/jsp/equipment/equipmentAcceptanceApplyAdd.jsp
Normal file
@ -0,0 +1,561 @@
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
//提交审核
|
||||
function dosubmit(){
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到设备验收审核流程,请先部署流程!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosave() {
|
||||
//$('#subForm').data('bootstrapValidator')
|
||||
//.updateStatus('instockManName', 'NOT_VALIDATED',null)
|
||||
// .validateField('instockManName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
//editFun('${id}');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
applyTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '申请日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/*
|
||||
warehouseId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '所属仓库不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
/*
|
||||
instockManName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '入库负责人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
}
|
||||
});
|
||||
$(function(){
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//采购时间
|
||||
$("#applyTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
});
|
||||
$("#applyTime").datepicker('setDate',new Date());
|
||||
|
||||
$('#table_equipmentAcceptanceApply').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getEquipmentAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
acceptanceApplyNumber:'${acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'purchaseRecordDetail.recordId', // 返回json数据中的name
|
||||
title: '采购记录编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'purchaseRecordDetail.number', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'purchaseRecordDetail.price', // 返回json数据中的name
|
||||
title: '单价/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'purchaseRecordDetail.totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// --------------------------------------------start-----------------------------------------------
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getGoodsAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_name: $('#search_name').val(),
|
||||
acceptanceApplyNumber:'${acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'goods.id', // 返回json数据中的name
|
||||
title: '物品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '物品品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.goodsClass.name', // 返回json数据中的name
|
||||
title: '物品类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '物品单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
/*
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_goodsAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
// ----------------------------------------------end-----------------------------------------------
|
||||
|
||||
});
|
||||
//选择申请人
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#applyPeopleId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"applyPeopleId",textId:"applyPeopleName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function() {
|
||||
var userIds= $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditId",textId:"auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//添加采购记录明细
|
||||
var addDetailFun = function() {
|
||||
var allTableData = $("#table_equipmentAcceptanceApply").bootstrapTable('getData');
|
||||
var PRDetailIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
if(PRDetailIds!=""){
|
||||
PRDetailIds+=",";
|
||||
}
|
||||
|
||||
PRDetailIds+=item.acceptancePurchaseRecordDetailId;
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/selectPurchaseRecordDetails.do', {companyId : '${company.id}',
|
||||
PRDetailIds:PRDetailIds},
|
||||
function(data) {
|
||||
$("#PRDetail4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var doFinishSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/savePurchaseRecordDetails.do', {PRDetailIds: data , acceptanceApplyNumber : '${acceptanceApplyNumber}' }, function(data) {
|
||||
if (data.res){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//删除多条申购明细数据
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_equipmentAcceptanceApply").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletesEquipmentAcceptanceApplyDetail.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
var addGoodsDetailFun = function() {
|
||||
//stopBubbleDefaultEvent();
|
||||
var allTableData = $("#table_goodsAcceptanceApply").bootstrapTable('getData');
|
||||
var goodsIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
if(goodsIds!=""){
|
||||
goodsIds+=",";
|
||||
}
|
||||
goodsIds+=item.id;
|
||||
//goodsIds+=item;
|
||||
console.log("goodsIds is:"+goodsIds);
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/selectGoodsDetails.do', {goodsIds:goodsIds,companyId:'${company.id}'},
|
||||
function(data) {
|
||||
$("#goods4SelectsDiv").html(data);
|
||||
openModal('subGoodsDetailModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var doFinishGoodsSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/saveGoodsAcceptanceApplyDetails.do', {acceptanceApplyNumber:'${acceptanceApplyNumber}',
|
||||
goodsIds:data} , function(data) {
|
||||
if(data.res){
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable('refresh');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
|
||||
//删除多条明细数据
|
||||
var deletesGoodsDetailFun = function() {
|
||||
var checkedItems = $("#table_goodsAcceptanceApply").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletesEquipmentAcceptanceApplyGoodsDetail.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备验收申请单</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="status" name="status" type="hidden" value="${START}"/>
|
||||
<input id="id" name="id" type="hidden" value="${id}"/>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${company.id}"/>
|
||||
<input id="applyPeopleId" name="applyPeopleId" type="hidden" value="${cu.id}"/>
|
||||
<input id="applyPeopleName" name="applyPeopleName" type="hidden" value="${cu.caption}"/>
|
||||
<input id="auditId" name="auditId" type="hidden" />
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="bizId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static" >${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*公司</label>
|
||||
<div class="col-sm-6">
|
||||
<p class="form-control-static" >${company.name}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备验收申请单号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="acceptanceApplyNumber" name ="acceptanceApplyNumber" placeholder="名称" value="${acceptanceApplyNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备验收申请日期</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="applyTime" name="applyTime" style="width: 230px;" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="applyPeopleNameShowPage" name="applyPeopleNameShowPage" value="${cu.caption}" disabled />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||
</div>
|
||||
<div id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentAcceptanceApply"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- -->
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">物品明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_goodsAcceptanceApply"></table>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
434
WebRoot/jsp/equipment/equipmentAcceptanceApplyAdjust.jsp
Normal file
434
WebRoot/jsp/equipment/equipmentAcceptanceApplyAdjust.jsp
Normal file
@ -0,0 +1,434 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%request.setAttribute("MAINTAIN_YEAR",MaintenanceCommString.MAINTAIN_YEAR); %>
|
||||
<%request.setAttribute("MAINTAIN_MONTH",MaintenanceCommString.MAINTAIN_MONTH); %>
|
||||
<%request.setAttribute("START",MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT",MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
//提交审核
|
||||
/* function dosubmit(routeNum){
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var targetusers = $("#auditId").val();
|
||||
$("#targetusers").val(targetusers);
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/submitAcceptanceApplyAdjust.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||
if (unitdata.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(unitdata.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
} */
|
||||
function dosubmit(){
|
||||
$('#subUnitForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
var routeNum = $("#routeNum").val();
|
||||
if (data.res == 1){
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/submitAcceptanceApplyAdjust.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||
if (unitdata.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(unitdata.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
/* function submitFun(routeNum){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit(routeNum);
|
||||
} */
|
||||
|
||||
//添加采购记录明细
|
||||
var addDetailFun = function() {
|
||||
var allTableData = $("#table_equipmentAcceptanceApply").bootstrapTable('getData');
|
||||
var PRDetailIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
if(PRDetailIds!=""){
|
||||
PRDetailIds+=",";
|
||||
}
|
||||
|
||||
PRDetailIds+=item.acceptancePurchaseRecordDetailId;
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/selectPurchaseRecordDetails.do', {companyId : '${eaa.bizId}',
|
||||
PRDetailIds:PRDetailIds},
|
||||
function(data) {
|
||||
$("#PRDetail4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var doFinishSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/savePurchaseRecordDetails.do', {PRDetailIds: data , acceptanceApplyNumber : '${eaa.acceptanceApplyNumber}' }, function(data) {
|
||||
if (data.res){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//删除多条申购明细数据
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_equipmentAcceptanceApply").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletesEquipmentAcceptanceApplyDetail.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var companyId = "${eaa.bizId}";
|
||||
$(function() {
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
//申请时间
|
||||
$("#applyTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('applyTime', 'NOT_VALIDATED',null)
|
||||
.validateField('applyTime');
|
||||
});
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
|
||||
applyTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '申请日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$("#subUnitForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$('#table_equipmentAcceptanceApply').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getEquipmentAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'purchaseRecordDetail.recordId', // 返回json数据中的name
|
||||
title: '采购记录编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'purchaseRecordDetail.number', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'purchaseRecordDetail.price', // 返回json数据中的name
|
||||
title: '单价/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'purchaseRecordDetail.totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subUnitForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">调整验收申请</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${eaa.id}"/>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${eaa.bizId}"/>
|
||||
<input type="hidden" id="acceptanceApplyNumber" name ="acceptanceApplyNumber" value="${eaa.acceptanceApplyNumber}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*验收申请单编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="acceptanceApplyNumberShowPage" name ="acceptanceApplyNumberShowPage" value="${eaa.acceptanceApplyNumber}" disabled />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请日期</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="applyTime" name="applyTime" style="width: 230px;" value="${eaa.applyTime.substring(0,10)}" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="applyPeopleName" name="applyPeopleName" placeholder="点击选择" disabled value="${eaa.applyPeopleName}">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="${eaa.auditMan}">
|
||||
<input id="auditId" name="auditId" type="hidden" value="${eaa.auditId}" />
|
||||
</div>
|
||||
</div> --%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注">${eaa.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!--保养审核退回后显示 -->
|
||||
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data" >
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<%-- <input type="hidden" class="form-control" id= "targetusers" name ="targetusers" value="${businessUnitHandle.targetusers}"> --%>
|
||||
<input type="hidden" class="form-control" name ="unitid" value="${businessUnitHandle.unitid}">
|
||||
<c:if test='${not empty businessUnitAudit.auditopinion }'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核意见:</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="auditopinion" name="auditopinion" rows="2" placeholder="审核意见" >${businessUnitAudit.auditopinion}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4AuditSelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">验收明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentAcceptanceApply"></table>
|
||||
</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="doupdate()" id="btn_update">保存</button>
|
||||
<button type="button" class="btn btn-primary" onclick="processExecute(submitFun,${businessUnitHandle.taskid},true)" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
401
WebRoot/jsp/equipment/equipmentAcceptanceApplyAudit.jsp
Normal file
401
WebRoot/jsp/equipment/equipmentAcceptanceApplyAudit.jsp
Normal file
@ -0,0 +1,401 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%request.setAttribute("MAINTAIN_YEAR",MaintenanceCommString.MAINTAIN_YEAR); %>
|
||||
<%request.setAttribute("MAINTAIN_MONTH",MaintenanceCommString.MAINTAIN_MONTH); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
/* function doPass(routeNum) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$("#passstatus").val(true);
|
||||
$("#routeNum").val(routeNum);
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/auditEquipmentAcceptanceApply.do', $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','操作执行失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function doBack(routeNum) {
|
||||
swal({
|
||||
title: "退回!",
|
||||
text: "请输入审核不通过理由:",
|
||||
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
|
||||
}
|
||||
},
|
||||
content: {
|
||||
element: "input",
|
||||
attributes: {
|
||||
placeholder: "审核不通过理由...",
|
||||
},
|
||||
},
|
||||
})
|
||||
.then(function(value){
|
||||
if(value){
|
||||
$("#auditopinion").val(value);
|
||||
$("#passstatus").val(false);
|
||||
$("#routeNum").val(routeNum)
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/auditEquipmentAcceptanceApply.do', $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','退回失败,请重试!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
} */
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/auditEquipmentAcceptanceApply.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','操作执行失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
//$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds} , function(data) {
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNode("${businessUnitAudit.taskid}");
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '提交人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$('#table_equipmentAcceptanceApply').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getEquipmentAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'purchaseRecordDetail.recordId', // 返回json数据中的name
|
||||
title: '采购记录编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'purchaseRecordDetail.number', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'purchaseRecordDetail.price', // 返回json数据中的name
|
||||
title: '单价/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'purchaseRecordDetail.totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getGoodsAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_name: $('#search_name').val(),
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'goods.id', // 返回json数据中的name
|
||||
title: '物品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '物品品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.goodsClass.name', // 返回json数据中的name
|
||||
title: '物品类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '物品单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
/*
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_goodsAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">设备验收申请(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<input id="companyId" name="companyId" type="hidden" value="${eaa.bizId}">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*验收申请单编号</label>
|
||||
<div class="col-sm-6">
|
||||
<p class="form-control-static" >${eaa.acceptanceApplyNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请日期</label>
|
||||
<div class="col-sm-6">
|
||||
<p class="form-control-static" >${eaa.applyTime.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请人</label>
|
||||
<div class="col-sm-6">
|
||||
<p class="form-control-static" >${eaa.applyPeopleName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*备注</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >${eaa.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name =unitid value="${param.unitId}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||||
<!-- <input type="hidden" class="form-control" id ="passstatus" name ="passstatus" value=true>
|
||||
<input type="hidden" class="form-control" id ="auditopinion" name ="auditopinion" >
|
||||
<input type="hidden" class="form-control" id ="routeNum" name ="routeNum" > -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核结果</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="passstatus" name ="passstatus" style="width: 270px;">
|
||||
<option value= true>通过</option>
|
||||
<option value= false>驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "reject" class="form-group">
|
||||
<label class="col-sm-2 control-label">*驳回原因</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="auditopinion" name ="auditopinion" placeholder="驳回原因"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">验收明细</h3>
|
||||
<!-- <div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentAcceptanceApply"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">物品明细</h3>
|
||||
<!--
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_goodsAcceptanceApply"></table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<%-- <button type="button" class="btn btn-primary" onclick="processExecute(doPass,${businessUnitAudit.taskid},true)" id="btn_update">通过</button>
|
||||
<button type="button" class="btn btn-danger" onclick="processExecute(doBack,${businessUnitAudit.taskid},false)" id="btn_submit">驳回</button> --%>
|
||||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
538
WebRoot/jsp/equipment/equipmentAcceptanceApplyEdit.jsp
Normal file
538
WebRoot/jsp/equipment/equipmentAcceptanceApplyEdit.jsp
Normal file
@ -0,0 +1,538 @@
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${eaa.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
function dosubmit(){
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAcceptanceApply/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到保养计划审核流程,请先部署流程!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
//关闭模态框时刷新表格数据
|
||||
function closeModel(){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
//添加采购记录明细
|
||||
var addDetailFun = function() {
|
||||
var allTableData = $("#table_equipmentAcceptanceApply").bootstrapTable('getData');
|
||||
var PRDetailIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
if(PRDetailIds!=""){
|
||||
PRDetailIds+=",";
|
||||
}
|
||||
|
||||
PRDetailIds+=item.acceptancePurchaseRecordDetailId;
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/selectPurchaseRecordDetails.do', {companyId : '${company.id}',
|
||||
PRDetailIds:PRDetailIds},
|
||||
function(data) {
|
||||
$("#PRDetail4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var doFinishSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/savePurchaseRecordDetails.do', {PRDetailIds: data , acceptanceApplyNumber : '${eaa.acceptanceApplyNumber}' }, function(data) {
|
||||
if (data.res){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//删除多条申购明细数据
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_equipmentAcceptanceApply").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletesEquipmentAcceptanceApplyDetail.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_equipmentAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//---------------------------------------------------------------------------------------------
|
||||
var addGoodsDetailFun = function() {
|
||||
//stopBubbleDefaultEvent();
|
||||
var allTableData = $("#table_goodsAcceptanceApply").bootstrapTable('getData');
|
||||
var goodsIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
if(goodsIds!=""){
|
||||
goodsIds+=",";
|
||||
}
|
||||
goodsIds+=item.id;
|
||||
//goodsIds+=item;
|
||||
console.log("goodsIds is:"+goodsIds);
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/selectGoodsDetails.do', {goodsIds:goodsIds,companyId:'${company.id}'},
|
||||
function(data) {
|
||||
$("#goods4SelectsDiv").html(data);
|
||||
openModal('subGoodsDetailModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var doFinishGoodsSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/saveGoodsAcceptanceApplyDetails.do', {acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
goodsIds:data} , function(data) {
|
||||
if(data.res){
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable('refresh');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
|
||||
//删除多条明细数据
|
||||
var deletesGoodsDetailFun = function() {
|
||||
var checkedItems = $("#table_goodsAcceptanceApply").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletesEquipmentAcceptanceApplyGoodsDetail.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
$(function(){
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
/*
|
||||
loseInstr: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备丢失原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
applyTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '申请日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$('#table_equipmentAcceptanceApply').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getEquipmentAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'purchaseRecordDetail.recordId', // 返回json数据中的name
|
||||
title: '采购记录编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'purchaseRecordDetail.number', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'purchaseRecordDetail.price', // 返回json数据中的name
|
||||
title: '单价/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'purchaseRecordDetail.totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getGoodsAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_name: $('#search_name').val(),
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'goods.id', // 返回json数据中的name
|
||||
title: '物品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '物品品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.goodsClass.name', // 返回json数据中的name
|
||||
title: '物品类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '物品单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
/*
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_goodsAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//申请时间
|
||||
$("#applyTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('applyTime', 'NOT_VALIDATED',null)
|
||||
.validateField('applyTime');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function() {
|
||||
var userIds= $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditId",textId:"auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备验收申请单</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${eaa.id}"/>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${eaa.bizId}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备验收申请单编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="acceptanceApplyNumber" name ="acceptanceApplyNumber" value="${eaa.acceptanceApplyNumber }" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请日期</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="applyTime" name="applyTime" style="width: 230px;" value="${eaa.applyTime.substring(0,10)}" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="applyPeopleName" name="applyPeopleName" placeholder="点击选择" disabled value="${eaa.applyPeopleName}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="${eaa.auditMan}">
|
||||
<input id="auditId" name="auditId" type="hidden" value="${eaa.auditId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="loseInstr" name ="loseInstr" placeholder="备注">${eaa.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||
</div>
|
||||
<div id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
|
||||
<table id="table_equipmentAcceptanceApply"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">物品明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesGoodsDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_goodsAcceptanceApply"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="closeModel()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_save">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
267
WebRoot/jsp/equipment/equipmentAcceptanceApplyExecuteView.jsp
Normal file
267
WebRoot/jsp/equipment/equipmentAcceptanceApplyExecuteView.jsp
Normal file
@ -0,0 +1,267 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||||
<%request.setAttribute("UNIT_HANDLE",BusinessUnit.UNIT_HANDLE);%>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
//var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem='tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance='tb_maintenance_file'; //数据表
|
||||
var nameSpace='MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage:true,
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDelete:''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
var viewHandleDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id:id} , function(data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$("#judgemaintainerstaff").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
$("#judgeresult").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
var result='${businessUnitRecords}';
|
||||
result=result.replace(new RegExp("\r\n","gm"),"");
|
||||
var json =JSON.parse(result);
|
||||
$.each(json, function(index, item) {
|
||||
if(item.id!=null &&item.id!=""){
|
||||
previews=new Array();
|
||||
$('#'+item.id).show();
|
||||
var data =item.files;
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");
|
||||
previews.push(path);
|
||||
previewConfig['width']= '30px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput(item.id);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv){
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
/*
|
||||
var ss = ".coversheet-pageBoder{"
|
||||
+" padding: 10px;"
|
||||
+" margin-top: 10px;"
|
||||
+" border: 1px solid gray;"
|
||||
+" page-break-after: always;"
|
||||
+" border-radius: 5px;"
|
||||
+" box-shadow: 0 1px 2px 1px rgba(0,0,0,.08), 0 3px 6px rgba(0,0,0,.08);"
|
||||
+"}"
|
||||
+".noprint{display: none;}"
|
||||
+".select2-container .select2-selection--single{ "
|
||||
+" height:34px; "
|
||||
+" line-height: 34px; "
|
||||
+" }"
|
||||
+" .select2-selection__arrow{"
|
||||
+" margin-top:3px;"
|
||||
+" } "
|
||||
+" .div-row{"
|
||||
+" margin-left:3px;"
|
||||
+" margin-right:3px;"
|
||||
+" }"
|
||||
+" .div-border{"
|
||||
+" border-style:solid;"
|
||||
+" border-width:1px;"
|
||||
+" text-align:center;"
|
||||
+" }"
|
||||
+" .right-border{"
|
||||
+" border-right:none;"
|
||||
+" }"
|
||||
+" .top-right-border{"
|
||||
+" border-top:none;"
|
||||
+" border-right:none;"
|
||||
+" }"
|
||||
+" .top-border{"
|
||||
+" border-top:none;"
|
||||
+" }";
|
||||
*/
|
||||
//for Chrome Firefox Opera Safari
|
||||
//wind.document.body.innerHTML = printHtml;
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
/*
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.rel = 'stylesheet';
|
||||
style.appendChild(document.createTextNode(ss));
|
||||
wind.document.head.appendChild(style);
|
||||
*/
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
//console.log(wind.document);
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="modal fade" id="acceptanceApplyExcuteModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">验收申请审核处理详情</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="padding-left:0;padding-right:0;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise >
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
</div>
|
||||
<c:if test ="${item.id!=''}">
|
||||
<div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading" />
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
</div>
|
||||
<!-- 流程打印布局 开始 -->
|
||||
<div id="equipmentAcceptanceApplyExcuteDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">验收申请审核处理详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr >
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 流程打印布局 结束-->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="printpage('equipmentAcceptanceApplyExcuteDetail');"><i class="fa fa-print"></i>打印</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
518
WebRoot/jsp/equipment/equipmentAcceptanceApplyList.jsp
Normal file
518
WebRoot/jsp/equipment/equipmentAcceptanceApplyList.jsp
Normal file
@ -0,0 +1,518 @@
|
||||
<%@ 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.sparepart.SparePartCommString"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header{display:none;}
|
||||
.content-header{display:none;}
|
||||
.main-footer{display:none;}
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
|
||||
var beginTimeStore2 = '';
|
||||
var endTimeStore2 = '';
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format" : 'YYYY-MM-DD',
|
||||
"separator" : " ~ ",
|
||||
"applyLabel" : "确定",
|
||||
"cancelLabel" : "取消",
|
||||
"fromLabel" : "起始时间",
|
||||
"toLabel" : "结束时间'",
|
||||
"customRangeLabel" : "自定义",
|
||||
"weekLabel" : "W",
|
||||
"daysOfWeek" : [ "日", "一", "二", "三", "四", "五", "六" ],
|
||||
"monthNames" : [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月" ],
|
||||
"firstDay" : 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker" : false,
|
||||
"timePicker24Hour" : false,
|
||||
"linkedCalendars" : false,
|
||||
"autoUpdateInput" : false,
|
||||
"timePickerIncrement" : 10,
|
||||
"locale" : locale,
|
||||
//汉化按钮部分
|
||||
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') ]
|
||||
},
|
||||
startDate : beginTimeStore2,
|
||||
endDate : endTimeStore2
|
||||
},
|
||||
function(start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
|
||||
} else {
|
||||
this.element.val(this.startDate
|
||||
.format(this.locale.format)
|
||||
+ this.locale.separator
|
||||
+ this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
|
||||
var addFun = function() {
|
||||
//$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/add.do', {companyId :companyId } , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
//};
|
||||
};
|
||||
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/edit.do', {id:id,companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var viewProcessFun = function(id){
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentAcceptanceApply/showProcessEquipmentAcceptanceApplyView.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('acceptanceApplyExcuteModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/equipment/equipmentAcceptanceApply/delete.do', {id : id,tableName:tbName_process}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}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 + '/equipment/equipmentAcceptanceApply/deletes.do', {ids:datas,tableName:tbName_process} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
initDate2();
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#companyName").text("公司: " + data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#search_pid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
companyId= data.id;
|
||||
//initFun();
|
||||
dosearch();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
|
||||
//输入框验证
|
||||
/*
|
||||
$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请先选择厂区'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
$('#searchApplyName').keyup(function(){
|
||||
if(event.keyCode==13){
|
||||
event.preventDefault();
|
||||
//alert($('#searchName').val())
|
||||
//回车执行查询
|
||||
dosearch();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
});
|
||||
var initFun = function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
searchName: $('#searchApplyName').val(),
|
||||
search_code: companyId,
|
||||
sdt : beginTimeStore2,
|
||||
edt : endTimeStore2
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'acceptanceApplyNumber', // 返回json数据中的name
|
||||
title: '设备验收申请编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'applyTime', // 返回json数据中的name
|
||||
title: '申请时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
},
|
||||
},{
|
||||
field: 'applyPeopleName', // 返回json数据中的name
|
||||
title: '申请人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'auditMan', // 返回json数据中的name
|
||||
title: '审核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '审核状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case '${FINISH}' :
|
||||
return "审核完成";
|
||||
case '${START}' :
|
||||
return "未提交";
|
||||
case '${AUDIT}' :
|
||||
return "已提交审核";
|
||||
default :
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.status == '${START}'){
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentAcceptanceApply/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentAcceptanceApply/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<button class="btn btn-default btn-sm" title="查看详情" onclick="viewProcessFun(\'' + row.id + '\')"><i class="fa fa-history"></i><span class="hidden-md hidden-lg">查看详情</span></button>';
|
||||
}
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="PRDetail4SelectsDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="goods4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div >
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<ul id="companyselect" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div><!-- /input-group -->
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/equipmentAcceptanceApply/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group pull-left input-group-sm">
|
||||
<label style="padding-top:5px">时间范围:</label> <input type="text"
|
||||
class="form-control pull-right" id="reservationtime2"
|
||||
style="width:180px">
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="searchApplyName" name="searchApplyName" class="form-control pull-right" placeholder="申请人">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
261
WebRoot/jsp/equipment/equipmentAcceptanceApplyView.jsp
Normal file
261
WebRoot/jsp/equipment/equipmentAcceptanceApplyView.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${eaa.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
$(function(){
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$('#table_equipmentAcceptanceApply').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getEquipmentAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'purchaseRecordDetail.recordId', // 返回json数据中的name
|
||||
title: '采购记录编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'purchaseRecordDetail.number', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'purchaseRecordDetail.price', // 返回json数据中的name
|
||||
title: '单价/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'purchaseRecordDetail.totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table_goodsAcceptanceApply").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAcceptanceApply/getGoodsAcceptanceApplyDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//search_name: $('#search_name').val(),
|
||||
acceptanceApplyNumber:'${eaa.acceptanceApplyNumber}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'goods.id', // 返回json数据中的name
|
||||
title: '物品编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '物品品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.goodsClass.name', // 返回json数据中的name
|
||||
title: '物品类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '物品单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
/*
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_goodsAcceptanceApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看设备验收申请单</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="status" name="status" type="hidden" value="${eaa.status}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备丢失申请单编号</label>
|
||||
<div class="col-sm-6" style="margin-top:8px; text-align:center">
|
||||
${eaa.acceptanceApplyNumber}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">申请日期</label>
|
||||
<div class="col-sm-6" style="margin-top:8px; text-align:center">
|
||||
${eaa.applyTime.substring(0,10)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">申请人</label>
|
||||
<div class="col-sm-6" style="margin-top:8px; text-align:center">
|
||||
${eaa.applyPeopleName}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-6" style="margin-top:8px; text-align:center">
|
||||
${eaa.auditMan}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-6" style="margin-top:8px; text-align:center">
|
||||
${eaa.remark}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备明细</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentAcceptanceApply"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">物品明细</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_goodsAcceptanceApply"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
465
WebRoot/jsp/equipment/equipmentAccidentAdd.jsp
Normal file
465
WebRoot/jsp/equipment/equipmentAccidentAdd.jsp
Normal file
@ -0,0 +1,465 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAccident/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
//提交审核
|
||||
function dosubmit(){
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAccident/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到保养计划审核流程,请先部署流程!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
/*
|
||||
deptId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '部门不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
accidentTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentPlace: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentDescribe: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故描述不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentReason: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//厂区ID
|
||||
var companyId = "${company.id}";
|
||||
$(function() {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$('#table_equipmentAccidentDetail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAccident/getEquipmentAccidentDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
accidentNumber:'${accidentNumber}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备厂内编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.areaid', // 返回json数据中的name
|
||||
title: '安装地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.assetnumber', // 返回json数据中的name
|
||||
title: '资产编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '生产商', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentvalue', // 返回json数据中的name
|
||||
title: '资产原值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'equipmentCard.residualvalue', // 返回json数据中的name
|
||||
title: '剩余价值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAccidentDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//申请时间
|
||||
$("#accidentTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('accidentTime', 'NOT_VALIDATED',null)
|
||||
.validateField('accidentTime');
|
||||
});
|
||||
$("#accidentTime").datepicker('setDate',new Date());
|
||||
//选择部门
|
||||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct =$("#deptId").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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
$('#deptName').val($("#deptId option:checked").text());
|
||||
|
||||
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
});
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function() {
|
||||
var userIds= $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditId",textId:"auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
//以下是新增内容
|
||||
//新增事故设备明细
|
||||
var addDetailFun = function() {
|
||||
var allTableData = $("#table_equipmentAccidentDetail").bootstrapTable('getData');
|
||||
var equipmentCardIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
|
||||
if(equipmentCardIds!=""){
|
||||
equipmentCardIds+=",";
|
||||
}
|
||||
//console.log("item.equipmentCardId value is"+item.equipmentCardId);
|
||||
//console.log("item.id value is"+item.id);
|
||||
equipmentCardIds+=item.equipmentCardId;
|
||||
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/selectEquipmentCardDetails.do', {equipmentCardIds:equipmentCardIds,companyId:'${company.id}'},
|
||||
function(data) {
|
||||
$("#equipmentCard4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var doFinishSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/saveEquipmentAccidentDetails.do', {accidentNumber:'${accidentNumber}',
|
||||
equipmentCardIds:data} , function(data) {
|
||||
if(data.res){
|
||||
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_equipmentAccidentDetail").bootstrapTable('refresh');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//删除多条明细数据
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_equipmentAccidentDetail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAccident/deletesEquipmentAccidentDetail.do', {ids:datas} , function(data) {
|
||||
|
||||
if(data.res){
|
||||
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_equipmentAccidentDetail").bootstrapTable('refresh');
|
||||
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备事故记录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
||||
<!--
|
||||
<input name="deptName" id="deptName" type="hidden" value=""/>
|
||||
-->
|
||||
<input name="workerId" id="workerId" type="hidden" value="${cu.id}"/>
|
||||
<input name="workerName" id="workerName" type="hidden" value="${cu.caption}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*公司</label>
|
||||
<div class="col-sm-6">
|
||||
<p class="form-control-static" >${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*部门</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="deptId" name ="deptId" style="width: 270px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备事故编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="accidentNumber" name ="accidentNumber" placeholder="丢失申请单编号" value="${accidentNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">*日期</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="accidentTime" name="accidentTime" style="width: 230px;" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*价值(元)</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="totalMoney" name ="totalMoney" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*上报人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="workerNameShowPage" name ="workerNameShowPage" disabled value="${cu.caption}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="">
|
||||
<input id="auditId" name="auditId" type="hidden" value="" />
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故地点</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentPlace" name="accidentPlace" rows="2" placeholder=""></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentDescribe" name="accidentDescribe" rows="2" placeholder=""></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故原因</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentReason" name="accidentReason" rows="2" placeholder=""></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||
</div>
|
||||
<div id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">事故设备明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
|
||||
<table id="table_equipmentAccidentDetail"></table>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
<!--
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
458
WebRoot/jsp/equipment/equipmentAccidentEdit.jsp
Normal file
458
WebRoot/jsp/equipment/equipmentAccidentEdit.jsp
Normal file
@ -0,0 +1,458 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${ea.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAccident/update.do", $("#subForm").serialize(), function(data) {
|
||||
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//提交审核
|
||||
function dosubmit(){
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentAccident/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到保养计划审核流程,请先部署流程!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
/*
|
||||
deptId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '部门不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
accidentTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentPlace: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故地点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentDescribe: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故描述不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
accidentReason: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '事故原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//厂区ID
|
||||
var companyId = "${company.id}";
|
||||
$(function() {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$('#table_equipmentAccidentDetail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentAccident/getEquipmentAccidentDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
accidentNumber:'${ea.accidentNumber}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备厂内编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.areaid', // 返回json数据中的name
|
||||
title: '安装地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.assetnumber', // 返回json数据中的name
|
||||
title: '资产编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '生产商', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentvalue', // 返回json数据中的name
|
||||
title: '资产原值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'equipmentCard.residualvalue', // 返回json数据中的name
|
||||
title: '剩余价值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAccidentDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//申请时间
|
||||
$("#accidentTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('accidentTime', 'NOT_VALIDATED',null)
|
||||
.validateField('accidentTime');
|
||||
});
|
||||
$("#accidentTime").datepicker('setDate',new Date());
|
||||
//选择部门
|
||||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct =$("#deptId").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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
$('#deptName').val($("#deptId option:checked").text());
|
||||
|
||||
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
});
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function() {
|
||||
var userIds= $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditId",textId:"auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
//以下是新增内容
|
||||
//新增事故设备明细
|
||||
var addDetailFun = function() {
|
||||
var allTableData = $("#table_equipmentAccidentDetail").bootstrapTable('getData');
|
||||
var equipmentCardIds="";
|
||||
$.each(allTableData,function(index,item){
|
||||
|
||||
if(equipmentCardIds!=""){
|
||||
equipmentCardIds+=",";
|
||||
}
|
||||
//console.log("item.equipmentCardId value is"+item.equipmentCardId);
|
||||
//console.log("item.id value is"+item.id);
|
||||
equipmentCardIds+=item.equipmentCardId;
|
||||
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/selectEquipmentCardDetails.do', {equipmentCardIds:equipmentCardIds,companyId:'${company.id}'},
|
||||
function(data) {
|
||||
$("#equipmentCard4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var doFinishSelects = function(data) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/saveEquipmentAccidentDetails.do', {accidentNumber:'${ea.accidentNumber}',
|
||||
equipmentCardIds:data} , function(data) {
|
||||
if(data.res){
|
||||
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_equipmentAccidentDetail").bootstrapTable('refresh');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//删除多条明细数据
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_equipmentAccidentDetail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentAccident/deletesEquipmentAccidentDetail.do', {ids:datas} , function(data) {
|
||||
|
||||
if(data.res){
|
||||
|
||||
//$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
||||
$("#table_equipmentAccidentDetail").bootstrapTable('refresh');
|
||||
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">修改设备事故记录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<input name="bizId" id="bizId" type="hidden" value="${ea.bizId}"/>
|
||||
<!--
|
||||
<input name="deptName" id="deptName" type="hidden" value=""/>
|
||||
-->
|
||||
<input name="accidentNumber" id="accidentNumber" type="hidden" value="${ea.accidentNumber}"/>
|
||||
<input name="workerId" id="workerId" type="hidden" value="${ea.workerId}"/>
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*部门</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="deptId" name ="deptId" style="width: 270px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备事故编号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="accidentNumberShowPage" name ="accidentNumberShowPage" placeholder="丢失申请单编号" value="${ea.accidentNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">*日期</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="accidentTime" name="accidentTime" style="width: 230px;" value="${ea.accidentTime.substring(0,10)}" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*价值(元)</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="totalMoney" name ="totalMoney" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*上报人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="workerNameShowPage" name ="workerNameShowPage" disabled value="${ea.workerName}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="">
|
||||
<input id="auditId" name="auditId" type="hidden" value="" />
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故地点</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentPlace" name="accidentPlace" rows="2" placeholder="">${ea.accidentPlace}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentDescribe" name="accidentDescribe" rows="2" placeholder="">${ea.accidentDescribe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*事故原因</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="accidentReason" name="accidentReason" rows="2" placeholder="">${ea.accidentReason}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||
</div>
|
||||
<div id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">事故设备明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
|
||||
<table id="table_equipmentAccidentDetail"></table>
|
||||
</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="doupdate()" id="btn_save">保存</button>
|
||||
<!--
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
560
WebRoot/jsp/equipment/equipmentAccidentList.jsp
Normal file
560
WebRoot/jsp/equipment/equipmentAccidentList.jsp
Normal file
@ -0,0 +1,560 @@
|
||||
<%@ 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.sparepart.SparePartCommString"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%=ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header{display:none;}
|
||||
.content-header{display:none;}
|
||||
.main-footer{display:none;}
|
||||
.select2-container .select2-selection--single {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
|
||||
var addFun = function() {
|
||||
//$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if (companyId == "") {
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/doadd.do',
|
||||
{
|
||||
companyId : companyId
|
||||
}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var beginTimeStore2 = '';
|
||||
var endTimeStore2 = '';
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format" : 'YYYY-MM-DD',
|
||||
"separator" : " ~ ",
|
||||
"applyLabel" : "确定",
|
||||
"cancelLabel" : "取消",
|
||||
"fromLabel" : "起始时间",
|
||||
"toLabel" : "结束时间'",
|
||||
"customRangeLabel" : "自定义",
|
||||
"weekLabel" : "W",
|
||||
"daysOfWeek" : [ "日", "一", "二", "三", "四", "五", "六" ],
|
||||
"monthNames" : [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月" ],
|
||||
"firstDay" : 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker" : false,
|
||||
"timePicker24Hour" : false,
|
||||
"linkedCalendars" : false,
|
||||
"autoUpdateInput" : false,
|
||||
"timePickerIncrement" : 10,
|
||||
"locale" : locale,
|
||||
//汉化按钮部分
|
||||
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') ]
|
||||
},
|
||||
startDate : beginTimeStore2,
|
||||
endDate : endTimeStore2
|
||||
},
|
||||
function(start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
|
||||
} else {
|
||||
this.element.val(this.startDate
|
||||
.format(this.locale.format)
|
||||
+ this.locale.separator
|
||||
+ this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/edit.do', {
|
||||
id : id,
|
||||
companyId : companyId
|
||||
}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewProcessFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/showProcessLoseApplyView.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('loseApplyExcuteModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/equipmentAccident/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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
|
||||
+ '/equipment/equipmentAccident/delete.do', {
|
||||
id : id, tableName:tbName_process
|
||||
}, function(data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function(index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} 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
|
||||
+ '/equipment/equipmentAccident/deletes.do',
|
||||
{
|
||||
ids : datas, tableName:tbName_process
|
||||
},
|
||||
function(data) {
|
||||
if (data > 0) {
|
||||
$("#table")
|
||||
.bootstrapTable(
|
||||
'refresh');
|
||||
} else {
|
||||
showAlert('d',
|
||||
'删除失败',
|
||||
'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
initDate2();
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', {
|
||||
ng : ''
|
||||
}, function(data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#companyName").text("公司: " + data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
} else if ((data.length == 1 && data.nodes != "")
|
||||
|| data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data : data,
|
||||
showBorder : false,
|
||||
levels : 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function(event, data) {
|
||||
$("#search_pid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
companyId = data.id;
|
||||
dosearch();
|
||||
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
}
|
||||
;
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function(e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function(e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
|
||||
$('#searchName').keyup(function(){
|
||||
if(event.keyCode==13){
|
||||
event.preventDefault();
|
||||
//alert($('#searchName').val())
|
||||
//回车执行查询
|
||||
dosearch();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
});
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows : params.limit, // 每页要显示的数据条数
|
||||
page : params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
//sort: params.sort, // 要排序的字段
|
||||
//order: params.order,
|
||||
companyId : companyId,
|
||||
search_name : $('#searchName').val(),
|
||||
sdt : beginTimeStore2,
|
||||
edt : endTimeStore2,
|
||||
};
|
||||
}
|
||||
var initFun = function() {
|
||||
$("#table")
|
||||
.bootstrapTable(
|
||||
{
|
||||
|
||||
url : ext.contextPath
|
||||
+ '/equipment/equipmentAccident/getList.do', // 获取表格数据的url
|
||||
|
||||
cache : false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped : true, //表格显示条纹,默认为false
|
||||
pagination : true, // 在表格底部显示分页组件,默认false
|
||||
pageList : [ 10, 20, 50 ], // 设置页面可以显示的数据条数
|
||||
pageSize : 10, // 页面数据条数
|
||||
pageNumber : 1, // 首页页码
|
||||
sidePagination : 'server', // 设置为服务器端分页
|
||||
queryParams : queryParamsFun,
|
||||
//sortName: 'id', // 要排序的字段
|
||||
//sortOrder: 'desc', // 排序规则
|
||||
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
|
||||
columns : [
|
||||
|
||||
{
|
||||
checkbox : true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field : 'accidentNumber', // 返回json数据中的name
|
||||
title : '事故编号', // 表格表头显示文字
|
||||
align : 'center', // 左右居中
|
||||
valign : 'middle' // 上下居中
|
||||
},
|
||||
|
||||
{
|
||||
field : 'accidentTime', // 返回json数据中的name
|
||||
title : '事故时间', // 表格表头显示文字
|
||||
align : 'center', // 左右居中
|
||||
valign : 'middle', // 上下居中
|
||||
formatter : function(value, row, index) {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
{
|
||||
field : 'accidentPlace', // 返回json数据中的name
|
||||
title : '事故地点', // 表格表头显示文字
|
||||
align : 'center', // 左右居中
|
||||
valign : 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field : 'accidentReason', // 返回json数据中的name
|
||||
title : '事故原因', // 表格表头显示文字
|
||||
align : 'center', // 左右居中
|
||||
valign : 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field : 'workerName', // 返回json数据中的name
|
||||
title : '上报人', // 表格表头显示文字
|
||||
align : 'center', // 左右居中
|
||||
valign : 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
title : "操作",
|
||||
align : 'center',
|
||||
valign : 'middle',
|
||||
width : 120, // 定义列的宽度,单位为像素px
|
||||
formatter : function(value, row, index) {
|
||||
var buts = '';
|
||||
//if(row.status == '${START}'){
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentAccident/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\''
|
||||
+ row.id
|
||||
+ '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentAccident/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''
|
||||
+ row.id
|
||||
+ '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
//}else{
|
||||
// buts+= '<button class="btn btn-default btn-sm" title="查看详情" onclick="viewProcessFun(\'' + row.id + '\')"><i class="fa fa-history"></i><span class="hidden-md hidden-lg">查看详情</span></button>';
|
||||
//}
|
||||
buts = '<div class="btn-group" >'
|
||||
+ buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
} ],
|
||||
onLoadSuccess : function() { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError : function() { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()"
|
||||
class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="subEditDiv"></div>
|
||||
<div id="equipmentCard4SelectsDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<!--
|
||||
<form id="searchForm">
|
||||
-->
|
||||
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" /> <span
|
||||
id="companyName"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<ul id="companyselect"
|
||||
style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button --> <a href="#" class="dropdown-toggle"
|
||||
data-toggle="dropdown" style="width:300px;"
|
||||
onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div>
|
||||
<!-- /input-group -->
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize
|
||||
buttonUrl="equipment/equipmentAccident/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick="addFun();">
|
||||
<i class="fa fa-plus"></i>新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick="deletesFun();">
|
||||
<i class="fa fa-trash-o"></i>删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group pull-left input-group-sm">
|
||||
<label style="padding-top:4px">时间范围:</label> <input type="text"
|
||||
class="form-control pull-right" id="reservationtime2"
|
||||
style="width:160px">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" id="searchName" name="searchName"
|
||||
class="form-control pull-right" placeholder="上报人">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();">
|
||||
<i class="fa fa-search">查询</i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
</form>
|
||||
-->
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
181
WebRoot/jsp/equipment/equipmentAccidentView.jsp
Normal file
181
WebRoot/jsp/equipment/equipmentAccidentView.jsp
Normal file
@ -0,0 +1,181 @@
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${ea.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
$(function(){
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$('#table_equipmentAccidentDetail').bootstrapTable({ // 对应table标签的id
|
||||
//url: ext.contextPath + '/sparepart/outStockRecord/getOutStockDetailList.do', // 获取表格数据的url
|
||||
url: ext.contextPath + '/equipment/equipmentAccident/getEquipmentAccidentDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
accidentNumber:'${ea.accidentNumber}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备厂内编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.areaid', // 返回json数据中的name
|
||||
title: '安装地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCard.assetnumber', // 返回json数据中的name
|
||||
title: '资产编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '生产商', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentvalue', // 返回json数据中的name
|
||||
title: '资产原值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'equipmentCard.residualvalue', // 返回json数据中的name
|
||||
title: '剩余价值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentAccidentDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看设备事故记录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备事故编号</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.accidentNumber}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">上报人</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.workerName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">日期</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.accidentTime.substring(0,10)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备事故地点</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.accidentPlace}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备事故描述</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.accidentDescribe}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备事故原因</label>
|
||||
<div class="col-sm-9" style="margin-top:8px; text-align:center">
|
||||
${ea.accidentReason}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文件附件:</label>
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="file-border" id="fileArea" style="margin-left:200px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备事故明细</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
|
||||
<table id="table_equipmentAccidentDetail"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
351
WebRoot/jsp/equipment/equipmentAgeList.jsp
Normal file
351
WebRoot/jsp/equipment/equipmentAgeList.jsp
Normal file
@ -0,0 +1,351 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("EquipmentLife_Warning", EquipmentCommStr.EquipmentLife_Warning); %>
|
||||
<%request.setAttribute("EquipmentLife_Alarm", EquipmentCommStr.EquipmentLife_Alarm); %>
|
||||
<%request.setAttribute("EquipmentLife_All", EquipmentCommStr.EquipmentLife_All); %>
|
||||
<%@ 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"%>
|
||||
<%request.setAttribute("UNIT_TYPE_BIZ",com.sipai.tools.CommString.UNIT_TYPE_BIZ);%>
|
||||
<%request.setAttribute("UNIT_TYPE_COMPANY",com.sipai.tools.CommString.UNIT_TYPE_COMPANY);%>
|
||||
<%request.setAttribute("UNIT_TYPE_DEPT",com.sipai.tools.CommString.UNIT_TYPE_DEPT);%>
|
||||
|
||||
<%request.setAttribute("Flag_Active",com.sipai.tools.CommString.Flag_Active);%>
|
||||
<%request.setAttribute("Flag_Unactive",com.sipai.tools.CommString.Flag_Unactive);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var equipmentid;//设备经济寿命模型全局变量
|
||||
function viewEconomicLifeFun(id) {
|
||||
equipmentid = id;
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEconomicLife.do', {},
|
||||
function (data) {
|
||||
$("#economicLifeDiv").html(data);
|
||||
openModal('economicLifeModal');
|
||||
});
|
||||
}
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $("#search_name").val(),
|
||||
companyId: companyId,
|
||||
alarmLevel: $("#alarmLevel").val(),
|
||||
equipmentClass: $("#equipmentCardClass").val(),
|
||||
}
|
||||
};
|
||||
var judgeColor = function (difference) {
|
||||
if (difference <= 0) {
|
||||
console.log("<");
|
||||
return { css: { "background-color": "red" } }
|
||||
//return { css: { 'background-color': '#FF7F50' } };
|
||||
} else if (difference > 0 && difference < alarmYears) {
|
||||
console.log("<>");
|
||||
return { css: { "background-color": "green" } }
|
||||
} else {
|
||||
console.log("yesss" + index);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
var alarmYears = 1;
|
||||
$(function () {
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
$("#alarmLevel").select2({ minimumResultsForSearch: 10, placeholder: '请选择', allowClear: true }).val("").trigger("change");
|
||||
fixSelect2ToTool('alarmLevel');
|
||||
$("#alarmLevel").on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
//设备类型搜索
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {}, function (data) {
|
||||
var select = $("#equipmentCardClass").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
});
|
||||
//获取报警颜色判断范围
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/getActiveModal.do", {}, function (data) {
|
||||
//console.log(data);
|
||||
if (data != null && data != "" && data.rows[0].param1 != "") {
|
||||
alarmYears = data.rows[0].param1;
|
||||
}
|
||||
initTableFun();
|
||||
}, 'json');
|
||||
}
|
||||
//加载表格
|
||||
var initTableFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getEquipmentAgeList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
//sortName: 'physical_life_time', // 要排序的字段
|
||||
//sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewEconomicLifeFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'bizName', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentSpecification.name', // 返回json数据中的name
|
||||
title: '设备规格', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'technicalLifeTime', // 返回json数据中的name
|
||||
title: '技术寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.technicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.technicalLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.technicalLife - row.alreadyUsedYears >= 0 && row.technicalLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
||||
}, {
|
||||
field: 'physicalLifeTime', // 返回json数据中的name
|
||||
title: '物理寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.physicalLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.physicalLife - row.alreadyUsedYears >= 0 && row.physicalLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
}, {
|
||||
field: 'economicLifeTime', // 返回json数据中的name
|
||||
title: '经济寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.economicLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.economicLife - row.alreadyUsedYears >= 0 && row.economicLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="economicLifeDiv"></div>
|
||||
<div class="row">
|
||||
<div id="companySelectTree" class="col-md-3">
|
||||
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">设备类型:</label>
|
||||
<select class="form-control select2 " id="equipmentCardClass"
|
||||
name="equipmentCardClass" style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">报警级别:</label>
|
||||
<select class="form-control select2 " id="alarmLevel" name="alarmLevel"
|
||||
style="width: 160px;">
|
||||
<option value="${EquipmentLife_Alarm}">报警
|
||||
</option>
|
||||
<option value="${EquipmentLife_Warning}">预警
|
||||
</option>
|
||||
<option value="${EquipmentLife_All}">报警+预警
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<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="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
321
WebRoot/jsp/equipment/equipmentAgeListTemporary.jsp
Normal file
321
WebRoot/jsp/equipment/equipmentAgeListTemporary.jsp
Normal file
@ -0,0 +1,321 @@
|
||||
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var equipmentid;//设备经济寿命模型全局变量
|
||||
function viewEconomicLifeFun(id) {
|
||||
equipmentid = id;
|
||||
$.post(ext.contextPath + '/valueEngineering/equipmentEvaluate/showEconomicLife.do', {},
|
||||
function (data) {
|
||||
$("#economicLifeDiv").html(data);
|
||||
openModal('economicLifeModal');
|
||||
});
|
||||
}
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $("#search_name").val(),
|
||||
companyId: companyId,
|
||||
alarmLevel: $("#alarmLevel").val(),
|
||||
equipmentClass: $("#equipmentCardClass").val(),
|
||||
}
|
||||
};
|
||||
var judgeColor = function (difference) {
|
||||
if (difference <= 0) {
|
||||
console.log("<");
|
||||
return { css: { "background-color": "red" } }
|
||||
//return { css: { 'background-color': '#FF7F50' } };
|
||||
} else if (difference > 0 && difference < alarmYears) {
|
||||
console.log("<>");
|
||||
return { css: { "background-color": "green" } }
|
||||
} else {
|
||||
console.log("yesss" + index);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
var alarmYears = 1;
|
||||
$(function () {
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$("#alarmLevel").select2({ minimumResultsForSearch: 10, placeholder: '请选择', allowClear: true }).val("").trigger("change");
|
||||
fixSelect2ToTool('alarmLevel');
|
||||
$("#alarmLevel").on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
//设备类型搜索
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {}, function (data) {
|
||||
var select = $("#equipmentCardClass").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
initTableFun();
|
||||
});
|
||||
//获取报警颜色判断范围
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/valueEngineering/equipmentModel/getActiveModal.do", {}, function (data) {
|
||||
//console.log(data);
|
||||
if (data != null && data != "" && data.rows[0].param1 != "") {
|
||||
alarmYears = data.rows[0].param1;
|
||||
}
|
||||
initTableFun();
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//编辑资产类型
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/doedit.do', {id:id,companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//加载表格
|
||||
var initTableFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/valueEngineering/equipmentEvaluate/getEquipmentAgeListTemporary.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
//sortName: 'physical_life_time', // 要排序的字段
|
||||
//sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewEconomicLifeFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'bizName', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentSpecification.name', // 返回json数据中的name
|
||||
title: '设备规格', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'technicalLifeTime', // 返回json数据中的name
|
||||
title: '技术寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.technicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.technicalLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.technicalLife - row.alreadyUsedYears >= 0 && row.technicalLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
||||
}, {
|
||||
field: 'physicalLifeTime', // 返回json数据中的name
|
||||
title: '物理寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.physicalLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.physicalLife - row.alreadyUsedYears >= 0 && row.physicalLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
}, {
|
||||
field: 'economicLifeTime', // 返回json数据中的name
|
||||
title: '经济寿命时间', // 表格表头显示文字
|
||||
sortable: true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null && value != "") {
|
||||
return value.substring(0, 10);
|
||||
}
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
if (row.physicalLife != 0 && row.alreadyUsedYears != 0) {
|
||||
if (row.economicLife - row.alreadyUsedYears < 0) {
|
||||
return { css: { "background-color": "#FF7F50" } };
|
||||
} else if (row.economicLife - row.alreadyUsedYears >= 0 && row.economicLife - row.alreadyUsedYears < alarmYears) {
|
||||
return { css: { "background-color": "#FFD700" } };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="economicLifeDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-left form-inline">
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">设备类型:</label>
|
||||
<select class="form-control select2 " id="equipmentCardClass"
|
||||
name="equipmentCardClass" style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
<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="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
183
WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
183
WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
function cellStyler(value,row,index){
|
||||
//if (index==1){
|
||||
return 'background-color:#999999;color:white;';
|
||||
//}
|
||||
}
|
||||
var grid="";
|
||||
$(function() {
|
||||
var content=parent.getEquipArrange();
|
||||
//alert(content)
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '90', title : '班次', field : 'gt_name', halign:'center'},
|
||||
{width : '160', title : '开始时间', field : 'stdt',halign:'center',styler:cellStyler,formatter:function(value,row){
|
||||
return row.stdt.substring(11,16);
|
||||
}},
|
||||
{width : '160', title : '结束时间', field : 'enddt',halign:'center',
|
||||
/* formatter:function(value,row){
|
||||
return row.enddt.substring(11,16);
|
||||
}, */
|
||||
editor:{
|
||||
type:'timespinner',
|
||||
options:{
|
||||
required : true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.checkFlag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onCheck: function(rowIndex,rowData){
|
||||
rowData.checkFlag=true;
|
||||
},
|
||||
onUncheck : function(rowIndex,rowData){
|
||||
rowData.checkFlag=false;
|
||||
},
|
||||
data:JSON.parse(content)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
//alert(value)
|
||||
if (field != "enddt" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
endEditing();
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'enddt' });
|
||||
//alert("oled"+value)
|
||||
$(ed.target).timespinner('setValue',value);
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'enddt' });
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] =number;
|
||||
//alert( 'new:'+$('#grid').datagrid('getRows')[editIndex]['enddt']);
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var dosave = function(dialog,grid) {
|
||||
//alert();
|
||||
//若用户未确认编辑状态,则自动完成编辑
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'enddt' });
|
||||
if(ed!=null){
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
}
|
||||
|
||||
var allItems = $('#grid').datagrid('getData').rows;
|
||||
|
||||
/* $.each(allItems, function(index, item){
|
||||
//alert(item)
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","gt_id":"'+item.gt_id +'",'+
|
||||
'"stdt":"'+item.stdt +'","enddt":"'+item.enddt +'"}';
|
||||
}); */
|
||||
|
||||
//alert(JSON.stringify(allItems))
|
||||
return JSON.stringify(allItems);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>${equipmentCard.equipmentname}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备编码</th>
|
||||
<td>${equipmentCard.equipmentcardid}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<td>${param.plandate}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
</form>
|
||||
<table class="table">
|
||||
<div data-options="region:'center',border:false">
|
||||
<table id="grid" data-options="border:false "></table>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
307
WebRoot/jsp/equipment/equipmentBelongAdd.jsp
Normal file
307
WebRoot/jsp/equipment/equipmentBelongAdd.jsp
Normal file
@ -0,0 +1,307 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave(){
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
var equipmentBelongFormData=$('#subForm').serialize();
|
||||
|
||||
var isExistMark=isExistEquipmentBelong(equipmentBelongFormData);
|
||||
|
||||
console.log("isExistMark=============="+isExistMark);
|
||||
//如果不存在就调用保存的方法
|
||||
if(false===isExistMark){
|
||||
var saveMark=saveEquipmentBelong(equipmentBelongFormData);
|
||||
console.log("saveMark=============="+saveMark);
|
||||
if(true===saveMark){
|
||||
//保存设备编码成功提示
|
||||
showAlert('s', '设备归属信息保存成功');
|
||||
setTimeout(function(){ closeModal('subModal'); },300);
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
//保存设备编码失败提示
|
||||
showAlert('d', '设备归属信息保存失败');
|
||||
}
|
||||
}else{
|
||||
//如果存在就提示
|
||||
showAlert('d', '设备归属信息已存在');
|
||||
}
|
||||
}
|
||||
},100)
|
||||
|
||||
}
|
||||
|
||||
function isExistEquipmentBelong(data){
|
||||
|
||||
var isExistMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/findEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示已存在0表示不存在
|
||||
if(value===1){
|
||||
isExistMark=true;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
return isExistMark;
|
||||
}
|
||||
|
||||
function saveEquipmentBelong(data){
|
||||
var saveMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/saveEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示保存成功0表示保存失败
|
||||
if(value===1){
|
||||
saveMark=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
return saveMark;
|
||||
}
|
||||
|
||||
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
belongName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备归属名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
belongCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备归属编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
/* function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentClassId").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doSaveProp.do", $("#propForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
} */
|
||||
|
||||
//输入框验证
|
||||
/* $("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备等级名称不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
||||
message: '名称已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
name: $('#name').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}); */
|
||||
|
||||
/* $(function () {
|
||||
$("#ecoLifeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
$("#maintainceFeeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
}) */
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备归属信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备归属名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongName" name="belongName" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*设备归属编码</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongCode" name="belongCode" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" rows="3" cols="3" id="remark" name="remark" ></textarea>
|
||||
<!-- <input class="form-control" type="text" id="remark" name="remark" /> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段一</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" id="codeOne" name="codeOne" style="width: 270px;" >
|
||||
<option value="-1" >-</option>
|
||||
<option value="0" selected>厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段二</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeTwo" name="codeTwo" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1" selected>归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段三</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeThree" name="codeThree" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2" selected>安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段四</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFour" name="codeFour" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3" selected>分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段五</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFive" name="codeFive" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4" selected>设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段六(流水号长度)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="number" id="waterNumLen" name="waterNumLen" value="2" />
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
299
WebRoot/jsp/equipment/equipmentBelongEdit.jsp
Normal file
299
WebRoot/jsp/equipment/equipmentBelongEdit.jsp
Normal file
@ -0,0 +1,299 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doupdate(){
|
||||
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
var equipmentBelongFormData=$('#subForm').serialize();
|
||||
|
||||
var saveMark=updateEquipmentBelong(equipmentBelongFormData);
|
||||
console.log("saveMark=============="+saveMark);
|
||||
if(true===saveMark){
|
||||
//保存设备编码成功提示
|
||||
showAlert('s', '设备归属信息保存成功');
|
||||
setTimeout(function(){ closeModal('subModal'); },300);
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
//保存设备编码失败提示
|
||||
showAlert('d', '设备归属信息保存失败');
|
||||
}
|
||||
}
|
||||
},100)
|
||||
|
||||
}
|
||||
|
||||
/* function isExistEquipmentBelong(data){
|
||||
|
||||
var isExistMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/findEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示已存在0表示不存在
|
||||
if(value===1){
|
||||
isExistMark=true;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
return isExistMark;
|
||||
} */
|
||||
|
||||
function updateEquipmentBelong(data){
|
||||
var saveMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/updateEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示保存成功0表示保存失败
|
||||
if(value===1){
|
||||
saveMark=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
return saveMark;
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
belongName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备归属名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
belongCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备归属编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentClassId").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doSaveProp.do", $("#propForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
} */
|
||||
|
||||
//输入框验证
|
||||
/* $("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备等级名称不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
||||
message: '名称已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
name: $('#name').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}); */
|
||||
|
||||
/* $(function () {
|
||||
$("#ecoLifeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
$("#maintainceFeeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
}) */
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备归属信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="${equipmentBelong.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备归属名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongName" name="belongName" value="${equipmentBelong.belongName}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备归属编码</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongCode" name="belongCode" value="${equipmentBelong.belongCode}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" rows="3" cols="3" id="remark" name="remark" >${equipmentBelong.remark}</textarea>
|
||||
<!-- <input class="form-control" type="text" id="remark" name="remark" /> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段一</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" id="codeOne" name="codeOne" style="width: 270px;" >
|
||||
<option value="-1" >-</option>
|
||||
<option value="0" selected>厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段二</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeTwo" name="codeTwo" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1" selected>归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段三</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeThree" name="codeThree" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2" selected>安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段四</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFour" name="codeFour" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3" selected>分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段五</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFive" name="codeFive" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4" selected>设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段六(流水号长度)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="number" id="waterNumLen" name="waterNumLen" value="2" />
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</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="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
280
WebRoot/jsp/equipment/equipmentBelongList.jsp
Normal file
280
WebRoot/jsp/equipment/equipmentBelongList.jsp
Normal file
@ -0,0 +1,280 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增设备归属信息
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentBelong/doadd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//编辑设备归属信息
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentBelong/doedit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//查看设备归属信息
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentBelong/doview.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除一条设备编码数据
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentBelong/dodelete.do', { id: id }, function (data) {
|
||||
if (data >= 0) {
|
||||
/* $.post(ext.contextPath + '/equipment/equipmentClass/dodelete.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}); */
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条设备编码数据
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} 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 + '/equipment/equipmentBelong/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data >= 0) {
|
||||
/* $.post(ext.contextPath + '/equipment/equipmentClass/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}); */
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function dosearch(){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentBelong/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
searchName: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'belongName', // 返回json数据中的name
|
||||
title: '归属名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
|
||||
},{
|
||||
field: 'belongCode', // 返回json数据中的name
|
||||
title: '归属编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentBelong/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentBelong/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/equipmentBelong/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<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="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>--%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include>--%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
127
WebRoot/jsp/equipment/equipmentBelongListForSelect.jsp
Normal file
127
WebRoot/jsp/equipment/equipmentBelongListForSelect.jsp
Normal file
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
var $table;
|
||||
function doselect() {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
//console.info(checkedItem);
|
||||
$('#equipmentBelongId' ).val(checkedItem.id);
|
||||
$('#equipmentBelongCode' ).val(checkedItem.belongCode);
|
||||
$('#equipmentBelongName').val(checkedItem.belongName);
|
||||
closeModal("equipmentBelongSubModal");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${equipmentBelongId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$table = $("#equipmentBelongTable").bootstrapTable({ // 对应table标签的id
|
||||
//url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
url: ext.contextPath + '/equipment/equipmentBelong/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'belongName', // 返回json数据中的name
|
||||
title: '归属名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
|
||||
},{
|
||||
field: 'belongCode', // 返回json数据中的name
|
||||
title: '归属编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("equipmentBelongTable");
|
||||
},
|
||||
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){
|
||||
$('#equipmentBelongTable .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="equipmentBelongSubModal" >
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">选择设备归属</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></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>
|
||||
143
WebRoot/jsp/equipment/equipmentBelongListForSelectForType.jsp
Normal file
143
WebRoot/jsp/equipment/equipmentBelongListForSelectForType.jsp
Normal file
@ -0,0 +1,143 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
var $table;
|
||||
function doselect() {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
//console.info(checkedItem);
|
||||
$('#equipmentBelongId' ).val(checkedItem.id);
|
||||
$('#equipmentBelongCode' ).val(checkedItem.belongCode);
|
||||
$('#equipmentBelongName').val(checkedItem.belongName);
|
||||
//选择设备型号
|
||||
$('#equipmentmodel').empty
|
||||
$.post(ext.contextPath + "/equipment/equipmentTypeNumber/getEquipmentTypeNumberForSelect.do", {equipmentclassid:$('#equipmentclassid').val}, function(data) {
|
||||
var selelct =$("#equipmentmodel").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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
},'json');
|
||||
closeModal("equipmentBelongSubModal");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${equipmentBelongId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$table = $("#equipmentBelongTable").bootstrapTable({ // 对应table标签的id
|
||||
//url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
url: ext.contextPath + '/equipment/equipmentBelong/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'belongName', // 返回json数据中的name
|
||||
title: '归属名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
|
||||
},{
|
||||
field: 'belongCode', // 返回json数据中的name
|
||||
title: '归属编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("equipmentBelongTable");
|
||||
},
|
||||
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){
|
||||
$('#equipmentBelongTable .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="equipmentBelongSubModal" >
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">选择设备归属</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></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>
|
||||
273
WebRoot/jsp/equipment/equipmentBelongView.jsp
Normal file
273
WebRoot/jsp/equipment/equipmentBelongView.jsp
Normal file
@ -0,0 +1,273 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
/* function doupdate(){
|
||||
|
||||
var equipmentBelongFormData=$('#subForm').serialize();
|
||||
|
||||
var saveMark=updateEquipmentBelong(equipmentBelongFormData);
|
||||
console.log("saveMark=============="+saveMark);
|
||||
if(true===saveMark){
|
||||
//保存设备编码成功提示
|
||||
showAlert('s', '设备归属信息保存成功');
|
||||
setTimeout(function(){ closeModal('subModal'); },300);
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
//保存设备编码失败提示
|
||||
showAlert('d', '设备归属信息保存失败');
|
||||
}
|
||||
} */
|
||||
|
||||
/* function isExistEquipmentBelong(data){
|
||||
|
||||
var isExistMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/findEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示已存在0表示不存在
|
||||
if(value===1){
|
||||
isExistMark=true;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
return isExistMark;
|
||||
} */
|
||||
|
||||
/* function updateEquipmentBelong(data){
|
||||
var saveMark=false;
|
||||
$.ajax({
|
||||
url : ext.contextPath
|
||||
+ "/equipment/equipmentBelong/updateEquipmentBelong.do",
|
||||
type : "post",
|
||||
cache : false,
|
||||
data:data,
|
||||
dataType : "json",
|
||||
async:false,
|
||||
success : function(result) {
|
||||
$.each(result,function(key,value){
|
||||
//1表示保存成功0表示保存失败
|
||||
if(value===1){
|
||||
saveMark=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
return saveMark;
|
||||
} */
|
||||
|
||||
|
||||
|
||||
|
||||
/* function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentClassId").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doSaveProp.do", $("#propForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
} */
|
||||
|
||||
//输入框验证
|
||||
/* $("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备等级名称不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
||||
message: '名称已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
name: $('#name').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}); */
|
||||
|
||||
/* $(function () {
|
||||
$("#ecoLifeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
$("#maintainceFeeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
}) */
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看设备归属信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="{equipmentBelong.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备归属名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongName" name="belongName" readonly="readonly" value="${equipmentBelong.belongName}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备归属编码</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="belongCode" name="belongCode" readonly="readonly" value="${equipmentBelong.belongCode}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" rows="3" cols="3" id="remark" name="remark" readonly="readonly">${equipmentBelong.remark}</textarea>
|
||||
<!-- <input class="form-control" type="text" id="remark" name="remark" /> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段一</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" id="codeOne" name="codeOne" style="width: 270px;" >
|
||||
<option value="-1" >-</option>
|
||||
<option value="0" selected>厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段二</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeTwo" name="codeTwo" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1" selected>归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段三</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeThree" name="codeThree" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2" selected>安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段四</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFour" name="codeFour" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3" selected>分类编码</option>
|
||||
<option value="4">设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段五</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="codeFive" name="codeFive" style="width: 270px;">
|
||||
<option value="-1" >-</option>
|
||||
<option value="0">厂区</option>
|
||||
<option value="1">归属或类别</option>
|
||||
<option value="2">安装位置</option>
|
||||
<option value="3">分类编码</option>
|
||||
<option value="4" selected>设备等级</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">码段六(流水号长度)</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="number" id="waterNumLen" name="waterNumLen" value="2" />
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</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="doupdate()" id="btn_save">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
154
WebRoot/jsp/equipment/equipmentCamera4Select.jsp
Normal file
154
WebRoot/jsp/equipment/equipmentCamera4Select.jsp
Normal file
@ -0,0 +1,154 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
var dosearchCamera = function() {
|
||||
$("#table_camera").bootstrapTable('refresh');
|
||||
};
|
||||
function doselect(dialog,grid) {
|
||||
var checkedItems = $("#table_camera").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item.id;
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardCamera/dosave.do',{eqid:'${param.eqid}',datas:datas},function(data) {
|
||||
closeModal("cameraSubModal");
|
||||
$("#cameratable").bootstrapTable('refresh');
|
||||
});
|
||||
closeModal("cameraSubModal")
|
||||
};
|
||||
|
||||
|
||||
var $table;
|
||||
function queryParams(params) {
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
$table=$("#table_camera").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/camera/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
// responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'name', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true // 显示一个勾选框
|
||||
},{
|
||||
field: 'name',
|
||||
title: "摄像头名称",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%'
|
||||
}, {
|
||||
field: 'url',
|
||||
title: "摄像头ip",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%',/*
|
||||
formatter:function(value,row,index){
|
||||
return row.processSection.name;
|
||||
}*/
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_camera");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
// selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="cameraSubModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择摄像头</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm " style="width: 220px;margin-left:30px">
|
||||
|
||||
<input type="text" id="search_name" name="search_name" class="form-control " placeholder="摄像头名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchCamera();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->
|
||||
</div>
|
||||
<div>
|
||||
<table id="table_camera" ></table>
|
||||
</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>
|
||||
316
WebRoot/jsp/equipment/equipmentCard4Selects.jsp
Normal file
316
WebRoot/jsp/equipment/equipmentCard4Selects.jsp
Normal file
@ -0,0 +1,316 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEquipment = function() {
|
||||
//$("#table_stock").bootstrapTable('refresh');
|
||||
console.info($('#equipmentName').val());
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEquipment() {
|
||||
//var checkItems = $("#table_stock").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
|
||||
|
||||
});
|
||||
console.log("datas value is="+datas);
|
||||
doFinishSelects(datas);
|
||||
closeModal("subDetailModal");
|
||||
};
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
var dosearchTable = function() {
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
};
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipmentCardIds}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipmentCardIds}');
|
||||
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipmentCardIds}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
var companyId;
|
||||
$(function() {
|
||||
//工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearchTable();
|
||||
});
|
||||
},'json');
|
||||
//$("#").attr("onsubmit","return false;");
|
||||
$("#equipmentName").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEquipment();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
//选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
if(data.length == 1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
$("#search_code").css("display", "none");
|
||||
$("#company").text(data[0].text);
|
||||
companyId=data[0].id;
|
||||
//initFun();
|
||||
}else{
|
||||
$("#company").css("display", "none");
|
||||
var selelct=$("#search_code").select2({
|
||||
data : data ,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct.val('').trigger("change");
|
||||
//initFun();
|
||||
selelct.on("change",function(e){
|
||||
companyId= $(this).val();
|
||||
//initFun();
|
||||
dosearchTable();
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
initialSelectionIds();
|
||||
$table=$("#table_equipmentCard").bootstrapTable({
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName: $('#equipmentName').val(),
|
||||
//companyId : '${param.companyId}',
|
||||
unitId : unitId,
|
||||
processSection : $('#processSection').val()
|
||||
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '公司名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}
|
||||
,{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备厂内编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'areaid', // 返回json数据中的name
|
||||
title: '安装地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'assetnumber', // 返回json数据中的name
|
||||
title: '资产编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '生产商', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentvalue', // 返回json数据中的name
|
||||
title: '资产原值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
|
||||
},{
|
||||
field: 'residualvalue', // 返回json数据中的name
|
||||
title: '剩余价值(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentCard");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subDetailModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">设备台账明细</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDetailDiv"></div>
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">水厂:</label>
|
||||
|
||||
<!-- <label class="form-label" id="companylabel">水厂:</label> -->
|
||||
<!-- <label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label> -->
|
||||
<input name="bizid" id="bizid" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static" >${company.sname}</p>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
</div> -->
|
||||
</div>
|
||||
<!--工艺段筛选-->
|
||||
<div class="input-group input-group-sm " style="margin-right: 1%;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-inline pull-right">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="equipmentName" name="equipmentName" class="form-control pull-right" placeholder="设备名称/设备编码/资产编码">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doSearchEquipment();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div id="table_equipmentCard" style="height:230px;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="doSelectEquipment()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
868
WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
868
WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
@ -0,0 +1,868 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryStatus_OFF", EquipmentCard.CompulsoryStatus_OFF); %>
|
||||
<%request.setAttribute("CompulsoryStatus_ON", EquipmentCard.CompulsoryStatus_ON); %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//判断是否为单一设备 所属设备
|
||||
function isOneDevice() {
|
||||
var equipid = $('#equipid').val();
|
||||
if (equipid != null && equipid != '') {
|
||||
$('#isOne').val("否");
|
||||
} else {
|
||||
$('#isOne').val("是");
|
||||
}
|
||||
}
|
||||
|
||||
function dosave() {
|
||||
// var companyCodeAuto = $('#companyCodeAuto').val();
|
||||
// var equipmentBelongCodeAuto = $('#equipmentBelongCodeAuto').val();
|
||||
// var equipmentClassCodeAuto = $('#equipmentClassCodeAuto').val();
|
||||
// var processsectionCodeAuto = $('#processsectionCodeAuto').val();
|
||||
// var equipmentlevelCodeAuto = $('#equipmentlevelCodeAuto').val();
|
||||
var equipmentcardid = $('#equipmentcardid').val();
|
||||
|
||||
// var equipmentcardid = companyCodeAuto + equipmentBelongCodeAuto + equipmentClassCodeAuto + processsectionCodeAuto + equipmentlevelCodeAuto;
|
||||
// $('#equipmentcardid').val(equipmentcardid);
|
||||
|
||||
if ('' == equipmentcardid || equipmentcardid == 'undefined') {
|
||||
showAlert('d', '设备编码不能为空');
|
||||
return;
|
||||
}
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentProp").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/dosaveEquipmentProp.do", $("#subPropForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
|
||||
$("#equipmentBelongId").val('');
|
||||
$("#equipmentCardType").val('');
|
||||
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipmentname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentstatus: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
var companyId = "${company.id}";
|
||||
$(function () {
|
||||
|
||||
//安装时间
|
||||
$("#installDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//首检时间
|
||||
$("#firstTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//下次检查时间
|
||||
$("#nextTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//启用时间
|
||||
$("#openDate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//购置时间
|
||||
$("#buyTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//入帐时间
|
||||
$("#inStockTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//出厂年月
|
||||
$("#productiondate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//领用时间
|
||||
$("#receiveTime").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
//是否强检
|
||||
var selelct_type2 = $("#isCompulsoryInspection").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_type2.on('change', function () {
|
||||
var isCompulsoryInspection = $('#isCompulsoryInspection').val();
|
||||
if ('${CompulsoryStatus_ON}' == isCompulsoryInspection) {
|
||||
$("#frequency-div").attr("style", "display:block;");
|
||||
$("#frequency-div2").attr("style", "display:block;");
|
||||
} else {
|
||||
$("#frequency-div").attr("style", "display:none;");
|
||||
$("#frequency-div2").attr("style", "display:none;");
|
||||
}
|
||||
})
|
||||
//强检类型
|
||||
var selelct_type3 = $("#compulsoryInspectionType").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
|
||||
//获取设备所属
|
||||
getEquipmentBelongFun();
|
||||
//获取工艺段
|
||||
getProcessSectionFun();
|
||||
//获取设备等级(ABC)
|
||||
getEquipmentLevelFun();
|
||||
//获取设备状态
|
||||
getEquipmentstatusFun();
|
||||
})
|
||||
//选择设备,根据厂区id选择厂内设备
|
||||
var selectEquipmentCard = function () {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {
|
||||
companyId: companyId,
|
||||
equipmentId: $("#equipid").val(),
|
||||
isone: '1'
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//设备所属 -- 如水线 - (方法在用) sj 2021-07-28
|
||||
function getEquipmentBelongFun() {
|
||||
var selectType = $("#equipmentBelongName").select2({minimumResultsForSearch: 10})
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelongForSelect.do", {unitId: unitId}, function (data) {
|
||||
$("#equipmentBelongName").empty();
|
||||
var selelct_ = $("#equipmentBelongName").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#equipmentBelongId').val(e.target.value);
|
||||
//给设备编码(水线部分)赋值
|
||||
// var name = $("#equipmentBelongName").find("option:selected").text();
|
||||
// $('#equipmentBelongCodeAuto').val(getParenthesesStr(name));
|
||||
})
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//工艺段 - (方法在用) sj 2021-07-28
|
||||
function getProcessSectionFun() {
|
||||
var selectType = $("#processsectionCode").select2({minimumResultsForSearch: 10})
|
||||
$.post(ext.contextPath + "/user/processSection/getList4EquipmentCard.do", {unitId: unitId}, function (data) {
|
||||
$("#processsectionCode").empty();
|
||||
var selelct_ = $("#processsectionCode").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#processsectionid').val(e.target.value);
|
||||
//给设备编码(工艺段部分)赋值
|
||||
// var name = $("#processsectionCode").find("option:selected").text();
|
||||
// $('#processsectionCodeAuto').val(getParenthesesStr(name));
|
||||
})
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//获取设备等级 如ABC - (方法在用) sj 2021-07-28
|
||||
function getEquipmentLevelFun() {
|
||||
var selectType = $("#equipmentlevelName").select2({minimumResultsForSearch: 10})
|
||||
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevel4Select.do", {unitId: unitId}, function (data) {
|
||||
$("#equipmentlevelName").empty();
|
||||
var selelct_ = $("#equipmentlevelName").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#equipmentlevelid').val(e.target.value);
|
||||
//给设备编码(工艺段部分)赋值
|
||||
// var name = $("#equipmentlevelName").find("option:selected").text();
|
||||
// $('#equipmentlevelCodeAuto').val(getParenthesesStr(name));
|
||||
})
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//获取设备状态 - (方法在用) sj 2021-07-28
|
||||
function getEquipmentstatusFun() {
|
||||
var selectType = $("#equipmentstatusName").select2({minimumResultsForSearch: 10})
|
||||
$.post(ext.contextPath + "/equipment/equipmentStatusManagement/getEquipmentstatus4Select.do", {unitId: unitId}, function (data) {
|
||||
$("#equipmentstatusName").empty();
|
||||
var selelct_ = $("#equipmentstatusName").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#equipmentstatus').val(e.target.value);
|
||||
})
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//设备类型 - (方法在用)
|
||||
var selectEquipmentClass = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/selectEquipmentClassForType.do', {}, function (data) {
|
||||
$("#equipmentClassSubDiv").html(data);
|
||||
openModal('equipmentClassSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
//规格型号 - (方法在用)
|
||||
var selectEquipmentModel = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentTypeNumber/selectEquipmentModel.do', {
|
||||
equipmentclassid: $('#equipmentclassid').val(),
|
||||
equipmentmodel: $('#equipmentmodel').val()
|
||||
}, function (data) {
|
||||
$("#equipmentModelSubDiv").html(data);
|
||||
openModal('equipmentModelSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
//资产类型 - (方法在用)
|
||||
var selectAssetTypeClass = function () {
|
||||
var equipmentBelongId = $("#equipmentBelongId").val();
|
||||
var equipmentBelongCode = $("#equipmentBelongCode").val();
|
||||
$.post(ext.contextPath + '/equipment/assetClass/selectAssetTypeForType.do', {
|
||||
equipmentBelongId: equipmentBelongId,
|
||||
equipmentBelongCode: equipmentBelongCode
|
||||
}, function (data) {
|
||||
$("#assetTypeSubDiv").html(data);
|
||||
openModal('assetTypeSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
//设备编码规则
|
||||
var selectEquipmentCodeRule = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCode/selectEquipmentCodeRule.do', {equipmentCodeId: $('#equipmentCodeId').val()}, function (data) {
|
||||
$("#equipmentCodeRuleSubDiv").html(data);
|
||||
openModal('equipmentCodeRuleSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 取出小括号内的内容
|
||||
* sj 2021-07-28
|
||||
* @param text
|
||||
* @returns {string}
|
||||
*/
|
||||
function getParenthesesStr(text) {
|
||||
var re = /\([^\)]+\)/g
|
||||
var s = text;
|
||||
s = s.match(re)[0];
|
||||
s = s.substring(1, s.length - 1);
|
||||
return s
|
||||
}
|
||||
|
||||
//根据设备编码规则自动生成设备编码
|
||||
function autoGenerateEquipmentCode() {
|
||||
var waterNumShort;
|
||||
var equipmentCardId = "";
|
||||
|
||||
var equipmentWaterNumLenParam = $('#equipmentWaterNumLen').val();
|
||||
|
||||
var enameParam = $('#ename').val();
|
||||
|
||||
var equipmentBelongCodeParam = $('#equipmentBelongCode').val();
|
||||
|
||||
var processsectionCodeParam = $('#processsectionCode').val();
|
||||
|
||||
var equipmentClassCodeParam = $('#equipmentClassCode').val();
|
||||
|
||||
var equipmentLevelCodeParam = $('#equipmentLevelCode').val();
|
||||
|
||||
var equipmentCodeRuleParamArr = [enameParam, equipmentBelongCodeParam, processsectionCodeParam, equipmentClassCodeParam, equipmentLevelCodeParam];
|
||||
|
||||
var equipmentCodeRuleParam = $('#equipmentCodeRule').val();
|
||||
|
||||
|
||||
for (var i = 0; i < equipmentCodeRuleParam.length; i++) {
|
||||
equipmentCardId += equipmentCodeRuleParamArr[i];
|
||||
}
|
||||
|
||||
var equCardIdAndWatNumShortArr = findEquipmentCardByEquipmentCodeRule(equipmentCodeRuleParam, equipmentWaterNumLenParam, equipmentCardId);
|
||||
//console.log("equCardIdAndWatNumShortArr=========================="+equCardIdAndWatNumShortArr);
|
||||
|
||||
var resultEquipmentCardId = equCardIdAndWatNumShortArr[0];
|
||||
var waterNumShort = equCardIdAndWatNumShortArr[1];
|
||||
// console.log("resultEquipmentCardId=============================="+resultEquipmentCardId);
|
||||
// console.log("waterNumShort=============================="+waterNumShort);
|
||||
//查询自动生成的设备编码数据库是否存在
|
||||
var isExitMark = false;
|
||||
do {
|
||||
var findResultMark = false;
|
||||
$.ajax({
|
||||
url: ext.contextPath
|
||||
+ "/equipment/findEquipmentCardIdByEquipmentCardId.do",
|
||||
type: "post",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: {equipmentCardId: resultEquipmentCardId},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
findResultMark = data['result'];
|
||||
//console.log(typeof findResultMark);
|
||||
//console.log("====================================="+(findResultMark==true));
|
||||
}
|
||||
});
|
||||
//console.log("findResultMark=================="+(findResultMark));
|
||||
//console.log("isExitMark=================="+(isExitMark));
|
||||
if (findResultMark == true) {
|
||||
waterNumShort++;
|
||||
resultEquipmentCardId = createEquipmentCardId(waterNumShort, equipmentWaterNumLenParam, equipmentCardId);
|
||||
} else {
|
||||
isExitMark = true;
|
||||
}
|
||||
} while (isExitMark == false);
|
||||
//console.log("resultEquipmentCardId======================================="+resultEquipmentCardId);
|
||||
$('#equipmentcardid').val(resultEquipmentCardId);
|
||||
}
|
||||
|
||||
function findEquipmentCardByEquipmentCodeRule(equipmentCodeRuleParam, equipmentWaterNumLenParam, equipmentCardId) {
|
||||
var equCardIdAndWatNumShortArr = [];
|
||||
$.ajax({
|
||||
url: ext.contextPath
|
||||
+ "/equipment/findEquipmentCardByEquipmentCodeRule.do",
|
||||
type: "post",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: {equipmentCodeRule: equipmentCodeRuleParam},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
var waterNumShort = data['result'];
|
||||
if ('' == waterNumShort) {
|
||||
waterNumShort = 0;
|
||||
}
|
||||
equipmentCardId = createEquipmentCardId(waterNumShort, equipmentWaterNumLenParam, equipmentCardId);
|
||||
equCardIdAndWatNumShortArr = [equipmentCardId, waterNumShort];
|
||||
}
|
||||
});
|
||||
return equCardIdAndWatNumShortArr;
|
||||
}
|
||||
|
||||
function createEquipmentCardId(waterNumShort, equipmentWaterNumLenParam, equipmentCardId) {
|
||||
var waterNumShortStr = waterNumShort + '';
|
||||
if (waterNumShortStr.length >= equipmentWaterNumLenParam) {
|
||||
equipmentCardId = equipmentCardId + waterNumShort;
|
||||
//console.log("==============调用了我1=============================");
|
||||
} else {
|
||||
//console.log("==============调用了我2=============================");
|
||||
var zero = "";
|
||||
var zeroNum = equipmentWaterNumLenParam - (waterNumShortStr.length);
|
||||
for (var j = 0; j < zeroNum; j++) {
|
||||
zero = zero + 0;
|
||||
}
|
||||
equipmentCardId = equipmentCardId + zero + waterNumShort;
|
||||
}
|
||||
return equipmentCardId;
|
||||
}
|
||||
|
||||
//生成设备编号 2020-07-12 start
|
||||
function autoGenerateEquipmentCodeByCodeRule() {
|
||||
var equipmentCardForm = $('#subForm').serialize();
|
||||
|
||||
var equipmentBelongCode = $('#equipmentBelongCode').val();
|
||||
var equipmentClassCode = $('#equipmentClassCode').val();
|
||||
var processsectionCode = $('#processsectionCode').val();
|
||||
var equipmentLevelCode = $('#equipmentLevelCode').val();
|
||||
|
||||
if ('' == equipmentBelongCode || equipmentBelongCode == 'undefined') {
|
||||
swal('工艺线不能为空');
|
||||
return;
|
||||
}
|
||||
if ('' == equipmentClassCode || equipmentClassCode == 'undefined') {
|
||||
swal('设备类型不能为空');
|
||||
return;
|
||||
}
|
||||
if ('' == processsectionCode || processsectionCode == 'undefined') {
|
||||
swal('工艺段不能为空');
|
||||
return;
|
||||
}
|
||||
if ('' == equipmentLevelCode || equipmentLevelCode == 'undefined') {
|
||||
swal('ABC分类不能为空');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: ext.contextPath
|
||||
+ "/equipment/autoGenerateEquipmentCodeByCodeRule.do",
|
||||
type: "post",
|
||||
cache: false,
|
||||
data: equipmentCardForm,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
var equipmentCode = result['equipmentCode'];
|
||||
var waterNumShort = result['waterNumShort'];
|
||||
$('#equipmentcardid').val(equipmentCode);
|
||||
$('#waterNumShort').val(waterNumShort);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">新增设备</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="hidden" id="id" name="id" value="${id}">
|
||||
<input type="hidden" id="type" name="type" value="0">
|
||||
<input type="hidden" id="waterNumShort" name="waterNumShort"
|
||||
value="${equipmentCard.waterNumShort}">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="bizid" id="bizid" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.sname}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentname" name="equipmentname"
|
||||
placeholder="设备名称" value="${equipmentCard.equipmentname}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备所属/工艺线</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="equipmentBelongName"
|
||||
name="equipmentBelongName"
|
||||
style="width: 370px;"></select>
|
||||
<input type="hidden" class="form-control" id="equipmentBelongId"
|
||||
name="equipmentBelongId" value="${equipmentCard.equipmentBelongId}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*设备类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentClassName"
|
||||
name="equipmentClassName" onclick="selectEquipmentClass()"
|
||||
value="${equipmentCard.equipmentClass.name}" placeholder="点击选择">
|
||||
<input type="hidden" class="form-control" id="equipmentClassCode"
|
||||
name="equipmentClassCode"
|
||||
value="${equipmentCard.equipmentClass.equipmentClassCode}">
|
||||
<input type="hidden" class="form-control" id="equipmentclassid"
|
||||
name="equipmentclassid"
|
||||
value="${equipmentCard.equipmentClass.id}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工艺段(安装位置)</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="processsectionCode"
|
||||
name="processsectionCode"
|
||||
style="width: 370px;"></select>
|
||||
<input type="hidden" class="form-control" id="processsectionid"
|
||||
name="processsectionid"
|
||||
value="${equipmentCard.processsectionid}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*设备等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="equipmentlevelName"
|
||||
name="equipmentlevelName"
|
||||
style="width: 370px;"></select>
|
||||
<input type="hidden" class="form-control" id="equipmentlevelid"
|
||||
name="equipmentlevelid"
|
||||
value="${equipmentCard.equipmentlevelid}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备编号</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="equipmentcardid"
|
||||
value="${equipmentCard.equipmentcardid}" name="equipmentcardid" readonly>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<div class="input-group-addon"
|
||||
style="width: 100%;background-color: #269abc;cursor: pointer;font-size: 11px;color: white;height: 34px;border-radius: 3px;float: left;line-height: 2.5;text-align: center;margin-right: 10px;padding: 0px !important;"
|
||||
onclick="autoGenerateEquipmentCodeByCodeRule()">生成
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="input-group-addon"
|
||||
style="width: 6%;background-color: #269abc;cursor: pointer;font-size: 11px;color: white;height: 34px;border-radius: 3px;float: left;line-height: 2.5;text-align: center;margin-right: 10px;padding: 0px !important;"
|
||||
onclick="autoGenerateEquipmentCodeByCodeRule()">生成
|
||||
</div>--%>
|
||||
|
||||
<label class="col-sm-2 control-label">规格型号</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="equipmentmodelname" name="equipmentmodelname"
|
||||
class="form-control"
|
||||
placeholder="规格型号" value="${equipmentCard.equipmentmodelname}">
|
||||
<input type="hidden" id="equipmentmodel" name="equipmentmodel">
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<div class="input-group-addon"
|
||||
style="width: 100%;background-color: #269abc;cursor: pointer;font-size: 11px;color: white;height: 34px;border-radius: 3px;float: left;line-height: 2.5;text-align: center;padding: 0px !important;"
|
||||
onclick="selectEquipmentModel()">选择
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="input-group-addon"
|
||||
style="width: 6%;background-color: #269abc;cursor: pointer;font-size: 11px;color: white;height: 34px;border-radius: 3px;float: left;line-height: 2.5;text-align: center;margin-right: 10px;padding: 0px !important;"
|
||||
onclick="selectEquipmentModel()">选择
|
||||
</div>--%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装地点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="areaid" name="areaid"
|
||||
placeholder="安装地点"
|
||||
value="${equipmentCard.areaid}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">安装日期(领料时间)</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="installDate" name="installDate"
|
||||
style="width: 330px;" value="${equipmentCard.installDate.substring(0,10)}"
|
||||
placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">制造厂家</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentmanufacturer"
|
||||
name="equipmentmanufacturer" placeholder="制造厂家"
|
||||
value="${equipmentCard.equipmentmanufacturer}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">出厂编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="factoryNumber" name="factoryNumber"
|
||||
placeholder="出厂编号" value="${equipmentCard.factoryNumber}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="openDate" name="openDate"
|
||||
style="width: 330px;" value="${equipmentCard.openDate.substring(0,10)}"
|
||||
placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">出厂年月</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="productiondate"
|
||||
name="productiondate"
|
||||
style="width: 330px;"
|
||||
value="${equipmentCard.productiondate.substring(0,10)}"
|
||||
placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否强检</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="isCompulsoryInspection"
|
||||
name="isCompulsoryInspection" style="width: 370px;">
|
||||
<option value="${CompulsoryStatus_ON}">是</option>
|
||||
<option value="${CompulsoryStatus_OFF}" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label id="frequency-div" style="display: none;"
|
||||
class="col-sm-2 control-label">强检类型</label>
|
||||
<div id="frequency-div2" style="display: none;" class="col-sm-4">
|
||||
<select class="form-control select2" id="compulsoryInspectionType"
|
||||
name="compulsoryInspectionType" style="width: 370px;">
|
||||
<option value="${CompulsoryInspectionType_EQUIP}" selected="selected">特种设备
|
||||
</option>
|
||||
<option value="${CompulsoryInspectionType_APP}">仪器仪表</option>
|
||||
<option value="${CompulsoryInspectionType_CAR}">车辆</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="equipmentstatusName"
|
||||
name="equipmentstatusName"
|
||||
style="width: 370px;"></select>
|
||||
<input type="hidden" class="form-control" id="equipmentstatus"
|
||||
name="equipmentstatus"
|
||||
value="${equipmentCard.equipmentstatus}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">内部编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="inCode" name="inCode"
|
||||
placeholder="内部编号" value="${equipmentCard.inCode}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">主要技术参数</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="techParameters"
|
||||
name="techParameters"
|
||||
placeholder="主要技术参数">${equipmentCard.techParameters}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="assetTypeName" name="assetTypeName"
|
||||
onclick="selectAssetTypeClass()" placeholder="点击选择"
|
||||
value="${equipmentCard.assetClass.assetclassname}">
|
||||
<input type="hidden" class="form-control" id="assetType" name="assetType"
|
||||
value="${equipmentCard.assetType}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">资产编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="assetnumber" name="assetnumber"
|
||||
placeholder="资产编号" value="${equipmentCard.assetnumber}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">购置日期(采购年月)</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="buyTime" name="buyTime"
|
||||
style="width: 330px;"
|
||||
value="${equipmentCard.buyTime.substring(0,10)}"
|
||||
placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">采购价/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="purchaseValue" name="purchaseValue"
|
||||
placeholder="采购价" value="${equipmentCard.purchaseValue}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">入帐日期(入库时间)</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="inStockTime" name="inStockTime"
|
||||
style="width: 330px;" value="${equipmentCard.inStockTime}"
|
||||
placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">使用年限/年</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="serviceLife" name="serviceLife"
|
||||
placeholder="使用年限" value="${equipmentCard.serviceLife}" min="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">账面原值/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentvalue"
|
||||
name="equipmentvalue"
|
||||
placeholder="账面原值" value="${equipmentCard.equipmentvalue}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">账面净值/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipWorth" name="equipWorth"
|
||||
placeholder="账面净值" value="${equipmentCard.equipWorth}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧年限/年</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="depreciationLife" name="depreciationLife"
|
||||
placeholder="折旧年限" value="${equipmentCard.depreciationLife}" min="0" step="1">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">残值率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="residualValueRate" name="residualValueRate"
|
||||
placeholder="残值率" value="${equipmentCard.residualValueRate}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark"
|
||||
placeholder="备注...">${equipmentCard.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
209
WebRoot/jsp/equipment/equipmentCardCameraList.jsp
Normal file
209
WebRoot/jsp/equipment/equipmentCardCameraList.jsp
Normal file
@ -0,0 +1,209 @@
|
||||
<%@ 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"%>
|
||||
<!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" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js"
|
||||
charset="utf-8"></script>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
/**
|
||||
新增
|
||||
*/
|
||||
var addCameraFun = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardCamera/selectListForCamera.do', {eqid:'${param.eqid}'}, function(data) {
|
||||
$("#subCameraAddDiv").html(data);
|
||||
openModal('cameraSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deletesCameraFun = function() {
|
||||
var checkedItems = $("#cameratable").bootstrapTable('getSelections');
|
||||
//console.log('getSelections',checkedItems);
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','cameraAlertdiv');
|
||||
}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 + '/equipment/equipmentCardCamera/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#cameratable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#cameratable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function initFun(){
|
||||
$("#cameratable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentCardCamera/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
// search_name: $('#search_name').val(),
|
||||
eqid:'${param.eqid}'
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'camera.name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts='';
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardCamera/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="查看" onclick="viewVideoFun(\'' + row.camera.id + '\',\'' + row.camera.channel + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
onReorderRow: function (newData) {
|
||||
//这里的newData是整个表格数据,数组形式
|
||||
// console.log("data",newData); //调试用代码
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardCamera/dosort.do', {jsondata: JSON.stringify(newData)},//将整张表数据 不能分页
|
||||
function (data) {
|
||||
if (data == 1) {
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '数据错误', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
$("#cameratable").tableDnD();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
initFun();
|
||||
});
|
||||
|
||||
var viewVideoFun = function(id,channel){
|
||||
/*window.location.href = ext.contextPath + '/work/camera/showVideo.do?id='+id+"&channel="+channel;*/
|
||||
$.post(ext.contextPath + '/work/camera/showCameraVideo.do', {id:id,nowUrl:window.location.host} , function(data) {
|
||||
$("#viewVideoDiv").html(data);
|
||||
openModal('subCameraModal');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- Main content -->
|
||||
|
||||
<div id="cameraAlertdiv"></div>
|
||||
|
||||
<section class="content container-fluid">
|
||||
|
||||
<div >
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/equipmentCardCamera/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addCameraFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesCameraFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--startprint-->
|
||||
<div id="tableDiv">
|
||||
<table id="cameratable" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
104
WebRoot/jsp/equipment/equipmentCardCameraListForEqView.jsp
Normal file
104
WebRoot/jsp/equipment/equipmentCardCameraListForEqView.jsp
Normal file
@ -0,0 +1,104 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager" %>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
|
||||
var $table;
|
||||
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
cameraId: '${param.cameraId}',
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$table = $("#table_eqcamera").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentCardCamera/getCameraEqList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
// responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'eqid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
// {
|
||||
// field: 'equipmentClass.name', // 返回json数据中的name
|
||||
// title: '设备类型', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// },
|
||||
{
|
||||
field: 'equipmentCard.equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_eqcamera");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="eqCameraModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">相关设备</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<%-- <div class="form-group pull-right form-inline" >--%>
|
||||
<%-- <div class="input-group input-group-sm " style="width: 220px;margin-left:30px">--%>
|
||||
|
||||
<%-- <input type="text" id="search_name" name="search_name" class="form-control " placeholder="摄像头名称">--%>
|
||||
<%-- <div class="input-group-btn">--%>
|
||||
<%-- <button class="btn btn-default" onclick="dosearchCamera();"><i class="fa fa-search"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->--%>
|
||||
<%-- </div>--%>
|
||||
<div>
|
||||
<table id="table_eqcamera"></table>
|
||||
</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>
|
||||
1267
WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
1267
WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
File diff suppressed because it is too large
Load Diff
114
WebRoot/jsp/equipment/equipmentCardImport.jsp
Normal file
114
WebRoot/jsp/equipment/equipmentCardImport.jsp
Normal file
@ -0,0 +1,114 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '${param.companyId}', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/equipment/saveExcelData.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//打开模板下载页面
|
||||
function openExcelTemplate(){
|
||||
|
||||
var companyId = unitId;
|
||||
$.post(ext.contextPath + '/equipment/openExcelTemplate.do', {companyId:companyId} , function(data) {
|
||||
$("#subDiv2").html(data);
|
||||
openModal('subModal2');
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
//模板下载
|
||||
function downExcelTemplate(){
|
||||
window.open(ext.contextPath + "/equipment/downloadEquipmentExcelTemplate.do");
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入设备列表</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="openExcelTemplate()" id="btn_save">模板下载</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
127
WebRoot/jsp/equipment/equipmentCardLinksAdd.jsp
Normal file
127
WebRoot/jsp/equipment/equipmentCardLinksAdd.jsp
Normal file
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardLinks/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
linkName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '链接名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
linkUrl: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接口不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备等级</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*链接名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="linkName" name ="linkName" placeholder="名称" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">内网IP端口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkIpIntranet" name ="linkIpIntranet" placeholder="内网IP端口"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">外网IP端口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkIpExtranet" name ="linkIpExtranet" placeholder="外网IP端口"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkUrl" name ="linkUrl" placeholder="接口"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*链接类型</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="linkType" name ="linkType" style="width: 270px;">
|
||||
<option value= "external" selected = "selected">外部</option>
|
||||
<option value= "inside">内部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name ="active" style="width: 270px;">
|
||||
<option value= "1" selected = "selected">启用</option>
|
||||
<option value= "0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${equipmentCardLinks.morder}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
461
WebRoot/jsp/equipment/equipmentCardLinksEdit.jsp
Normal file
461
WebRoot/jsp/equipment/equipmentCardLinksEdit.jsp
Normal file
@ -0,0 +1,461 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardLinks/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//编辑链接内容
|
||||
var editParameterFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinksParameter/doedit.do', {id:id} , function(data) {
|
||||
$("#subParameterDiv").html(data);
|
||||
openModal('subParameterModal');
|
||||
});
|
||||
};
|
||||
function dosaveParameter() {
|
||||
$("#subParameterForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subParameterForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardLinksParameter/dosave.do", $("#subParameterForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_Parameter").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
//删除多条明细数据
|
||||
var deletesParameterFun = function(id) {
|
||||
var datas="";
|
||||
if(id!=null && id !=undefined && id!=''){
|
||||
datas=id;
|
||||
}else{
|
||||
var checkedItems = $("#table_Parameter").bootstrapTable('getSelections');
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}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 + '/equipment/equipmentCardLinksParameter/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Parameter").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function(){
|
||||
$("#active").select2({minimumResultsForSearch: 10}).val("${equipmentCardLinks.active}").trigger("change");
|
||||
$("#linkType").select2({minimumResultsForSearch: 10}).val("${equipmentCardLinks.linkType}").trigger("change");
|
||||
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
linkName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '链接名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
linkUrl: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '链接地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//输入框验证
|
||||
$("#subParameterForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
parameter: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
parameterType: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
var dynamic = [{ id: 'aaaa', text: '设备台账', disabled: true },{ id: 'equipmentname', text: '设备名称:equipmentname' },{ id: 'equipmentmodel', text: '设备型号:equipmentmodel' }
|
||||
,{ id: 'assetnumber', text: '资产编号:assetnumber' },{ id: 'equipmentManufacturer', text: '生产商:equipmentManufacturer' },{ id: 'leaveFactoryNumber', text: '出厂编号:leaveFactoryNumber' }];
|
||||
//销毁表格
|
||||
$('#table_Parameter').bootstrapTable('destroy');
|
||||
$("#table_Parameter").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentCardLinksParameter/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
linkId: '${equipmentCardLinks.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'parameter', // 返回json数据中的name
|
||||
title: '链接参数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'parameterValue', // 返回json数据中的name
|
||||
title: '参数固定值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'parameterType', // 返回json数据中的name
|
||||
title: '参数类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case 'dynamic' :
|
||||
return "动态";
|
||||
case 'fixed' :
|
||||
return "固定";
|
||||
default :
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dynamic', // 返回json数据中的name
|
||||
title: '动态参数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index){
|
||||
var res = value;
|
||||
for(var i=0;i<dynamic.length;i++){
|
||||
var ob = dynamic[i];
|
||||
if(ob.id==value){
|
||||
res = ob.text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 85, // 定义列的宽度,单位为像素px
|
||||
},
|
||||
{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 90, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.id!=null){
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardLinksParameter/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editParameterFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardLinksParameter/delete.do">';
|
||||
buts+='<a class="btn btn-default btn-sm" title="删除" onclick="deletesParameterFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></a';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardLinksParameter/new.do">';
|
||||
buts+= '<a class="btn btn-default btn-sm" title="添加" onclick="dosaveParameter()"><i class="fa fa-plus"></i><span class="hidden-md hidden-lg"> 添加</span></a>';
|
||||
buts+= '</security:authorize>';
|
||||
}
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
var newData = [{
|
||||
'parameter': '<input id="parameter" name="parameter" type="text" class="form-control" value="" />',
|
||||
'parameterValue': '<input id="parameterValue" name="parameterValue" type="text" class="form-control" value=""/>',
|
||||
'parameterType':'<input id="parameterType" name="parameterType" type="text" class="form-control" value=""/>',
|
||||
'dynamic': '<input id="dynamic" name="dynamic" type="text" class="form-control"/>',
|
||||
'morder': '<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序" >',
|
||||
'active': '<input id="parameter_active" name="active" type="text" class="form-control" value="" />',
|
||||
}];
|
||||
$('#table_Parameter').bootstrapTable('prepend', newData);
|
||||
$("#parameterType").empty();
|
||||
var parameterType = [{ id: 'fixed', text: '固定' },{ id: 'dynamic', text: '动态' }];
|
||||
var selelct_parameterType =$("#parameterType").select2({
|
||||
data: parameterType,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_parameterType.on('change', function (e) {
|
||||
if(e.target.value==parameterType[1].id){
|
||||
//动态
|
||||
$("#parameterValue").attr("readonly","readonly");
|
||||
//$("#dynamic").removeAttr("readonly");
|
||||
$("#dynamic").empty();
|
||||
var selelct_dynamic =$("#dynamic").select2({
|
||||
data: dynamic,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;}, // 函数用于呈现当前的选择
|
||||
disabled:false
|
||||
});
|
||||
}else{
|
||||
$("#parameterValue").removeAttr("readonly");
|
||||
//$("#dynamic").attr("readonly","readonly");
|
||||
$("#dynamic").empty();
|
||||
var selelct_dynamic =$("#dynamic").select2({
|
||||
data: dynamic,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;}, // 函数用于呈现当前的选择
|
||||
disabled:true
|
||||
});
|
||||
}
|
||||
})
|
||||
$("#parameter_active").empty();
|
||||
var parameter_active = [{ id: '1', text: '启用' },{ id: '0', text: '禁用' }];
|
||||
var selelct_parameter_active =$("#parameter_active").select2({
|
||||
data: parameter_active,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
$("#dynamic").empty();
|
||||
var selelct_dynamic =$("#dynamic").select2({
|
||||
data: dynamic,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;}, // 函数用于呈现当前的选择
|
||||
disabled:true
|
||||
});
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
//<select class="form-control select2" id="active" name ="active"><option value= "1" selected = "selected">启用</option><option value= "0">禁用</option></select>
|
||||
//<select class="form-control select2" id="parameterType" name ="parameterType"><option value= "fixed" selected = "selected">固定值</option><option value= "dynamic">动态值</option></select>
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">编辑链接</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value= "${equipmentCardLinks.id}">
|
||||
<input type="hidden" name="equipmentId" value= "${equipmentId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*链接名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="linkName" name ="linkName" placeholder="名称" value="${equipmentCardLinks.linkName}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">内网IP端口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkIpIntranet" name ="linkIpIntranet" placeholder="内网IP端口">${equipmentCardLinks.linkIpIntranet}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">外网IP端口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkIpExtranet" name ="linkIpExtranet" placeholder="外网IP端口">${equipmentCardLinks.linkIpExtranet}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接口</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="linkUrl" name ="linkUrl" placeholder="接口">${equipmentCardLinks.linkUrl}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*链接类型</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="linkType" name ="linkType" style="width: 270px;">
|
||||
<option value= "external" selected = "selected">外部</option>
|
||||
<option value= "inside">内部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name ="active" style="width: 270px;">
|
||||
<option value= "1" selected = "selected">启用</option>
|
||||
<option value= "0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${equipmentCardLinks.morder}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="备注...">${equipmentCardLinks.remarks}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="subParameterForm">
|
||||
<input type="hidden" name="linkId" value= "${equipmentCardLinks.id}">
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">链接参数</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="deletesParameterFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Parameter"></table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
273
WebRoot/jsp/equipment/equipmentCardLinksList.jsp
Normal file
273
WebRoot/jsp/equipment/equipmentCardLinksList.jsp
Normal file
@ -0,0 +1,273 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增链接内容
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑链接内容
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doedit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看链接内容
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条链接内容数据
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/dodeletes.do', {ids : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条链接内容数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}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 + '/equipment/equipmentCardLinks/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function() {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentCardLinks/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'linkName', // 返回json数据中的name
|
||||
title: '链接名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'linkIpIntranet', // 返回json数据中的name
|
||||
title: '内网IP端口', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'linkIpExtranet', // 返回json数据中的name
|
||||
title: '外网IP端口', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'linkUrl', // 返回json数据中的name
|
||||
title: '链接地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'linkType', // 返回json数据中的name
|
||||
title: '链接类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case 'external' :
|
||||
return "外部";
|
||||
case 'inside' :
|
||||
return "内部";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index){
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'remarks', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardLinks/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="equipment/equipmentCardLinks/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subParameterDiv"></div>
|
||||
<div >
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl=" equipment/equipmentCardLinks/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<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="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
391
WebRoot/jsp/equipment/equipmentCardLinksListEqu.jsp
Normal file
391
WebRoot/jsp/equipment/equipmentCardLinksListEqu.jsp
Normal file
@ -0,0 +1,391 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增链接内容
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑链接内容
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doedit4Equ.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看链接内容
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条链接内容数据
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardLinks/dodeletes.do', {ids : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条链接内容数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}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 + '/equipment/equipmentCardLinks/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载工艺段
|
||||
*/
|
||||
var proTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3, showTags: true});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList1(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载设备类型
|
||||
*/
|
||||
var equTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
|
||||
// $.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList2(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
var showList1 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'p') {//点击工艺段
|
||||
$('#processSectionId').val(id);
|
||||
tableFun(id,'');
|
||||
} else {//点击其他 如厂
|
||||
$('#processSectionId').val('');
|
||||
tableFun('','');
|
||||
}
|
||||
};
|
||||
|
||||
var showList2 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'e') {//点击设备类型
|
||||
$('#equipmentClassId').val(id);
|
||||
tableFun('',id);
|
||||
} else {//点击其他 如厂
|
||||
$('#equipmentClassId').val('');
|
||||
tableFun('','');
|
||||
}
|
||||
};
|
||||
var tableFun = function (processSectionId,equipmentClassId) {
|
||||
$("#table").bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentCardLinks/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: unitId,
|
||||
processSectionId: processSectionId,
|
||||
equipmentClassId: equipmentClassId,
|
||||
search_name: $('#search_name').val(),
|
||||
linksStatus: $('#linksStatus').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
width: '40px', // 定义列的宽度,单位为像素px
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
/* formatter: function (value, row, index) {
|
||||
return '<span onclick="viewFun(\'' + row.id + '\');" style="color:#004B97;cursor:pointer;">' + row.equipmentname + '</span>';
|
||||
} */
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '制造厂家', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span>' + row.equipmentmanufacturer + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
}, {
|
||||
field: 'equipmentStatusManagement.name', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%'
|
||||
}, {
|
||||
field: 'equipmentStatusMemo', // 返回json数据中的name
|
||||
title: '配置情况', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="配置" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
};
|
||||
//点击工艺段(按钮)
|
||||
function proFun() {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
proTreeView();
|
||||
// $('#proButton').css('background-color', '#e8f5fe');
|
||||
// $('#equButton').css('background-color', '#FFFFFF');
|
||||
}
|
||||
|
||||
//点击设备类型(按钮)
|
||||
function equFun() {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
equTreeView();
|
||||
// $('#proButton').css('background-color', '#FFFFFF');
|
||||
// $('#equButton').css('background-color', '#e8f5fe');
|
||||
}
|
||||
$(function() {
|
||||
proTreeView();
|
||||
//默认加载右边 Table
|
||||
showList1(unitId, 'B', unitId)
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subParameterDiv"></div>
|
||||
<div class="row">
|
||||
<!--左边树形框-->
|
||||
<div class="col-md-2" id="leftTools" style="left:0px;top:0px;border-radius: 12px;">
|
||||
<div class="box box-solid" id="leftToolsLvl2">
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<button type="button" id="button1" class="btn btn-primary btn-sm" onclick="proFun();">
|
||||
工艺段
|
||||
</button>
|
||||
<button type="button" id="button2" class="btn btn-default btn-sm" onclick="equFun();">
|
||||
设备类型
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:750px;overflow: scroll;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--右边table style="margin-left:-20px;"-->
|
||||
<div class="col-md-10" id="rightTools">
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm">
|
||||
<select class="form-control select2 " id="linksStatus" name ="linksStatus" style="width: 160px;" onchange="dosearch();">
|
||||
<option value="" selected>所有配置</option>
|
||||
<option value="已配置" >已配置</option>
|
||||
<option value="未配置" >未配置</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;float: left;">
|
||||
<input type="text" id="search_name" name="search_name"
|
||||
class="form-control pull-right" placeholder="设备编号/设备名称/规格型号/制造厂家">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
202
WebRoot/jsp/equipment/equipmentCardLinksParameterEdit.jsp
Normal file
202
WebRoot/jsp/equipment/equipmentCardLinksParameterEdit.jsp
Normal file
@ -0,0 +1,202 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doParameterUpdate() {
|
||||
$("#editEquipmentCardLinksParameterForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editEquipmentCardLinksParameterForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardLinksParameter/doupdate.do", $("#editEquipmentCardLinksParameterForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subParameterModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#editEquipmentCardLinksParameterForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
parameter: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
parameterType: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
var dynamic = [{ id: 'aaaa', text: '设备台账', disabled: true },{ id: 'equipmentname', text: '设备名称:equipmentname' },{ id: 'equipmentmodel', text: '设备型号:equipmentmodel' }
|
||||
,{ id: 'assetnumber', text: '资产编号:assetnumber' },{ id: 'equipmentManufacturer', text: '生产商:equipmentManufacturer' },{ id: 'leaveFactoryNumber', text: '出厂编号:leaveFactoryNumber' }];
|
||||
$("#parameterType_edit").empty();
|
||||
var parameterType = [{ id: 'fixed', text: '固定' },{ id: 'dynamic', text: '动态' }];
|
||||
var selelct_parameterType =$("#parameterType_edit").select2({
|
||||
width: '270px',
|
||||
data: parameterType,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_parameterType.on('change', function (e) {
|
||||
if(e.target.value==parameterType[1].id){
|
||||
//动态
|
||||
$("#parameterValue_edit").attr("readonly","readonly");
|
||||
//$("#dynamic").removeAttr("readonly");
|
||||
$("#dynamic_edit").empty();
|
||||
var selelct_dynamic =$("#dynamic_edit").select2({
|
||||
width: '270px',
|
||||
data: dynamic,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;}, // 函数用于呈现当前的选择
|
||||
disabled:false
|
||||
});
|
||||
selelct_dynamic.val("${equipmentCardLinksParameter.dynamic}").trigger("change");
|
||||
}else{
|
||||
$("#parameterValue_edit").removeAttr("readonly");
|
||||
//$("#dynamic").attr("readonly","readonly");
|
||||
$("#dynamic_edit").empty();
|
||||
var selelct_dynamic =$("#dynamic_edit").select2({
|
||||
width: '270px',
|
||||
data: dynamic,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;}, // 函数用于呈现当前的选择
|
||||
disabled:true
|
||||
});
|
||||
selelct_dynamic.val("${equipmentCardLinksParameter.dynamic}").trigger("change");
|
||||
}
|
||||
})
|
||||
selelct_parameterType.val("${equipmentCardLinksParameter.parameterType}").trigger("change");
|
||||
$("#parameter_active_edit").empty();
|
||||
var parameter_active = [{ id: '1', text: '启用' },{ id: '0', text: '禁用' }];
|
||||
var selelct_parameter_active =$("#parameter_active_edit").select2({
|
||||
width: '270px',
|
||||
data: parameter_active,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_parameter_active.val("${equipmentCardLinksParameter.active}").trigger("change");
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subParameterModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备等级</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为editEquipmentCardLinksParameterForm -->
|
||||
<form class="form-horizontal" id="editEquipmentCardLinksParameterForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value= "${equipmentCardLinksParameter.id}">
|
||||
<input type="hidden" name="linkId" value= "${equipmentCardLinksParameter.linkId}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*链接参数</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="parameter_edit" name ="parameter" placeholder="参数" value="${equipmentCardLinksParameter.parameter}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参数固定值</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="parameterValue_edit" name ="parameterValue" placeholder="固定值" value="${equipmentCardLinksParameter.parameterValue}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参数类型</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="parameterType_edit" name ="parameterType" placeholder="类型" value="${equipmentCardLinksParameter.parameterType}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">动态参数</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="dynamic_edit" name ="dynamic" placeholder="动态参数" value="${equipmentCardLinksParameter.dynamic}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="parameter_active_edit" name ="active" style="width: 270px;">
|
||||
<option value= "1" selected = "selected">启用</option>
|
||||
<option value= "0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="morder_edit" name ="morder" placeholder="顺序" value="${equipmentCardLinks.morder}" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks_edit" name ="remarks" placeholder="备注...">${equipmentCardLinksParameter.remarks}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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="doParameterUpdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
356
WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
356
WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
@ -0,0 +1,356 @@
|
||||
<%@ 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.equipment.EquipmentCard" %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引入list - js-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentList.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${param.unitId}',
|
||||
processSectionId: '${param.processSectionId}',
|
||||
equipmentClassPid: '${param.equipmentClassPid}',
|
||||
equipmentClassId: '${param.equipmentClassId}',
|
||||
search_name: $('#equipment_search_name').val(),
|
||||
equipmentLevel: $('#equipmentLevelSelect').val(),
|
||||
equipmentBelong: $('#equipmentBelongSelect').val(),
|
||||
equipmentStatus: $("#equipmentstatusSelect").val(),
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
width: '40px', // 定义列的宽度,单位为像素px
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '12%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span onclick="viewFun(\'' + row.id + '\');" style="color:#004B97;cursor:pointer;">' + row.equipmentname + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '制造厂家', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span>' + row.equipmentmanufacturer + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
},
|
||||
{
|
||||
field: 'assetnumber', // 返回json数据中的name
|
||||
title: '资产编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
},{
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
}, {
|
||||
field: 'equipmentStatusManagement.name', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/location.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="定位" onclick="locationFun(\'' + row.id + '\')"><i class="fa fa-map-marker"></i><span class="hidden-md hidden-lg"> 定位</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/del.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
//获取工艺段
|
||||
// getProcessSection();
|
||||
//设备所属--常排项目用
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelong4Select.do", {companyId:unitId}, function(data) {
|
||||
$("#equipmentBelongSelect").empty();
|
||||
var selelct_ =$("#equipmentBelongSelect").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//abc分类
|
||||
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevel4Select.do", {companyId:unitId}, function(data) {
|
||||
$("#equipmentLevelSelect").empty();
|
||||
var selelct_ =$("#equipmentLevelSelect").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//状态
|
||||
$.post(ext.contextPath + "/equipment/equipmentStatusManagement/getEquipmentstatus4Select.do", {companyId:unitId}, function(data) {
|
||||
$("#equipmentstatusSelect").empty();
|
||||
var selelct_ =$("#equipmentstatusSelect").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content container-fluid">
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv2"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentModelSubDiv"></div>
|
||||
<div id="assetTypeSubDiv"></div>
|
||||
<%--测量点曲线--%>
|
||||
<div id="subDivHis"></div>
|
||||
<div id="viewVideoDiv"></div>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--设备资料--%>
|
||||
<div id="subDiv_Doc"></div>
|
||||
|
||||
<%--摄像头弹窗--%>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--备注新增弹窗--%>
|
||||
<div id="subRemarkAddDiv"></div>
|
||||
<%--备注修改弹窗--%>
|
||||
<div id="subRemarkEditDiv"></div>
|
||||
<%--备注查看弹窗--%>
|
||||
<div id="subRemarkViewDiv"></div>
|
||||
<%--测量点弹窗--%>
|
||||
<div id="subDiv_PatroPoint"></div>
|
||||
<%--保养配置新增弹窗--%>
|
||||
<div id="subMainConfigAddDiv"></div>
|
||||
<%--保养配置修改弹窗--%>
|
||||
<div id="subMainConfigEditDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<security:authorize buttonUrl="equipment/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<security:authorize buttonUrl="equipment/del.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<security:authorize buttonUrl="equipment/import.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<security:authorize buttonUrl="equipment/download.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
|
||||
<div class="form-group pull-right form-inline">
|
||||
|
||||
<!--设备所属-常排项目用-->
|
||||
<div class="input-group input-group-sm" style="padding-right: 10px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">设备所属:</label>
|
||||
<select class="form-control select2 " id="equipmentBelongSelect" name ="equipmentBelongSelect" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="padding-right: 10px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">ABC分类:</label>
|
||||
<select class="form-control select2 " id="equipmentLevelSelect" name ="equipmentLevelSelect" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="padding-right: 10px;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">状态:</label>
|
||||
<select class="form-control select2 " id="equipmentstatusSelect" name ="equipmentstatusSelect" style="width: 100px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="equipment_search_name" name="equipment_search_name"
|
||||
class="form-control pull-right" placeholder="设备编号/设备名称/规格型号/制造厂家">
|
||||
<input type="text" class="form-control" style="display:none">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<table id="table"></table>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
290
WebRoot/jsp/equipment/equipmentCardList1.jsp
Normal file
290
WebRoot/jsp/equipment/equipmentCardList1.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%request.setAttribute("Status_Fault",EquipmentCard.Status_Fault);%>
|
||||
<%request.setAttribute("Status_OFF",EquipmentCard.Status_OFF);%>
|
||||
<%request.setAttribute("Status_ON",EquipmentCard.Status_ON);%>
|
||||
<%request.setAttribute("Status_StandBy",EquipmentCard.Status_StandBy);%>
|
||||
<%request.setAttribute("Status_UnMatch",EquipmentCard.Status_UnMatch);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备信息',
|
||||
url : ext.contextPath + '/equipment/addEquipmentCard.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备卡片信息',
|
||||
url : ext.contextPath + '/equipment/viewEquipmentCard.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备信息',
|
||||
url : ext.contextPath + '/equipment/editEquipmentCard.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doimportEquipmentCard.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentCard.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentCards.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '150', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备状态', field : 'equipmentstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch(row.equipmentstatus){
|
||||
case '${Status_Fault}':
|
||||
return '故障';
|
||||
break;
|
||||
case '${Status_OFF}':
|
||||
return '停机';
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
return '运行中';
|
||||
break;
|
||||
case '${Status_StandBy}':
|
||||
return '待机';
|
||||
break;
|
||||
case '${Status_UnMatch}':
|
||||
return '未匹配测量点';
|
||||
break;
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该类型已禁用' /> ";
|
||||
}else{
|
||||
|
||||
return value.name;
|
||||
}}}
|
||||
},
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该位置已禁用' /> ";
|
||||
}else{
|
||||
return value.name;
|
||||
}}
|
||||
}},
|
||||
{width : '70', title : '能否被使用', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{width : '120', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备调度" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
var arrangework = function(id){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:1000,
|
||||
height:500,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentCard.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="importFun();">导入</a>
|
||||
|
||||
</td>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
429
WebRoot/jsp/equipment/equipmentCardList4Choice.jsp
Normal file
429
WebRoot/jsp/equipment/equipmentCardList4Choice.jsp
Normal file
@ -0,0 +1,429 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<style type="text/css">
|
||||
.box-header {
|
||||
padding: 10px 10px 10px 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
|
||||
var doSearchEquipments = function () {
|
||||
$("#table_equipment").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function doSelectEquipment() {
|
||||
var checkedItems = $("#table_equipment").bootstrapTable('getSelections');
|
||||
var datas_id = "";
|
||||
var datas_name = "";
|
||||
var datas_cardId = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas_id += item.id + ",";
|
||||
datas_name += item.equipmentname + ",";
|
||||
datas_cardId += item.equipmentcardid + ",";
|
||||
});
|
||||
if (datas_id != null && datas_id != '') {
|
||||
datas_id = datas_id.substr(0, datas_id.length - 1);
|
||||
datas_name = datas_name.substr(0, datas_name.length - 1);
|
||||
datas_cardId = datas_cardId.substr(0, datas_name.length - 1);
|
||||
}
|
||||
|
||||
//用于分页多选设备
|
||||
datas_id = selectionIds + '';
|
||||
|
||||
//调用上一界面方法完成选择
|
||||
doFinishSelectEquipment(datas_id, datas_name, datas_cardId);
|
||||
//在上个页面确定是否关闭 有些为单选有些多选
|
||||
// closeModal("equipment4SelectModal");
|
||||
};
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${goodsIds}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${goodsIds}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
console.log("selectionIds is ", selectionIds)
|
||||
}
|
||||
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${goodsIds}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${param.unitId}',
|
||||
processSectionId: $('#process_section_id').val(),
|
||||
equipmentClassId: $('#equipment_class_id').val(),
|
||||
search_name: $('#search_name').val(),
|
||||
timeSelect: $('#timeSelect').val()
|
||||
};
|
||||
if ('${ids}') {
|
||||
temp.ids = '${ids}'
|
||||
}
|
||||
/* var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
} */
|
||||
return temp;
|
||||
}
|
||||
|
||||
//点击工艺段(按钮)
|
||||
function proFun() {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
proTreeView();
|
||||
}
|
||||
|
||||
//点击设备类型(按钮)
|
||||
function equFun() {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
equTreeView();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载工艺段
|
||||
*/
|
||||
var proTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
|
||||
unitId: '${param.unitId}'
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData});
|
||||
//默认选中对应的树节点
|
||||
var node = $('#tree').treeview('findNodes', [$('#process_section_id').val(), 'id']);
|
||||
$('#tree').treeview('selectNode', [node[0], {silent: true}]);
|
||||
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
$('#process_section_id').val(treeList.id);
|
||||
doSearchEquipments();
|
||||
});
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载设备类型
|
||||
*/
|
||||
var equTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
|
||||
unitId: '${param.unitId}'
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
$('#equipment_class_id').val(treeList.id);
|
||||
doSearchEquipments();
|
||||
});
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
var doResetSelect = function () {
|
||||
// closeModal("equipment4SelectModal");
|
||||
// doEditEquipment();
|
||||
selectionIds = [];
|
||||
$('#equipment_class_id').val('');
|
||||
$('#process_section_id').val('');
|
||||
|
||||
$("#search_name").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
console.log(133333333333)
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEquipments();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
initialSelectionIds();
|
||||
|
||||
$('#table_equipment').bootstrapTable('destroy');
|
||||
loadTable();
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
proFun();
|
||||
|
||||
}
|
||||
|
||||
var loadTable = function () {
|
||||
$table = $("#table_equipment").bootstrapTable({
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 200, 500], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParams,
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
width: '40px',
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true// 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipment");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#search_name").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEquipments();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
initialSelectionIds();
|
||||
|
||||
loadTable();
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
proFun();
|
||||
|
||||
});
|
||||
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union": union, "difference": difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
var timeSelect = $("#timeSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '全部',
|
||||
}).val('').trigger("change");
|
||||
timeSelect.on("change", function (e) {
|
||||
|
||||
});
|
||||
|
||||
var statusSelect = $("#statusSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '全部',
|
||||
}).val('').trigger("change");
|
||||
statusSelect.on("change", function (e) {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<input type="hidden" id="equipment_class_id" name="equipment_class_id" value="">
|
||||
<input type="hidden" id="process_section_id" name="process_section_id"
|
||||
value="${param.processSectionId}">
|
||||
<div class="box box-solid" id="leftToolsLvl2">
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<button type="button" id="button1" class="btn btn-primary btn-sm"
|
||||
onclick="proFun();">
|
||||
工艺段
|
||||
</button>
|
||||
<button type="button" id="button2" class="btn btn-default btn-sm"
|
||||
onclick="equFun();">
|
||||
设备类型
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-8">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;"></div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
|
||||
<%--只有保养模块才显示--%>
|
||||
<c:if test="${choiceType == '1'}">
|
||||
<div class="form-group">
|
||||
<label class="form-label">近期需保养设备:</label>
|
||||
<select class="form-control select2 " id="timeSelect" name="timeSelect"
|
||||
style="width: 120px;">
|
||||
<option value="0">全部</option>
|
||||
<option value="1">1个月</option>
|
||||
<option value="3">3个月</option>
|
||||
<option value="6">6个月</option>
|
||||
<option value="12">12个月</option>
|
||||
</select>
|
||||
</div>
|
||||
<%--<div class="form-group">
|
||||
<label class="form-label">保养状态:</label>
|
||||
<select class="form-control select2 " id="statusSelect" name="statusSelect"
|
||||
style="width: 120px;">
|
||||
<option value="0">全部</option>
|
||||
<option value="1">已保养</option>
|
||||
<option value="3">未保养</option>
|
||||
</select>
|
||||
</div>--%>
|
||||
</c:if>
|
||||
|
||||
<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="设备名称" style="height:34px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doSearchEquipments();" style="height:34px;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<table id="table_equipment" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</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="doResetSelect()">重置筛选</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelectEquipment()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
167
WebRoot/jsp/equipment/equipmentCardList4Web.jsp
Normal file
167
WebRoot/jsp/equipment/equipmentCardList4Web.jsp
Normal file
@ -0,0 +1,167 @@
|
||||
<%@ 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.equipment.EquipmentCard" %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引入list - js-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentList.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
/*element.style {*/
|
||||
/* left: 0px;*/
|
||||
/* top: 50px;*/
|
||||
/*}*/
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${param.unitId}',
|
||||
processSectionId: '${param.processSectionId}',
|
||||
equipmentClassId: '${param.equipmentClassId}',
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: false, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%'
|
||||
// formatter: function (value, row, index) {
|
||||
// return '<span onclick="viewFun(\'' + row.id + '\');" style="color:#004B97;cursor:pointer;">' + row.equipmentname + '</span>';
|
||||
// }
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '120px', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-location-arrow"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
//获取工艺段
|
||||
// getProcessSection();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper" style="background-color: #15305F;padding-top: 50px;">
|
||||
|
||||
<table id="table"></table>
|
||||
|
||||
<section class="content container-fluid">
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentModelSubDiv"></div>
|
||||
<div id="assetTypeSubDiv"></div>
|
||||
|
||||
<%--<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm" style="width: 250px;float: left;">
|
||||
<input type="text" id="search_name" name="search_name"
|
||||
class="form-control pull-right" placeholder="设备编号/设备名称/规格型号/制造厂家">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>--%>
|
||||
|
||||
<%-- <table id="table"></table>--%>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
343
WebRoot/jsp/equipment/equipmentCardListForAbnormitySelects.jsp
Normal file
343
WebRoot/jsp/equipment/equipmentCardListForAbnormitySelects.jsp
Normal file
@ -0,0 +1,343 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function () {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function doSelectEqu(dialog, grid) {
|
||||
var datas = "";
|
||||
datas_name = "";
|
||||
$.each(selectionIds, function (index, item) {
|
||||
// if (datas != "") {
|
||||
// datas += ",";
|
||||
// }
|
||||
// datas += item;
|
||||
datas = item;
|
||||
});
|
||||
if (datas != "") {
|
||||
$.post(ext.contextPath + '/equipment/getList.do', {
|
||||
companyId: '${param.companyId}',
|
||||
checkedIds: datas,
|
||||
page: 1,
|
||||
rows: 50
|
||||
}, function (resp) {
|
||||
console.info(resp)
|
||||
$.each(resp.rows, function (index, item) {
|
||||
if (datas_name != "") {
|
||||
datas_name += ",";
|
||||
}
|
||||
datas_name += item.equipmentname;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}').val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal");
|
||||
jobNameFuction();
|
||||
}, 'json');
|
||||
} else {
|
||||
$('#${param.formId} #${param.hiddenId}').val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal");
|
||||
jobNameFuction();
|
||||
}
|
||||
};
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${equipments}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${equipments}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${equipments}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_equName').val(),
|
||||
unitId: '${param.companyId}',
|
||||
processSectionId: '${param.processSectionId}',
|
||||
equipmentId: ''
|
||||
};
|
||||
var status = $('#switchBtn').bootstrapSwitch('state')
|
||||
if (status) {
|
||||
temp.checkedIds = getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
var companyId = '${param.companyId}';
|
||||
$(function () {
|
||||
$("#searchEquForm").attr("onsubmit", "return false;");
|
||||
$("#searchEquForm").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEqu();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
selelct_.val("").trigger("change");
|
||||
/* selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
}); */
|
||||
}, 'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table = $("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
singleSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler: responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
// checkbox: true, // 显示一个勾选框
|
||||
// formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
// if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
// return {
|
||||
// checked: true // 存在则选中
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
radio: true
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%'
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '40%'
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%'
|
||||
}
|
||||
/*{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},*/
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union": union, "difference": difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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 " style="padding:0;" id="searchEquForm">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;"></select>
|
||||
</div> -->
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_equName" name="search_equName"
|
||||
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-6 button-group" style="padding: 0;">
|
||||
<button type="button" class="btn btn-default btn-sm pull-right"
|
||||
onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
287
WebRoot/jsp/equipment/equipmentCardListForAttachedSelects.jsp
Normal file
287
WebRoot/jsp/equipment/equipmentCardListForAttachedSelects.jsp
Normal file
@ -0,0 +1,287 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_attEqu").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/saveAttachedEquipment.do', {equipmentId:'${param.equipmentId}',attachedIds : datas}, function(resp) {
|
||||
if (resp.res > 0){
|
||||
closeModal("attached4SelectModal")
|
||||
$("#table_attached").bootstrapTable('refresh');
|
||||
}else if(resp.res == 0){
|
||||
showAlert('d','保存失败','alertAttachedDiv');
|
||||
}else{
|
||||
showAlert('d',resp.res,'alertAttachedDiv');
|
||||
}
|
||||
|
||||
},'json');
|
||||
}else{
|
||||
closeModal("attached4SelectModal")
|
||||
}
|
||||
};
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipments}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipments}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipments}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: '${param.companyId}',
|
||||
pSectionId: $("#pSection_attached").val(),
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
var companyId= '${param.companyId}';
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct_ =$("#pSection_attached").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
selelct_.val("").trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
doSearchEqu();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_attEqu").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_attEqu");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="attached4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertAttachedDiv"></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 " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="pSection_attached" name ="pSection_attached" style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name" name="search_name" 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-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_attEqu" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
290
WebRoot/jsp/equipment/equipmentCardListForEvaluateSelects.jsp
Normal file
290
WebRoot/jsp/equipment/equipmentCardListForEvaluateSelects.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/getList.do', {companyId:'${param.companyId}',checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
//console.info(resp)
|
||||
/* $.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.equipmentname;
|
||||
}); */
|
||||
finishSelectFun(resp.rows);
|
||||
closeModal("equipment4SelectModal")
|
||||
},'json');
|
||||
}else{
|
||||
closeModal("equipment4SelectModal")
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipments}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipments}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipments}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: '${param.companyId}',
|
||||
pSectionId: $("#processSection").val(),
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
var companyId= '${param.companyId}';
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
selelct_.val("").trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
doSearchEqu();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentmodel', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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 " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name" name="search_name" 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-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
367
WebRoot/jsp/equipment/equipmentCardListForGoodsSelects.jsp
Normal file
367
WebRoot/jsp/equipment/equipmentCardListForGoodsSelects.jsp
Normal file
@ -0,0 +1,367 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/getList.do', {companyId:companyId,checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
//console.info(resp)
|
||||
$.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.equipmentname;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal")
|
||||
},'json');
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal")
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipments}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipments}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipments}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#searchEqu_name').val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
//初始化工艺段选择框
|
||||
var refreshSelect = function() {
|
||||
$("#processSection").select2({
|
||||
data: null,
|
||||
placeholder:'请先选择厂区',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
};
|
||||
var companyId= "";
|
||||
$(function() {
|
||||
$("#searchEqu_name").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEqu();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
//选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.on("change",function(e){
|
||||
doSearchEqu();
|
||||
});
|
||||
},'json');
|
||||
doSearchEqu();
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect();
|
||||
var selelct =$("#bizid").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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
doSearchEqu();
|
||||
});
|
||||
},'json');
|
||||
doSearchEqu();
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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 " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="bizid" name ="bizid" style="width: 170px;">
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid">
|
||||
</div>
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="searchEqu_name" name="searchEqu_name" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
<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-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
221
WebRoot/jsp/equipment/equipmentCardListForMpointSelect.jsp
Normal file
221
WebRoot/jsp/equipment/equipmentCardListForMpointSelect.jsp
Normal file
@ -0,0 +1,221 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
function doselect() {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
console.info(checkedItem)
|
||||
$('#equipmentid' ).val(checkedItem.id);
|
||||
$('#equipmentname' ).val(checkedItem.equipmentname);
|
||||
//$('#equipname').val(checkedItem.equipmentname);
|
||||
closeModal("emSubModal");
|
||||
}else{
|
||||
showAlert('d','尚未选择设备!','mainAlertdiv');
|
||||
}
|
||||
};
|
||||
var $table;
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${param.equipmentId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var dosearchTable_equ = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = '${param.companyId}';
|
||||
$(function() {
|
||||
$("#processSection1").empty();
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection1").empty();
|
||||
var selelct_ =$("#processSection1").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearchTable_equ();
|
||||
});
|
||||
},'json');
|
||||
|
||||
$table = $("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name_equip').val(),
|
||||
companyId: companyId,
|
||||
unitId: companyId,
|
||||
pSectionId: $("#processSection1").val(),
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},/*{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '统一编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},*//* {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '厂内编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
// ,{
|
||||
// field: 'equipmentClass.name', // 返回json数据中的name
|
||||
// title: '设备类型', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// },{
|
||||
// field: 'equipmentmodel', // 返回json数据中的name
|
||||
// title: '设备型号', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// },{
|
||||
// field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
// title: '设备级别', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
// },{
|
||||
// field: 'equipmentstatus', // 返回json数据中的name
|
||||
// title: '状态', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// switch (value){
|
||||
// case '0' :
|
||||
// return "禁用";
|
||||
// case '1' :
|
||||
// return "启用";
|
||||
// default :
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
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_equ .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="emSubModal" >
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group ">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection1" name ="processSection1" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm pull-left" style="width: 220px;margin-left:10px">
|
||||
<input type="text" id="search_name_equip" name="search_name_equip" class="form-control pull-right" placeholder="设备名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTable_equ();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_equ"></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>
|
||||
@ -0,0 +1,89 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("PatrolPlan_Weekly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Weekly); %>
|
||||
<% request.setAttribute("PatrolPlan_Daily", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Daily); %>
|
||||
<% request.setAttribute("PatrolPlan_Monthly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Monthly); %>
|
||||
<% request.setAttribute("PatrolType_Equipment", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolType_Equipment); %>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//获取巡检内容树
|
||||
$.post(ext.contextPath + "/equipment/getEquipment4Tree.do",{unitId:unitId, type:"${PatrolType_Equipment}"},function(data){
|
||||
var obj = eval('(' + data + ')');
|
||||
$('#tree').treeview({
|
||||
showCheckbox: true,
|
||||
data: obj.result,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
onRendered: function(event, nodes) {
|
||||
setTimeout("selectNodeLeft();","10");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//左边巡检内容的 回显函数
|
||||
function selectNodeLeft(){
|
||||
var equipmentIds="${equipmentIds}";
|
||||
var equipmentIdsArr = equipmentIds.split(",");
|
||||
// alert("666"+equipmentIdsArr);
|
||||
for(i = 0, len = equipmentIdsArr.length; i < len; i++) {
|
||||
var node =$('#tree').treeview('findNodes', [equipmentIdsArr[i], 'id']);
|
||||
for(var k = 0; k < node.length; k++) {
|
||||
if(node[k].id == equipmentIdsArr[i]){
|
||||
$('#tree').treeview('toggleNodeChecked', [ node[k], { silent: true } ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function doupdateforconfigure(){
|
||||
var checkedtree1 = $('#tree').treeview('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedtree1,function(index,item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//调用上一界面方法完成选择
|
||||
doFinishSelectEquipment(datas);
|
||||
|
||||
closeModal('equipment4SelectModal');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
<!-- <form class="form-horizontal" id="treeStr" enctype="multipart/form-data">
|
||||
<input name="jsonStr" id="jsonStr" type="hidden" value="" />
|
||||
</form> -->
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">关联设备选择</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div id="tree"></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="doupdateforconfigure()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
239
WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
239
WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
@ -0,0 +1,239 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
function doselect() {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
// console.info(checkedItem)
|
||||
$('#equipid' ).val(checkedItem.id);
|
||||
$('#equipmentIds' ).val(checkedItem.id);
|
||||
$('#equipname').val(checkedItem.equipmentname);
|
||||
$('#equipmentNumber').val(checkedItem.equipmentcardid);
|
||||
$('#equipmentmodelname').val(checkedItem.equipmentmodelname);
|
||||
$('#processSectionId' ).val(checkedItem.processsectionid);
|
||||
if(checkedItem.processSection != null && checkedItem.processSection!=""){
|
||||
$('#processectionname').val(checkedItem.processSection.name);
|
||||
}else{
|
||||
$('#processectionname').val("");
|
||||
}
|
||||
closeModal("emSubModal");
|
||||
var isone = $('#isone').val();
|
||||
if(isone=='1'){
|
||||
isOneDevice();
|
||||
}
|
||||
}else{
|
||||
showAlert('d','尚未选择设备台账!','alertDiv_MaintainPlanSelect');
|
||||
}
|
||||
};
|
||||
var $table;
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${equipmentId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var dosearchTable_equ = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
console.info($('#searchEqu_name').val())
|
||||
};
|
||||
|
||||
var companyId = '${companyId}';
|
||||
$(function() {
|
||||
$("#searchEqu_name").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
dosearchTable_equ();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$("#processSection1").empty();
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection1").empty();
|
||||
var selelct_ =$("#processSection1").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearchTable_equ();
|
||||
});
|
||||
},'json');
|
||||
|
||||
$table = $("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName : $('#searchEqu_name').val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection1").val(),
|
||||
checkedIds:'${param.ids}'
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}/* ,{
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
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_equ .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="emSubModal" >
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="isone" name="isone" value="${isone}">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group ">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection1" name ="processSection1" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm pull-left" style="width: 220px;margin-left:10px">
|
||||
<input type="text" id="searchEqu_name" name="searchEqu_name" class="form-control pull-right" placeholder="设备名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTable_equ();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_equ"></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>
|
||||
239
WebRoot/jsp/equipment/equipmentCardListForSelect2.jsp
Normal file
239
WebRoot/jsp/equipment/equipmentCardListForSelect2.jsp
Normal file
@ -0,0 +1,239 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var checkedItem="";
|
||||
function doselect() {
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
// console.info(checkedItem)
|
||||
$('#equipmentId' ).val(checkedItem.id);
|
||||
$('#equipname').val(checkedItem.equipmentname);
|
||||
$('#equipmentNumber').val(checkedItem.equipmentcardid);
|
||||
$('#equipmentmodelname').val(checkedItem.equipmentmodelname);
|
||||
$('#processSectionId' ).val(checkedItem.processsectionid);
|
||||
if(checkedItem.processSection != null && checkedItem.processSection!=""){
|
||||
$('#processectionname').val(checkedItem.processSection.name);
|
||||
}else{
|
||||
$('#processectionname').val("");
|
||||
}
|
||||
closeModal("emSubModal");
|
||||
var isone = $('#isone').val();
|
||||
if(isone=='1'){
|
||||
isOneDevice();
|
||||
}
|
||||
}else{
|
||||
showAlert('d','尚未选择设备台账!','alertDiv_MaintainPlanSelect');
|
||||
}
|
||||
};
|
||||
var $table;
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${equipmentId}'){
|
||||
flag=true;
|
||||
checkedItem = row;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var dosearchTable_equ = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
console.info($('#searchEqu_name').val())
|
||||
};
|
||||
|
||||
var companyId = '${companyId}';
|
||||
|
||||
$("#searchEqu_name").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
dosearchTable_equ();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$("#processSection1").empty();
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection1").empty();
|
||||
var selelct_ =$("#processSection1").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearchTable_equ();
|
||||
});
|
||||
},'json');
|
||||
|
||||
$('#table_equ').bootstrapTable('destroy');
|
||||
$table = $("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName : $('#searchEqu_name').val(),
|
||||
unitId: companyId,
|
||||
pSectionId: $("#processSection1").val(),
|
||||
checkedIds:'${param.ids}'
|
||||
}
|
||||
},
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}/* ,{
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
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_equ .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="emSubModal" >
|
||||
<div class="modal-dialog modal-lg" >
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择设备</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="isone" name="isone" value="${isone}">
|
||||
<div id="alertDiv_MaintainPlanSelect"></div>
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<div class="form-group form-inline" >
|
||||
<div class="form-group form-inline">
|
||||
<div class="form-group ">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection1" name ="processSection1" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm pull-left" style="width: 220px;margin-left:10px">
|
||||
<input type="text" id="searchEqu_name" name="searchEqu_name" class="form-control pull-right" placeholder="设备名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTable_equ();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_equ"></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>
|
||||
261
WebRoot/jsp/equipment/equipmentCardListForSelectShow.jsp
Normal file
261
WebRoot/jsp/equipment/equipmentCardListForSelectShow.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchPatrolPoint = function () {
|
||||
$("#table_EquipmentCardForSelect").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
datas_name = "";
|
||||
$.each(selectionIds, function (index, item) {
|
||||
if (datas != "") {
|
||||
datas += ",";
|
||||
}
|
||||
console.log(item);
|
||||
datas += item;
|
||||
});
|
||||
//调用上一界面方法完成选择
|
||||
doFinishSelectEquipmentCard(datas);
|
||||
closeModal("equipmentCardModal");
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${equipmentCards}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${equipmentCards}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${equipmentCards}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName: $('#search_name_equ').val(),
|
||||
companyId: '${param.bizId}',
|
||||
processSectionId:'${processSectionId}'
|
||||
};
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
temp.checkedIds = getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function () {
|
||||
$("#searchForm_Equ").attr("onsubmit", "return false;");
|
||||
$("#search_name_equ").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchPatrolPoint();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
})
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
|
||||
initialSelectionIds();
|
||||
$table = $("#table_EquipmentCardForSelect").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
clickToSelect: true,
|
||||
responseHandler: responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentcardid',
|
||||
title: "编号",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%'
|
||||
}, {
|
||||
field: 'equipmentname',
|
||||
title: "名称",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%',/*
|
||||
formatter:function(value,row,index){
|
||||
return row.processSection.name;
|
||||
}*/
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_EquipmentCardForSelect");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if ('check' == e.type) {
|
||||
obj.parent().addClass("checked");
|
||||
} else {
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = { "union": union, "difference": difference };
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipmentCardModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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_EquipmentCardForSelect" style="height:230px;overflow:auto;width:100%"></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>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
304
WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
304
WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
datas_codes = "";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/getList.do', {companyId:'${param.companyId}',checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
//console.info(resp)
|
||||
$.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.equipmentname;
|
||||
|
||||
if(datas_codes!=""){
|
||||
datas_codes+=",";
|
||||
}
|
||||
datas_codes+=item.equipmentcardid;
|
||||
// console.log(item);
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.equipcode}').val(datas_codes);
|
||||
closeModal("equipment4SelectModal")
|
||||
console.log(222222222)
|
||||
},'json');
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.equipcode}').val(datas_codes);
|
||||
closeModal("equipment4SelectModal")
|
||||
console.log(1111111111111)
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipments}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipments}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipments}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: '${param.companyId}',
|
||||
pSectionId: $("#processSection").val(),
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
var companyId= '${param.companyId}';
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
selelct_.val("").trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
doSearchEqu();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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 " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name" name="search_name" 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-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
293
WebRoot/jsp/equipment/equipmentCardListForSupplementSelects.jsp
Normal file
293
WebRoot/jsp/equipment/equipmentCardListForSupplementSelects.jsp
Normal file
@ -0,0 +1,293 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentCardByCompanyId.do', {companyId:'${param.companyId}',checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
//console.info(resp)
|
||||
$.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.equipmentName;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal")
|
||||
},'json');
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("equipment4SelectModal")
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${equipments}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${equipments}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${equipments}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: '${param.companyId}',
|
||||
pSectionId: $("#processSection").val(),
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
var companyId= '${param.companyId}';
|
||||
$.post(ext.contextPath + "/work/mpoint/getProcessSectionList4Select.do", {companyId:companyId}, function(data) {
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
selelct_.val("").trigger("change");
|
||||
/* selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
}); */
|
||||
},'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getEquipmentCardByCompanyId.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentCardID', // 返回json数据中的name
|
||||
title: '厂内编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '统一编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'equipmentModel', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'factory', // 返回json数据中的name
|
||||
title: '厂家名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</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 " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name" name="search_name" 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-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;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="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
749
WebRoot/jsp/equipment/equipmentCardList_20210727.jsp
Normal file
749
WebRoot/jsp/equipment/equipmentCardList_20210727.jsp
Normal file
@ -0,0 +1,749 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%@ 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" %>
|
||||
<%request.setAttribute("UNIT_TYPE_BIZ", com.sipai.tools.CommString.UNIT_TYPE_BIZ);%>
|
||||
<%request.setAttribute("UNIT_TYPE_COMPANY", com.sipai.tools.CommString.UNIT_TYPE_COMPANY);%>
|
||||
<%request.setAttribute("UNIT_TYPE_DEPT", com.sipai.tools.CommString.UNIT_TYPE_DEPT);%>
|
||||
|
||||
<%request.setAttribute("Flag_Active", com.sipai.tools.CommString.Flag_Active);%>
|
||||
<%request.setAttribute("Flag_Unactive", com.sipai.tools.CommString.Flag_Unactive);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<style type="text/css">
|
||||
/*隐藏百度地图底部文字*/
|
||||
.anchorBL {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var showMaintenanceList = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subMaintenanceModal');
|
||||
});
|
||||
};
|
||||
var showHandleDetailList = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
var viewEquipmentFun = function (equipmentName, equipmentCardID, id) {
|
||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {
|
||||
equipmentName: equipmentName,
|
||||
equipmentCardID: equipmentCardID,
|
||||
id: id
|
||||
}, function (data) {
|
||||
$("#subEquipmentDiv").html(data);
|
||||
openModal('subEquipmentModal');
|
||||
});
|
||||
};
|
||||
|
||||
//导出设备表,要用get请求的方式
|
||||
function downloadFun() {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
var search_equName = "";
|
||||
var deptName = "";
|
||||
if (datas == "") {
|
||||
search_equName = $("#search_name").val();
|
||||
deptName = $("#search_dept").val();
|
||||
}
|
||||
//console.info(deptName)
|
||||
window.open(ext.contextPath + "/equipment/downloadEquipmentExcel.do?companyId=" + companyId
|
||||
+ "&equipmentIds=" + datas + "&equipmentName=" + search_equName
|
||||
+ "&search_dept=" + deptName);
|
||||
}
|
||||
}
|
||||
|
||||
//导入设备列表
|
||||
function importFun() {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/importEquipmentCard.do', {companyId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//同步GIS坐标
|
||||
function synGISFun() {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/synGISCoordinate.do', {companyId: companyId}, function (data) {
|
||||
console.info(data)
|
||||
if (data.res > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '同步失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//新增设备卡片
|
||||
var addFun = function () {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/doadd.do', {companyId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
//编辑资产类型
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/doedit.do', {id: id, companyId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看设备详情
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/equipment/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条资产类型数据
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/equipment/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} 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 + '/equipment/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
$(function () {
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
initTreeView();
|
||||
$("#search_dept").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
dosearch();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
//设备类型搜索
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {}, function (data) {
|
||||
var selelct = $("#equipmentCardClass").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
//2020-07-13 start
|
||||
//设备归属
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelongForSelect.do", {}, function (data) {
|
||||
var selelct = $("#equipmentBelongId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
|
||||
//台账类型
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardTypeForSelect.do", {}, function (data) {
|
||||
var selelct = $("#equipmentCardType").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
//2020-07-13 end
|
||||
|
||||
});
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentName: $("#search_name").val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
equipmentCardClass: $("#equipmentCardClass").val(),
|
||||
search_dept: $("#search_dept").val(),
|
||||
//设备规格
|
||||
specification: $("#search_specification").val(),
|
||||
//设备型号
|
||||
equipmentmodel: $("#search_equipmentmodel").val(),
|
||||
//设备级别
|
||||
equipmentlevel: $("#search_equipmentlevel").val(),
|
||||
//设备归属
|
||||
equipmentBelongId: $("#equipmentBelongId").val(),
|
||||
//台账类型
|
||||
equipmentCardType: $("#equipmentCardType").val(),
|
||||
|
||||
}
|
||||
};
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '厂内编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentSpecification.name', // 返回json数据中的name
|
||||
title: '设备规格', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '制造厂家', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentTypeNumber.name', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备级别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${Status_OFF}' :
|
||||
return "封存";
|
||||
case '${Status_ON}' :
|
||||
return "在用";
|
||||
case '${Status_Fault}' :
|
||||
return "故障";
|
||||
case '${Status_Transfer}' :
|
||||
return "调拨";
|
||||
case '${Status_Scrap}' :
|
||||
return "报废";
|
||||
case '${Status_STOP}' :
|
||||
return "停用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 220, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/user/getUnitForTree_Selected.do', {ng: ''}, function (data) {
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
companyId = data.id;
|
||||
initFun();
|
||||
});
|
||||
}, 'json');
|
||||
};
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subEquipmentDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="maintenanceDiv"></div>
|
||||
<div id="maintenanceDetailDiv"></div>
|
||||
<div id="equipmentLevelSubDiv"></div>
|
||||
<div id="equipmentProcessSectionSubDiv"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentBelongSubDiv"></div>
|
||||
<div id="equipmentCodeRuleSubDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="subEditViewDiv"></div>
|
||||
<div id="MpointDiv"></div>
|
||||
<div id="ivSubDiv"></div>
|
||||
<div id="subFileDiv"></div>
|
||||
<div id="subRepairDiv"></div>
|
||||
<div id="subMaintainDiv"></div>
|
||||
<div id="subAttachedDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">公司列表</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="companytree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<!-- <form id="searchForm"> -->
|
||||
<!-- <div class="form-group form-inline">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<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="companyName" style="width:220px;border: none;background: transparent;"></span>
|
||||
</div> -->
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: auto;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i
|
||||
class="fa fa-cloud-upload"></i> 导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i
|
||||
class="fa fa-cloud-download"></i> 导出
|
||||
</button>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="synGISFun();"><i class="fa fa-industry"></i>同步坐标</button> -->
|
||||
</security:authorize>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 160px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">设备类型:</label>
|
||||
<select class="form-control select2 " id="equipmentCardClass" name ="equipmentCardClass" style="width: 160px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">所属部门:</label>
|
||||
<input type="text" id="search_dept" name="search_dept" class="form-control pull-right" placeholder="所属部门">
|
||||
</div>
|
||||
<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="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-inline">
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 160px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">设备类型:</label>
|
||||
<select class="form-control select2 " id="equipmentCardClass" name="equipmentCardClass"
|
||||
style="width: 160px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">设备归属:</label>
|
||||
<select class="form-control select2 " id="equipmentBelongId" name="equipmentBelongId"
|
||||
style="width: 160px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">台账类型:</label>
|
||||
<select class="form-control select2 " id="equipmentCardType" name="equipmentCardType"
|
||||
style="width: 160px;"></select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_dept" name="search_dept" class="form-control pull-right" style="width: 120px;" placeholder="所属部门">
|
||||
</div>
|
||||
<div class="input-group input-group-sm" >
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" style="width: 115px;" placeholder="名称">
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group form-inline">
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_dept" name="search_dept" class="form-control pull-right"
|
||||
style="width: 120px;" placeholder="所属部门">
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
style="width: 115px;" placeholder="名称">
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_specification" name="search_specification"
|
||||
class="form-control pull-right" placeholder="请输入设备规格" style="width:200px;">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_equipmentmodel" name="search_equipmentmodel"
|
||||
class="form-control pull-right" placeholder="请输入设备型号" style="width:230px;">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<input type="text" id="search_equipmentlevel" name="search_equipmentlevel"
|
||||
class="form-control pull-right" placeholder="请输入设备级别" style="width:200px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<%-- <script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
</script> --%>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 本ak仅限珠海水控自来水项目临时使用,公司申请商业ak后替换更新。后续项目请使用公司商业ak -->
|
||||
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=NZhMekYms7kucYQ2ZeSlauu1E868uS4F"></script>
|
||||
</html>
|
||||
203
WebRoot/jsp/equipment/equipmentCardMapEdit.jsp
Normal file
203
WebRoot/jsp/equipment/equipmentCardMapEdit.jsp
Normal file
@ -0,0 +1,203 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var equipmentName='${equipmentName}';
|
||||
//alert("equipmentName value is:"+equipmentName);
|
||||
var lng='${lng}';
|
||||
//alert("lng value is:"+lng);
|
||||
var lat='${lat}';
|
||||
//alert("lat value is:"+lat);
|
||||
var companyName='${companyName}';
|
||||
//alert("companyName value is:"+companyName);
|
||||
// 创建地图实例
|
||||
var map = new BMap.Map("container", {
|
||||
minZoom : 18,
|
||||
maxZoom : 19
|
||||
});
|
||||
|
||||
// 创建点坐标
|
||||
//(珠海市大概经纬度)113.58271881713522, 22.271476394207497
|
||||
//(上海市大概经纬度)121.43208992029295, 31.174275468915532
|
||||
//我的经纬度 121.48789949,31.24916171
|
||||
var point='';
|
||||
if(''!=lng || ''!=lat){
|
||||
point = new BMap.Point(lng, lat);
|
||||
}else if(companyName =="乾务水厂"){
|
||||
point = new BMap.Point(113.23254136335125, 22.1788928940499);
|
||||
}else{
|
||||
point = new BMap.Point(119.982345,31.800048);
|
||||
}
|
||||
//var point = new BMap.Point(113.58271881713522, 22.271476394207497);
|
||||
// 初始化地图,设置中心点坐标和地图级别
|
||||
map.centerAndZoom(point, 10);
|
||||
//添加地图类型控件
|
||||
map.addControl(new BMap.MapTypeControl({
|
||||
mapTypes : [ BMAP_NORMAL_MAP, BMAP_HYBRID_MAP ]
|
||||
}));
|
||||
map.setCurrentCity("常州"); // 设置地图显示的城市 此项是必须设置的
|
||||
|
||||
|
||||
// 添加带有定位的导航控件
|
||||
var navigationControl = new BMap.NavigationControl({
|
||||
// 靠左上角位置
|
||||
anchor : BMAP_ANCHOR_TOP_LEFT,
|
||||
// LARGE类型
|
||||
type : BMAP_NAVIGATION_CONTROL_LARGE,
|
||||
// 启用显示定位(定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
enableGeolocation : true
|
||||
});
|
||||
map.addControl(navigationControl);
|
||||
|
||||
/* 备注:暂时不用 (定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
// 添加定位控件
|
||||
var geolocationControl = new BMap.GeolocationControl();
|
||||
geolocationControl.addEventListener("locationSuccess", function(e) {
|
||||
// 定位成功事件
|
||||
var address = '';
|
||||
address += e.addressComponent.province;
|
||||
address += e.addressComponent.city;
|
||||
address += e.addressComponent.district;
|
||||
address += e.addressComponent.street;
|
||||
address += e.addressComponent.streetNumber;
|
||||
alert("当前定位地址为:" + address);
|
||||
});
|
||||
geolocationControl.addEventListener("locationError", function(e) {
|
||||
// 定位失败事件
|
||||
alert(e.message);
|
||||
});
|
||||
map.addControl(geolocationControl);
|
||||
*/
|
||||
|
||||
//使用鼠标滑轮缩放地图
|
||||
map.enableScrollWheelZoom();
|
||||
//禁止双击缩放地图
|
||||
map.disableDoubleClickZoom();
|
||||
//设置地图默认的鼠标指针样式
|
||||
//map.setDefaultCursor("url('bird.cur')");
|
||||
// 百度地图API功能 浏览器定位(定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
/*
|
||||
var geolocation = new BMap.Geolocation();
|
||||
geolocation.getCurrentPosition(function(r) {
|
||||
if (this.getStatus() == BMAP_STATUS_SUCCESS) {
|
||||
var mk = new BMap.Marker(r.point);
|
||||
map.addOverlay(mk);
|
||||
map.panTo(r.point);
|
||||
alert('您的位置:' + r.point.lng + ',' + r.point.lat);
|
||||
} else {
|
||||
//alert('failed:' + this.getStatus());
|
||||
console.log("failed:" + this.getStatus());
|
||||
}
|
||||
}, {
|
||||
enableHighAccuracy : true
|
||||
});
|
||||
*/
|
||||
//关于状态码
|
||||
//BMAP_STATUS_SUCCESS 检索成功。对应数值“0”。
|
||||
//BMAP_STATUS_CITY_LIST 城市列表。对应数值“1”。
|
||||
//BMAP_STATUS_UNKNOWN_LOCATION 位置结果未知。对应数值“2”。
|
||||
//BMAP_STATUS_UNKNOWN_ROUTE 导航结果未知。对应数值“3”。
|
||||
//BMAP_STATUS_INVALID_KEY 非法密钥。对应数值“4”。
|
||||
//BMAP_STATUS_INVALID_REQUEST 非法请求。对应数值“5”。
|
||||
//BMAP_STATUS_PERMISSION_DENIED 没有权限。对应数值“6”。(自 1.1 新增)
|
||||
//BMAP_STATUS_SERVICE_UNAVAILABLE 服务不可用。对应数值“7”。(自 1.1 新增)
|
||||
//BMAP_STATUS_TIMEOUT 超时。对应数值“8”。(自 1.1 新增)
|
||||
//标记点
|
||||
var marker = "";
|
||||
//存放所有的经纬度信息
|
||||
var pointData = [];
|
||||
if(''!=lng || ''!=lat){
|
||||
pointData.push(lng,lat);
|
||||
var point = new BMap.Point(lng,lat);
|
||||
var label="";
|
||||
|
||||
if(''!=equipmentName){
|
||||
label = new BMap.Label(equipmentName, {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
// 创建文本标注对象
|
||||
label.setStyle({
|
||||
border: "0",
|
||||
fontWeight :"bold",
|
||||
backgroundColor: "0.05",
|
||||
fontFamily:"微软雅黑"
|
||||
});
|
||||
|
||||
}else{
|
||||
label = new BMap.Label("", {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
// 创建文本标注对象
|
||||
label.setStyle({
|
||||
border: "0",
|
||||
fontWeight :"bold",
|
||||
backgroundColor: "0.05",
|
||||
fontFamily:"微软雅黑"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
addMarker(point, label);
|
||||
}
|
||||
//单击获取点击的经纬度
|
||||
map.addEventListener("click", function(e) {
|
||||
if (pointData.length == 0) {
|
||||
//alert(e.point.lng + "," + e.point.lat);
|
||||
document.getElementById("lng").value = e.point.lng;
|
||||
document.getElementById("lat").value = e.point.lat;
|
||||
pointData.push(e.point.lng, e.point.lat);
|
||||
var point = new BMap.Point(e.point.lng, e.point.lat);
|
||||
var label = new BMap.Label(equipmentName, {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
// 创建文本标注对象
|
||||
label.setStyle({
|
||||
border: "0",
|
||||
fontWeight :"bold",
|
||||
backgroundColor: "0.05",
|
||||
fontFamily:"微软雅黑"
|
||||
});
|
||||
addMarker(point, label);
|
||||
|
||||
} else {
|
||||
map.removeEventListener("click", function(e) {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 编写自定义函数,创建标注
|
||||
function addMarker(point, label) {
|
||||
marker = new BMap.Marker(point);
|
||||
//设置标记点并显示再地图上
|
||||
map.addOverlay(marker);
|
||||
//设置标记的文本信息
|
||||
marker.setLabel(label);
|
||||
//设置标注点可以拖动
|
||||
marker.enableDragging();
|
||||
//跳动的动画
|
||||
marker.setAnimation(BMAP_ANIMATION_BOUNCE);
|
||||
marker.addEventListener("click", getMarkerAttr);
|
||||
// 开启事件监听
|
||||
marker.addEventListener("dragend", function(e) {
|
||||
var x = e.point.lng; //经度
|
||||
var y = e.point.lat; //纬度
|
||||
//alert("拖到的地点的经纬度:" + x + "," + y);
|
||||
document.getElementById("lng").value = e.point.lng;
|
||||
document.getElementById("lat").value = e.point.lat;
|
||||
});
|
||||
}
|
||||
|
||||
function getMarkerAttr() {
|
||||
//获取marker的位置
|
||||
var p = marker.getPosition();
|
||||
//alert("标记点的位置是" + p.lng + "," + p.lat);
|
||||
}
|
||||
|
||||
//清除覆盖物
|
||||
function removeOverlay() {
|
||||
map.clearOverlays();
|
||||
pointData = [];
|
||||
document.getElementById("lng").value = "";
|
||||
document.getElementById("lat").value = "";
|
||||
}
|
||||
</script>
|
||||
202
WebRoot/jsp/equipment/equipmentCardMapView.jsp
Normal file
202
WebRoot/jsp/equipment/equipmentCardMapView.jsp
Normal file
@ -0,0 +1,202 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var equipmentName='${equipmentName}';
|
||||
//alert("equipmentName value is:"+equipmentName);
|
||||
var lng='${lng}';
|
||||
//alert("lng value is:"+lng);
|
||||
var lat='${lat}';
|
||||
//alert("lat value is:"+lat);
|
||||
var companyName='${companyName}';
|
||||
//alert("companyName value is:"+companyName);
|
||||
|
||||
// 创建地图实例
|
||||
var map = new BMap.Map("container", {
|
||||
minZoom : 18,
|
||||
maxZoom : 19
|
||||
});
|
||||
|
||||
// 创建点坐标
|
||||
//(珠海市大概经纬度)113.58271881713522, 22.271476394207497
|
||||
//(上海市大概经纬度)121.43208992029295, 31.174275468915532
|
||||
//我的经纬度 121.48789949,31.24916171
|
||||
var point='';
|
||||
if(''!=lng || ''!=lat){
|
||||
point = new BMap.Point(lng, lat);
|
||||
}else{
|
||||
point = new BMap.Point(119.982345,31.800048);
|
||||
}
|
||||
//var point = new BMap.Point(113.58271881713522, 22.271476394207497);
|
||||
// 初始化地图,设置中心点坐标和地图级别
|
||||
map.centerAndZoom(point, 10);
|
||||
//添加地图类型控件
|
||||
map.addControl(new BMap.MapTypeControl({
|
||||
mapTypes : [ BMAP_NORMAL_MAP, BMAP_HYBRID_MAP ]
|
||||
}));
|
||||
map.setCurrentCity("常州"); // 设置地图显示的城市 此项是必须设置的
|
||||
|
||||
|
||||
// 添加带有定位的导航控件
|
||||
var navigationControl = new BMap.NavigationControl({
|
||||
// 靠左上角位置
|
||||
anchor : BMAP_ANCHOR_TOP_LEFT,
|
||||
// LARGE类型
|
||||
type : BMAP_NAVIGATION_CONTROL_LARGE,
|
||||
// 启用显示定位(定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
enableGeolocation : true
|
||||
});
|
||||
map.addControl(navigationControl);
|
||||
|
||||
/* 备注:暂时不用 (定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
// 添加定位控件
|
||||
var geolocationControl = new BMap.GeolocationControl();
|
||||
geolocationControl.addEventListener("locationSuccess", function(e) {
|
||||
// 定位成功事件
|
||||
var address = '';
|
||||
address += e.addressComponent.province;
|
||||
address += e.addressComponent.city;
|
||||
address += e.addressComponent.district;
|
||||
address += e.addressComponent.street;
|
||||
address += e.addressComponent.streetNumber;
|
||||
alert("当前定位地址为:" + address);
|
||||
});
|
||||
geolocationControl.addEventListener("locationError", function(e) {
|
||||
// 定位失败事件
|
||||
alert(e.message);
|
||||
});
|
||||
map.addControl(geolocationControl);
|
||||
*/
|
||||
|
||||
//使用鼠标滑轮缩放地图
|
||||
map.enableScrollWheelZoom();
|
||||
//禁止双击缩放地图
|
||||
map.disableDoubleClickZoom();
|
||||
//设置地图默认的鼠标指针样式
|
||||
//map.setDefaultCursor("url('bird.cur')");
|
||||
// 百度地图API功能 浏览器定位(定位功能不稳定,时好时坏,大概是没有充值将就着用)
|
||||
/*
|
||||
var geolocation = new BMap.Geolocation();
|
||||
geolocation.getCurrentPosition(function(r) {
|
||||
if (this.getStatus() == BMAP_STATUS_SUCCESS) {
|
||||
var mk = new BMap.Marker(r.point);
|
||||
map.addOverlay(mk);
|
||||
map.panTo(r.point);
|
||||
alert('您的位置:' + r.point.lng + ',' + r.point.lat);
|
||||
} else {
|
||||
//alert('failed:' + this.getStatus());
|
||||
console.log("failed:" + this.getStatus());
|
||||
}
|
||||
}, {
|
||||
enableHighAccuracy : true
|
||||
});
|
||||
*/
|
||||
//关于状态码
|
||||
//BMAP_STATUS_SUCCESS 检索成功。对应数值“0”。
|
||||
//BMAP_STATUS_CITY_LIST 城市列表。对应数值“1”。
|
||||
//BMAP_STATUS_UNKNOWN_LOCATION 位置结果未知。对应数值“2”。
|
||||
//BMAP_STATUS_UNKNOWN_ROUTE 导航结果未知。对应数值“3”。
|
||||
//BMAP_STATUS_INVALID_KEY 非法密钥。对应数值“4”。
|
||||
//BMAP_STATUS_INVALID_REQUEST 非法请求。对应数值“5”。
|
||||
//BMAP_STATUS_PERMISSION_DENIED 没有权限。对应数值“6”。(自 1.1 新增)
|
||||
//BMAP_STATUS_SERVICE_UNAVAILABLE 服务不可用。对应数值“7”。(自 1.1 新增)
|
||||
//BMAP_STATUS_TIMEOUT 超时。对应数值“8”。(自 1.1 新增)
|
||||
//标记点
|
||||
var marker = "";
|
||||
//存放所有的经纬度信息
|
||||
var pointData = [];
|
||||
if(''!=lng || ''!=lat){
|
||||
pointData.push(lng,lat);
|
||||
var point = new BMap.Point(lng,lat);
|
||||
var label="";
|
||||
|
||||
if(''!=equipmentName){
|
||||
label = new BMap.Label(equipmentName, {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
// 创建文本标注对象
|
||||
label.setStyle({
|
||||
border: "0",
|
||||
fontWeight :"bold",
|
||||
backgroundColor: "0.05",
|
||||
fontFamily:"微软雅黑"
|
||||
});
|
||||
|
||||
}else{
|
||||
label = new BMap.Label("id=" + 1, {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
// 创建文本标注对象
|
||||
label.setStyle({
|
||||
border: "0",
|
||||
fontWeight :"bold",
|
||||
backgroundColor: "0.05",
|
||||
fontFamily:"微软雅黑"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
addMarker(point, label);
|
||||
}
|
||||
//单击获取点击的经纬度
|
||||
/*
|
||||
map.addEventListener("click", function(e) {
|
||||
if (pointData.length == 0) {
|
||||
alert(e.point.lng + "," + e.point.lat);
|
||||
document.getElementById("lng").value = e.point.lng;
|
||||
document.getElementById("lat").value = e.point.lat;
|
||||
pointData.push(e.point.lng, e.point.lat);
|
||||
var point = new BMap.Point(e.point.lng, e.point.lat);
|
||||
var label = new BMap.Label("id=" + 1, {
|
||||
offset : new BMap.Size(20, -10)
|
||||
});
|
||||
addMarker(point, label);
|
||||
|
||||
} else {
|
||||
map.removeEventListener("click", function(e) {
|
||||
});
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
// 编写自定义函数,创建标注
|
||||
function addMarker(point, label) {
|
||||
marker = new BMap.Marker(point);
|
||||
//设置标记点并显示再地图上
|
||||
map.addOverlay(marker);
|
||||
//设置标记的文本信息
|
||||
marker.setLabel(label);
|
||||
//设置标注点可以拖动
|
||||
//marker.enableDragging();
|
||||
//跳动的动画
|
||||
marker.setAnimation(BMAP_ANIMATION_BOUNCE);
|
||||
//marker.addEventListener("click", getMarkerAttr);
|
||||
// 开启事件监听
|
||||
/*
|
||||
marker.addEventListener("dragend", function(e) {
|
||||
var x = e.point.lng; //经度
|
||||
var y = e.point.lat; //纬度
|
||||
alert("拖到的地点的经纬度:" + x + "," + y);
|
||||
document.getElementById("lng").value = e.point.lng;
|
||||
document.getElementById("lat").value = e.point.lat;
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
function getMarkerAttr() {
|
||||
//获取marker的位置
|
||||
var p = marker.getPosition();
|
||||
alert("marker的位置是" + p.lng + "," + p.lat);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
//清除覆盖物
|
||||
function removeOverlay() {
|
||||
map.clearOverlays();
|
||||
pointData = [];
|
||||
document.getElementById("lng").value = "";
|
||||
document.getElementById("lat").value = "";
|
||||
}
|
||||
*/
|
||||
</script>
|
||||
1180
WebRoot/jsp/equipment/equipmentCardNewAdd_20210727.jsp
Normal file
1180
WebRoot/jsp/equipment/equipmentCardNewAdd_20210727.jsp
Normal file
File diff suppressed because it is too large
Load Diff
3456
WebRoot/jsp/equipment/equipmentCardNewEdit_20210727.jsp
Normal file
3456
WebRoot/jsp/equipment/equipmentCardNewEdit_20210727.jsp
Normal file
File diff suppressed because it is too large
Load Diff
1514
WebRoot/jsp/equipment/equipmentCardNewListForOverdue.jsp
Normal file
1514
WebRoot/jsp/equipment/equipmentCardNewListForOverdue.jsp
Normal file
File diff suppressed because it is too large
Load Diff
265
WebRoot/jsp/equipment/equipmentCardNewListForScrap.jsp
Normal file
265
WebRoot/jsp/equipment/equipmentCardNewListForScrap.jsp
Normal file
@ -0,0 +1,265 @@
|
||||
<%@ 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" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
padding-right: 4px;
|
||||
background-color: #d0d0d0;
|
||||
/*其他样式,比如圆角等*/
|
||||
}
|
||||
|
||||
/*滑块样式*/
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #6C6C6C;
|
||||
}
|
||||
|
||||
/*当前窗口失去焦点时的滑块样式*/
|
||||
::-webkit-scrollbar-thumb:window-inactive {
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
/*默认隐藏滚动条*/
|
||||
#tree {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
/*悬浮显示滚动条*/
|
||||
#tree:hover {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var showList1 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'p') {//点击工艺段
|
||||
$('#processSectionId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showListForScrap.do', {
|
||||
processSectionId: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#processSectionId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showListForScrap.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var showList2 = function (id, type, unitId, pid) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'e') {//点击设备类型
|
||||
$('#equipmentClassId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showListForScrap.do', {
|
||||
equipmentClassId: id,
|
||||
equipmentClassPid: pid,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#equipmentClassId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showListForScrap.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载工艺段
|
||||
*/
|
||||
var proTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#treeScrap').treeview({data: treeData, levels: 3, showTags: true});
|
||||
$('#treeScrap').on('nodeSelected', function (event, treeList) {
|
||||
showList1(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载设备类型
|
||||
*/
|
||||
var equTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
|
||||
// $.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#treeScrap').treeview({data: treeData, levels: 3});
|
||||
$('#treeScrap').on('nodeSelected', function (event, treeList) {
|
||||
showList2(treeList.id, treeList.type, treeList.unitId, treeList.pid);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
//点击工艺段(按钮)
|
||||
function proFun() {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
proTreeView();
|
||||
// $('#proButton').css('background-color', '#e8f5fe');
|
||||
// $('#equButton').css('background-color', '#FFFFFF');
|
||||
}
|
||||
|
||||
//点击设备类型(按钮)
|
||||
function equFun() {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
equTreeView();
|
||||
// $('#proButton').css('background-color', '#FFFFFF');
|
||||
// $('#equButton').css('background-color', '#e8f5fe');
|
||||
}
|
||||
|
||||
function framePackup() {
|
||||
$("#leftToolsLvl2").css("display", "none");
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","block");$("#leftToolsLvl2").css("display","none");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-10")
|
||||
$('#rightTools').addClass("col-md-12")
|
||||
}
|
||||
|
||||
function frameOpen() {
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","none");$("#leftToolsLvl2").css("display","block");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-12")
|
||||
$('#rightTools').addClass("col-md-10")
|
||||
}
|
||||
|
||||
$(function () {
|
||||
proTreeView();
|
||||
|
||||
//默认加载右边 Table
|
||||
showList1(unitId, 'B', unitId)
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<input type="hidden" name="unitId" id="unitId" value=""><%--厂id--%>
|
||||
<input type="hidden" name="processSectionId" id="processSectionId" value=""><%--工艺段id--%>
|
||||
<input type="hidden" name="equipmentClassId" id="equipmentClassId" value=""><%--设备类型id--%>
|
||||
|
||||
<%--<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>
|
||||
</ol>
|
||||
</section>--%>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<%--设备资料--%>
|
||||
<div id="subDiv_Scrap"></div>
|
||||
<div class="row">
|
||||
|
||||
<!--隐藏时候的按钮-->
|
||||
<div id="leftToolsPackup" onclick="frameOpen();"
|
||||
style="display: none;position: absolute;z-index:9;left:0px;top:100px;width: 20px;height: 25px;border-radius: 4px;box-shadow: 2px 2px 4px 0px #696969, 0px 0px 4px 0px #696969;">
|
||||
<button type="button" class="btn btn-box-tool"><i class="fa fa-forward"></i></button>
|
||||
</div>
|
||||
|
||||
<!--左边树形框-->
|
||||
<div class="col-md-2" id="leftTools" style="left:0px;top:0px;border-radius: 12px;">
|
||||
<div class="box box-solid" id="leftToolsLvl2">
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<button type="button" id="button1" class="btn btn-primary btn-sm" onclick="proFun();">
|
||||
工艺段
|
||||
</button>
|
||||
<button type="button" id="button2" class="btn btn-default btn-sm" onclick="equFun();">
|
||||
设备类型
|
||||
</button>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="framePackup();">
|
||||
<i class="fa fa-backward"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="nav-tabs-custom">--%>
|
||||
<%-- <ul class="nav nav-tabs" id="">--%>
|
||||
<%-- <li class="kuandu active" id="proButton"><a onclick="proFun()" data-toggle="tab" index="0" aria-expanded="true">工艺段11</a></li>--%>
|
||||
<%-- --%>
|
||||
<%-- <li class="kuandu " id="equButton" ><a onclick="equFun()" data-toggle="tab" index="1" aria-expanded="false">设备类型</a></li>--%>
|
||||
<%-- <div class="box-tools">--%>
|
||||
<%-- <button type="button" class="btn btn-box-tool" onclick="framePackup();"><i--%>
|
||||
<%-- class="fa fa-backward"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </ul>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="treeScrap" style="height:1000px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--右边table style="margin-left:-20px;"-->
|
||||
<div class="col-md-10" id="rightTools">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1533
WebRoot/jsp/equipment/equipmentCardNewListForScrap_ycy_20240229.jsp
Normal file
1533
WebRoot/jsp/equipment/equipmentCardNewListForScrap_ycy_20240229.jsp
Normal file
File diff suppressed because it is too large
Load Diff
172
WebRoot/jsp/equipment/equipmentCardNewListForoutQRCode.jsp
Normal file
172
WebRoot/jsp/equipment/equipmentCardNewListForoutQRCode.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<%@ 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"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 下载PDF-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/pdf/html2canvas.js"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/pdf/jsPDF-1.3.2/dist/jspdf.debug.js"></script>
|
||||
<script type="text/javascript">
|
||||
var nowpage=1;
|
||||
var checkedIds='&checkedIds=${param.eqids}';
|
||||
$(function() {
|
||||
getlist();
|
||||
});
|
||||
|
||||
var totalpages="";
|
||||
function getlist(){
|
||||
var page="&page="+nowpage;
|
||||
var rows="&rows=100";
|
||||
$.post(ext.contextPath + '/equipment/getList.do',checkedIds+page+rows, function(datas) {
|
||||
totalpages=Math.ceil(datas.total/24);
|
||||
var data=datas.rows;
|
||||
if(data!=''){
|
||||
var html="";
|
||||
for(var i=0;i<data.length;i++){
|
||||
var eqId=data[i].id;
|
||||
var eqNo=data[i].equipmentcardid;
|
||||
var eqName=data[i].equipmentname;
|
||||
html+="<div style='float:left;width:50%;margin-bottom:115px;'>";
|
||||
html+="<div style='float:left;width:100%;text-align: center;font-weight: bold;'>"+eqName+"</div>";
|
||||
html+="<div style='float:left;width:100%;text-align: center;font-weight: bold;'>"+eqNo+"</div>";
|
||||
html+="<div id='"+eqId+"' style='float:left;width:100%;text-align: center;'></div>";
|
||||
html+="</div>";
|
||||
}
|
||||
$('#print').html(html);
|
||||
for(var i=0;i<data.length;i++){
|
||||
var eqId=data[i].id;
|
||||
$("#"+eqId+"").qrcode({
|
||||
render : "canvas",
|
||||
width : 150, //设置宽度
|
||||
height : 150, //设置高度
|
||||
typeNumber : -1, //计算模式
|
||||
background : "#ffffff",//背景颜色
|
||||
foreground : "#000000", //前景颜色
|
||||
text: eqId
|
||||
});
|
||||
}
|
||||
$('#pageSt').text(nowpage+"/"+totalpages);
|
||||
}else{
|
||||
nowpage=0;
|
||||
totalpages=0;
|
||||
$('#pageSt').text(nowpage+"/"+totalpages);
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
|
||||
function lastpage(){
|
||||
if(totalpages==0){
|
||||
alert("当前无数据");
|
||||
return;
|
||||
}
|
||||
if(nowpage==1){
|
||||
nowpage=totalpages;
|
||||
}else{
|
||||
nowpage--;
|
||||
}
|
||||
getlist();
|
||||
}
|
||||
|
||||
function nextpage(){
|
||||
if(totalpages==0){
|
||||
alert("当前无数据");
|
||||
return;
|
||||
}
|
||||
if(nowpage==totalpages){
|
||||
nowpage=1;
|
||||
}else{
|
||||
nowpage++;
|
||||
}
|
||||
getlist();
|
||||
}
|
||||
|
||||
function printPDF(){
|
||||
if(confirm("您确认下载该PDF文件吗?")){
|
||||
var pdfName="台账二维码"+nowpage;
|
||||
var target = $('#print');
|
||||
// var pdf = new jsPDF('p','pt','a4');
|
||||
// // 设置打印比例 越大打印越小
|
||||
// pdf.internal.scaleFactor = 1;
|
||||
// var options = {
|
||||
// pagesplit: true, //设置是否自动分页
|
||||
// "background": '#FFFFFF' //如果导出的pdf为黑色背景,需要将导出的html模块内容背景 设置成白色。
|
||||
// };
|
||||
// var printHtml = $('#print'); // 页面某一个div里面的内容,通过id获取div内容
|
||||
// pdf.addHTML(printHtml,15, 15, options,function() {
|
||||
// pdf.save(pdfName+'.pdf');
|
||||
// });
|
||||
|
||||
if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate();
|
||||
html2canvas(target, {
|
||||
onrendered:function(canvas) {
|
||||
var contentWidth = canvas.width;
|
||||
var contentHeight = canvas.height;
|
||||
|
||||
//一页pdf显示html页面生成的canvas高度;
|
||||
var pageHeight = contentWidth / 595.28 * 841.89;
|
||||
//未生成pdf的html页面高度
|
||||
var leftHeight = contentHeight;
|
||||
//页面偏移
|
||||
var position = 0;
|
||||
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
|
||||
var imgWidth = 595.28;
|
||||
var imgHeight = 591.28/contentWidth * contentHeight;
|
||||
|
||||
var pageData = canvas.toDataURL('image/jpeg', 1.0);
|
||||
|
||||
var pdf = new jsPDF('', 'pt', 'a4');
|
||||
|
||||
//有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
|
||||
//当内容未超过pdf一页显示的范围,无需分页
|
||||
if (leftHeight < pageHeight) {
|
||||
pdf.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight );
|
||||
} else {
|
||||
while(leftHeight > 0) {
|
||||
pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
|
||||
leftHeight -= pageHeight;
|
||||
position -= 841.89;
|
||||
//避免添加空白页
|
||||
if(leftHeight > 10) {
|
||||
pdf.addPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
pdf.save(pdfName+".pdf");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body >
|
||||
<div class="wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div style="float:left;width: 100%;height: 50px;">
|
||||
<div style="float:left;width:120px;height: 50px;padding-left:10px;padding-top:5px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="printPDF();"><i
|
||||
class="fa fa-file-pdf-o"></i> 下载PDF
|
||||
</button>
|
||||
</div>
|
||||
<div style="float:right;width:130px;height: 50px;padding-right:10px;padding-top:5px;">
|
||||
<div style="float:left;width:35px;height: 50px;text-align: left;"><button type="button" class="btn btn-default btn-sm pull-left" onclick="lastpage();"><</button></div>
|
||||
<div style="float:left;width:50px;height: 50px;text-align: center;"><span id="pageSt" style="line-height: 30px;"></span></div>
|
||||
<div style="float:left;width:35px;height: 50px;text-align: right;"><button type="button" class="btn btn-default btn-sm pull-right" onclick="nextpage();">></button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="print" name="print" style="float:left;width: 100%;background-color:#FFFFFF;"></div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</body>
|
||||
2908
WebRoot/jsp/equipment/equipmentCardNewList_20210727.jsp
Normal file
2908
WebRoot/jsp/equipment/equipmentCardNewList_20210727.jsp
Normal file
File diff suppressed because it is too large
Load Diff
2172
WebRoot/jsp/equipment/equipmentCardNewView.jsp
Normal file
2172
WebRoot/jsp/equipment/equipmentCardNewView.jsp
Normal file
File diff suppressed because it is too large
Load Diff
1339
WebRoot/jsp/equipment/equipmentCardNewViewForTongji.jsp
Normal file
1339
WebRoot/jsp/equipment/equipmentCardNewViewForTongji.jsp
Normal file
File diff suppressed because it is too large
Load Diff
2275
WebRoot/jsp/equipment/equipmentCardNewView_20210727.jsp
Normal file
2275
WebRoot/jsp/equipment/equipmentCardNewView_20210727.jsp
Normal file
File diff suppressed because it is too large
Load Diff
244
WebRoot/jsp/equipment/equipmentCardPropAdd.jsp
Normal file
244
WebRoot/jsp/equipment/equipmentCardPropAdd.jsp
Normal file
@ -0,0 +1,244 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<!-- <%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %> -->
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<!-- <%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %> -->
|
||||
|
||||
<%request.setAttribute("ABC_A", EquipmentCard.ABC_A); %>
|
||||
<%request.setAttribute("ABC_B", EquipmentCard.ABC_B); %>
|
||||
<%request.setAttribute("ABC_C", EquipmentCard.ABC_C); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("AssetType_MECH", EquipmentCard.AssetType_MECH); %>
|
||||
<%request.setAttribute("AssetType_ELEC", EquipmentCard.AssetType_ELEC); %>
|
||||
<%request.setAttribute("AssetType_APP", EquipmentCard.AssetType_APP); %>
|
||||
<%request.setAttribute("AssetType_AUTO", EquipmentCard.AssetType_AUTO); %>
|
||||
<%request.setAttribute("AssetType_HALFAUTO", EquipmentCard.AssetType_HALFAUTO); %>
|
||||
<%request.setAttribute("AssetType_INDUS", EquipmentCard.AssetType_INDUS); %>
|
||||
|
||||
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
|
||||
$("#subForm_equipmentcardprop").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm_equipmentcardprop").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardProp/dosave.do", $("#subForm_equipmentcardprop").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('SubModal_equipmentcardprop');
|
||||
|
||||
$("#table_equipmentProp").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm_equipmentcardprop").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
installDateProp: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安装时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
purchaseMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '购置费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
laborMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人工费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
instantFlow: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '效率值不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
technicalLife: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '技术寿命年份不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
var companyId="${company.id}";
|
||||
$(function(){
|
||||
|
||||
//安装时间
|
||||
$("#installDateProp").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="SubModal_equipmentcardprop">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备附属</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_equipmentcardprop" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" id="equipmentId" name="equipmentId" value="${equipmentCardId}">
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="installDateProp" name="installDate" style="" value="" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-sm-2 control-label">购置费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="purchaseMoney" name ="purchaseMoney" placeholder="购置费/元" value ="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">人工费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="laborMoney" name ="laborMoney" placeholder="人工费/元" value ="">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">效率值</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="instantFlow" name ="instantFlow" placeholder="效率值" value ="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命年份/年</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="technicalLife" name ="technicalLife" placeholder="技术寿命年份/年" min="0" value=0 step="1">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">能耗费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="energyMoney" name ="energyMoney" placeholder="能耗费用/元" value ="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">维护增额/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="maintainIncrement" name ="maintainIncrement" placeholder="维护增额/元" value ="">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">折旧数值/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="residualValue" name ="residualValue" placeholder="折旧数值/元" value ="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="residualValueRate" name ="residualValueRate" placeholder="折旧率" value ="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<!-- <form class="form-horizontal" id="subPropForm" autocomplete=off>
|
||||
<input type="hidden" id="equipmentProp" name ="equipmentId">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采购费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="purchaseMoney" name ="purchaseMoney" placeholder="采购费" value ="">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">人工费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="laborMoney" name ="laborMoney" placeholder="人工费" value ="" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="technicalLife" name ="technicalLife" placeholder="技术寿命年限" value ="${equipmentCardProp.technicalLife}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物理寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="physicalLife" name ="physicalLife" placeholder="物理寿命年限" value ="${equipmentCardProp.physicalLife}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">安装日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="installDate" name="installDate" style="width: 132px;" value="" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
261
WebRoot/jsp/equipment/equipmentCardPropEdit.jsp
Normal file
261
WebRoot/jsp/equipment/equipmentCardPropEdit.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<!-- <%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %> -->
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<!-- <%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %> -->
|
||||
|
||||
<%request.setAttribute("ABC_A", EquipmentCard.ABC_A); %>
|
||||
<%request.setAttribute("ABC_B", EquipmentCard.ABC_B); %>
|
||||
<%request.setAttribute("ABC_C", EquipmentCard.ABC_C); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("AssetType_MECH", EquipmentCard.AssetType_MECH); %>
|
||||
<%request.setAttribute("AssetType_ELEC", EquipmentCard.AssetType_ELEC); %>
|
||||
<%request.setAttribute("AssetType_APP", EquipmentCard.AssetType_APP); %>
|
||||
<%request.setAttribute("AssetType_AUTO", EquipmentCard.AssetType_AUTO); %>
|
||||
<%request.setAttribute("AssetType_HALFAUTO", EquipmentCard.AssetType_HALFAUTO); %>
|
||||
<%request.setAttribute("AssetType_INDUS", EquipmentCard.AssetType_INDUS); %>
|
||||
|
||||
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
|
||||
$("#subForm_equipmentcardprop").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm_equipmentcardprop").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardProp/doupdate.do", $("#subForm_equipmentcardprop").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('SubModal_equipmentcardprop');
|
||||
|
||||
$("#table_equipmentProp").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','更新失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm_equipmentcardprop").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
installDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安装时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
purchaseMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '购置费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
laborMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人工费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
instantFlow: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '效率值不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
technicalLife: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '技术寿命年份不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
var companyId="${company.id}";
|
||||
$(function(){
|
||||
//保留两位小数
|
||||
if('${equipmentCardProp.laborMoney}' != ""){
|
||||
$("#laborMoney").val(parseFloat('${equipmentCardProp.laborMoney}').toFixed(2))
|
||||
}
|
||||
if('${equipmentCardProp.purchaseMoney}' != ""){
|
||||
$("#purchaseMoney").val(parseFloat('${equipmentCardProp.purchaseMoney}').toFixed(2))
|
||||
}
|
||||
if('${equipmentCardProp.energyMoney}' != ""){
|
||||
$("#energyMoney").val(parseFloat('${equipmentCardProp.energyMoney}').toFixed(2))
|
||||
}
|
||||
if('${equipmentCardProp.maintainIncrement}' != ""){
|
||||
$("#maintainIncrement").val(parseFloat('${equipmentCardProp.maintainIncrement}').toFixed(2))
|
||||
}
|
||||
if('${equipmentCardProp.residualValue}' != ""){
|
||||
$("#residualValue").val(parseFloat('${equipmentCardProp.residualValue}').toFixed(2))
|
||||
}
|
||||
if('${equipmentCardProp.installDate}' != ""){
|
||||
$("#installDateProp").val('${equipmentCardProp.installDate}'.substring(0,10))
|
||||
}
|
||||
//安装时间
|
||||
$("#installDateProp").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="SubModal_equipmentcardprop">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备附属</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_equipmentcardprop" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" id="id" name="id" value="${equipmentCardProp.id}">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="installDateProp" name="installDate" value="${equipmentCardProp.installDate}" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-sm-2 control-label">购置费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="purchaseMoney" name ="purchaseMoney" placeholder="购置费/元" value ="${equipmentCardProp.purchaseMoney}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">人工费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="laborMoney" name ="laborMoney" placeholder="人工费/元" value ="${equipmentCardProp.laborMoney}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">效率值</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="instantFlow" name ="instantFlow" placeholder="效率值" value ="${equipmentCardProp.instantFlow}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命年份/年</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="technicalLife" name ="technicalLife" placeholder="技术寿命年份/年" min="0" value=0 step="1" value="${equipmentCardProp.technicalLife}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">能耗费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="energyMoney" name ="energyMoney" placeholder="能耗费用/元" value ="${equipmentCardProp.energyMoney}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">维护增额/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="maintainIncrement" name ="maintainIncrement" placeholder="维护增额/元" value ="${equipmentCardProp.maintainIncrement}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">折旧数值/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="residualValue" name ="residualValue" placeholder="折旧数值/元" value ="${equipmentCardProp.residualValue}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="residualValueRate" name ="residualValueRate" placeholder="折旧率" value ="${equipmentCardProp.residualValueRate}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<!-- <form class="form-horizontal" id="subPropForm" autocomplete=off>
|
||||
<input type="hidden" id="equipmentProp" name ="equipmentId">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采购费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="purchaseMoney" name ="purchaseMoney" placeholder="采购费" value ="">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">人工费/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="laborMoney" name ="laborMoney" placeholder="人工费" value ="" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="technicalLife" name ="technicalLife" placeholder="技术寿命年限" value ="${equipmentCardProp.technicalLife}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物理寿命年限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="physicalLife" name ="physicalLife" placeholder="物理寿命年限" value ="${equipmentCardProp.physicalLife}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">安装日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="installDate" name="installDate" style="width: 132px;" value="" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
1892
WebRoot/jsp/equipment/equipmentCardPumpList.jsp
Normal file
1892
WebRoot/jsp/equipment/equipmentCardPumpList.jsp
Normal file
File diff suppressed because it is too large
Load Diff
217
WebRoot/jsp/equipment/equipmentCardReamrkAdd.jsp
Normal file
217
WebRoot/jsp/equipment/equipmentCardReamrkAdd.jsp
Normal file
@ -0,0 +1,217 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<!-- <%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %> -->
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<!-- <%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %> -->
|
||||
|
||||
<%request.setAttribute("ABC_A", EquipmentCard.ABC_A); %>
|
||||
<%request.setAttribute("ABC_B", EquipmentCard.ABC_B); %>
|
||||
<%request.setAttribute("ABC_C", EquipmentCard.ABC_C); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("AssetType_MECH", EquipmentCard.AssetType_MECH); %>
|
||||
<%request.setAttribute("AssetType_ELEC", EquipmentCard.AssetType_ELEC); %>
|
||||
<%request.setAttribute("AssetType_APP", EquipmentCard.AssetType_APP); %>
|
||||
<%request.setAttribute("AssetType_AUTO", EquipmentCard.AssetType_AUTO); %>
|
||||
<%request.setAttribute("AssetType_HALFAUTO", EquipmentCard.AssetType_HALFAUTO); %>
|
||||
<%request.setAttribute("AssetType_INDUS", EquipmentCard.AssetType_INDUS); %>
|
||||
|
||||
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var tbName ='tb_doc_file'; //数据表
|
||||
var masterId =''; //数据表
|
||||
var filelist = new Array();
|
||||
function dosave() {
|
||||
|
||||
$("#subForm_equipmentRemarkprop").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm_equipmentRemarkprop").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
console.log($("#subForm_equipmentcardprop").serialize())
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardRemark/dosave.do", {
|
||||
eqid: $('#equipmentId').val(),
|
||||
name: $('#name').val(),
|
||||
content: $('#content').val(),
|
||||
}, function(data) {
|
||||
if (data.total == 1){
|
||||
masterId = data.id
|
||||
control.fileinput("upload");
|
||||
}else if(data.total == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm_equipmentRemarkprop").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
content: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '备注内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: true,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
dropZoneEnabled: false ,//是否显示拖拽区域
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) {
|
||||
//var editorText = editor.txt.html();
|
||||
//传参
|
||||
var data = {
|
||||
"masterId": masterId, //此处自定义传参
|
||||
"tbName": tbName,
|
||||
"nameSpace": 'reamrkfile',
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
//actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
slugCallback: function (data,data2) {
|
||||
console.log(data2);
|
||||
return data;
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
console.log("data is ", data)
|
||||
closeModal('SubModal_equipmentRemarkprop');
|
||||
$("#remarktable").bootstrapTable('refresh');
|
||||
}
|
||||
if(!data.response.pdf) {
|
||||
closeModal('fileInputModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var companyId="${company.id}";
|
||||
$(function(){
|
||||
initFileInput("filelist", ext.contextPath+ "/base/updateFile.do");
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="SubModal_equipmentRemarkprop">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备备注</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_equipmentRemarkprop" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" id="equipmentId" name="equipmentId" value="${equipmentCardId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">备注名称</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="name" name="name" style="" value="" placeholder="请输入名称"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">请输入备注内容</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea type="text" class="form-control" id="content" name ="content" placeholder="备注内容" value =""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">上传文件</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
352
WebRoot/jsp/equipment/equipmentCardReamrkEdit.jsp
Normal file
352
WebRoot/jsp/equipment/equipmentCardReamrkEdit.jsp
Normal file
@ -0,0 +1,352 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<!-- <%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %> -->
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<!-- <%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %> -->
|
||||
|
||||
<%request.setAttribute("ABC_A", EquipmentCard.ABC_A); %>
|
||||
<%request.setAttribute("ABC_B", EquipmentCard.ABC_B); %>
|
||||
<%request.setAttribute("ABC_C", EquipmentCard.ABC_C); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("AssetType_MECH", EquipmentCard.AssetType_MECH); %>
|
||||
<%request.setAttribute("AssetType_ELEC", EquipmentCard.AssetType_ELEC); %>
|
||||
<%request.setAttribute("AssetType_APP", EquipmentCard.AssetType_APP); %>
|
||||
<%request.setAttribute("AssetType_AUTO", EquipmentCard.AssetType_AUTO); %>
|
||||
<%request.setAttribute("AssetType_HALFAUTO", EquipmentCard.AssetType_HALFAUTO); %>
|
||||
<%request.setAttribute("AssetType_INDUS", EquipmentCard.AssetType_INDUS); %>
|
||||
|
||||
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var id = '${equipmentCardRemark.id}'
|
||||
var tbName ='tb_doc_file'; //数据表
|
||||
var nameSpace ='reamrkfile'; //数据表
|
||||
var filelist = new Array();
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileListById.do', {
|
||||
masterId: id,
|
||||
tbName: tbName
|
||||
}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '2500px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
if (data[i].type.split("/")[0] == 'application') {
|
||||
previewConfig['type'] = 'pdf';
|
||||
} else {
|
||||
previewConfig['type'] = data[i].type.split("/")[0];
|
||||
}
|
||||
previewConfig['size'] = data[i].size;
|
||||
previewConfig['filetype'] = data[i].type;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
}
|
||||
|
||||
showFileInput("filelist2");
|
||||
/*else {
|
||||
$('#filelist').hide();
|
||||
}*/
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
console.log(ctrlName, "11111")
|
||||
control = $('#' + ctrlName);
|
||||
|
||||
//control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: ext.contextPath+ "/base/updateFile.do", //上传的地址
|
||||
uploadAsync: true,
|
||||
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: true,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
dropZoneEnabled: false ,//是否显示拖拽区域
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) {
|
||||
//传参
|
||||
var data = {
|
||||
"masterId": id, //此处自定义传参
|
||||
"tbName": tbName,
|
||||
"nameSpace": nameSpace,
|
||||
// "wName":$("#wName").val(),
|
||||
// "wContent": editorText
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
//actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
slugCallback: function (data,data2) {
|
||||
console.log(data2);
|
||||
return data;
|
||||
},
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on('filezoomhide', function (event, params) {
|
||||
//关闭预览模态框后清空内部,防止音视频继续播放
|
||||
$(params.modal).find('.kv-zoom-body').empty();
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('SubModal_equipmentRemarkEdit');
|
||||
$("#remarkable").bootstrapTable('refresh');
|
||||
|
||||
}
|
||||
if(!data.response.pdf) {
|
||||
closeModal('SubModal_equipmentRemarkEdit');
|
||||
$("#remarkable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: true,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
dropZoneEnabled: false ,//是否显示拖拽区域
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) {
|
||||
//var editorText = editor.txt.html();
|
||||
//传参
|
||||
var data = {
|
||||
"masterId": masterId, //此处自定义传参
|
||||
"tbName": tbName,
|
||||
"nameSpace": 'reamrkfile',
|
||||
"equipmentIds":$("#equipmentIds").val()
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
//actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
slugCallback: function (data,data2) {
|
||||
console.log(data2);
|
||||
return data;
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
console.log("data is ", data)
|
||||
closeModal('SubModal_equipmentRemarkprop');
|
||||
$("#remarktable").bootstrapTable('refresh');
|
||||
}
|
||||
if(!data.response.pdf) {
|
||||
closeModal('SubModal_equipmentRemarkprop');
|
||||
$("#remarktable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dosave() {
|
||||
|
||||
$("#SubModal_equipmentRemarkEdit").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#SubModal_equipmentRemarkEdit").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentCardRemark/doupdate.do", {
|
||||
id: $("#r_id").val(),
|
||||
eqid: $('#equipmentId').val(),
|
||||
name: $('#name').val(),
|
||||
content: $('#content').val(),
|
||||
}, function(data) {
|
||||
if (data.total == 1){
|
||||
control.fileinput("upload");
|
||||
}else if(data.total == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//输入框验证
|
||||
$("#subForm_equipmentRemarkprop").bootstrapValidator({
|
||||
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
content: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '备注内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var companyId="${company.id}";
|
||||
$(function(){
|
||||
getFileList();
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="SubModal_equipmentRemarkEdit">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备备注</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_equipmentRemarkprop" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" id="equipmentId" name="equipmentId" value="${equipmentCardId}">
|
||||
<input type="hidden" id="r_id" name="r_id" value="${equipmentCardRemark.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">备注名称</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="name" name="name" style="" value="${equipmentCardRemark.name}" placeholder="请输入名称"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">请输入备注内容</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea type="text" class="form-control" id="content" name ="content" placeholder="备注内容">${equipmentCardRemark.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">上传文件</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="file" name="filelist" id="filelist2" multiple class="file-loading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
182
WebRoot/jsp/equipment/equipmentCardReamrkView.jsp
Normal file
182
WebRoot/jsp/equipment/equipmentCardReamrkView.jsp
Normal file
@ -0,0 +1,182 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<!-- <%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %> -->
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<!-- <%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %> -->
|
||||
|
||||
<%request.setAttribute("ABC_A", EquipmentCard.ABC_A); %>
|
||||
<%request.setAttribute("ABC_B", EquipmentCard.ABC_B); %>
|
||||
<%request.setAttribute("ABC_C", EquipmentCard.ABC_C); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%request.setAttribute("AssetType_MECH", EquipmentCard.AssetType_MECH); %>
|
||||
<%request.setAttribute("AssetType_ELEC", EquipmentCard.AssetType_ELEC); %>
|
||||
<%request.setAttribute("AssetType_APP", EquipmentCard.AssetType_APP); %>
|
||||
<%request.setAttribute("AssetType_AUTO", EquipmentCard.AssetType_AUTO); %>
|
||||
<%request.setAttribute("AssetType_HALFAUTO", EquipmentCard.AssetType_HALFAUTO); %>
|
||||
<%request.setAttribute("AssetType_INDUS", EquipmentCard.AssetType_INDUS); %>
|
||||
|
||||
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var id = '${id}'
|
||||
var tbName ='tb_doc_file'; //数据表
|
||||
var nameSpace ='Remark'; //数据表
|
||||
var filelist = new Array();
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
|
||||
function showFileInputView(ctrlName) {
|
||||
control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx', 'wmv', 'mp4'],
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false,
|
||||
showDownload: true, // 显示下载按钮 (这个也很重要)
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionDelete: '', //这行可以隐藏删除按钮
|
||||
actionUpload: '' //这行可以隐藏上传按钮
|
||||
}
|
||||
});
|
||||
control.on('filezoomhide', function (event, params) {
|
||||
//关闭预览模态框后清空内部,防止音视频继续播放
|
||||
$(params.modal).find('.kv-zoom-body').empty();
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileListView = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileListById.do', {
|
||||
masterId: id,
|
||||
tbName: tbName
|
||||
}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '2500px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
if (data[i].type.split("/")[0] == 'application') {
|
||||
previewConfig['type'] = 'pdf';
|
||||
} else {
|
||||
previewConfig['type'] = data[i].type.split("/")[0];
|
||||
}
|
||||
previewConfig['downloadUrl'] = ext.contextPath + "/report/rptInfoSetFile/downloadFile4minio.do?id=" + data[i].id + "&tbName=" + tbName;//这个是显示下载按钮的关键,如果没有此属性,下载按钮是不会显示的。
|
||||
previewConfig['size'] = data[i].size;
|
||||
previewConfig['filetype'] = data[i].type;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
}
|
||||
showFileInputView("filelistView");
|
||||
/*else {
|
||||
$('#filelistView').hide();
|
||||
}*/
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
var companyId="${company.id}";
|
||||
$(function(){
|
||||
getFileListView();
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="SubModal_equipmentRemarkView">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备备注</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_equipmentRemarkprop" autocomplete=off>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" id="equipmentId" name="equipmentId" value="${equipmentCardId}">
|
||||
<input type="hidden" id="r_id" name="r_id" value="${equipmentCardRemark.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 col-xs-12 control-label">备注文件</label>
|
||||
<div class="col-md-10 col-xs-12">
|
||||
<input type="file" name="filelistView" id="filelistView" multiple class="file-loading"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
305
WebRoot/jsp/equipment/equipmentCardScrapList.jsp
Normal file
305
WebRoot/jsp/equipment/equipmentCardScrapList.jsp
Normal file
@ -0,0 +1,305 @@
|
||||
<%@ 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.equipment.EquipmentCard" %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</title>
|
||||
<!-- 引入list - js-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentList.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${param.unitId}',
|
||||
processSectionId: '${param.processSectionId}',
|
||||
equipmentClassPid: '${param.equipmentClassPid}',
|
||||
equipmentClassId: '${param.equipmentClassId}',
|
||||
search_name: $('#equipment_search_name').val(),
|
||||
equipmentLevel: $('#equipmentLevel').val(),
|
||||
equipmentBelong: $('#equipmentBelong').val(),
|
||||
equipmentStatus: $("#equipmentstatus").val(),
|
||||
isScrap: "isSrcap",
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCardScrap.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
width: '40px', // 定义列的宽度,单位为像素px
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '12%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span onclick="viewFun(\'' + row.id + '\');" style="color:#004B97;cursor:pointer;">' + row.equipmentname + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '制造厂家', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span>' + row.equipmentmanufacturer + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
},
|
||||
{
|
||||
field: 'assetnumber', // 返回json数据中的name
|
||||
title: '资产编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
},{
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
}, {
|
||||
field: 'equipmentStatusManagement.name', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/scrap.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="报废申请" onclick="addScrapApplyFun(\'' + row.id + '\')"><i class="fa fa-plus-square" aria-hidden="true"></i>\n<span class="hidden-md hidden-lg"> 报废申请</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
//获取工艺段
|
||||
// getProcessSection();
|
||||
//设备所属--常排项目用
|
||||
$.post(ext.contextPath + "/equipment/equipmentBelong/getEquipmentBelong4Select.do", {companyId:unitId}, function(data) {
|
||||
$("#equipmentBelong").empty();
|
||||
var selelct_ =$("#equipmentBelong").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
//abc分类
|
||||
$.post(ext.contextPath + "/equipment/equipmentLevel/getEquipmentLevel4Select.do", {companyId:unitId}, function(data) {
|
||||
$("#equipmentLevel").empty();
|
||||
var selelct_ =$("#equipmentLevel").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content container-fluid">
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv2"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentModelSubDiv"></div>
|
||||
<div id="assetTypeSubDiv"></div>
|
||||
<%--测量点曲线--%>
|
||||
<div id="subDivHis"></div>
|
||||
<div id="viewVideoDiv"></div>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--设备资料--%>
|
||||
<div id="subDiv_Doc"></div>
|
||||
|
||||
<%--摄像头弹窗--%>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--备注新增弹窗--%>
|
||||
<div id="subRemarkAddDiv"></div>
|
||||
<%--备注修改弹窗--%>
|
||||
<div id="subRemarkEditDiv"></div>
|
||||
<%--备注查看弹窗--%>
|
||||
<div id="subRemarkViewDiv"></div>
|
||||
<%--测量点弹窗--%>
|
||||
<div id="subDiv_PatroPoint"></div>
|
||||
<%--人员选择弹窗--%>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<%--设备选择弹窗--%>
|
||||
<div id="equipmentCard4SelectsDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
|
||||
<security:authorize buttonUrl="/equipment/EquipmentScrapApply/doEquipmentCardSave.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addScrapApplyFuns();"><i
|
||||
class="fa fa-plus"></i>
|
||||
报废申请
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<div class="form-group pull-right form-inline">
|
||||
|
||||
<!--设备所属-常排项目用-->
|
||||
<div class="input-group input-group-sm" style="padding-right: 10px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">设备所属:</label>
|
||||
<select class="form-control select2 " id="equipmentBelong" name ="equipmentBelong" style="width: 100px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="padding-right: 10px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">ABC分类:</label>
|
||||
<select class="form-control select2 " id="equipmentLevel" name ="equipmentLevel" style="width: 100px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="equipment_search_name" name="equipment_search_name"
|
||||
class="form-control pull-right" placeholder="设备编号/设备名称/规格型号/制造厂家">
|
||||
<input type="text" class="form-control" style="display:none">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<table id="table"></table>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
263
WebRoot/jsp/equipment/equipmentCardTree.jsp
Normal file
263
WebRoot/jsp/equipment/equipmentCardTree.jsp
Normal file
@ -0,0 +1,263 @@
|
||||
<%@ 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" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
padding-right: 4px;
|
||||
background-color: #d0d0d0;
|
||||
/*其他样式,比如圆角等*/
|
||||
}
|
||||
|
||||
/*滑块样式*/
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #6C6C6C;
|
||||
}
|
||||
|
||||
/*当前窗口失去焦点时的滑块样式*/
|
||||
::-webkit-scrollbar-thumb:window-inactive {
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
/*默认隐藏滚动条*/
|
||||
#tree {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
/*悬浮显示滚动条*/
|
||||
#tree:hover {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var showList1 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'p') {//点击工艺段
|
||||
$('#processSectionId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList.do', {
|
||||
processSectionId: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#processSectionId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var showList2 = function (id, type, unitId, pid) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'e') {//点击设备类型
|
||||
$('#equipmentClassId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList.do', {
|
||||
equipmentClassId: id,
|
||||
equipmentClassPid: pid,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#equipmentClassId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载工艺段
|
||||
*/
|
||||
var proTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3, showTags: true});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList1(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载设备类型
|
||||
*/
|
||||
var equTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
|
||||
// $.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList2(treeList.id, treeList.type, treeList.unitId, treeList.pid);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
//点击工艺段(按钮)
|
||||
function proFun() {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
proTreeView();
|
||||
// $('#proButton').css('background-color', '#e8f5fe');
|
||||
// $('#equButton').css('background-color', '#FFFFFF');
|
||||
}
|
||||
|
||||
//点击设备类型(按钮)
|
||||
function equFun() {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
equTreeView();
|
||||
// $('#proButton').css('background-color', '#FFFFFF');
|
||||
// $('#equButton').css('background-color', '#e8f5fe');
|
||||
}
|
||||
|
||||
function framePackup() {
|
||||
$("#leftToolsLvl2").css("display", "none");
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","block");$("#leftToolsLvl2").css("display","none");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-10")
|
||||
$('#rightTools').addClass("col-md-12")
|
||||
}
|
||||
|
||||
function frameOpen() {
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","none");$("#leftToolsLvl2").css("display","block");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-12")
|
||||
$('#rightTools').addClass("col-md-10")
|
||||
}
|
||||
|
||||
$(function () {
|
||||
proTreeView();
|
||||
|
||||
//默认加载右边 Table
|
||||
showList1(unitId, 'B', unitId)
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<input type="hidden" name="unitId" id="unitId" value=""><%--厂id--%>
|
||||
<input type="hidden" name="processSectionId" id="processSectionId" value=""><%--工艺段id--%>
|
||||
<input type="hidden" name="equipmentClassId" id="equipmentClassId" value=""><%--设备类型id--%>
|
||||
|
||||
<%--<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>
|
||||
</ol>
|
||||
</section>--%>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div class="row">
|
||||
|
||||
<!--隐藏时候的按钮-->
|
||||
<div id="leftToolsPackup" onclick="frameOpen();"
|
||||
style="display: none;position: absolute;z-index:9;left:0px;top:100px;width: 20px;height: 25px;border-radius: 4px;box-shadow: 2px 2px 4px 0px #696969, 0px 0px 4px 0px #696969;">
|
||||
<button type="button" class="btn btn-box-tool"><i class="fa fa-forward"></i></button>
|
||||
</div>
|
||||
|
||||
<!--左边树形框-->
|
||||
<div class="col-md-2" id="leftTools" style="left:0px;top:0px;border-radius: 12px;">
|
||||
<div class="box box-solid" id="leftToolsLvl2">
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<button type="button" id="button1" class="btn btn-primary btn-sm" onclick="proFun();">
|
||||
工艺段
|
||||
</button>
|
||||
<button type="button" id="button2" class="btn btn-default btn-sm" onclick="equFun();">
|
||||
设备类型
|
||||
</button>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="framePackup();">
|
||||
<i class="fa fa-backward"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="nav-tabs-custom">--%>
|
||||
<%-- <ul class="nav nav-tabs" id="">--%>
|
||||
<%-- <li class="kuandu active" id="proButton"><a onclick="proFun()" data-toggle="tab" index="0" aria-expanded="true">工艺段11</a></li>--%>
|
||||
<%-- --%>
|
||||
<%-- <li class="kuandu " id="equButton" ><a onclick="equFun()" data-toggle="tab" index="1" aria-expanded="false">设备类型</a></li>--%>
|
||||
<%-- <div class="box-tools">--%>
|
||||
<%-- <button type="button" class="btn btn-box-tool" onclick="framePackup();"><i--%>
|
||||
<%-- class="fa fa-backward"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </ul>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:1000px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--右边table style="margin-left:-20px;"-->
|
||||
<div class="col-md-10" id="rightTools">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
259
WebRoot/jsp/equipment/equipmentCardTreeViewWeb.jsp
Normal file
259
WebRoot/jsp/equipment/equipmentCardTreeViewWeb.jsp
Normal file
@ -0,0 +1,259 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
padding-right: 4px;
|
||||
background-color: #d0d0d0;
|
||||
/*其他样式,比如圆角等*/
|
||||
}
|
||||
|
||||
/*滑块样式*/
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #6C6C6C;
|
||||
}
|
||||
|
||||
/*当前窗口失去焦点时的滑块样式*/
|
||||
::-webkit-scrollbar-thumb:window-inactive {
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
/*默认隐藏滚动条*/
|
||||
#tree {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
/*悬浮显示滚动条*/
|
||||
#tree:hover {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.treeview .list-group-item {
|
||||
cursor: pointer;
|
||||
background-color: #15305F;
|
||||
}
|
||||
|
||||
.box.box-solid {
|
||||
border-top: 0;
|
||||
background-color: #15305F;
|
||||
}
|
||||
|
||||
/*element.style {*/
|
||||
/* min-height: 265px;*/
|
||||
/* background-color: #15305F;*/
|
||||
/*}*/
|
||||
|
||||
</style>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var showList1 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'p') {//点击工艺段
|
||||
$('#processSectionId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList4Web.do', {
|
||||
processSectionId: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#processSectionId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList4Web.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var showList2 = function (id, type, unitId) {
|
||||
$('#unitId').val(unitId);
|
||||
|
||||
if (type == 'e') {//点击设备类型
|
||||
$('#equipmentClassId').val(id);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList4Web.do', {
|
||||
equipmentClassId: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
} else {//点击其他 如厂
|
||||
$('#equipmentClassId').val('');
|
||||
|
||||
$.post(ext.contextPath + '/equipment/showList4Web.do', {
|
||||
unitId: id
|
||||
}, function (data) {
|
||||
$("#rightTools").html(data);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载工艺段
|
||||
*/
|
||||
var proTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
|
||||
unitId: '${unitId}'
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3, showTags: true});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList1(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载设备类型
|
||||
*/
|
||||
var equTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
|
||||
// $.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {
|
||||
unitId: '${unitId}'
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeList) {
|
||||
showList2(treeList.id, treeList.type, treeList.unitId);
|
||||
});
|
||||
}, 'json');
|
||||
//$("#rightTools").html("");
|
||||
};
|
||||
|
||||
//点击工艺段(按钮)
|
||||
function proFun() {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
proTreeView();
|
||||
// $('#proButton').css('background-color', '#e8f5fe');
|
||||
// $('#equButton').css('background-color', '#FFFFFF');
|
||||
}
|
||||
|
||||
//点击设备类型(按钮)
|
||||
function equFun() {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
equTreeView();
|
||||
// $('#proButton').css('background-color', '#FFFFFF');
|
||||
// $('#equButton').css('background-color', '#e8f5fe');
|
||||
}
|
||||
|
||||
function framePackup() {
|
||||
$("#leftToolsLvl2").css("display", "none");
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","block");$("#leftToolsLvl2").css("display","none");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-10")
|
||||
$('#rightTools').addClass("col-md-12")
|
||||
}
|
||||
|
||||
function frameOpen() {
|
||||
$("#leftTools").animate({width: 'toggle'}, 500);
|
||||
setTimeout('$("#leftToolsPackup").css("display","none");$("#leftToolsLvl2").css("display","block");', 500);
|
||||
|
||||
$('#rightTools').removeClass("col-md-12")
|
||||
$('#rightTools').addClass("col-md-10")
|
||||
}
|
||||
|
||||
$(function () {
|
||||
proTreeView();
|
||||
|
||||
//默认加载右边 Table
|
||||
showList1(unitId, 'B', unitId)
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body style="opacity:0.8;background: transparent;">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper" style="background-color: #15305F;color: #FFFFFF;">
|
||||
|
||||
<input type="hidden" name="unitId" id="unitId" value=""><%--厂id--%>
|
||||
<input type="hidden" name="processSectionId" id="processSectionId" value=""><%--工艺段id--%>
|
||||
<input type="hidden" name="equipmentClassId" id="equipmentClassId" value=""><%--设备类型id--%>
|
||||
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div class="row">
|
||||
|
||||
<!--隐藏时候的按钮-->
|
||||
<div id="leftToolsPackup" onclick="frameOpen();"
|
||||
style="display: none;position: absolute;z-index:9;left:0px;top:100px;width: 20px;height: 25px;border-radius: 4px;box-shadow: 2px 2px 4px 0px #696969, 0px 0px 4px 0px #696969;">
|
||||
<button type="button" class="btn btn-box-tool"><i class="fa fa-forward"></i></button>
|
||||
</div>
|
||||
|
||||
<!--左边树形框-->
|
||||
<div class="col-md-3" id="leftTools" style="left:0px;top:0px;border-radius: 12px;">
|
||||
<div class="box box-solid" id="leftToolsLvl2">
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group" style="width: 100%;color: #FFFFFF;">
|
||||
<button type="button" id="button1" class="btn btn-primary btn-sm" onclick="proFun();">
|
||||
工艺区域
|
||||
</button>
|
||||
<button type="button" id="button2" class="btn btn-default btn-sm" onclick="equFun();">
|
||||
设备类型
|
||||
</button>
|
||||
<%--<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="framePackup();">
|
||||
<i class="fa fa-backward"></i></button>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--右边table style="margin-left:-20px;"-->
|
||||
<div class="col-md-9" id="rightTools" style="left:0px;top:0px;">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
226
WebRoot/jsp/equipment/equipmentCardTreeViewWeb2.jsp
Normal file
226
WebRoot/jsp/equipment/equipmentCardTreeViewWeb2.jsp
Normal file
@ -0,0 +1,226 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
// var dosearch = function () {
|
||||
// initFun();
|
||||
// };
|
||||
// var refreshTable = function () {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// };
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${unitId}',
|
||||
processSectionId: $('#processSection').val(),
|
||||
equipmentClassId: $('#equipmentClass').val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
//销毁表格
|
||||
$("#table").bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: false, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
// showToggle: true,
|
||||
cardView:false,
|
||||
// strictSearch:true,
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
// formatter: function (value, row, index) {
|
||||
// if (value != null && value != '') {
|
||||
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
// }
|
||||
// }
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
// formatter: function (value, row, index) {
|
||||
// if (value != null && value != '') {
|
||||
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
// }
|
||||
// }
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
// formatter: function (value, row, index) {
|
||||
// if (value != null && value != '') {
|
||||
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
// }
|
||||
// }
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
// formatter: function (value, row, index) {
|
||||
// if (value != null && value != '') {
|
||||
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 工艺段
|
||||
*/
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${unitId}'}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 5,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassJson4Root.do", {}, function (data) {
|
||||
$("#equipmentClass").empty();
|
||||
var selelct_ = $("#equipmentClass").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 5,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body style="opacity:0.8;background: transparent;">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper" style="background-color: #15305F;color: #FFFFFF;">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv_Configure"></div>
|
||||
<div id="subDiv_PatroPoint"></div>
|
||||
<div id="subDiv_Equipment"></div>
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 180px;">
|
||||
</select>
|
||||
<label class="form-label ">设备类型</label>
|
||||
<select class="form-control select2 " id="equipmentClass" name="equipmentClass"
|
||||
style="width: 180px;">
|
||||
</select>
|
||||
<label class="form-label">设备名称</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<%-- <table id="table" style="table-layout:fixed;"></table>--%>
|
||||
<table id="table"></table>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1002
WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
1002
WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
File diff suppressed because it is too large
Load Diff
115
WebRoot/jsp/equipment/equipmentCardViewBox.jsp
Normal file
115
WebRoot/jsp/equipment/equipmentCardViewBox.jsp
Normal file
@ -0,0 +1,115 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); %>
|
||||
<%request.setAttribute("Status_Finish", MaintenanceDetail.Status_Finish); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
//关联测量点
|
||||
$("#table_point").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: '${equipmentCard.bizid}',
|
||||
equipid:'${equipmentCard.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewEquipmentCardFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
/* {
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, */{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '数据', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_point");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备信息</h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-primary btn-xs" onclick="viewEquModel('${equipmentCard.id}');">设备卡片</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">统一编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.id}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentCard.equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设计参数</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_point"></table>
|
||||
</div>
|
||||
</div>
|
||||
257
WebRoot/jsp/equipment/equipmentCardViewList4Type.jsp
Normal file
257
WebRoot/jsp/equipment/equipmentCardViewList4Type.jsp
Normal file
@ -0,0 +1,257 @@
|
||||
<%@ 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.equipment.EquipmentCard" %>
|
||||
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
||||
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
||||
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
||||
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
||||
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
||||
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
||||
<%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<%--<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>--%>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 引入list - js-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentList.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: '${unitId}',
|
||||
processSectionId: '${param.processSectionId}',
|
||||
equipmentClassPid: '${param.equipmentClassPid}',
|
||||
equipmentClassId: '${param.equipmentClassId}',
|
||||
equipmentClassCode: '${equipmentClassCode}',
|
||||
search_name: $('#equipment_search_name').val()
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'equipmentcardid', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
width: '40px', // 定义列的宽度,单位为像素px
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '12%',
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '14%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span onclick="viewFun(\'' + row.id + '\');" style="color:#004B97;cursor:pointer;">' + row.equipmentname + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentmanufacturer', // 返回json数据中的name
|
||||
title: '制造厂家', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
return '<span>' + row.equipmentmanufacturer + '</span>';
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentmodelname', // 返回json数据中的name
|
||||
title: '设备型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
},
|
||||
{
|
||||
field: 'assetnumber', // 返回json数据中的name
|
||||
title: '资产编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'equipmentLevel.levelname', // 返回json数据中的name
|
||||
title: '设备等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
}, {
|
||||
field: 'equipmentStatusManagement.name', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '5%'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '6%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">浏览</span></button>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
//获取工艺段
|
||||
// getProcessSection();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<input type="hidden" id="equipmentClassCode" name="equipmentClassCode" value="${equipmentClassCode}">
|
||||
<section class="content container-fluid">
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv2"></div>
|
||||
<div id="equipmentClassSubDiv"></div>
|
||||
<div id="equipmentModelSubDiv"></div>
|
||||
<div id="assetTypeSubDiv"></div>
|
||||
<%--测量点曲线--%>
|
||||
<div id="subDivHis"></div>
|
||||
<div id="viewVideoDiv"></div>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--设备资料--%>
|
||||
<div id="subDiv_Doc"></div>
|
||||
|
||||
<%--摄像头弹窗--%>
|
||||
<div id="subCameraAddDiv"></div>
|
||||
<%--备注新增弹窗--%>
|
||||
<div id="subRemarkAddDiv"></div>
|
||||
<%--备注修改弹窗--%>
|
||||
<div id="subRemarkEditDiv"></div>
|
||||
<%--备注查看弹窗--%>
|
||||
<div id="subRemarkViewDiv"></div>
|
||||
<%--测量点弹窗--%>
|
||||
<div id="subDiv_PatroPoint"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 100%;">
|
||||
<%--<security:authorize buttonUrl="equipment/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<security:authorize buttonUrl="equipment/del.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<security:authorize buttonUrl="equipment/import.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
</security:authorize>--%>
|
||||
|
||||
<security:authorize buttonUrl="equipment/download.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm" style="width: 250px;float: left;">
|
||||
<input type="text" id="equipment_search_name" name="equipment_search_name"
|
||||
class="form-control pull-right"
|
||||
placeholder="设备编号/设备名称/规格型号/制造厂家">
|
||||
<input type="text" class="form-control" style="display:none">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table id="table"></table>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
202
WebRoot/jsp/equipment/equipmentCardViewWeb.jsp
Normal file
202
WebRoot/jsp/equipment/equipmentCardViewWeb.jsp
Normal file
@ -0,0 +1,202 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// background:transparent;
|
||||
<%--alert('<%=request.getContextPath()%>/IMG/bim/bim.png');--%>
|
||||
// $('#body').css('background', 'background:transparent;');
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="body" style="opacity:0.8;background: transparent;">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper" style="background-color: #15305F;color: #FFFFFF;">
|
||||
<section class="content container-fluid">
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<div id="left" class="leftstyle">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备所属/工艺线:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentBelong.belongName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentClass.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.processSection.name}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">设备等级:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentLevel.levelname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">规格型号:</label>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${not empty equipmentCard.equipmentmodel}">
|
||||
<p class="form-control-static">${equipmentCard.equipmentTypeNumber.name}</p>
|
||||
</c:if>
|
||||
<c:if test="${empty equipmentCard.equipmentmodel}">
|
||||
<p class="form-control-static">${equipmentCard.equipmentmodelname}</p>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装地点:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.areaid}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">主要技术参数:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.techParameters}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">制造厂家:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentmanufacturer}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">出厂编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.factoryNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="openDate"
|
||||
class="form-control-static">${equipmentCard.openDate.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">安装日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="installDate"
|
||||
class="form-control-static">${equipmentCard.installDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.assetClass.assetclassname}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">资产编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.assetnumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">购置日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="buyTime"
|
||||
class="form-control-static">${equipmentCard.buyTime.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">采购价:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.purchaseValue} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">入账日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.inStockTime.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">出厂年月:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.productiondate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">账面原值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentvalue} </p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">账面净值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipWorth} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentStatusManagement.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
621
WebRoot/jsp/equipment/equipmentCardView_old.jsp
Normal file
621
WebRoot/jsp/equipment/equipmentCardView_old.jsp
Normal file
@ -0,0 +1,621 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
|
||||
<%@page import="com.sipai.entity.workorder.WorkorderDetail" %>
|
||||
<%request.setAttribute("REPAIR", WorkorderDetail.REPAIR); %>
|
||||
<%request.setAttribute("MAINTAIN", WorkorderDetail.MAINTAIN); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryStatus_OFF", EquipmentCard.CompulsoryStatus_OFF); %>
|
||||
<%request.setAttribute("CompulsoryStatus_ON", EquipmentCard.CompulsoryStatus_ON); %>
|
||||
|
||||
<%request.setAttribute("CompulsoryInspectionType_EQUIP", EquipmentCard.CompulsoryInspectionType_EQUIP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_APP", EquipmentCard.CompulsoryInspectionType_APP); %>
|
||||
<%request.setAttribute("CompulsoryInspectionType_CAR", EquipmentCard.CompulsoryInspectionType_CAR); %>
|
||||
|
||||
<%--维修内容--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentRepair.js"
|
||||
charset="utf-8"></script>
|
||||
<%--保养内容--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentMaintenance.js"
|
||||
charset="utf-8"></script>
|
||||
<%--关联点位--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentMeasurePoint.js"
|
||||
charset="utf-8"></script>
|
||||
<%--关联摄像头--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentCardCamera.js"
|
||||
charset="utf-8"></script>
|
||||
<%--iframe链接--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentCardLinks.js"
|
||||
charset="utf-8"></script>
|
||||
<%--检定记录--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentSpecial.js"
|
||||
charset="utf-8"></script>
|
||||
<%--设备资料--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentDoc.js"
|
||||
charset="utf-8"></script>
|
||||
<%--设备备注--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/equipment/equipmentCardRemark.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//加载维修
|
||||
function getRepairFunction_View() {
|
||||
getRepair4EquipmentCard('${REPAIR}', '${equipmentCard.id}');
|
||||
}
|
||||
|
||||
//加载保养
|
||||
function getMaintenanceFunction_View() {
|
||||
getMaintenance4EquipmentCard('${MAINTAIN}', '${equipmentCard.id}');
|
||||
}
|
||||
|
||||
//加载测量点(目前关联id和编号都可以,但后面全部要改成关联id)
|
||||
function getMpointFunction_View() {
|
||||
getMpoint4EquipmentCard('${equipmentCard.id}', '${equipmentCard.equipmentcardid}', '${equipmentCard.bizid}', 'view');
|
||||
}
|
||||
|
||||
//摄像头清单
|
||||
function getCameraFunction_View() {
|
||||
getCamera4EquipmentCard('${equipmentCard.id}', 'view');
|
||||
}
|
||||
|
||||
//加载检定记录
|
||||
function getSpecialFunction_View() {
|
||||
getSpecial('', '${equipmentCard.id}');
|
||||
}
|
||||
|
||||
//PME设备
|
||||
showLinks('${equipmentCard.id}');
|
||||
|
||||
//获取设备资料
|
||||
function getDocFunction_View() {
|
||||
getDoc('${equipmentCard.id}');
|
||||
}
|
||||
|
||||
//备注列表
|
||||
function getRemarkFunction() {
|
||||
getRemark4EquipmentCard('${equipmentCard.id}', 'view');
|
||||
}
|
||||
|
||||
|
||||
//上次维修时间
|
||||
function getLastRepairDt() {
|
||||
$.post(ext.contextPath + '/workorder/workorderDetail/getLastDt.do', {type: 'repair',equipmentId:'${equipmentCard.id}'}, function (data) {
|
||||
$('#lastRepair').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
//上次保养时间
|
||||
function getLastMaintenanceDt() {
|
||||
$.post(ext.contextPath + '/workorder/workorderDetail/getLastDt.do', {type: 'maintain',equipmentId:'${equipmentCard.id}'}, function (data) {
|
||||
$('#lastMaintenance').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
//报废时间
|
||||
function getScrapDt() {
|
||||
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/getScrapDt.do', {equipmentId:'${equipmentCard.id}'}, function (data) {
|
||||
if(data == '无'){
|
||||
document.getElementById('scrapDtDiv').style.display = 'none';
|
||||
}else{
|
||||
$('#scrapDt').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
getLastRepairDt();
|
||||
getLastMaintenanceDt();
|
||||
getScrapDt();
|
||||
});
|
||||
|
||||
/*window.onload = function() {
|
||||
getLastRepairDt();
|
||||
getLastMaintenanceDt();
|
||||
};*/
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">×</span></button>
|
||||
<h4 class="modal-title">浏览</h4>
|
||||
</div>
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs" id="equipmentCardView_tab_title">
|
||||
|
||||
<li class="kuandu active"><a href="#tab0" data-toggle="tab" index="0" aria-expanded="true">设备详情</a>
|
||||
</li>
|
||||
<li class="kuandu "><a href="#tab1" data-toggle="tab" index="1" aria-expanded="false"
|
||||
onclick="getRepairFunction_View();">维修记录</a></li>
|
||||
<li class="kuandu"><a href="#tab2" data-toggle="tab" index="2" aria-expanded="false"
|
||||
onclick="getMaintenanceFunction_View();">保养记录</a></li>
|
||||
<li class="kuandu"><a href="#tab3" data-toggle="tab" index="3" aria-expanded="false"
|
||||
onclick="getMpointFunction_View();">关联点表</a></li>
|
||||
<c:if test="${equipmentCard.isCompulsoryInspection == CompulsoryStatus_ON}">
|
||||
<li class="kuandu"><a href="#tab4" data-toggle="tab" index="4" aria-expanded="false"
|
||||
onclick="getSpecialFunction_View();">检定记录</a>
|
||||
</li>
|
||||
</c:if>
|
||||
<li class="kuandu"><a href="#tab5" data-toggle="tab" index="5" aria-expanded="false"
|
||||
onclick="getCameraFunction_View();">关联摄像头</a></li>
|
||||
<li class="kuandu"><a href="#tab6" data-toggle="tab" index="6" aria-expanded="false"
|
||||
onclick="getDocFunction_View();">设备资料</a></li>
|
||||
<li class="kuandu hidden" id="tab_iframe"><a href="#tab7" data-toggle="tab" index="7"
|
||||
aria-expanded="false" onclick="showIframe()">PME设备</a>
|
||||
</li>
|
||||
<li class="kuandu"><a href="#tab8" data-toggle="tab" index="8"
|
||||
aria-expanded="false">设备附属</a>
|
||||
</li>
|
||||
<li class="kuandu"><a href="#tab9" data-toggle="tab" index="5" aria-expanded="false"
|
||||
onclick="getRemarkFunction();">设备备注</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content" id="equipmentCardView_tab_content">
|
||||
<div class=" tab-pane active" id="tab0">
|
||||
<div class="modal-body">
|
||||
<div id="left" class="leftstyle">
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="companyId" value="${equipmentCard.bizid}">
|
||||
<input type="hidden" id="id" name="id" value="${equipmentCard.id}">
|
||||
<input type="hidden" id="equipmentSpecification" name="specification"
|
||||
value="${equipmentCard.equipmentSpecification.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备所属/工艺线:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentBelong.belongName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentClass.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.processSection.name}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">设备等级:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentLevel.levelname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">规格型号:</label>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${not empty equipmentCard.equipmentmodel}">
|
||||
<p class="form-control-static">${equipmentCard.equipmentTypeNumber.name}</p>
|
||||
</c:if>
|
||||
<c:if test="${empty equipmentCard.equipmentmodel}">
|
||||
<p class="form-control-static">${equipmentCard.equipmentmodelname}</p>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装地点:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.areaid}</p>
|
||||
</div>
|
||||
|
||||
<div id="scrapDtDiv">
|
||||
<label class="col-sm-2 control-label">报废时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="scrapDt" class="form-control-static"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">主要技术参数:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.techParameters}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">制造厂家:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentmanufacturer}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">出厂编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.factoryNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">上次维修时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="lastRepair" class="form-control-static"></p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">上次保养时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="lastMaintenance" class="form-control-static"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="openDate"
|
||||
class="form-control-static">${equipmentCard.openDate.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">安装日期(领料时间):</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="installDate"
|
||||
class="form-control-static">${equipmentCard.installDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否强检:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">
|
||||
<c:if test="${equipmentCard.isCompulsoryInspection == CompulsoryStatus_ON}">
|
||||
是
|
||||
</c:if>
|
||||
<c:if test="${equipmentCard.isCompulsoryInspection == CompulsoryStatus_OFF}">
|
||||
否
|
||||
</c:if>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<c:if test="${equipmentCard.isCompulsoryInspection == CompulsoryStatus_ON}">
|
||||
<label class="col-sm-2 control-label">强检类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">
|
||||
<c:if test="${equipmentCard.compulsoryInspectionType == CompulsoryInspectionType_EQUIP}">
|
||||
特种设备
|
||||
</c:if>
|
||||
<c:if test="${equipmentCard.compulsoryInspectionType == CompulsoryInspectionType_APP}">
|
||||
仪器仪表
|
||||
</c:if>
|
||||
<c:if test="${equipmentCard.compulsoryInspectionType == CompulsoryInspectionType_CAR}">
|
||||
车辆
|
||||
</c:if>
|
||||
</p>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">资产类型:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.assetClass.assetclassname}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">资产编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.assetnumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">购置日期(采购年月):</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="buyTime"
|
||||
class="form-control-static">${equipmentCard.buyTime.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">采购价:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.purchaseValue} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">入账日期(入库时间):</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.inStockTime.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">出厂年月:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.productiondate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">账面原值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentvalue} </p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">账面净值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipWorth} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧年限:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="depreciationLife"
|
||||
class="form-control-static">${equipmentCard.depreciationLife}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">残值率:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="residualValueRate"
|
||||
class="form-control-static">${equipmentCard.residualValueRate}</p>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备状态:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCard.equipmentStatusManagement.name}</p>
|
||||
</div>
|
||||
|
||||
<%--<label class="col-sm-2 control-label">使用年限:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="serviceLife" class="form-control-static">${equipmentCard.serviceLife}</p>
|
||||
</div>--%>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备状况评价:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.equipmentStatusMemo}</p>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentCard.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab1">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="table_repair" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="table_maintain" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab3">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="table_mpoint2"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="table_special"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab5">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="cameratable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab9">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="remarktable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<table id="table_doc"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane " id="tab7">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<div id="links"><label class='bg-info'>请求PME设备数据中,请稍后。</label></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" tab-pane" id="tab8">
|
||||
<div class="modal-body">
|
||||
<div class="leftstyle">
|
||||
<form class="form-horizontal">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安装日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.installDate.substring(0,10)}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">购置费/元:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="installDate2"
|
||||
class="form-control-static">${equipmentCardProp.purchaseMoney}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">人工费/元:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.laborMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">效率值:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.instantFlow}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%-- <label class="col-sm-2 control-label">技术寿命年份/年:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.technicalLife}</p>
|
||||
</div>--%>
|
||||
<label class="col-sm-2 control-label">能耗费用/元:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.energyMoney}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">维护增额/元:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.maintainIncrement}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">折旧数值/元:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.residualValue}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">折旧率:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.residualValueRate}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">税额:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.taxAmount}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否备用:</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${equipmentCardProp.isBackup == '1'}">
|
||||
<p class="form-control-static">是</p>
|
||||
</c:if>
|
||||
<c:if test="${equipmentCardProp.isBackup == '0'}">
|
||||
<p class="form-control-static">否</p>
|
||||
</c:if>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">关键性指数:</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${equipmentCardProp.keynum == '1'}">
|
||||
<p class="form-control-static">无</p>
|
||||
</c:if>
|
||||
<c:if test="${equipmentCardProp.keynum == '2'}">
|
||||
<p class="form-control-static">低</p>
|
||||
</c:if>
|
||||
<c:if test="${equipmentCardProp.keynum == '3'}">
|
||||
<p class="form-control-static">高</p>
|
||||
</c:if>
|
||||
<c:if test="${equipmentCardProp.keynum == '4'}">
|
||||
<p class="form-control-static">极高</p>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">记账凭证号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.bookkeepVoucher}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">注销日期:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.equLogoutDate.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预计使用时间/年:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.estimatedLife}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物理寿命/年:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.physicalLife}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">技术寿命/年:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.technicalLife}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">经济寿命/年:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentCardProp.economicLife}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
138
WebRoot/jsp/equipment/equipmentClass4Tree.jsp
Normal file
138
WebRoot/jsp/equipment/equipmentClass4Tree.jsp
Normal file
@ -0,0 +1,138 @@
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var unitId="";
|
||||
|
||||
//type 1 为类别 2 为设备 3为部位
|
||||
var addFun = function(type) {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/add.do', {pid:pid,type:type} , function(data) {
|
||||
console.log(data);
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id, type) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/edit.do', {id: id,type: type} , function(data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {unitId:unitId} , function(data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData,levels: 2});
|
||||
$('#tree').on('nodeSelected', function(event, treeData) {
|
||||
editFun(treeData.id, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
// if(treeData.type == 3){
|
||||
// $("#addDiv").css("display","none");//隐藏div
|
||||
// }else{
|
||||
// $("#addDiv").css("display","block");//显示div
|
||||
// }
|
||||
|
||||
});
|
||||
},'json');
|
||||
$("#menuBox").html("");
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport(){
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/importEquipmentClass.do', {unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport(){
|
||||
window.open(ext.contextPath + "/equipment/equipmentClass/doExport.do?unitId="+unitId);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
unitId=unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"> </h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun('1');"><i class="fa fa-plus"></i>
|
||||
大类
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun('2');"><i class="fa fa-plus"></i>
|
||||
小类
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun('3');"><i class="fa fa-plus"></i>
|
||||
部位
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:750px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="menuBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
43
WebRoot/jsp/equipment/equipmentClass4select.jsp
Normal file
43
WebRoot/jsp/equipment/equipmentClass4select.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getEquipmentClassJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
//console.log("=======#${param.formId}========"+(${param.formId}));
|
||||
//console.log("=======#${param.hiddenId}========"+(${param.hiddenId}));
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
//console.log("========#${param.textId}======="+(${param.textId}));
|
||||
closeModal("equipmentClass4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="equipmentClass4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择父级</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></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="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
285
WebRoot/jsp/equipment/equipmentClassAdd.jsp
Normal file
285
WebRoot/jsp/equipment/equipmentClassAdd.jsp
Normal file
@ -0,0 +1,285 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showMenu4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/showMenu4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#menu4SelectDiv").html(data);
|
||||
openModal('menu4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/save.do", $("#subForm").serialize(), function (data) {
|
||||
var dataStr = eval("("+data+")");
|
||||
if (dataStr.result == 1) {
|
||||
alert('保存成功');
|
||||
initTreeView();
|
||||
editFun('${id}');
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_pname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '上级菜单不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentLevelId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '关联等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择启用状态'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var showSubscribe4SelectsFun = function() {
|
||||
var assetClassId= $("#assetClassId").val();
|
||||
var _assetClassname=$("#_assetClassname").val();
|
||||
|
||||
$.post(ext.contextPath + '/equipment/assetClass/subscribeList4select.do', {formId:"subForm",hiddenId:"assetClassId",textId:"_assetClassname",assetClassId:assetClassId,_assetClassname:_assetClassname} , function(data) {
|
||||
$("#fault4SelectDiv111").html(data);
|
||||
openModal("subDetailModal2");
|
||||
});
|
||||
};
|
||||
//资产类型树
|
||||
$.post(ext.contextPath + '/equipment/assetClass/getAssetClassJson.do', {ng: ''}, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid2").val(data[0].id);
|
||||
$("#companyselect2").hide();
|
||||
$("#companyName2").text("资产类型:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree2').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 1
|
||||
});
|
||||
$('#companytree2').on('nodeSelected', function (event, data) {
|
||||
//只能点最底层
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid2").val(data.id);
|
||||
// $("#cname_input2").val(data.text);
|
||||
// document.getElementById('company_select2').style.display = "none";
|
||||
// $("ul#company_select2").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
$("#search_pid2").val(data.id);
|
||||
$("#cname_input2").val(data.text);
|
||||
document.getElementById('company_select2').style.display = "none";
|
||||
$("ul#company_select2").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
}
|
||||
;
|
||||
}, 'json');
|
||||
// function saveDefault() {
|
||||
// if($("#location").val()==''){
|
||||
// top.$.messager.alert('提示','请先填写菜单地址','info');
|
||||
// }else{
|
||||
// if ($(".form").form('validate')) {
|
||||
// $.post(ext.contextPath + "/user/saveDefaultFunc.do", $(".form").serialize(), function(result) {
|
||||
// if (result > 0) {
|
||||
// top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
// $('#grid').datagrid('reload');
|
||||
// });
|
||||
// } else {
|
||||
// top.$.messager.alert('提示', "保存失败", 'info');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function dodel() {
|
||||
// top.$.messager.confirm('提示', '确定删除此菜单?', function(r) {
|
||||
// if (r) {
|
||||
// $.post(ext.contextPath + "/user/deleteMenu.do", $(".form").serialize(), function(result) {
|
||||
// if (result.res > 0) {
|
||||
// top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
// //刷新树
|
||||
// parent.reloadTree();
|
||||
// parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuAdd.do?pid="+$("#pid").val());
|
||||
// });
|
||||
// } else {
|
||||
// top.$.messager.alert('提示', result.msg, 'info');
|
||||
// }
|
||||
// },'json');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
$(function () {
|
||||
//var active=$("#active").select2();
|
||||
//$("#active").select2({ minimumResultsForSearch: 10 }).val("${menu.active}").trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm" autocomplete="off">
|
||||
<input id="id" name="id" type="hidden" value="${id}" />
|
||||
<input id="type" name="type" type="hidden" value="${param.type}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv111"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${menu.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
|
||||
<c:if test="${param.type == '1'}">
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
value="无" readonly="true">
|
||||
<input id="pid" name="pid" type="hidden" value="-1" />
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${param.type == '2' || param.type == '3'}">
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
value="${pname}" readonly="true">
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}" />
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type == '2'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计算单位</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="unit" name="unit" placeholder="如:台"
|
||||
value="${menu.unit}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备分类</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="equipmentLevelId" name="equipmentLevelId" class="form-control select2">
|
||||
<option value="">请选择..</option>
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentClassCode" name="equipmentClassCode" placeholder="编号" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${menu.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">资产类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_assetClassname" name ="_assetClassname" placeholder="点击选择" onclick="showSubscribe4SelectsFun();" >
|
||||
<input type="hidden" class="form-control" id="assetClassId" name="assetClassId" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">说明</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="remark" name="remark" placeholder="说明"
|
||||
value="${menu.remark}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
152
WebRoot/jsp/equipment/equipmentClassAdd_old.jsp
Normal file
152
WebRoot/jsp/equipment/equipmentClassAdd_old.jsp
Normal file
@ -0,0 +1,152 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentClassId").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doSaveProp.do", $("#propForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备等级名称不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
||||
message: '名称已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
name: $('#name').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#ecoLifeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
$("#maintainceFeeSetRes").select2({ minimumResultsForSearch: 10 }).val('${EquipmentLife_Standard_Trade}').trigger("change");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增设备类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备类型名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark" placeholder="备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="propForm">
|
||||
<input type="hidden" id="equipmentClassId" name="equipmentClassId">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">经济寿命标准预设值</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="ecoLifeSet" name="ecoLifeSet" placeholder="" min="1"
|
||||
value="3">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">(年)</label>
|
||||
<label class="col-sm-2 control-label">标准来源</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="ecoLifeSetRes" name="ecoLifeSetRes" style="width:100%;">
|
||||
<option value="${EquipmentLife_Standard_Trade}">行业标准</option>
|
||||
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
||||
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">首年保养费用标准预设值</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="maintainceFeeSet" name="maintainceFeeSet" placeholder=""
|
||||
min="1" value="100">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">(元)</label>
|
||||
<label class="col-sm-2 control-label">标准来源</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="maintainceFeeSetRes" name="maintainceFeeSetRes"
|
||||
style="width:100%;">
|
||||
<option value="${EquipmentLife_Standard_Trade}">行业标准</option>
|
||||
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
||||
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
377
WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
377
WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
@ -0,0 +1,377 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var showMenu4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/showMenu4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#equipmentClass4SelectDiv").html(data);
|
||||
openModal("equipmentClass4SelectModal")
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/update.do", $("#subForm").serialize(), function (data) {
|
||||
var dataStr = eval("("+data+")");
|
||||
if (dataStr.result == 1) {
|
||||
//showAlert('s', '保存成功');
|
||||
alert('保存成功');
|
||||
initTreeView();
|
||||
editFun('${equipmentClass.id}');
|
||||
}else{
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var showSubscribe4SelectsFun = function() {
|
||||
var assetClassId= $("#assetClassId").val();
|
||||
var _assetClassname=$("#_assetClassname").val();
|
||||
var pid = $("#id").val();
|
||||
$.post(ext.contextPath + '/equipment/assetClass/subscribeList4select.do', {formId:"subForm",hiddenId:"assetClassId",textId:"_assetClassname",assetClassId:assetClassId,_assetClassname:_assetClassname,pid:pid} , function(data) {
|
||||
$("#fault4SelectDiv111").html(data);
|
||||
openModal("subDetailModal2");
|
||||
});
|
||||
};
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_pname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '上级菜单不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentLevelId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '关联等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择启用状态'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function dodel() {
|
||||
|
||||
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 + '/equipment/equipmentClass/dodelete.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.result > 0) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// function delPowerFun(id) {
|
||||
|
||||
// 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 + '/user/deleteMenu.do', { id: id }, function (data) {
|
||||
// if (data.res > 0) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// } else {
|
||||
// showAlert('d', '删除失败', 'alertDiv_power');
|
||||
// }
|
||||
// }, 'json');
|
||||
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// var addPowerFun = function () {
|
||||
// $.post(ext.contextPath + '/user/showFuncAdd.do', { pid: "${equipmentClass.id}" }, function (data) {
|
||||
// $("#powerDiv").html(data);
|
||||
// openModal('powerModal')
|
||||
// });
|
||||
// };
|
||||
// var editPowerFun = function (id) {
|
||||
// $.post(ext.contextPath + '/user/showFuncEdit.do', { id: id }, function (data) {
|
||||
// $("#powerDiv").html(data);
|
||||
// openModal('powerModal')
|
||||
// });
|
||||
// };
|
||||
|
||||
$(function(){
|
||||
$("#active").select2({ minimumResultsForSearch: 10 }).val("${equipmentClass.active}").trigger("change");
|
||||
$("#equipmentLevelId").select2({ minimumResultsForSearch: 10 }).val("${equipmentClass.equipmentLevelId}").trigger("change");
|
||||
})
|
||||
|
||||
// $(function () {
|
||||
// $("#active").select2({ minimumResultsForSearch: 10 }).val("${equipmentClass.active}").trigger("change");
|
||||
// $("#table").bootstrapTable({ // 对应table标签的id
|
||||
// url: ext.contextPath + '/user/getFuncJson.do?id=${equipmentClass.id}', // 获取表格数据的url
|
||||
// cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
// striped: true, //表格显示条纹,默认为false
|
||||
// pagination: true, // 在表格底部显示分页组件,默认false
|
||||
// pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
// pageSize: 50, // 页面数据条数
|
||||
// pageNumber: 1, // 首页页码
|
||||
// sidePagination: 'server', // 设置为服务器端分页
|
||||
// queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
// return {
|
||||
// rows: params.limit, // 每页要显示的数据条数
|
||||
// page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
// sort: params.sort, // 要排序的字段
|
||||
// order: params.order // 排序规则
|
||||
// }
|
||||
// },
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
// columns: [
|
||||
// {
|
||||
// field: 'name', // 返回json数据中的name
|
||||
// title: '名称', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
// field: 'location', // 返回json数据中的name
|
||||
// title: '路径', // 表格表头显示文字
|
||||
// align: 'left', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
// field: 'pid', // 返回json数据中的name
|
||||
// title: '所属菜单', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle', // 上下居中
|
||||
// formatter: function (value, row, index) {
|
||||
// return row._pname;
|
||||
// },
|
||||
// }, {
|
||||
// field: 'active', // 返回json数据中的name
|
||||
// title: '状态', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
// title: "操作",
|
||||
// align: 'center',
|
||||
// valign: 'middle',
|
||||
// width: 100, // 定义列的宽度,单位为像素px
|
||||
// formatter: function (value, row, index) {
|
||||
// return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editPowerFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>' +
|
||||
// '<button class="btn btn-default btn-sm" onclick="delPowerFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// onLoadSuccess: function () { //加载成功时执行
|
||||
// $(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
// },
|
||||
// onLoadError: function () { //加载失败时执行
|
||||
// console.info("加载数据失败");
|
||||
// }
|
||||
|
||||
// })
|
||||
// });
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">详情</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm" autocomplete="off">
|
||||
<input id="id" name="id" type="hidden" value="${equipmentClass.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv111"></div>
|
||||
<div id="equipmentClass4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${equipmentClass.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<c:if test="${equipmentClass.type == '1'}">
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
onclick="showMenu4SelectFun();" value="无" readonly="true">
|
||||
<input id="pid" name="pid" type="hidden" value="-1" />
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${equipmentClass.type == '2' || equipmentClass.type == '3'}">
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
onclick="showMenu4SelectFun();" value="${equipmentClass._pname}" readonly="true">
|
||||
<input id="pid" name="pid" type="hidden" value="${equipmentClass.pid}" />
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type == '2'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计算单位</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="unit" name="unit" placeholder="如:台"
|
||||
value="${equipmentClass.unit}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备分类</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="equipmentLevelId" name="equipmentLevelId" class="form-control select2">
|
||||
<option value="">请选择..</option>
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentClassCode" name="equipmentClassCode" placeholder="编号"
|
||||
value="${equipmentClass.equipmentClassCode }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${equipmentClass.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">资产类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_assetClassname" name ="_assetClassname" placeholder="点击选择" onclick="showSubscribe4SelectsFun();" value="${equipmentClass._assetClassname}" >
|
||||
<input type="hidden" class="form-control" id="assetClassId" name="assetClassId" value="${equipmentClass.assetClassId}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">说明</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="remark" name="remark" placeholder="说明"
|
||||
value="${equipmentClass.remark}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addPowerFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="saveDefault();"><i class="fa fa-plus-square"></i>
|
||||
默认</button>
|
||||
|
||||
</div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="equipmentClass4SelectDiv_func"></div>
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
157
WebRoot/jsp/equipment/equipmentClassEdit_old.jsp
Normal file
157
WebRoot/jsp/equipment/equipmentClassEdit_old.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#equipmentClassId").val(data.id);
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/doUpdateProp.do", $("#propForm").serialize(), function (datap) {
|
||||
if (datap.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (datap.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', datap.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备类型名称不能为空'
|
||||
},
|
||||
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
||||
message: '名称已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function (validator) {
|
||||
return {
|
||||
name: $('#name').val(),
|
||||
id: $('#id').val()
|
||||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#ecoLifeSetRes").select2({ minimumResultsForSearch: 10 }).val('${equipmentClassProp.ecoLifeSetRes}').trigger("change");
|
||||
$("#maintainceFeeSetRes").select2({ minimumResultsForSearch: 10 }).val('${equipmentClassProp.maintainceFeeSetRes}').trigger("change");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑设备类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="${equipmentClass.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备类型名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${equipmentClass.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="active" name="active" style="width: 270px;">
|
||||
<option value="1" selected="selected">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark"
|
||||
placeholder="备注...">${equipmentClass.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="propForm">
|
||||
<input type="hidden" id="id" name="id" value="${equipmentClassProp.id}">
|
||||
<input type="hidden" id="equipmentClassId" name="equipmentClassId">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">经济寿命标准预设值</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="ecoLifeSet" name="ecoLifeSet" placeholder="" min="1"
|
||||
value="${equipmentClassProp.ecoLifeSet}">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">(年)</label>
|
||||
<label class="col-sm-2 control-label">标准来源</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="ecoLifeSetRes" name="ecoLifeSetRes" style="width:100%;">
|
||||
<option value="${EquipmentLife_Standard_Trade}">行业标准</option>
|
||||
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
||||
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">首年保养费用标准预设值</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="maintainceFeeSet" name="maintainceFeeSet" placeholder=""
|
||||
min="1" value="${equipmentClassProp.maintainceFeeSet}">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">(元)</label>
|
||||
<label class="col-sm-2 control-label">标准来源</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="maintainceFeeSetRes" name="maintainceFeeSetRes"
|
||||
style="width:100%;">
|
||||
<option value="${EquipmentLife_Standard_Trade}">行业标准</option>
|
||||
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
||||
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
95
WebRoot/jsp/equipment/equipmentClassImport.jsp
Normal file
95
WebRoot/jsp/equipment/equipmentClassImport.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '-1', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/equipment/equipmentClass/saveExcelData.do?unitId="+unitId);
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入设备类别</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
351
WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
351
WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
@ -0,0 +1,351 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增设备类型
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doadd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑设备类型
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doedit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看设备等级
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doview.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条设备类型数据
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doDeleteProp.do', { id: id }, function (data) {
|
||||
if (data >= 0) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/dodelete.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条设备类型数据
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} 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 + '/equipment/equipmentClass/doDeletesProp.do', { ids: datas }, function (data) {
|
||||
if (data >= 0) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentClass/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '设备类型名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return "禁用";
|
||||
case '1':
|
||||
return "启用";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'ecoLifeSet', // 返回json数据中的name
|
||||
title: '经济寿命标准预设值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentClassProp != null) {
|
||||
return row.equipmentClassProp.ecoLifeSet;
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'ecoLifeSetRes', // 返回json数据中的name
|
||||
title: '经济寿命标准来源', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentClassProp != null) {
|
||||
switch (row.equipmentClassProp.ecoLifeSetRes) {
|
||||
case '${EquipmentLife_Standard_Trade}':
|
||||
return "行业标准";
|
||||
case '${EquipmentLife_Standard_Supplier}':
|
||||
return "供应商标准";
|
||||
case '${EquipmentLife_Standard_Enterprise}':
|
||||
return "企业标准";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
|
||||
}
|
||||
}, {
|
||||
field: 'maintainceFeeSet', // 返回json数据中的name
|
||||
title: '首年保养费用标准预设值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentClassProp != null) {
|
||||
return row.equipmentClassProp.maintainceFeeSet;
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'maintainceFeeSetRes', // 返回json数据中的name
|
||||
title: '首年保养费用标准来源', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentClassProp != null) {
|
||||
switch (row.equipmentClassProp.maintainceFeeSetRes) {
|
||||
case '${EquipmentLife_Standard_Trade}':
|
||||
return "行业标准";
|
||||
case '${EquipmentLife_Standard_Supplier}':
|
||||
return "供应商标准";
|
||||
case '${EquipmentLife_Standard_Enterprise}':
|
||||
return "企业标准";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentClass/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentClass/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<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="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="equipment/equipmentClass/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<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="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user