first commit
This commit is contained in:
270
WebRoot/jsp/maintenance/libraryFaultBloc4Tree.jsp
Normal file
270
WebRoot/jsp/maintenance/libraryFaultBloc4Tree.jsp
Normal file
@ -0,0 +1,270 @@
|
||||
<%@ 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>
|
||||
<style type="text/css">
|
||||
|
||||
.buttonDiv {
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var companyId = "-1";
|
||||
|
||||
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, pid, type) {
|
||||
var modelId = '';
|
||||
|
||||
//获取对应的设备型号
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + '/equipment/equipmentTypeNumber/getdata4EquClass.do',
|
||||
data: {id: id, pid: pid, type: type},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
$('#modelButton').empty(); //清空resText里面的所有内容
|
||||
var html = '';
|
||||
modelId = '-1';
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + -1 + '\',\'(' + '通用' + ')\');">通用</button>';
|
||||
|
||||
//暂时注释 -- sj 2021-08-23
|
||||
// for (var i = 0; i < data.length; i++) {
|
||||
// html += '<button type="button" class="btn btn-default" onclick="choiceModel(\''+data[i].id+'\',\'('+data[i].text+')\');">'+data[i].text+'</button>';
|
||||
// }
|
||||
$('#modelButton').html(html);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showListBloc.do', {
|
||||
classId: id,
|
||||
type: type,
|
||||
modelId: modelId
|
||||
}, function (data) {
|
||||
$("#faultListTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
function choiceModel(id, text) {
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
$('#modelNameId').html(text);
|
||||
//$('#faultId').val('');
|
||||
|
||||
if ($('#modelId').val() != '-1') {
|
||||
$("#faultadd").hide();
|
||||
$("#repairadd").hide();
|
||||
} else {
|
||||
$("#faultadd").show();
|
||||
$("#repairadd").show();
|
||||
}
|
||||
|
||||
//projectFun();
|
||||
repairFun();
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {unitId: companyId}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, 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/libraryFaultBloc/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: companyId,
|
||||
ids: ids
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
if (treeData.type == 3) {
|
||||
//$("#addDiv").css("display","block");//显示div
|
||||
} else {
|
||||
//$("#addDiv").css("display","none");//隐藏div
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBloc.do', {unitId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/maintenance/libraryFaultBloc/doExport.do?unitId=" + companyId);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
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 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">
|
||||
<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>
|
||||
</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="modelButton"></div>
|
||||
<!-- 故障库列表 -->
|
||||
<div class="col-md-9" id="faultListTable"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user