project-list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>项目列表页面</title>
  5. <!--#include file="common/_header.html"-->
  6. <style>
  7. .table .center{
  8. text-align:center;
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <nav class="breadcrumb">
  14. <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 列表
  15. <a class="btn btn-success radius r"
  16. style="line-height: 1.6em; margin-top: 3px"
  17. href="javascript:location.replace(location.href);" title="刷新">
  18. <i class="Hui-iconfont">&#xe68f;</i></a>
  19. </nav>
  20. <div class="page-container">
  21. <div class="container mb-10">
  22. <form>
  23. <div class="row mb-10">
  24. <input type="text" class="input-text" style="width: 250px" placeholder="输入项目名称" id="projectName" name="projectName">
  25. <select class="select-box" style="width: 250px" id="parkId" name="parkId">
  26. <option value="">--选择园区--</option>
  27. </select>
  28. <select class="select-box" style="width: 250px" id="status">
  29. <option value="">--选择阶段--</option>
  30. <option value="-1">未发起流程</option>
  31. <option value="0">项目履约转办</option>
  32. <option value="1">项目开工建设</option>
  33. <option value="2">项目建成投产</option>
  34. <option value="3">已完成</option>
  35. <option value="8">停止</option>
  36. </select>
  37. <button type="submit" class="btn btn-success" id="btnSearch"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
  38. <button id="btnReset" type="reset" class="btn btn-default"><i class="Hui-iconfont">&#xe68f;</i> 重置</button>
  39. </div>
  40. </form>
  41. </div>
  42. <div class="cl pd-5 bg-1 bk-gray" id="hid1" style="display: none;">
  43. <span class="l">
  44. <a href="javascript:batch_del();" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i>批量删除</a>
  45. <a href="javascript:item_add();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i>添加</a>
  46. </span>
  47. </div>
  48. <div class="mt-20">
  49. <table id="grid1" class="table table-border table-bordered table-bg">
  50. <thead>
  51. <tr class="text-c">
  52. <th width="25"><input id="checkAll" type="checkbox" value=""></th>
  53. <th width="80">所属园区</th>
  54. <th width="120">项目名称</th>
  55. <th width="80">项目签约时间</th>
  56. <th width="60">计划投资</th>
  57. <th width="120">选址位于</th>
  58. <th width="120">相关情况</th>
  59. <th width="120">相关乡镇场</th>
  60. <th width="80">项目秘书</th>
  61. <th width="80">包联领导</th>
  62. <th width="80">项目方所属管理员</th>
  63. <th width="80">停止时间</th>
  64. <th width="80">停止备注</th>
  65. <th width="280">操作</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. <!--_footer 作为公共模版分离出去-->
  74. <!--#include file="common/_footer.html"-->
  75. <!--/_footer 作为公共模版分离出去-->
  76. <!--请在下方写此页面业务相关的脚本-->
  77. <script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
  78. <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
  79. <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
  80. <script id="rowTmpl" type="text/template">
  81. <div>
  82. {{if procInstId==null}}
  83. <a href="javascript:startProcess('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe603;</i>发起流程</a>
  84. {{else}}
  85. <a href="javascript:projectProgress('{{id}}','{{title}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe627;</i>项目进度</a>
  86. {{/if}}
  87. <a href="javascript:openFile('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>附件查看</a>
  88. </div>
  89. <div>
  90. <a href="javascript:item_edit('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>编辑</a>
  91. <a href="javascript:item_del('{{id}}','{{title}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i>删除</a>
  92. <a href="javascript:item_exit('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>停止</a>
  93. </div>
  94. </script>
  95. <script id="rowTmpl2" type="text/template">
  96. <div>
  97. {{if procInstId==null}}
  98. <a href="javascript:startProcess('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe603;</i>发起流程</a>
  99. {{else}}
  100. <a href="javascript:projectProgress('{{id}}','{{title}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe627;</i>项目进度</a>
  101. {{/if}}
  102. <a href="javascript:openFile('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>附件查看</a>
  103. </div>
  104. <div>
  105. <a href="javascript:item_view('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>查看详情</a>
  106. </div>
  107. </script>
  108. <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
  109. <script type="text/javascript" src="scripts/global.js"></script>
  110. <!-- select2 start-->
  111. <link rel="stylesheet" type="text/css" href="lib/select2/select2.min.css" />
  112. <script src="lib/select2/select2.full.js" type="text/javascript"></script>
  113. <script src="lib/select2/select2.zh-CN.js" type="text/javascript"></script>
  114. <!-- select2 end -->
  115. <script type="text/javascript">
  116. var path = global_backend_url;
  117. var userStr;
  118. var json;
  119. var allowEdit = false;
  120. $(document).ready(function(){
  121. /***角色权限****/
  122. userStr = sessionStorage.getItem("user");
  123. json = JSON.parse(userStr);
  124. for(var i=0;i<json.adminRoleList.length;i++){
  125. var role = json.adminRoleList[i];
  126. if(role.roleName=='XMF'){
  127. $("#hid1").hide();
  128. break;
  129. }
  130. else if(role.roleName == 'TZCJZX' || role.roleName=='SYSADMIN'){
  131. $("#hid1").show();
  132. allowEdit = true;
  133. break;
  134. }
  135. }
  136. var loadingIndex = -1;
  137. $('#grid1').dataTable({
  138. ajax: {
  139. url: path + "/project/projectList",
  140. type: 'post',
  141. dataFilter: function(responseText){
  142. var jsonData = JSON.parse(responseText);
  143. if(loadingIndex!=-1){
  144. top.layer.close(loadingIndex);
  145. }
  146. // 处理返回json
  147. if(jsonData.result){
  148. return JSON.stringify(jsonData.data);
  149. }
  150. else{
  151. processError(jsonData);
  152. return null;
  153. }
  154. },
  155. data: function(searchParams){
  156. // 查询json
  157. //searchParams["name"] = $("#procDefName").val();
  158. searchParams["projectName"] = $("#projectName").val();
  159. searchParams["status"] = $("#status").val();
  160. searchParams["parkId"] = $("#parkId").val();
  161. loadingIndex = top.layer.load(0, {shade: [0.1,'#fff']});
  162. }
  163. },
  164. serverSide: true,
  165. searching : false,
  166. ordering: false,
  167. columns: [
  168. {data:'projectId'},
  169. {data:'parkId'},
  170. {data:'title'},
  171. {data:'startTime'},
  172. {data:'size'},
  173. {data:'address'},
  174. {data:'detail'},
  175. {data:'townshipAdminName'},
  176. {data:'secretaryAdmin.realName'},
  177. {data:'leaderAdmin.realName'},
  178. {data:'projectAdmin.realName'},
  179. {data:'exitTime'},
  180. {data:'exitRemark'},
  181. {"data":null}
  182. ],
  183. columnDefs: [
  184. {
  185. targets:0,
  186. sClass:'center',
  187. bSortable:false,
  188. render: function (data, type, row) {
  189. return '<input type="checkbox" name="checkItems" value="'+ data + '">';
  190. }
  191. },{
  192. targets:1,
  193. sClass:'center',
  194. bSortable:false,
  195. render: function (data, type, row) {
  196. if(row.park == null){
  197. return '';
  198. }else{
  199. return row.park.title;
  200. }
  201. }
  202. },{
  203. targets:8,
  204. sClass:'center',
  205. bSortable:false,
  206. render: function (data, type, row) {
  207. if(row.secretaryAdmin == null){
  208. return '';
  209. }else{
  210. return row.secretaryAdmin.realName;
  211. }
  212. }
  213. },{
  214. targets:9,
  215. sClass:'center',
  216. bSortable:false,
  217. render: function (data, type, row) {
  218. if(row.leaderAdmin == null){
  219. return '';
  220. }else{
  221. return row.leaderAdmin.realName;
  222. }
  223. }
  224. },{
  225. targets:10,
  226. sClass:'center',
  227. bSortable:false,
  228. render: function (data, type, row) {
  229. if(row.projectAdmin == null){
  230. return '';
  231. }else{
  232. return row.projectAdmin.realName;
  233. }
  234. }
  235. },{
  236. targets:13,
  237. sClass:'center',
  238. bSortable:false,
  239. render: function (data, type, row) {
  240. var rowStr = "rowTmpl2";
  241. if(allowEdit){
  242. rowStr = "rowTmpl";
  243. }
  244. else{
  245. rowStr = "rowTmpl2";
  246. }
  247. return template(rowStr,{
  248. id: row.projectId,
  249. title: row.title,
  250. procInstId: row.procInstId
  251. });
  252. }
  253. }
  254. ]
  255. });
  256. $("#checkAll").change(function(){
  257. var checked = $(this).is(':checked');
  258. $("input[name='checkItems']").each(function(){
  259. $(this).attr("checked",checked);
  260. });
  261. });
  262. $("#btnSearch").click(function(){
  263. event.preventDefault();
  264. var table = $('#grid1').DataTable();
  265. table.ajax.reload();
  266. });
  267. getParkList("");
  268. });
  269. function getParkList(parkId){
  270. $.post(path + "/park/allList",function(json){
  271. if(json.result){
  272. $.each(json.data,function(index,obj){
  273. if(parkId!=""){
  274. if(obj.parkId==parkId){
  275. $("#parkId").append("<option value='"+obj.parkId+"' selected>"+obj.title+"</option>")
  276. }else{
  277. $("#parkId").append("<option value='"+obj.parkId+"'>"+obj.title+"</option>")
  278. }
  279. }
  280. else{
  281. $("#parkId").append("<option value='"+obj.parkId+"'>"+obj.title+"</option>")
  282. }
  283. })
  284. }
  285. else{
  286. layer.msg(json.message);
  287. }
  288. },"json")
  289. }
  290. function item_add(){
  291. layer_show("添加","project-detail.html",800,600);
  292. }
  293. function item_edit(id){
  294. layer_show("编辑","project-detail.html?id=" + id,800,600);
  295. }
  296. function item_view(id){
  297. layer_show("查看","project-view.html?id=" + id,800,600);
  298. }
  299. function item_exit(id){
  300. layer_show("编辑","project-exit.html?id=" + id,600,300);
  301. }
  302. function startProcess(id){
  303. var index = top.layer.open({
  304. type: 2,
  305. fix: false, //不固定
  306. maxmin: true,
  307. shade:0.4,
  308. title: "发起流程",
  309. content: "project-start-process.html?id=" + id
  310. });
  311. window.top["listWindow"] = this;
  312. window.top.layer.full(index);
  313. }
  314. function projectProgress(id,title){
  315. //layer_show(title + "-项目进度","project-progress.html?projectId=" + id,800,600);
  316. var index = top.layer.open({
  317. type: 2,
  318. fix: false, //不固定
  319. maxmin: true,
  320. shade:0.4,
  321. title: title + "-项目进度",
  322. content: "project-progress.html?projectId=" + id
  323. });
  324. top.layer.full(index);
  325. }
  326. function openFile(id){
  327. var link = $("a");
  328. link.attr("data-href","project-file-list.html?id=" + id);
  329. link.attr("data-title","附件列表");
  330. Hui_admin_tab(link);
  331. }
  332. function item_del(id){
  333. layer.confirm("是否删除?",{
  334. btns:["是","否"]
  335. },function(){
  336. $.post(path + "/project/delete/" + id,null,function(json){
  337. if(json.result){
  338. layer.msg("删除成功!",{icon:1,time:2000});
  339. reloadList();
  340. }
  341. else{
  342. layer.msg("删除失败!" + json.message);
  343. }
  344. });
  345. });
  346. }
  347. function reloadList(){
  348. $('#grid1').DataTable().ajax.reload(null,false);
  349. }
  350. function batch_del(){
  351. var arr = $("input[name='checkItems']:checked").map(function(){
  352. return $(this).val();
  353. }).get();
  354. if(arr.length==0){
  355. layer.msg("请选择记录!");
  356. return;
  357. }
  358. layer.confirm("是否删除选中项?",{
  359. btns:["是","否"]
  360. },function(){
  361. $.post(path + "/project/batchDelete",{
  362. ids:arr.join(",")
  363. },function(json){
  364. if(json.result){
  365. layer.msg("删除成功!",{icon:1,time:2000});
  366. reloadList();
  367. }
  368. else{
  369. alert(json.message);
  370. layer.msg("删除失败!" + json.message);
  371. }
  372. });
  373. })
  374. }
  375. </script>
  376. </body>
  377. </html>