176 lines
7.5 KiB
Plaintext
176 lines
7.5 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>
|
|
<!-- 文件上传-->
|
|
<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 updateFun = function () {
|
|
$.post(ext.contextPath + '/maintenance/libraryFaultBiz/update4UintId.do', {unitId: unitId}, function (data) {
|
|
if (data.code == 1) {
|
|
alert('同步成功');
|
|
$("#faultTable").bootstrapTable('refresh');
|
|
} else {
|
|
alert('同步失败');
|
|
}
|
|
}, 'json');
|
|
};
|
|
|
|
var editFun = function (id, pid, type) {
|
|
var modelId = '';
|
|
var modelNameId = '';
|
|
//获取对应的设备型号
|
|
$.ajax({
|
|
type: "GET",
|
|
url: ext.contextPath + '/equipment/getdata4Equ.do',
|
|
data: {id: id, pid: pid, type: type, unitId: unitId},
|
|
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/showListBiz.do', {
|
|
classId: id,
|
|
type: type,
|
|
modelId: modelId
|
|
}, function (data) {
|
|
$("#faultListTable").html(data);
|
|
//$('#modelNameId').html(modelNameId);
|
|
});
|
|
};
|
|
|
|
function choiceModel(id, text) {
|
|
$('#modelId').val(id);//给型号id赋值
|
|
//$('#faultId').val('');//清除用于大修内容的id
|
|
$('#modelNameId').html(text);
|
|
|
|
repairFun();
|
|
}
|
|
|
|
var initTreeView = function () {
|
|
$.post(ext.contextPath + '/equipment/equipmentClass/getTree4EquipmentCard.do', {unitId: unitId}, function (data) {
|
|
var treeData = data.result;
|
|
$('#tree').treeview({data: treeData, levels: 3});
|
|
if (treeData != undefined && treeData.length > 0) {
|
|
$('#tree').on('nodeSelected', function (event, treeData) {
|
|
editFun(treeData.id, treeData.pid, treeData.type);
|
|
});
|
|
var node = $('#tree').treeview('findNodes', [treeData[0].nodes[0].id, 'id']);
|
|
$('#tree').treeview('selectNode', [node[0], { silent: true }]);
|
|
editFun(treeData[0].nodes[0].id, treeData[0].nodes[0].pid, treeData[0].nodes[0].type);
|
|
}
|
|
}, 'json');
|
|
$("#faultListTable").html("");
|
|
};
|
|
$(function () {
|
|
//alert(unitId);
|
|
initTreeView();
|
|
});
|
|
|
|
var doInit = function () {
|
|
let sure = confirm("此操作将重置当前配置还原为公司级标准!是否继续?");
|
|
if (sure) {
|
|
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doInit.do', {unitId: unitId}, function (data) {
|
|
if (data.code == '1') {
|
|
showAlert('s', data.msg, 'mainAlertdiv');
|
|
// refreshPage('/TGLW/maintenance/libraryFaultBloc/showList4TreeBiz.do')
|
|
location.reload();
|
|
} else {
|
|
showAlert('d', data.msg, 'mainAlertdiv');
|
|
}
|
|
}, 'json');
|
|
}
|
|
};
|
|
|
|
//导入
|
|
function doImport() {
|
|
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBiz.do', {unitId: unitId}, function (data) {
|
|
// $.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBloc.do', {unitId: unitId}, function (data) {
|
|
$("#subDiv").html(data);
|
|
openModal('subModal');
|
|
});
|
|
}
|
|
|
|
//导出
|
|
function doExport() {
|
|
window.open(ext.contextPath + "/maintenance/libraryFaultBloc/doExport4Biz.do?unitId=" + unitId);
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
|
<div class="wrapper">
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<!-- 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" id="addDiv">
|
|
<button type="button" class="btn btn-box-tool" onclick="doInit();"><i
|
|
class="fa fa-retweet"></i>
|
|
初始化
|
|
</button>
|
|
<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>
|
|
<!-- /.box-body -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 设备型号按钮 -->
|
|
<div class="col-md-9" id="modelButton"></div>
|
|
|
|
<div class="col-md-9" id="faultListTable"></div>
|
|
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|