Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/process/processAdjustmentContentList.jsp

398 lines
18 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<script type="text/javascript">
/*
* 加载绩效附表
*/
function getContent(pid, status) {
$("#table_content").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/process/processAdjustmentContent/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,
pid: pid
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
checkbox: true, // 显示一个勾选框
width: '40px'
},
{
field: '', // 返回json数据中的name
title: '异常名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
// return row.libraryProcessAdjustment.libraryProcessAbnormal.abnormalName;
if(row.abnormalName!=null && row.abnormalName!=''){
return row.abnormalName;
}else{
return '-';
}
}
},
{
field: '', // 返回json数据中的name
title: '调整代码', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
formatter: function (value, row, index) {
// return row.libraryProcessAdjustment.proCode;
if(row.proCode!=null && row.proCode!=''){
return row.proCode;
}else{
return '-';
}
}
},
{
field: '', // 返回json数据中的name
title: '调整名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.libraryProcessAdjustment.proName + "'>" + row.libraryProcessAdjustment.proName + "</span>";
// }
return row.proName;
}
},
{
field: '', // 返回json数据中的name
title: '调整措施', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '27%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.libraryProcessAdjustment.proMeasures + "'>" + row.libraryProcessAdjustment.proMeasures + "</span>";
// }
return row.proMeasures;
}
},
{
field: '', // 返回json数据中的name
title: '定额工时(时)', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '18%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return row.libraryProcessAdjustment.receiveRatedTime;
// }
return row.receiveRatedTime;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_content");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
}
/*
* 加载绩效附表
*/
function getContentView(pid, status) {
$("#table_content").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/process/processAdjustmentContent/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,
pid: pid
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: '', // 返回json数据中的name
title: '异常名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
// return row.libraryProcessAdjustment.libraryProcessAbnormal.abnormalName;
if(row.abnormalName!=null && row.abnormalName!=''){
return row.abnormalName;
}else{
return '-';
}
}
},
{
field: '', // 返回json数据中的name
title: '调整代码', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
formatter: function (value, row, index) {
// return row.libraryProcessAdjustment.proCode;
if(row.proCode!=null && row.proCode!=''){
return row.proCode;
}else{
return '-';
}
}
},
{
field: '', // 返回json数据中的name
title: '调整名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.libraryProcessAdjustment.proName + "'>" + row.libraryProcessAdjustment.proName + "</span>";
// }
return row.proName;
}
},
{
field: '', // 返回json数据中的name
title: '调整措施', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '27%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.libraryProcessAdjustment.proMeasures + "'>" + row.libraryProcessAdjustment.proMeasures + "</span>";
// }
return row.proMeasures;
}
},
{
field: '', // 返回json数据中的name
title: '定额工时(时)', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '18%',
formatter: function (value, row, index) {
// if (row.libraryProcessAdjustment != null && row.libraryProcessAdjustment != '') {
// return row.libraryProcessAdjustment.receiveRatedTime;
// }
return row.receiveRatedTime;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_content");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
}
/*
* 删除
*/
var deleteContentFun = function () {
var checkedItems = $("#table_content").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/processAdjustmentContent/dodeletes.do', {ids: datas}, function (data) {
var datastr = eval('(' + data + ')');
if (datastr.code == 1) {
//计算总工时及剩余工时
//doCountWorkingHours();
$("#table_content").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv2');
}
});
}
});
}
};
var doImport = function (pid) {
//根据异常进行筛选 目前是异常名称
var abnormalName = $('#abnormalName').val();
//获取编辑页面的typeId
var typeId = $('#typeId').val();
var tableData = $("#table_content").bootstrapTable('getData');
var libraryIds = "";
$.each(tableData, function (index, item) {
if (libraryIds != "") {
libraryIds += ",";
}
libraryIds += item.libraryId;//维保库id
})
$.post(ext.contextPath + '/process/libraryProcessAdjustment/library4Select.do', {
libraryIds: libraryIds,
unitId: unitId,
classId: typeId,
abnormalName: abnormalName
}, function (data) {
$("#subDiv_library").html(data);
openModal('libraryModal');
});
}
var doaddContent = function (entityId) {
$.post(ext.contextPath + '/process/processAdjustmentContent/doadd.do', {
entityId: entityId
}, function (data) {
$("#subDiv_library").html(data);
openModal('detailModal');
});
}
var doeditContent = function (id) {
$.post(ext.contextPath + '/process/processAdjustmentContent/doedit.do', {id: id}, function (data) {
$("#subDivDetail").html(data);
openModal('subModalContent');
});
}
var doFinishSelectLibraryAdjustment4Select = function (datas) {
$.post(ext.contextPath + '/process/processAdjustmentContent/updateLibrary.do', {
id: '${processAdjustment.id}',
libraryIds: datas,
unitId: '${processAdjustment.unitId}'
}, function (data) {
if (data.code == '1') {
$("#table_content").bootstrapTable('refresh');
$("#table_contentFile").bootstrapTable('refresh');
}
}, 'json');
}
function getContentForFile(pid, status) {
$("#table_contentFile").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/process/processAdjustmentContent/getListForFile.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'client', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
// rows: params.limit, // 每页要显示的数据条数
// page: params.offset / params.limit + 1, // 每页显示数据的开始页码
// sort: params.sort, // 要排序的字段
// order: params.order,
pid: pid
}
},
// sortName: 'id', // 要排序的字段
// sortOrder: 'desc', // 排序规则
columns: [
{
field: 'proCode', // 返回json数据中的name
title: '调整代码', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
},
{
field: 'proName', // 返回json数据中的name
title: '调整名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
},
{
field: 'filename', // 返回json数据中的name
title: '档案名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '30%',
}, {
field: 'upuser', // 返回json数据中的name
title: '上传人', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '30%',
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-xs" title="下载" onclick="fileDownload(\'' + row.docId + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
// buts += '<button class="btn btn-default btn-sm" title="删除" onclick="delRelation(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
buts = '<div class = "btn-group">' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_contentFile");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
}
//下载文件
var fileDownload = function (id) {
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=tb_doc_file");
};
</script>