approve_list.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>申报项目审核</title>
  7. <style>
  8. .select-box, input, label {
  9. float: left;
  10. margin-bottom: 10px;
  11. height: 30px;
  12. margin-right: 10px;
  13. }
  14. label {
  15. line-height: 30px;
  16. }
  17. .cl .l .layui-upload-file {
  18. display: none;
  19. }
  20. </style>
  21. </head>
  22. <body layout:fragment="content">
  23. <nav class="breadcrumb" th:action="@{/projectDeclaration/list/{type}(type=${type})}" th:method="post">
  24. <i class="Hui-iconfont">&#xe67f;</i>
  25. 首页
  26. <span th:unless="${is_label}" class="c-gray en">&gt; 项目申报</span>
  27. <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
  28. href="javascript:location.replace(location.href);" title="刷新">
  29. <i class="Hui-iconfont">&#xe68f;</i>
  30. </a>
  31. </nav>
  32. <form id="myForm" th:action="@{/projectDeclaration/list/{type}(type=${type})}" th:method="get">
  33. <div class="page-container">
  34. <div class="">
  35. <div class="row clearfix" style="padding: 0 15px;">
  36. <span class="select-box" style="width:170px;">
  37. <select class="select" th:name="project_year" id="project_year" onchange="changeProjectByYear()">
  38. <option value="">-- 请选择年份 --</option>
  39. </select>
  40. </span>
  41. <span class="select-box" style="width:170px;">
  42. <select class="select" th:name="project_type" id="project_type">
  43. <option value="">-- 请选择项目类别 --</option>
  44. <option th:each="item : ${projectTypeList}" th:value="${item.id}"
  45. th:text="${item.type_name}" th:selected="${paramApplication.project_type}==${item.id}">
  46. </option>
  47. </select>
  48. </span>
  49. <span th:if="${type=='4'}" class="select-box" style="width:170px;">
  50. <select class="select" th:name="approval_status" id="approval_status">
  51. <option value="">-- 请选择单据状态 --</option>
  52. <option th:each="item : ${statusList}" th:value="${item.value}"
  53. th:text="${item.name}" th:selected="${paramApplication.approval_status}==${item.value}">
  54. </option>
  55. </select>
  56. </span>
  57. <span class="select-box" style="width:190px;">
  58. <select class="select" th:name="street_id" id="street_id">
  59. <option value="">-- 请选择街道 --</option>
  60. <option th:each="item : ${streetList}" th:value="${item.id}"
  61. th:text="${item.name}" th:selected="${paramApplication.street_id}==${item.id}">
  62. </option>
  63. </select>
  64. </span>
  65. <div style="width:280px; float: left;">
  66. <label>项目名称:</label>
  67. <input style="width:190px;" type="text" class="input-text" placeholder="请输入项目名称查询" id="project_name"
  68. name="project_name" th:value="${paramApplication.project_name}"/>
  69. </div>
  70. <div style="width:280px; float: left;">
  71. <label>申请企业:</label>
  72. <input style="width:190px;" type="text" class="input-text" placeholder="请输入申请企业查询" id="company_name"
  73. name="company_name" th:value="${paramApplication.company_name}"/>
  74. </div>
  75. <div style="width:420px; float: left;">
  76. <label>申请日期:</label>
  77. <input style="width:150px;" type="text" class="input-text" id="apply_date_start"
  78. name="apply_date_start"
  79. th:value="${paramApplication.apply_date_start}"/>
  80. <label>-</label>
  81. <input style="width:150px;" type="text" class="input-text" th:id="apply_date_end"
  82. th:name="apply_date_end"
  83. th:value="${paramApplication.apply_date_end}"/>
  84. </div>
  85. <input type="button" value="搜索" class="btn btn-primary" onclick="$('#myForm').submit();">
  86. </div>
  87. </div>
  88. <div class="cl pd-5 bg-1 bk-gray mt-20">
  89. <span class="l" th:if="${type} == 4">
  90. <a onclick="exportExcel()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 导出</a>
  91. <a id="import" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe640;</i> 导入</a>
  92. </span>
  93. <span class="r">共有数据:<strong th:text="${pageInfo.total}" id="total">54</strong> 条</span>
  94. </div>
  95. <!-- 表格 -->
  96. <table id="index" class="table table-border table-bordered table-bg table-hover"
  97. style="table-layout: fixed;width:100%;">
  98. <thead>
  99. <tr class="text-c">
  100. <!--<th style="width:0px;"></th>-->
  101. <th>申请单号</th>
  102. <th>申请企业</th>
  103. <th>所属街道/乡镇</th>
  104. <th>项目类别</th>
  105. <th>申报项目</th>
  106. <th>申请日期</th>
  107. <th>单据状态</th>
  108. <th th:if="${type} == 4">导入通过状态</th>
  109. <th>操作</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr class="text-c" th:each="model,iterStat:${pageInfo.list}" th:object="${model}">
  114. <td th:text="*{apply_no}" style="width:200px;" class="text-overflow" th:title="*{apply_no}"></td>
  115. <td th:text="*{company_name}" style="width:200px;" class="text-overflow"
  116. th:title="*{company_name}"></td>
  117. <td th:text="*{street_name}" style="width:200px;" class="text-overflow" th:title="*{street_name}"></td>
  118. <td th:text="*{project_type}" style="width:200px;" class="text-overflow"
  119. th:title="*{project_type}"></td>
  120. <td th:text="*{project_name}" style="width:200px;" class="text-overflow"
  121. th:title="*{project_name}"></td>
  122. <td th:text="*{apply_date}" style="width:90px;" class="text-overflow" th:title="*{apply_date}"></td>
  123. <td th:text="*{statedesc}" style="width:180px;" class="text-overflow" th:title="*{statedesc}"></td>
  124. <td th:if="${type} == 4" th:text="*{pass}" style="width:180px;" class="text-overflow"
  125. th:title="*{pass}"></td>
  126. <td class="td-manage" style="width:90px;">
  127. <a th:if="${type=='2'||type=='4'}" title="查看"
  128. th:onclick="'javascript:open_dialog(\'查看\',\'/projectDeclaration/check/'+*{id}+'\',\'800\',\'400\');'"
  129. class="ml-5" style="text-decoration:none">查看</a>
  130. <a th:if="${type=='1'}">
  131. <a th:if="*{approve_status!='6' && approve_status!='5' && approve_status!='11' && approve_status!='12'&& approve_status!='13'}"
  132. title="审核"
  133. th:onclick="'javascript:open_dialog(\'审核\',\'/projectDeclaration/approve/'+*{id}+'\',\'800\',\'400\');'"
  134. class="ml-5" style="text-decoration:none">审核</a>
  135. <a th:if="*{approve_status=='5' || approve_status=='11' || approve_status=='12'|| approve_status=='13'}"
  136. title="上传"
  137. th:onclick="'javascript:open_dialog(\'上传\',\'/projectDeclaration/approve/'+*{id}+'\',\'800\',\'400\');'"
  138. class="ml-5" style="text-decoration:none">上传</a>
  139. <a th:if="*{approve_status=='6'}" title="通知"
  140. th:onclick="'javascript:open_dialog(\'通知\',\'/projectDeclaration/approve/'+*{id}+'\',\'800\',\'400\');'"
  141. class="ml-5" style="text-decoration:none">通知</a>
  142. </a>
  143. </td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. <div th:replace="admin/common/page :: page"></div>
  148. </div>
  149. </form>
  150. <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
  151. <script type="text/javascript" th:src="@{/js/company/companyInfoManage/layui.all.js}"></script>
  152. <script th:inline="javascript">
  153. onload = function () {
  154. var year = new Date().getFullYear(); //获取当前年份
  155. var sel = document.getElementById('project_year');//获取select下拉列表
  156. for (var i = 2018; i < year + 3; i++)//循环添加2006到当前年份加3年的每个年份依次添加到下拉列表
  157. {
  158. var option = document.createElement('option');
  159. option.value = i;
  160. var txt = document.createTextNode(i);
  161. option.appendChild(txt);
  162. sel.appendChild(option);
  163. }
  164. var selectYear = [[${paramApplication.project_year}]];
  165. console.log(selectYear);
  166. if (selectYear) {
  167. $("#project_year").find("option:contains('" + selectYear + "')").attr("selected", true);
  168. // changeProjectByYear(selectYear);
  169. }
  170. };
  171. function changeProjectByYear() {
  172. $.ajax({
  173. url: pagePath + "/project/getProjectByYear",
  174. type: "get",
  175. data: {
  176. 'year': $("#project_year").val()
  177. },
  178. dataType: "json",
  179. success: function (result) {
  180. if (result.success) {
  181. var types = result.obj;
  182. $("#project_type").find("option").remove();
  183. var options = '<option value="" >-- 请选择项目类别 --</option>';
  184. for (var i = 0; i < types.length; i++) {
  185. options += '<option value="' + types[i].id + '" >' + types[i].type_name + '</option>';
  186. }
  187. $("#project_type").append(options);
  188. } else {
  189. errorMessage(result.message);
  190. }
  191. },
  192. error: function () {
  193. errorMessage('系统错误!');
  194. }
  195. });
  196. }
  197. //弹出框
  198. function open_dialog(title, url, w, h) {
  199. var index = layer_show(title, pagePath + url, w, h);
  200. //默认全屏
  201. layer.full(index);
  202. }
  203. laydate.render({
  204. elem: '#apply_date_start', //指定元素
  205. /*min: 0,
  206. format: 'yyyy-MM-dd',
  207. type: 'datetime'*/
  208. });
  209. laydate.render({
  210. elem: '#apply_date_end', //指定元素
  211. /*min: 0,
  212. format: 'yyyy-MM-dd',
  213. type: 'datetime'*/
  214. });
  215. function exportExcel(id) {
  216. var project_type = $('#project_type').val();
  217. var street_id = $('#street_id').val();
  218. var project_name = $('#project_name').val();
  219. var company_name = $('#company_name').val();
  220. var apply_date_start = $('#apply_date_start').val();
  221. var apply_date_end = $('#apply_date_end').val();
  222. var approval_status = $('#approval_status').val();
  223. var project_year = $('#project_year').val();
  224. window.open(encodeURI(pagePath + "/projectDeclaration/exportExcel?project_type=" + project_type +
  225. "&street_id=" + street_id + "&project_name=" + project_name + "&company_name=" + company_name +
  226. "&apply_date_start=" + apply_date_start + "&apply_date_end=" + apply_date_end +
  227. "&approval_status=" + approval_status + "&project_year=" + project_year));
  228. }
  229. $(function () {
  230. /*导入excel*/
  231. layui.use('upload', function () {
  232. var $ = layui.jquery, upload = layui.upload,loading_index;
  233. //批量导入
  234. upload.render({
  235. elem: '#import'
  236. , url: pagePath + "/projectDeclaration/importProject"
  237. , auto: true
  238. //data:{"fileUpload":"File"}
  239. , method: 'post'//上传接口的HTTP类型
  240. , field: 'file'
  241. //,multiple: true
  242. // ,bindAction: '#test9'
  243. , accept: 'file' //允许上传的文件类型
  244. , exts: 'xlsx'//允许上传文件的后缀
  245. //,size: 50 //最大允许上传的文件大小
  246. , before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
  247. loading_index = layer.load(); //上传loading
  248. },
  249. done: function (res, index, upload) {
  250. layer.close(loading_index);
  251. if (res.success) {
  252. succeedMessage(res.message);
  253. if (res.obj) {
  254. var arr = res.obj, str = "以下企业状态更新失败:" + "<br/>";
  255. for (var i = 0; i < arr.length; i++) {
  256. str += "年度:" + arr[i].projectYear + ",企业名称:" + arr[i].companyName + "<br/>";
  257. }
  258. layer.alert(
  259. str,
  260. {area: ['800px', '500px']}
  261. )
  262. } else {
  263. setTime();
  264. }
  265. } else {
  266. errorMessage(res.message);
  267. setTime();
  268. }
  269. }
  270. , error: function (res, index, upload) {
  271. //请求异常回调
  272. console.log(res)
  273. }
  274. });
  275. });
  276. });
  277. </script>
  278. </body>
  279. </html>