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

305 lines
10 KiB
Plaintext

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="com.sipai.entity.base.ServerObject"%>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<style type="text/css">
.buttonDiv{
float: left;
}
</style>
<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/equipmentClass/add.do', {pid:pid} , function(data) {
//console.log(data);
$("#faultListTable").html(data);
});
};
var editFun = function(id, type) {
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultList.do', {classId: id,type: type} , function(data) {
$("#faultListTable").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: 3});
$('#tree').on('nodeSelected', function(event, treeData) {
editFun(treeData.id, treeData.type);
//level为树形层级 1为设备大类 2为设备小类 3为部位
if(treeData.type == 3){
$("#addDiv").css("display","block");//显示div
}else{
$("#addDiv").css("display","none");//隐藏div
}
});
},'json');
$("#faultListTable").html("");
};
//高级搜索
function searchDivFun(){
var searchStatus = $('#searchStatus').val();
if(searchStatus == '0'){
$('#searchDiv').css('display','block');//显示div
$('#searchStatus').val('1');
$('#searchButton2').css('display','block');
$("#searchButton1").css("display","none");
}
if(searchStatus == '1'){
$('#searchDiv').css('display','none');//隐藏div
$('#searchStatus').val('0');
$('#searchButton1').css('display','block');
$("#searchButton2").css("display","none");
}
}
//执行搜索
function searchFun(){
var quotaTypes = document.getElementsByName("quotaType");//定额类型 低中高
var repairPartyTypes = document.getElementsByName("repairPartyType");//维修方式 自修或委外
var repairTypes = document.getElementsByName("repairType");//维修类型 小修、中修等
var search_name = $('#search_name').val();//搜索内容
//定额类型
var check_val = [];
for (k in quotaTypes){
if(quotaTypes[k].checked){
check_val.push(quotaTypes[k].value);
}
}
//维修方式
var check_val2 = [];
for (k in repairPartyTypes){
if(repairPartyTypes[k].checked){
check_val2.push(repairPartyTypes[k].value);
}
}
//维修类型
var check_val3 = [];
for (k in repairTypes){
if(repairTypes[k].checked){
check_val3.push(repairTypes[k].value);
}
}
$.ajax({
type: "post",
url: ext.contextPath + '/maintenance/faultLibrary/getClassIds4Search.do',
data: {quotaTypes:check_val,repairPartyTypes:check_val2,repairTypes:check_val3,search_name:search_name},
dataType: "json",
success: function(data){
var id = data.result;
var ids = '';
for (var i = 0; i < id.length; i++) {
ids += id[i]+',';
}
//alert(ids);
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson4Where.do', {unitId:unitId,ids:ids} , function(data) {
var treeData = data.result;
$('#tree').treeview({data: treeData,levels: 3});
$('#tree').on('nodeSelected', function(event, treeData) {
editFun(treeData.id, treeData.type);
//level为树形层级 1为设备大类 2为设备小类 3为部位
if(treeData.type == 3){
$("#addDiv").css("display","block");//显示div
}else{
$("#addDiv").css("display","none");//隐藏div
}
});
},'json');
}
});
}
$(function() {
unitId=unitId;
initTreeView();
});
</script>
</head>
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
<!-- 搜索状态 0为隐藏 1为显示 -->
<input type="hidden" id="searchStatus" name="searchStatus" value="0">
<div class="wrapper">
<div class="content-wrapper">
<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"></div>
<div style="background-color:#FFFFFF;">
<div style="height:8px;"></div>
<div class="form-group" style="padding:0;">
<div class="btn-group" style="width: 220px;padding-bottom:8px;">
<div class="input-group input-group-sm" style="width: 250px;padding-left:15px;">
<input type="text" id="search_name" name="search_name" class="form-control pull-right" autocomplete="off" placeholder="请输入搜索内容">
<div class="input-group-btn">
<button class="btn btn-default" onclick="searchFun();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
<div class="form-group pull-right form-inline" >
<div id="searchButton1" class="buttonDiv" style="display: block;"><!-- 下箭头 -->
<button type="button" class="btn btn-default btn-sm" onclick="searchDivFun();" ><i class="glyphicon glyphicon-chevron-down"></i> 高级搜索</button>
</div>
<div id="searchButton2" class="buttonDiv" style="display: none;"><!-- 上箭头 -->
<button type="button" class="btn btn-default btn-sm" onclick="searchDivFun();" ><i class="glyphicon glyphicon-chevron-up" id="searchButton" ></i> 高级搜索</button>
</div>
<div id="searchButton3" class="buttonDiv">
<button type="button" class="btn btn-default btn-sm" onclick="searchFun();"><i class="glyphicon glyphicon-search"></i> 搜索</button>
</div>
<div id="searchButton4" class="buttonDiv">
<button type="button" class="btn btn-default btn-sm" onclick="resetFun();"><i class="glyphicon glyphicon-repeat"></i> 重置</button>
</div>
</div>
</div>
<div id="searchDiv" style="display:none;">
<div style="height:30px;padding-left:15px;float:left;">
定额等级:
<label class="checkbox-inline">
<input type="checkbox" name="quotaType" value="低">低
</label>
<label class="checkbox-inline">
<input type="checkbox" name="quotaType" value="中">中
</label>
<label class="checkbox-inline">
<input type="checkbox" name="quotaType" value="高">高
</label>
</div>
<div style="float:left;">
<div style="float:left;padding-left:30px;">工时:</div>
<div style="width:70px;height:30px;float:left;" >
<div class="input-group mb-3 input-group-sm" >
<input class="form-control date-picker"
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
</div>
</div>
<div style="width:20px;height:30px;float:left;margin-left:6px;">
</div>
<div style="width:70px;height:30px;float:left;" >
<div class="input-group mb-3 input-group-sm" >
<input class="form-control date-picker"
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
</div>
</div>
</div>
<div style="float:left;">
<div style="float:left;padding-left:30px;">费用:</div>
<div style="width:70px;height:30px;float:left;" >
<div class="input-group mb-3 input-group-sm" >
<input class="form-control date-picker"
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
</div>
</div>
<div style="width:20px;height:30px;float:left;margin-left:6px;">
</div>
<div style="width:70px;height:30px;float:left;" >
<div class="input-group mb-3 input-group-sm" >
<input class="form-control date-picker"
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
</div>
</div>
</div>
<div style="clear:both;height:30px;padding-left:15px;">
维修方式:
<label class="checkbox-inline">
<input type="checkbox" name="repairPartyType" value="自修">自修
</label>
<label class="checkbox-inline">
<input type="checkbox" name="repairPartyType" value="委外">委外
</label>
</div>
<div style="clear:both;height:30px;padding-left:15px;">
维修类型:
<label class="checkbox-inline">
<input type="checkbox" name="repairType" value="小修">小修
</label>
<label class="checkbox-inline">
<input type="checkbox" name="repairType" value="中修">中修
</label>
</div>
</div>
</div>
<div style="width:100%;height:10px;background-color:#ECF0F5;">
</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" id="addDiv" style="display:none">
</div>
</div>
<div class="box-body no-padding">
<div id="tree" style="height:700px;overflow:auto; "></div>
</div>
</div>
</div>
<div class="col-md-9" id="faultListTable" ></div>
</div>
</section>
</div>
</div>
</body>
</html>