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

164 lines
5.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
/*
* 加载绩效附表
*/
function getDetailList(pid, unitId) {
$("#table_detail").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/process/libraryProcessManageDetail/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 50, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
pid: pid,
unitId: unitId
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
checkbox: true, // 显示一个勾选框
},
{
field: '', // 返回json数据中的name
title: '指标名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
return row.code;
}
},
{
field: '', // 返回json数据中的name
title: '测量点编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
formatter: function (value, row, index) {
if (row.mPoint != null && row.mPoint != '') {
return row.mPoint.mpointcode;
}
}
},
{
field: '', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
formatter: function (value, row, index) {
if (row.mPoint != null && row.mPoint != '') {
return row.mPoint.parmname;
}
}
},
{
field: '', // 返回json数据中的name
title: '取值方式', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
return row.selectionMethod;
}
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: '10%', // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" onclick="doDetailEdit(\'' + row.id + '\',\'' + unitId + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts = '<div class = "btn-group">' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_detail");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
}
/*
* 删除
*/
var deletesDetailFun = function () {
var checkedItems = $("#table_detail").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems, function (index, item) {
datas += item.id + ",";
});
if (datas == "") {
showAlert('d', '请先选择记录', 'mainAlertdiv2');
} 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 + '/process/libraryProcessManageDetail/dodeletes.do', { ids: datas }, function (data) {
var datastr = eval('(' + data + ')');
if (datastr.code == 1) {
//计算总工时及剩余工时
// doCountWorkingHours();
$("#table_detail").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv2');
}
});
}
});
}
};
var doDetailAdd = function (pid) {
$.post(ext.contextPath + '/process/libraryProcessManageDetail/doadd.do', { pid: pid }, function (data) {
$("#subDivDetail").html(data);
openModal('subModalDetail');
});
}
var doDetailEdit = function (id, unitId) {
$.post(ext.contextPath + '/process/libraryProcessManageDetail/doedit.do', { id: id, unitId: unitId }, function (data) {
$("#subDivDetail").html(data);
openModal('subModalDetail');
});
}
</script>