473 lines
22 KiB
Plaintext
473 lines
22 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"%>
|
||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||
<%request.setAttribute("START", SparePartCommString.STATUS_START); %>
|
||
<%request.setAttribute("DEPT_AUDIT", SparePartCommString.STATUS_DEPT_AUDIT); %>
|
||
<%request.setAttribute("DEPT_REJECT", SparePartCommString.STATUS_DEPT_REJECT); %>
|
||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_FINISH); %>
|
||
<%request.setAttribute("INQUIRY_AUDIT", SparePartCommString.STATUS_INQUIRY_AUDIT); %>
|
||
<%request.setAttribute("INQUIRY_REJECT", SparePartCommString.STATUS_INQUIRY_REJECT); %>
|
||
<%request.setAttribute("PURCHASE_INQUIRY", SparePartCommString.STATUS_PURCHASE_INQUIRY); %>
|
||
<%request.setAttribute("PERSONAL_START", SparePartCommString.STATUS_PERSONAL_START); %>
|
||
<%request.setAttribute("PERSONAL_AUDIT", SparePartCommString.STATUS_PERSONAL_AUDIT); %>
|
||
<%request.setAttribute("PERSONAL_REJECT", SparePartCommString.STATUS_PERSONAL_REJECT); %>
|
||
<%request.setAttribute("PERSONAL_FINISH", SparePartCommString.STATUS_PERSONAL_FINISH); %>
|
||
<%request.setAttribute("department", SparePartCommString.department); %>
|
||
<%request.setAttribute("personal", SparePartCommString.personal); %>
|
||
<%request.setAttribute("temporary", SparePartCommString.temporary); %>
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
<head>
|
||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
<!-- bootstrap switch -->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||
<!--bootstrap-edittable 表格行内编辑 -->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single{
|
||
height:30px;
|
||
line-height: 30px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
.table-hover>tbody>tr:hover {
|
||
cursor: pointer;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
var addFun = function(type) {
|
||
$("#searchForm4"+type).bootstrapValidator('validate');//提交验证
|
||
if ($("#searchForm4"+type).data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + '/sparepart/subscribe/add.do', {companyId :companyId,type:type } , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
};
|
||
var editFun = function(id) {
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/edit.do', {id:id} , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
var viewFun = function(id, type){
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/view.do', {id:id} , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
//流程处理详情
|
||
var viewDetailHandleFun = function(id) {
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/showSubscribeView.do', {id:id} , function(data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subscribeExcuteModal');
|
||
});
|
||
};
|
||
var deleteFun = function(id,type) {
|
||
stopBubbleDefaultEvent();
|
||
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 + '/sparepart/subscribe/delete.do', {id : id}, function(data) {
|
||
if(data==1){
|
||
dosearch(type);
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
};
|
||
|
||
var deletesFun = function(type) {
|
||
var checkedItems = $("#table4"+type).bootstrapTable('getSelections');
|
||
var datas="";
|
||
$.each(checkedItems, function(index, item){
|
||
console.log(item);
|
||
if(item.status!='${START}' && item.status!='${PERSONAL_START}' && item.status!='${PERSONAL_REJECT}'){
|
||
//此状态下不可删除
|
||
}else{
|
||
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 + '/sparepart/subscribe/deletes.do', {ids:datas,type:type} , function(data) {
|
||
if(data>0){
|
||
dosearch(type);
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
//查询方法,选择厂区后自动加载
|
||
var dosearch = function(type) {
|
||
$("#table4"+type).bootstrapTable('refresh');
|
||
};
|
||
|
||
var companyId = "";
|
||
$(function() {
|
||
companyId = unitId;
|
||
initFun();
|
||
DatePicker('.startdt4personal','.enddt4personal');
|
||
DatePicker('.startdt4${department}-${temporary}','.enddt4${department}-${temporary}');
|
||
});
|
||
|
||
|
||
var initFun = function(){
|
||
tableAdd('${personal}');
|
||
tableAdd('${department}-${temporary}');
|
||
}
|
||
var tableAdd = function(type){
|
||
$("#table4"+type).bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/sparepart/subscribe/getList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
showColumns:true,
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
var startdt = $('.startdt4'+type).val();
|
||
var enddt = $('.enddt4'+type).val();
|
||
companyId = unitId;
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
search_name: $('#search_name').val(),
|
||
search_code: companyId,
|
||
startdt:startdt,
|
||
enddt:enddt,
|
||
type: type,
|
||
};
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||
viewFun(row.id);
|
||
}, */
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
formatter: function (value, row, index){
|
||
if(row.status!='${START}' && row.status!='${PERSONAL_START}' && row.status!='${PERSONAL_REJECT}'){
|
||
return {
|
||
disabled : true
|
||
}
|
||
}
|
||
}
|
||
},{
|
||
field: 'id', // 返回json数据中的name
|
||
title: '申购单号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'dept.name', // 返回json数据中的name
|
||
title: '申购部门', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
if(value!=null && value!=undefined && value!=''){
|
||
return value;
|
||
}else{
|
||
return row.company.name;
|
||
}
|
||
}
|
||
},{
|
||
field: 'subscribeManName', // 返回json数据中的name
|
||
title: '申购人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'subscribeDate', // 返回json数据中的name
|
||
title: '申购日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return value.substring(0,10);
|
||
}
|
||
},{
|
||
field: 'totalMoney', // 返回json数据中的name
|
||
title: '合计金额/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'status', // 返回json数据中的name
|
||
title: '申购状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
switch (value){
|
||
case '${START}' :
|
||
return "未提交";
|
||
case '${DEPT_AUDIT}' :
|
||
return "部门审核中";
|
||
case '${DEPT_REJECT}' :
|
||
return "部门审核驳回";
|
||
case '${PURCHASE_INQUIRY}' :
|
||
return "询价中";
|
||
case '${INQUIRY_AUDIT}' :
|
||
return "询价审核中";
|
||
case '${INQUIRY_REJECT}' :
|
||
return "询价审核驳回";
|
||
case '${FINISH}' :
|
||
return "已完成";
|
||
case '${PERSONAL_START}' :
|
||
return "未提交";
|
||
case '${PERSONAL_AUDIT}' :
|
||
return "已提交";
|
||
case '${PERSONAL_REJECT}' :
|
||
return "已退回";
|
||
case '${PERSONAL_FINISH}' :
|
||
return "已使用";
|
||
default :
|
||
return value;
|
||
}
|
||
}
|
||
},{
|
||
field: 'type', // 返回json数据中的name
|
||
title: '类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
switch (value){
|
||
case '${personal}' :
|
||
return "个人申购";
|
||
case '${department}' :
|
||
return "部门申购";
|
||
case '${temporary}' :
|
||
return "临时申购";
|
||
default :
|
||
return '其他';
|
||
}
|
||
}
|
||
},{
|
||
field: 'remark', // 返回json数据中的name
|
||
title: '备注', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts= '';
|
||
if(row.status == '${START}' || row.status == '${PERSONAL_START}'){
|
||
buts+= '<security:authorize buttonUrl="sparepart/subscribe/edit.do">';
|
||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||
buts+= '</security:authorize>';
|
||
|
||
buts+= '<security:authorize buttonUrl="sparepart/subscribe/delete.do">';
|
||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\',\''+type+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||
buts+= '</security:authorize>';
|
||
}else{//流程未发起时不能查看流程详情
|
||
buts+= '<security:authorize buttonUrl="sparepart/subscribe/view.do">';
|
||
buts+= '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
|
||
buts+= '</security:authorize>';
|
||
<%--if(row.status != '${PERSONAL_AUDIT}'&& row.status != '${PERSONAL_REJECT}' && row.status != '${PERSONAL_FINISH}'){--%>
|
||
<%-- buts+= '<button class="btn btn-default btn-sm" title="查看流程详情" onclick="viewDetailHandleFun(\'' + row.id + '\')"><i class="fa fa-history"></i><span class="hidden-md hidden-lg">查看</span></button>';--%>
|
||
<%--}--%>
|
||
}
|
||
buts='<div class="btn-group" >'+buts+'</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table4"+type);
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
</script>
|
||
</head>
|
||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
<div class="wrapper">
|
||
<!-- 引用top -->
|
||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||
<!-- 菜单栏 -->
|
||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||
<div class="content-wrapper">
|
||
<!-- Main content -->
|
||
|
||
<section class="content container-fluid">
|
||
<div id="mainAlertdiv"></div>
|
||
<div id="subDiv"></div>
|
||
<div id="subDetailDiv"></div>
|
||
<div id="Goods4SelectDiv"></div>
|
||
<div id="Goods4SelectsDiv"></div>
|
||
<div id="user4SelectDiv"></div>
|
||
<div id="fileInputDiv"></div>
|
||
<div id="goodsAddDiv"></div>
|
||
<div id="equ4SelectDiv"></div>
|
||
<div id="fault4SelectDiv"></div>
|
||
<div id="importDiv"></div>
|
||
<div id="templateDiv"></div>
|
||
<div id="personalDiv"></div>
|
||
<div id="sendMessageDiv"></div>
|
||
<div id="sendUser4SelectDiv"></div>
|
||
<div class="nav-tabs-custom">
|
||
<ul class="nav nav-tabs">
|
||
<security:authorize buttonUrl="sparepart/subscribe/showlist4personal.do">
|
||
<li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">个人申购</a></li>
|
||
</security:authorize>
|
||
<security:authorize buttonUrl="sparepart/subscribe/showlist4department.do">
|
||
<li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">部门申购</a></li>
|
||
</security:authorize>
|
||
<security:authorize buttonUrl="sparepart/goods/showlist4number.do">
|
||
<!-- <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">编号申请</a></li> -->
|
||
</security:authorize>
|
||
</ul>
|
||
<div class="tab-content">
|
||
<div class="tab-pane active" id="tab_1">
|
||
<form id="searchForm4personal">
|
||
<div >
|
||
<div class="form-group" style="padding:0;margin-bottom: 0px;float:left;">
|
||
<div class="btn-group pull-left" style="width: 220px;">
|
||
<security:authorize buttonUrl="sparepart/subscribe/add.do">
|
||
<button type="button" class="btn btn-default btn-sm" onclick="addFun('${personal}');"><i class="fa fa-plus"></i> 新增</button>
|
||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun('${personal}');"><i class="fa fa-trash-o"></i> 删除</button>
|
||
</security:authorize>
|
||
</div>
|
||
<div class="form-group pull-right form-inline" >
|
||
<div class="input-group" >
|
||
<span class="input-group-addon">申购日期</span>
|
||
<input type="text" class="form-control startdt4personal" name="startdt" >
|
||
<span class="input-group-addon">至</span>
|
||
<input type="text" class="form-control enddt4personal" name="enddt" >
|
||
</div>
|
||
<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="单号">
|
||
<div class="input-group-btn">
|
||
<button type="button" class="btn btn-default" onclick="dosearch('${personal}');"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<table id="table4personal"></table>
|
||
</div>
|
||
<!-- /.tab-pane -->
|
||
<div class="tab-pane" id="tab_2">
|
||
<form id="searchForm4${department}-${temporary}">
|
||
<div >
|
||
<div class="form-group" style="padding:0;margin-bottom: 0px;float:left;">
|
||
<div class="btn-group pull-left" style="width: 220px;">
|
||
<security:authorize buttonUrl="sparepart/subscribe/add.do">
|
||
<button type="button" class="btn btn-default btn-sm" onclick="addFun('${department}-${temporary}');"><i class="fa fa-plus"></i> 新增</button>
|
||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun('${department}-${temporary}');"><i class="fa fa-trash-o"></i> 删除</button>
|
||
</security:authorize>
|
||
</div>
|
||
<div class="form-group pull-right form-inline" >
|
||
<div class="input-group" >
|
||
<span class="input-group-addon">申购日期</span>
|
||
<input type="text" class="form-control startdt4${department}-${temporary}" name="startdt" >
|
||
<span class="input-group-addon">至</span>
|
||
<input type="text" class="form-control enddt4${department}-${temporary}" name="enddt" >
|
||
</div>
|
||
<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="单号">
|
||
<div class="input-group-btn">
|
||
<button type="button" class="btn btn-default" onclick="dosearch('${department}-${temporary}');"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<table id="table4${department}-${temporary}"></table>
|
||
</div>
|
||
<!-- /.tab-pane -->
|
||
<div class="tab-pane" id="tab_3">
|
||
</div>
|
||
<!-- /.tab-pane -->
|
||
</div>
|
||
<!-- /.tab-content -->
|
||
</div>
|
||
</section>
|
||
<!-- /.content -->
|
||
</div>
|
||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||
</div>
|
||
</body>
|
||
<!-- 文件上传-->
|
||
<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" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||
</html>
|