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

190 lines
9.0 KiB
Plaintext
Raw Permalink 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"%>
<!DOCTYPE html>
<!-- 引入daterangepicker-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
<script type="text/javascript">
var addFun = function() {
$.post(ext.contextPath + '/achievement/acceptanceModelCreate/doRecordAdd.do', {pid:'${param.pid}'} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
function queryParams(params) {
var temp={
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
pid:'${param.pid}',
search_name: '${param.search_name}'
};
return temp;
}
$(function() {
$("#search_name_goods").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
//回车执行查询
doSearch();
event.stopPropagation();
}
});
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/achievement/acceptanceModelCreate/getRecordlist.do', // 获取表格数据的url
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
// clickToSelect:true,
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20], // 设置页面可以显示的数据条数
pageSize: 20, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'sdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
/* showColumns: true,
showRefresh: true, */
columns: [
{
checkbox:true,//单选框
},{
field: 'name', // 返回json数据中的name
title: '名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'sdt', // 返回json数据中的name
title: '创建日期', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter:function(value){
return value.substring(0,10);
}
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 160, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return '<div class="btn-group"><button title="文件下载" class="btn btn-default btn-sm" onclick="fileDownloadFun(\'' + row.id + '\')"><i class="fa fa-download"></i></button>'+
'<button title="相关数据" class="btn btn-default btn-sm" onclick="showData(\'' + row.id + '\')"><i class="fa fa-object-ungroup"></i></button>'+
'<button title="在线预览" class="btn btn-default btn-sm" onclick="onlineExcel(\'' + row.name + '\')"><i class="fa fa-eye"></i></button>'+
'<button title="文件删除" class="btn btn-default btn-sm" onclick="delFileFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>'+
'</div>';
}
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
});
function onlineExcel(filename){
window.open(getRootPath()+'_tohtm/AcceptanceModel/data/'+filename+'.htm','onlineExcel', 'width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+ ',top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');
}
function getRootPath(){
var pathName = window.location.pathname.substring(1);
var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
return window.location.protocol + '//' + window.location.host +"/"+webName;
}
function showData(id){
// $.post(ext.contextPath + '/achievement/acceptanceModelCreate/doDataRecordShow.do', {pid:id} , function(data) {
// $("#subDiv").html(data);
// openModal('dataSubModal');
// });
var top=(window.screen.height-30-750)/2;
var left=(window.screen.width-10-900)/2;
window.open(ext.contextPath + '/achievement/acceptanceModelCreate/doDataRecordOpenShow.do?pid='+id,'showData', 'width=900,height=750,top='+top+',left='+left+',toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');
}
function fileDownloadFun(id){
window.open(ext.contextPath + "/base/downloadFileFromMasterid.do?key="+id+"&tbName=TB_Achievement_AcceptanceModelRecord_file");
}
function delFileFun(id){
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 + '/achievement/acceptanceModelCreate/deleteRecord.do', {id:id}, function(data) {
if(data.code==1){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','alertDiv');
}
},'json');
}
});
}
function dosearch(){
var search_name=$('#search_name').val();
createFun('${param.pid}',search_name);
}
</script>
<body class="hold-transition ${cu.themeclass} sidebar-mini">
<div class="wrapper">
<div class="content-wrapper">
<section class="content container-fluid">
<!-- <form id="searchForm"> -->
<div >
<div id="companySelectTree" style="float:left;"></div>
<div class="form-group" style="padding:0;margin-bottom: 0px;float:left;" id="action">
<div class="btn-group" style="width: 220px;">
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
<!-- <security:authorize buttonUrl="sparepart/channels/add.do">
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
</security:authorize> -->
</div>
</div>
<div class="form-group" style="padding:0;margin-bottom: 10px;float:right;" id="action">
<div class="form-group pull-right form-inline" style="margin-bottom: 0px;">
<div class="input-group input-group-sm" style="width: 250px;">
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称" value="${param.search_name}">
<div class="input-group-btn" style="line-height: 30px">
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
</div>
<!-- </form> -->
<table id="table"></table>
</section>
<!-- /.content -->
</div>
</div>
</body>