first commit
This commit is contained in:
148
WebRoot/jsp/maintenance/libraryOverhaulProjectBloc4Tree.jsp
Normal file
148
WebRoot/jsp/maintenance/libraryOverhaulProjectBloc4Tree.jsp
Normal file
@ -0,0 +1,148 @@
|
||||
<%@ 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 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/libraryOverhaulProjectBloc/showListBloc.do', {classId:id,type:type,modelId:modelId} , function(data) {
|
||||
$("#overhaulTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
//$("#orderBtnGroup .btn:first").click().addClass("active");
|
||||
|
||||
function choiceModel(id,text){
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
$('#modelNameId').html(text);
|
||||
//$('#projectId').val('');//清除用于大修内容的id
|
||||
|
||||
if($('#modelId').val() != '-1'){
|
||||
$("#projectadd").hide();
|
||||
$("#contentadd").hide();
|
||||
}else{
|
||||
$("#projectadd").show();
|
||||
$("#contentadd").show();
|
||||
}
|
||||
|
||||
projectFun();
|
||||
contentFun();
|
||||
}
|
||||
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson4Equ.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.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
// if(treeData.type == 3){
|
||||
// $("#addDiv").css("display","block");//显示div
|
||||
// }else{
|
||||
// $("#addDiv").css("display","none");//隐藏div
|
||||
// }
|
||||
});
|
||||
},'json');
|
||||
$("#overhaulTable").html("");
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport(){
|
||||
$.post(ext.contextPath + '/maintenance/libraryOverhaulProjectBloc/doImport.do', {unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport(){
|
||||
window.open(ext.contextPath + "/maintenance/libraryOverhaulProjectBloc/doExport4Bloc.do?unitId="+unitId);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
unitId=unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<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="overhaulTable" ></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user