annualPlan_showPlanList.jsp 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  3. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  4. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  8. %>
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12. <base href="<%=basePath%>">
  13. <!-- 下拉框 -->
  14. <link rel="stylesheet" href="static/ace/css/chosen.css" />
  15. <!-- jsp文件头和头部 -->
  16. <%@ include file="../../system/index/top.jsp"%>
  17. <!-- 日期框 -->
  18. <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  19. </head>
  20. <body class="no-skin">
  21. <!-- /section:basics/navbar.layout -->
  22. <div class="main-container" id="main-container">
  23. <div id="nPlanList" style='display:none;'>${nPlanList}</div>
  24. <!-- /section:basics/sidebar -->
  25. <div class="main-content">
  26. <div class="main-content-inner">
  27. <div class="page-content">
  28. <div class="row">
  29. <div class="col-xs-12">
  30. <form name="Form" id="Form">
  31. <div id="zhongxin" style="padding-top: 13px;">
  32. <div style="padding-left:2px;margin-left: 4px;">
  33. <p style="width:120px;margin: 12px 0 5px 5px;float: left">设置最晚提交时间:</p>
  34. <input style="width:120px;margin: 5px 0 5px 5px;" class="span12 date-picker" name="lastStart" id="lastStart" value="${sptime}" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:100px;" placeholder="最晚提交时间" title="最晚提交时间"/>
  35. <a class="btn btn-mini btn-primary" style="margin-left: 30px;" onclick="save('${pd.YEAR}');">保存</a>
  36. </div>
  37. <div style="float: left;position: relative;width: 30%;margin-left: 1%">
  38. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  39. <thead>
  40. <tr>
  41. <th class="center" style="width:20px;">序号</th>
  42. <th class="center">未提交公司</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <!-- 开始循环 -->
  47. <c:choose>
  48. <c:when test="${not empty nPlanList}">
  49. <c:forEach items="${nPlanList}" var="var" varStatus="vs">
  50. <tr>
  51. <td class='center' style="width: 50px;">${vs.index+1}</td>
  52. <td class='center'>${var.COMPANY_NAME}</td>
  53. </tr>
  54. </c:forEach>
  55. </c:when>
  56. </c:choose>
  57. </tbody>
  58. </table>
  59. </div>
  60. <div style="float: left;position: relative;width: 65%;margin-left: 4%">
  61. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  62. <thead>
  63. <tr>
  64. <th class="center" style="width:20px;">序号</th>
  65. <th class="center">已提交公司</th>
  66. <th class="center">提交时间</th>
  67. <th class="center">操作</th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <!-- 开始循环 -->
  72. <c:choose>
  73. <c:when test="${not empty planList}">
  74. <c:forEach items="${planList}" var="var" varStatus="vs">
  75. <tr>
  76. <td class='center' style="width: 50px;">${vs.index+1}</td>
  77. <c:choose>
  78. <c:when test="${var.MTIME > sptime}">
  79. <td class='center' style="color:red;">${var.COMPANY_NAME}</td>
  80. </c:when>
  81. <c:otherwise>
  82. <td class='center'>${var.COMPANY_NAME}</td>
  83. </c:otherwise>
  84. </c:choose>
  85. <td class='center'>${var.MTIME}</td>
  86. <td class='center'>
  87. <c:choose>
  88. <c:when test="${var.STATUS == '待审批'}">
  89. <img style="margin-left: 5%;margin-top: 2%;cursor:pointer;" src="static/images/b_sp.png" title="审批通过"
  90. onclick = "changePlanStatus('${var.COMPANY_ID}','${var.YEAR}','1');">
  91. <img style="margin-left: 5%;margin-top: 2%;cursor:pointer;" src="static/images/bohui.png" title="驳回"
  92. onclick = "changePlanStatus('${var.COMPANY_ID}','${var.YEAR}','2');">
  93. </c:when>
  94. </c:choose>
  95. </td>
  96. </tr>
  97. </c:forEach>
  98. </c:when>
  99. </c:choose>
  100. </tbody>
  101. </table>
  102. </div>
  103. </div>
  104. <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
  105. </form>
  106. </div>
  107. <!-- /.col -->
  108. </div>
  109. <!-- /.row -->
  110. </div>
  111. <!-- /.page-content -->
  112. </div>
  113. </div>
  114. </div>
  115. <footer>
  116. <div style="width: 100%;padding-bottom: 2px;" class="center">
  117. </div>
  118. </footer>
  119. <!-- 页面底部js¨ -->
  120. <%@ include file="../../system/index/foot.jsp"%>
  121. <!-- 下拉框 -->
  122. <script src="static/ace/js/chosen.jquery.js"></script>
  123. <!-- 日期框 -->
  124. <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
  125. <!--提示框-->
  126. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  127. <script src="static/ace/js/bootbox.js"></script>
  128. <script type="text/javascript">
  129. $( getTop(this).hangge());
  130. //保存
  131. function save(){
  132. if($("#YEAR").val()==""){
  133. $("#YEAR").tips({
  134. side:3,
  135. msg:'请输入年份',
  136. bg:'#AE81FF',
  137. time:2
  138. });
  139. $("#YEAR").focus();
  140. return false;
  141. }
  142. if($("#COMPANY").val()==""){
  143. $("#COMPANY").tips({
  144. side:3,
  145. msg:'请输入公司名称',
  146. bg:'#AE81FF',
  147. time:2
  148. });
  149. $("#COMPANY").focus();
  150. return false;
  151. }
  152. if($('#YEAR option:selected').val()!=""){
  153. hasPlan();
  154. }else{
  155. $("#Form").submit();
  156. $("#zhongxin").hide();
  157. $("#zhongxin2").show();
  158. //关闭弹框
  159. window.parent.document.getElementById("tb_showPlanList").style.display = "none";
  160. }
  161. }
  162. $(function() {
  163. //日期框
  164. $('.date-picker').datepicker({autoclose: true,todayHighlight: true});
  165. });
  166. //判断该年度计划是否存在
  167. function hasPlan(){
  168. var year = $('#YEAR option:selected').val();//选中的值
  169. var company = $('#COMPANY').val();//选中的值
  170. $.ajax({
  171. type: "get",
  172. url: '<%=basePath%>annualPlan/hasPlan.do?COMPANY='+encodeURIComponent(company) + '&YEAR=' + year,
  173. dataType:'json',
  174. success: function(data){
  175. if("success" == data.result){
  176. $("#Form").submit();
  177. $("#zhongxin").hide();
  178. $("#zhongxin2").show();
  179. //关闭弹框+刷新页面
  180. window.parent.document.getElementById("tb_showPlanList").style.display = "none";
  181. window.parent.tosearch();
  182. }else{
  183. bootbox.dialog({
  184. message: "<span class='bigger-110'>"+data.result+"</span>",
  185. buttons:
  186. {
  187. "button" :
  188. {
  189. "label" : "确定",
  190. "className" : "btn-sm btn-success"
  191. }
  192. }
  193. });
  194. }
  195. }
  196. });
  197. }
  198. //新增取消按钮
  199. function cancle(){
  200. window.parent.document.getElementById("tb_showPlanList").style.display = "none";
  201. window.parent.document.getElementById("_DialogBGDiv").style.display = "none";
  202. //window.location.href="<%=basePath%>annualPlan/list.do?";
  203. }
  204. //保存按钮
  205. function save(year){
  206. var time = $('#lastStart').val();
  207. var url = "<%=basePath%>annualPlanKG/saveTime.do?YEAR="+year + "&TIME=" + time;
  208. $.get(url,function(data){
  209. if("success" == data.result){
  210. window.location.href="<%=basePath%>annualPlanKG/showPlanList.do?YEAR="+year;
  211. }else if("false" == data.result){
  212. getTop(this).hangge();
  213. bootbox.dialog({
  214. message: "<span class='bigger-110'>保存失败</span>",
  215. buttons:
  216. {
  217. "button" :
  218. {
  219. "label" : "确定",
  220. "className" : "btn-sm btn-success"
  221. }
  222. }
  223. });
  224. }
  225. });
  226. }
  227. function changePlanStatus(company_id,year,type){
  228. var msg = "确定要审批通过吗?";
  229. if( type== "2"){
  230. msg = "确定要驳回吗?";
  231. }
  232. bootbox.confirm(msg, function(result) {
  233. if(result) {
  234. //getTop(this).jzts();
  235. var url = "<%=basePath%>annualPlanKG/changePlanStatus.do?YEAR="+year + "&COMPANY_ID=" +company_id + "&TYPE=" + type;
  236. $.get(url,function(data){
  237. if("success" == data.result){
  238. window.location.href="<%=basePath%>annualPlanKG/showPlanList.do?YEAR="+year;
  239. }else if("false" == data.result){
  240. getTop(this).hangge();
  241. bootbox.dialog({
  242. message: "<span class='bigger-110'>操作失败</span>",
  243. buttons:
  244. {
  245. "button" :
  246. {
  247. "label" : "确定",
  248. "className" : "btn-sm btn-success"
  249. }
  250. }
  251. });
  252. }
  253. });
  254. }
  255. });
  256. }
  257. </script>
  258. </body>
  259. </html>