742 lines
30 KiB
Plaintext
742 lines
30 KiB
Plaintext
|
|
<%@ 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;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tools {
|
|||
|
|
margin-right: 8px;
|
|||
|
|
margin-top: 8px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var showStructureCard4SelectFun = function () {
|
|||
|
|
$.post(ext.contextPath + '/structure/showList4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
|||
|
|
$("#fault4SelectDiv").html(data);
|
|||
|
|
openModal('fault4SelectModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
function dosave() {
|
|||
|
|
//if ($("#subForm").form('validate')) {
|
|||
|
|
$.post(ext.contextPath + "/structure/doupdate.do", $("#subForm").serialize(), function (result) {
|
|||
|
|
if (result == 1) {
|
|||
|
|
showAlert('s', '保存成功');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var editPointFun = function (id, unitId) {
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPicture/editRoutePoint.do', { id, unitId }, function (data) {
|
|||
|
|
$("#subDiv").html(data);
|
|||
|
|
openModal('subModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
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 + '/structure/dodel.do', $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res > 0) {
|
|||
|
|
initTreeView();
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
$(function () {
|
|||
|
|
$("#active").select2({ minimumResultsForSearch: -1 }).val("${structureCard.active}").trigger("change");
|
|||
|
|
$("#type").select2({ minimumResultsForSearch: -1 }).val("${structureCard.type}").trigger("change");
|
|||
|
|
|
|||
|
|
//底图table
|
|||
|
|
$("#table_picture").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/structure/structureCardPicture/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,
|
|||
|
|
search_name: $('#search_name').val(),
|
|||
|
|
unitId: unitId,
|
|||
|
|
structureId: $('#id').val(),
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
detailView: true,//父子表
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
}, {
|
|||
|
|
field: 'name', // 返回json数据中的number
|
|||
|
|
title: '底图名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
title: '所属厂区',
|
|||
|
|
field: 'company.sname',
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: '所属类别',
|
|||
|
|
field: 'type',
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
formatter: function (value, row, index){
|
|||
|
|
if(value == 'line'){
|
|||
|
|
return '巡检路线';
|
|||
|
|
}else if(value == 'area'){
|
|||
|
|
return '安全区域';
|
|||
|
|
}else{
|
|||
|
|
return '巡检路线';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'floor', // 返回json数据中的remark
|
|||
|
|
title: '楼层', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
}, {
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: 120, // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var str = "";
|
|||
|
|
/*str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i></button>';*/
|
|||
|
|
str += '<button class="btn btn-default btn-sm" onclick="editPicFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
|||
|
|
str += '<button class="btn btn-default btn-sm" onclick="editRouteFun(\'' + row.id + '\')" data-toggle="tooltip" title="巡检路线"><i class="fa fa-map-o"></i></button>';
|
|||
|
|
str = '<div class="btn-group" >' + str + '</div>';
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
//注册加载子表的事件。index:父表当前行的行索引,row:父表当前行的Json数据对象,$detail:当前行下面创建的新行里面的td对象。
|
|||
|
|
onExpandRow: function (index, row, $detail) {
|
|||
|
|
initFittingsDetailTable(index, row, $detail);
|
|||
|
|
//存入sessionStorage
|
|||
|
|
sessionStorage.setItem("index", index);
|
|||
|
|
},
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
//初始化子表
|
|||
|
|
var initFittingsDetailTable = function (index, row, $detail) {
|
|||
|
|
var id = row.id;
|
|||
|
|
var detailTable = $detail.html('<table></table>').find('table');
|
|||
|
|
$(detailTable).bootstrapTable({
|
|||
|
|
url: ext.contextPath + '/structure/structureCardPicture/getRoutePointsOrderbySort.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 50, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
paginationDetailHAlign: ' hidden',//去除分页的显示
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
floorId: id,
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'insdt', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
field: 'insdt', // 返回json数据中的name
|
|||
|
|
title: '时间', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var subValue = value.substring(0, 19);
|
|||
|
|
return subValue;
|
|||
|
|
}
|
|||
|
|
}, {
|
|||
|
|
field: 'patrolContent', // 返回json数据中的name
|
|||
|
|
title: '点位名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: 120, // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var str = '';
|
|||
|
|
str+='<button class="btn btn-default btn-sm" title="编辑" onclick="editPointFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
|||
|
|
return str;
|
|||
|
|
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("detailTable");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$('#table_equipmentLoseApplyDetail').bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/structure/getEquipment4StructureCard.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [5, 10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 5, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
structureId: '${structureCard.id}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
}, {
|
|||
|
|
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', // 上下居中
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_equipmentLoseApplyDetail");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
//运行参数
|
|||
|
|
dopoint('design');
|
|||
|
|
//设计参数
|
|||
|
|
dopoint('operation');
|
|||
|
|
//实际参数
|
|||
|
|
dopoint('actual');
|
|||
|
|
});
|
|||
|
|
function dopoint(structureCodeType) {
|
|||
|
|
|
|||
|
|
//关联测量点
|
|||
|
|
$("#table_" + structureCodeType).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: 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(),
|
|||
|
|
companyId: companyId,
|
|||
|
|
structureId: '${structureCard.id}',
|
|||
|
|
structureCodeType: structureCodeType
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
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' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'measuredt', // 返回json数据中的name
|
|||
|
|
title: '时间', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'ledcolor',
|
|||
|
|
title: '状态',
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
formatter: function (value, row) {
|
|||
|
|
var pic;
|
|||
|
|
if (value == 0) {
|
|||
|
|
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lg.png" style="width:20px;height:20px;" ></img>';
|
|||
|
|
} else {
|
|||
|
|
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lr.png" style="width:20px;height:20px;" ></img>';
|
|||
|
|
}
|
|||
|
|
return pic;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_" + structureCodeType);
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
var doFinishSelects = function (data) {
|
|||
|
|
$.post(ext.contextPath + '/structure/saveEquipment4StructureCard.do', {
|
|||
|
|
structureId: '${structureCard.id}',
|
|||
|
|
equipmentCardIds: data
|
|||
|
|
}, function (data) {
|
|||
|
|
if (data.res) {
|
|||
|
|
$("#table_equipmentLoseApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//新增设备停用明细
|
|||
|
|
var addDetailFun = function () {
|
|||
|
|
var allTableData = $("#table_equipmentLoseApplyDetail").bootstrapTable('getData');
|
|||
|
|
var equipmentCardIds = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
|
|||
|
|
if (equipmentCardIds != "") {
|
|||
|
|
equipmentCardIds += ",";
|
|||
|
|
}
|
|||
|
|
equipmentCardIds += item.equipmentCardId;
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/structure/selectEquipment4StructureCard.do', { equipmentCardIds: equipmentCardIds, companyId: '${company.id}' },
|
|||
|
|
function (data) {
|
|||
|
|
$("#equipmentCard4SelectsDiv").html(data);
|
|||
|
|
openModal('subDetailModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//删除多条明细数据
|
|||
|
|
var deletesDetailFun = function () {
|
|||
|
|
var checkedItems = $("#table_equipmentLoseApplyDetail").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 + '/structure/deletesEquipment4StructureCard.do', { ids: datas }, function (data) {
|
|||
|
|
|
|||
|
|
if (data.res) {
|
|||
|
|
$("#table_equipmentLoseApplyDetail").bootstrapTable('refresh');
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'alertDiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var selectMPint = function (pid) {
|
|||
|
|
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', { formId: 'subForm', hiddenId: pid, codeId: pid, textId: 'txt', valueId: 'value', mpid: $("#" + pid).val() }, function (data) {
|
|||
|
|
$("#mpSubDiv").html(data);
|
|||
|
|
openModal('mpSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
//保存选择点位
|
|||
|
|
var doMPointFinishSelects = function (mpoints) {
|
|||
|
|
var structureCodeType = $("#nowTable").val();
|
|||
|
|
$.post(ext.contextPath + '/structure/saveMPoint4StructureCard.do', {
|
|||
|
|
structureId: '${structureCard.id}',
|
|||
|
|
structureCodeType: structureCodeType, mpoints: mpoints, companyId: companyId
|
|||
|
|
}, function (data) {
|
|||
|
|
if (data.res) {
|
|||
|
|
$("#table_" + structureCodeType).bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//选择点位
|
|||
|
|
var addMPoint = function () {
|
|||
|
|
var structureCodeType = $("#nowTable").val();
|
|||
|
|
var allTableData = $("#table_" + structureCodeType).bootstrapTable('getData');
|
|||
|
|
var mpoints = "";
|
|||
|
|
$.each(allTableData, function (index, item) {
|
|||
|
|
|
|||
|
|
if (mpoints != "") {
|
|||
|
|
mpoints += ",";
|
|||
|
|
}
|
|||
|
|
mpoints += item.mpointcode;
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/structure/showlistMPointForSelects.do', { mpoints: mpoints, companyId: companyId },
|
|||
|
|
function (data) {
|
|||
|
|
$("#mpoint4SelectsDiv").html(data);
|
|||
|
|
openModal('mpsSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//删除选择点位
|
|||
|
|
var deletesMPoint = function () {
|
|||
|
|
var structureCodeType = $("#nowTable").val();
|
|||
|
|
var checkedItems = $("#table_" + structureCodeType).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 + '/structure/deletesMPoint4StructureCard.do', { ids: datas, companyId: companyId }, function (data) {
|
|||
|
|
|
|||
|
|
if (data.res) {
|
|||
|
|
$("#table_" + structureCodeType).bootstrapTable('refresh');
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'alertDiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
function activeTable(id) {
|
|||
|
|
$("#nowTable").val(id);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var addPicFun = function () {
|
|||
|
|
var structureId = $("#id").val();
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPicture/add.do', { unitId, structureId }, function (data) {
|
|||
|
|
$("#subDiv").html(data);
|
|||
|
|
openModal('subModal_floor');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var editPicFun = function (id) {
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPicture/edit.do', { id: id }, function (data) {
|
|||
|
|
$("#subDiv").html(data);
|
|||
|
|
openModal('subModal_floor');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var deletesPicFun = function () {
|
|||
|
|
var checkedItems = $("#table_picture").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 + '/structure/structureCardPicture/dodeletes.do', { ids: datas }, function (data) {
|
|||
|
|
var data = JSON.parse(data);
|
|||
|
|
if (data.result > 0) {
|
|||
|
|
$("#table_picture").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
var editRouteFun = function (id, unitId) {
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPicture/editRoute.do', { id, unitId }, function (data) {
|
|||
|
|
$("#subDiv").html(data);
|
|||
|
|
openModal('subModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
</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">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${structureCard.id}" />
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="fault4SelectDiv"></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="${structureCard.name }">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">上级菜单</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
|||
|
|
onclick="showStructureCard4SelectFun();" value="${structureCard._pname}">
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${structureCard.pid}" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="type" name="type" class="form-control select2">
|
|||
|
|
<option value="0">构筑物</option>
|
|||
|
|
<option value="1">工艺单体</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="${structureCard.morder}">
|
|||
|
|
</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="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-4">
|
|||
|
|
<input type="text" class="form-control" style="cursor: pointer" id="designCode"
|
|||
|
|
value="${structureCard.designCode}" name="designCode" onclick="selectMPint('designCode')"
|
|||
|
|
placeholder="单击选择" readonly>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">可调能力测量点</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" style="cursor: pointer" id="adjustableCode"
|
|||
|
|
value="${structureCard.adjustableCode}" name="adjustableCode" onclick="selectMPint('adjustableCode')"
|
|||
|
|
placeholder="单击选择" readonly>
|
|||
|
|
</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" style="cursor: pointer" id="currentCode"
|
|||
|
|
value="${structureCard.currentCode}" name="currentCode" onclick="selectMPint('currentCode')"
|
|||
|
|
placeholder="单击选择" readonly>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">当前负荷率测量点</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" style="cursor: pointer" id="loadCode"
|
|||
|
|
value="${structureCard.loadCode}" name="loadCode" onclick="selectMPint('loadCode')" placeholder="单击选择"
|
|||
|
|
readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</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="addPicFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
|||
|
|
class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<a onclick="deletesPicFun()" 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_picture"></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="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_equipmentLoseApplyDetail"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<input id="nowTable" name="nowTable" type="hidden" value="design" />
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="nav-tabs-custom">
|
|||
|
|
<ul class="nav nav-tabs" id="">
|
|||
|
|
<li class="active"><a href="#tab1" data-toggle="tab" index="0" aria-expanded="true"
|
|||
|
|
onclick="activeTable('design')">设计参数点位</a></li>
|
|||
|
|
<li class=""><a href="#tab2" data-toggle="tab" index="1" aria-expanded="false"
|
|||
|
|
onclick="activeTable('operation')">运行参数点位</a></li>
|
|||
|
|
<li class=""><a href="#tab3" data-toggle="tab" index="2" aria-expanded="false"
|
|||
|
|
onclick="activeTable('actual')">实际参数点位</a></li>
|
|||
|
|
<div class="tools pull-right">
|
|||
|
|
<a onclick="addMPoint()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
|||
|
|
class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<a onclick="deletesMPoint()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
|||
|
|
class="glyphicon glyphicon-minus"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</ul>
|
|||
|
|
<div class="tab-content">
|
|||
|
|
<div class=" tab-pane active" id="tab1">
|
|||
|
|
<table id="table_design"></table>
|
|||
|
|
</div>
|
|||
|
|
<div class=" tab-pane " id="tab2">
|
|||
|
|
<table id="table_operation"></table>
|
|||
|
|
</div>
|
|||
|
|
<div class=" tab-pane " id="tab3">
|
|||
|
|
<table id="table_actual"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|