report.jsp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <jsp:include page="../../common/common-meta-include.jsp"></jsp:include>
  8. <jsp:include page="../../common/common-js-include.jsp"></jsp:include>
  9. <jsp:include page="../../common/common-css-include.jsp"></jsp:include>
  10. <!--[if lt IE 9]>
  11. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  12. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  13. <![endif]-->
  14. <style>
  15. .layui-table-cell{
  16. height: 42px !important;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <div id="app"></div>
  22. <template id="template">
  23. <div class="layui-layout layui-layout-admin">
  24. <!-- 内容区域 -->
  25. <div class="right_title">
  26. <span class="txt">项目信息申报</span>
  27. <%-- <button class="btn btn_add" @click="add">新增</button>--%>
  28. <div class="layui-collapse">
  29. <div class="layui-colla-item">
  30. <%-- <h2 class="layui-colla-title">筛选</h2>--%>
  31. <div class="layui-colla-content layui-show">
  32. <form class="layui-form" lay-filter="searchForm">
  33. <div class="layui-row">
  34. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  35. <div class="layui-form-item">
  36. <label class="layui-form-label">项目名称</label>
  37. <div class="layui-input-block">
  38. <input type="text" name="subName" placeholder="请输入" autocomplete="off" class="layui-input">
  39. </div>
  40. </div>
  41. </div>
  42. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  43. <div class="layui-form-item">
  44. <label class="layui-form-label">项目状态</label>
  45. <div class="layui-input-block">
  46. <select name="status">
  47. <option value="">请选择</option>
  48. <option value="1">储备</option>
  49. <option value="2">新建</option>
  50. <option value="3">在建</option>
  51. <option value="9">投产</option>
  52. </select>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">开工时间</label>
  59. <div class="layui-input-block time_box">
  60. <input type="text" id="startTime" name="rangeDate" placeholder="请选择时间段" autocomplete="off" class="layui-input">
  61. </div>
  62. </div>
  63. </div>
  64. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  65. <div class="layui-form-item">
  66. <div class="layui-input-block time_box">
  67. <button type="button" class="layui-btn layui-btn-normal" @click="search">查询</button>
  68. <%-- <button type="button" class="layui-btn layui-btn-export" @click="downTemplate">下载模板</button>--%>
  69. <%-- <button type="button" class="layui-btn layui-btn-export" @click="impExcel">导入</button>--%>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>
  78. <%-- <div>--%>
  79. <%-- <button class="layui-btn btn_add" @click="add">新增</button>--%>
  80. <%-- </div>--%>
  81. </div>
  82. <div class="table_box">
  83. <div class="table_process">
  84. <table id="table1" lay-filter="test"></table>
  85. <div class="pagination-box" id="pagination"></div>
  86. </div>
  87. </div>
  88. <div style="height: 20px;"></div>
  89. </div>
  90. </template>
  91. <div id="importExc" style="display: none;">
  92. </div>
  93. <div id="selectWeek" class="layuimini-main" style="display: none;">
  94. <form class="layui-form" lay-filter="weekForm">
  95. <div class="layui-row">
  96. </div>
  97. <div class="layui-row">
  98. <div class="layui-col-xs12 layui-col-sm12">
  99. <div class="layui-form-item">
  100. <label class="layui-form-label">周:</label>
  101. <div class="layui-input-block">
  102. <select name="weekValue">
  103. <c:forEach items="${weekList}" var="js">
  104. <option value="${js}">${js}</option>
  105. </c:forEach>
  106. </select>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </form>
  112. </div>
  113. <div id="selectMonth" class="layuimini-main" style="display: none;">
  114. <form class="layui-form" lay-filter="monthForm">
  115. <div class="layui-row">
  116. </div>
  117. <div class="layui-row">
  118. <div class="layui-col-xs12 layui-col-sm12">
  119. <div class="layui-form-item">
  120. <label class="layui-form-label">月:</label>
  121. <div class="layui-input-block">
  122. <select name="monthValue">
  123. <c:forEach items="${monthList}" var="js">
  124. <option value="${js}">${js}</option>
  125. </c:forEach>
  126. </select>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </form>
  132. </div>
  133. <script type="text/html" id="subName">
  134. <span title="{{d.subName}}">{{d.subName}}</span>
  135. </script>
  136. <script type="text/html" id="pre">
  137. <div class="toolBar">
  138. <span style="width: 30px;cursor: pointer;" lay-event="preEdit">办理</span>
  139. </div>
  140. </script>
  141. <script type="text/html" id="yearPlan">
  142. <div class="toolBar">
  143. <span lay-event="yearPlan">年度计划</span>
  144. </div>
  145. </script>
  146. <script type="text/html" id="begin">
  147. <div class="toolBar">
  148. {{#if(d.status == "6"){ }}
  149. <span style="width: 30px;" lay-event="begin">开工申请</span>
  150. {{#} else { }}
  151. <span style="color:#999 ">开工申请</span>
  152. {{#} }}
  153. </div>
  154. </script>
  155. <script type="text/html" id="end">
  156. <div class="toolBar">
  157. {{#if(d.status == "7"){ }}
  158. <span style="width: 30px;" lay-event="end">竣工申请</span>
  159. {{#} else { }}
  160. <span style="color:#999">竣工申请</span>
  161. {{#} }}
  162. </div>
  163. </script>
  164. <script type="text/html" id="week">
  165. <div class="toolBar">
  166. {{#if(d.status == "7" || d.status == "8"){ }}
  167. <span lay-event="week">周报</span>
  168. {{#} else { }}
  169. <span style="color:#999">周报</span>
  170. {{#} }}
  171. </div>
  172. </script>
  173. <script type="text/html" id="month">
  174. <div class="toolBar">
  175. {{#if(d.status == "7" || d.status == "8"){ }}
  176. <span style="width: 30px;" lay-event="month">月报</span>
  177. {{#} else { }}
  178. <span style="color:#999">月报</span>
  179. {{#} }}
  180. </div>
  181. </script>
  182. <script type="text/html" id="stop">
  183. <div class="toolBar">
  184. {{#if(d.status == "7"){ }}
  185. <span style="width: 30px;" lay-event="stop">停工</span>
  186. {{#} else if(d.status == "8") { }}
  187. <span style="width: 30px;" lay-event="stop">开工</span>
  188. {{#} else { }}
  189. <span style="color:#999;">停工</span>
  190. {{#} }}
  191. </div>
  192. </script>
  193. <script type="text/html" id="endLight">
  194. {{# var computedPer1 = function(beginDate){
  195. var beginDate =new Date(beginDate);
  196. var newDate = new Date();
  197. if(newDate.getTime() >beginDate.getTime()){
  198. return "red";
  199. }else{
  200. return "-";
  201. }
  202. };
  203. }}
  204. {{#if(computedPer1(d.endDate)=="red" && d.status != 'A') { }}
  205. <span style="color: red" > <image style="width:40px;height:40px;margin: auto;" src="${WebSite.asset}/css/images/bigScreen/light-red.png"></image></span>
  206. {{#} else { }}
  207. <span style="color: yellow"> <image style="width:40px;height:40px;margin: auto;" src="${WebSite.asset}/css/images//bigScreen/light-green.png"></image></span>
  208. {{# } }}
  209. </script>
  210. <script type="text/html" id="date">
  211. <div title="">
  212. <div class="line">计划开工:{{d.beginDate}}
  213. </div>
  214. <div class="line">计划竣工:{{d.endDate}}
  215. </div>
  216. </div>
  217. </script>
  218. <script type="text/html" id="toolBar">
  219. <div class="toolBar">
  220. <span style="width: 30px;" lay-event="toPre">办理情况</span>
  221. <span style="width: 30px;" lay-event="toDetail">项目详情</span>
  222. </div>
  223. </script>
  224. <script>
  225. new Vue({
  226. el: "#app",
  227. template: "#template",
  228. data: {
  229. winH: 0,
  230. dataList : [],
  231. tableName : 'test',
  232. pageNo : 1,
  233. pageSize : 10
  234. },
  235. mounted : function() {
  236. this.init();
  237. },
  238. methods: {
  239. init : function() {
  240. this.winH = document.body.clientHeight;
  241. var curYear = new Date().getFullYear();
  242. layui.laydate.render({
  243. elem: '#startTime',
  244. range: '~',
  245. theme: layDateTheme,
  246. value: curYear+"-01-01 ~ "+ curYear+"-12-31"
  247. });
  248. layui.upload.render({
  249. elem: '#importExc'
  250. ,url: App.getUrl('/api/subject/subInfo/importHisData')
  251. ,done: function(res, index, upload){ //上传后的回调
  252. if(res.success){
  253. layer.msg("导入成功", {icon: 1, time: 1000});
  254. }
  255. }
  256. ,accept: 'file' //允许上传的文件类型
  257. ,exts: 'xls|xlsx'
  258. ,multiple: false //允许上传多个文件
  259. });
  260. this.getData();
  261. window.toDetail = this.toDetail;
  262. },
  263. del: function(obj) {
  264. var self = this;
  265. App.msg.confirm("确认删除该项目吗?", function(){
  266. App.postJson("/api/subject/subInfo/del",{id : obj.data.id}, function(res){
  267. if(res.success){
  268. self.getData();
  269. }
  270. })
  271. })
  272. },
  273. getData : function(){
  274. var self = this;
  275. var param = layui.form.getValue("searchForm");
  276. if(param.rangeDate) {
  277. param.beginDate = param.rangeDate.split(" ~ ")[0];
  278. param.endDate = param.rangeDate.split(" ~ ")[1];
  279. param.rangeDate = null;
  280. }
  281. param.pageNo = this.pageNo;
  282. param.pageSize = this.pageSize;
  283. // param.status = "0";
  284. App.postJson("/api/subject/subInfo/pageQueryNDataPlus",param, function(res){
  285. self.dataList = res.rows;
  286. for(var i=0;i<self.dataList.length;i++){
  287. var tem = self.dataList[i];
  288. switch(tem.status){
  289. case '1':
  290. tem.statusName = '储备';
  291. break;
  292. case '2':
  293. tem.statusName = '新建';
  294. break;
  295. case '3':
  296. tem.statusName = '在建';
  297. break;
  298. case '9':
  299. tem.statusName = '投产';
  300. break;
  301. }
  302. }
  303. self.loadPage(res.total);
  304. self.loadTable();
  305. });
  306. },
  307. loadTable : function(){
  308. var self = this;
  309. layui.table.render({
  310. elem: '#table1', // 指定原始表格元素选择器(推荐id选择器)
  311. even: true,
  312. height:'auto',
  313. cols: [[ // 设置表头
  314. {type: 'numbers', align: 'center',title:'序号', width: 44},
  315. {field: 'subName', title: '项目名称', minWidth: 500, templet: '#subName'},
  316. {field: 'amtTotal', title: '总投资(万元)', minWidth: 100},
  317. {field: 'amtJh', title: '计划投资(万元)', minWidth: 100},
  318. {field: 'statusName', title: '项目状态', minWidth: 100},
  319. {field: 'indusKindName', title: '行业类别', minWidth: 100},
  320. {field: 'subjectName', title: '建设地点', minWidth: 100},
  321. // {field: 'statusName', title: '竣工灯色', minWidth: 100, templet: '#endLight'},
  322. // {field: '', title: '项目前期', minWidth: 100, templet: '#pre'},
  323. // {field: '', title: '年度计划', minWidth: 100, templet: '#yearPlan'},
  324. // {field: '', title: '开工申请', minWidth: 100, templet: '#begin'},
  325. // {field: '', title: '竣工申请', minWidth: 100, templet: '#end'},
  326. // {field: '', title: '周报', minWidth: 100, templet: '#week'},
  327. // {field: '', title: '月报', minWidth: 100, templet: '#month'},
  328. // {field: '', title: '是否停工', minWidth: 100, templet: '#stop'},
  329. {title: '操作', width: 180, align:'center', toolbar: '#toolBar',},
  330. ]],
  331. fixed:true,
  332. height:window.screen.availHeight-380,
  333. data : self.dataList
  334. });
  335. layui.table.on('tool('+this.tableName+')', function(obj){
  336. var event = obj.event;
  337. self[event].call(this, obj);
  338. });
  339. },
  340. loadPage : function(totalCount){
  341. var self = this;
  342. layui.laypage.render({
  343. elem: 'pagination',
  344. count: totalCount,
  345. curr : self.pageNo,
  346. limit : self.pageSize,
  347. layout: ['count', 'prev', 'page', 'next', 'skip'],
  348. jump: function(obj, first) {
  349. //首次不执行
  350. if(!first) {
  351. self.pageNo = obj.curr;
  352. self.getData();
  353. }
  354. }
  355. });
  356. },
  357. add : function(){
  358. var self = this;
  359. var content='<span style="color:red;font-size:25px;"> SM项目禁止录入!!!!</span>';
  360. layer.confirm(content,{
  361. area: ['350px',''],
  362. btn: ['开始录入','取消']
  363. }, function(){
  364. window.location.href= App.getUrl("/subject/subInfo/add");
  365. })
  366. },
  367. //判断监管单位是否存在
  368. checkAdd : function(){
  369. var subjectId=$("#zrzt").val();
  370. var hyfl=$("#hyfl").val();
  371. App.postJson("/api/subject/subInfo/checkAdd",{subjectId : subjectId,hyfl:hyfl}, function(res){
  372. if(res.success){
  373. window.location.href= App.getUrl("/subject/subInfo/add?subjectId="+subjectId+"&hyfl="+hyfl+"&unit_id="+res.data.id);
  374. }
  375. });
  376. },
  377. xuanze : function(){
  378. var self = this;
  379. this.planEditPanl = layer.open({
  380. title : "所属行业 与 建设地点选择",
  381. type : 1,
  382. content : $("#preplanEdit"),
  383. area : ['800px', '600px']
  384. })
  385. },
  386. edit: function(obj) {
  387. window.location.href=App.getUrl("/subject/subInfo/add?id=" + obj.data.id);
  388. },
  389. detail: function(obj) {
  390. window.location.href=App.getUrl("/subject/subInfo/detail?subId=" + obj.data.id);
  391. },
  392. // 前往项目手续办理页面
  393. toPre: function (obj) {
  394. window.location.href=App.getUrl("/subPreNew/sbTodo?subId=" + obj.data.id);
  395. },
  396. toDetail: function (obj) {
  397. //详情
  398. var index = layer.open({
  399. type: 2,
  400. title: '',
  401. area: ['1000px', '800px'],
  402. content: App.getUrl("/subject/subInfo/detailView?layer=true&subId=" + obj.data.id + "&lastUrl=" + window.location.href),
  403. });
  404. layui.layer.full(index);
  405. },
  406. preEdit: function(obj) {
  407. window.location.href=App.getUrl("/subPreNew/todo?subId=" + obj.data.id);
  408. },
  409. yearPlan: function(obj) {
  410. var date=new Date;
  411. App.postJson("/api/amtPlan/checkAmtPlanLock",{subId : obj.data.id,year:date.getFullYear()}, function(res){
  412. if(res.success){
  413. if (res.data){
  414. App.msg.warn(" 计划已被锁定");
  415. return;
  416. }
  417. }
  418. });
  419. // if (obj.data.is_lock=="1"){
  420. // App.msg.warn("该项目的年度计划被锁定,不能录入了!");
  421. // return;
  422. // }else{
  423. window.location.href=App.getUrl("/amtPlan/edit?subId="+obj.data.id+"&year="+date.getFullYear());
  424. // }
  425. },
  426. begin : function(obj){
  427. var self = this;
  428. // var message= checkSubInfoStatus(obj);
  429. //
  430. // //判断状态
  431. // if (obj.data.status != "6"){
  432. //
  433. // App.msg.warn(message +"项目状态为审核通过 才能进行开工申报");
  434. // return;
  435. // }
  436. var subName = "项目名称:"+ obj.data.subName+"<br>是否确认进行项目开工申报?";
  437. layer.confirm(subName,{title: "项目开工申报",btn:["确认","取消"]}, function(){
  438. App.postJson("/api/subject/subInfo/subStartDeclaration",{subId : obj.data.id}, function(res){
  439. if(res.success){
  440. layer.closeAll();
  441. self.getData();
  442. }
  443. });
  444. });
  445. },
  446. end : function(obj){
  447. // var message= checkSubInfoStatus(obj);
  448. // //判断状态
  449. // if (obj.data.status != "7"){
  450. //
  451. // App.msg.warn(message+ "项目状态为 施工中才能进行 竣工申报");
  452. // return;
  453. // }
  454. //20230821 竣工申报直接竣工,不管计划。
  455. App.postJson("/api/subComplete/canReport",{subId : obj.data.id}, function(res){
  456. if(res.success){
  457. window.location.href=App.getUrl("subComplete/report?subId="+obj.data.id);
  458. }
  459. });
  460. },
  461. stop: function (obj) {
  462. var self = this;
  463. var msgConfirm = (obj.data.status == '7' ? '确认变更为停工状态?' : '确认变更为开工状态?');
  464. App.msg.confirm(msgConfirm, function () {
  465. layer.open({
  466. type: 1,
  467. title: obj.data.status == '7' ? '停工日期' : '开工日期',
  468. content: $("#openAndEndDate"),
  469. area: ['500px', '300px'],
  470. btn: ["保存", "取消"],
  471. yes: function (index) {
  472. var reason = layui.form.val("openForm");
  473. if (reason.openDate==null||reason.openDate==""){
  474. App.msg.warn("日期不能为空");
  475. return;
  476. }
  477. App.postJson("/api/subject/subInfo/changeTg", {subId: obj.data.id,openDate:reason.openDate}, function (res) {
  478. if (res.success) {
  479. App.msg.success("变更成功");
  480. layer.close(index);
  481. self.getData();
  482. }
  483. })
  484. },
  485. close: function (index) {
  486. layer.close(index);
  487. }
  488. })
  489. })
  490. },
  491. // stop: function(obj) {
  492. //
  493. // var self = this;
  494. // var msgConfirm = (obj.data.status == '7' ? '确认变更为停工状态?':'确认变更为开工状态?');
  495. // App.msg.confirm(msgConfirm, function(){
  496. // App.postJson("/api/subject/subInfo/changeTg", {subId: obj.data.id}, function(res){
  497. // if(res.success){
  498. // App.msg.success("变更成功");
  499. // self.getData();
  500. // }
  501. // })
  502. // })
  503. // },
  504. week: function (obj) {
  505. // var message= checkSubInfoStatus(obj);
  506. //
  507. // //判断状态
  508. // if (obj.data.status != "7"&& obj.data.status != "8"){
  509. //
  510. // App.msg.warn(message+" 项目状态为施工中,才能填写周报");
  511. // return;
  512. // }
  513. layer.open({
  514. type: 1,
  515. title: "周报时间选择",
  516. content: $("#selectWeek"),
  517. area: ['800px', '600px'],
  518. btn: ["周报填写", "取消"],
  519. yes: function(index) {
  520. var data = layui.form.val("weekForm");
  521. //请求周报
  522. //跳转
  523. window.location.href=App.getUrl("weekReport/getBySubId?subId="+obj.data.id+"&beginDate="+data.weekValue.split("~")[0]);
  524. },
  525. close: function(index) {
  526. layer.close(index);
  527. }
  528. })
  529. //弹出周选择
  530. },
  531. month: function (obj) {
  532. // var message= checkSubInfoStatus(obj);
  533. // //判断状态
  534. // if (obj.data.status != "7"&& obj.data.status != "8"){
  535. //
  536. // App.msg.warn(message+" 项目状态为施工中,才能填写月报");
  537. // return;
  538. // }
  539. layer.open({
  540. type: 1,
  541. title: "月报时间选择",
  542. content: $("#selectMonth"),
  543. area: ['800px', '600px'],
  544. btn: ["月报填写", "取消"],
  545. yes: function(index) {
  546. var data = layui.form.val("monthForm");
  547. //请求周报
  548. //跳转
  549. window.location.href=App.getUrl("monthReport/getBySubId?subId="+obj.data.id+"&beginDate="+data.monthValue);
  550. },
  551. close: function(index) {
  552. layer.close(index);
  553. }
  554. })
  555. //弹出月选择 monthReport
  556. },
  557. genTime : function(weekNum) {
  558. if(!weekNum) {
  559. weekNum = 0;
  560. }
  561. let today = new Date().addWeeks(weekNum);
  562. let weekday = today.getDay();
  563. let monday;
  564. let sunday;
  565. if (weekday == 0) {
  566. monday = new Date(1000 * 60 * 60 * 24 * (weekday - 6) + today.getTime());
  567. } else {
  568. monday = new Date(1000 * 60 * 60 * 24 * (1 - weekday) + today.getTime());
  569. }
  570. if (weekday == 0) {
  571. sunday = today;
  572. } else {
  573. sunday = new Date(1000 * 60 * 60 * 24 * (7 - weekday) + today.getTime());
  574. }
  575. let month = monday.getMonth() + 1;
  576. if (month < 10) {
  577. month = "0" + month;
  578. }
  579. let day1 = monday.getDate();
  580. if (day1 < 10) {
  581. day1 = "0" + day1;
  582. }
  583. let start = "" + monday.getFullYear() + "-" + month + "-" + day1;
  584. let month2 = sunday.getMonth() + 1;
  585. if (month2 < 10) {
  586. month2 = "0" + month2;
  587. }
  588. let day2 = sunday.getDate();
  589. if (day2 < 10) {
  590. day2 = "0" + day2;
  591. }
  592. let end = "" + sunday.getFullYear() + "-" + month2 + "-" + day2;
  593. return start + " ~ " + end;
  594. },
  595. setTimeData(value, ele) {
  596. if (value != "" && value.length > 0) {
  597. let today = new Date(value.substring(0, 10));
  598. let weekday = today.getDay();
  599. let monday;
  600. let sunday;
  601. if (weekday == 0) {
  602. monday = new Date(1000 * 60 * 60 * 24 * (weekday - 6) + today.getTime());
  603. } else {
  604. monday = new Date(1000 * 60 * 60 * 24 * (1 - weekday) + today.getTime());
  605. }
  606. if (weekday == 0) {
  607. sunday = today;
  608. } else {
  609. sunday = new Date(1000 * 60 * 60 * 24 * (7 - weekday) + today.getTime());
  610. }
  611. let month = monday.getMonth() + 1;
  612. if (month < 10) {
  613. month = "0" + month;
  614. }
  615. let day1 = monday.getDate();
  616. if (day1 < 10) {
  617. day1 = "0" + day1;
  618. }
  619. let start = "" + monday.getFullYear() + "-" + month + "-" + day1;
  620. let month2 = sunday.getMonth() + 1;
  621. if (month2 < 10) {
  622. month2 = "0" + month2;
  623. }
  624. let day2 = sunday.getDate();
  625. if (day2 < 10) {
  626. day2 = "0" + day2;
  627. }
  628. let end = "" + sunday.getFullYear() + "-" + month2 + "-" + day2;
  629. ele.val(start + " ~ " + end);
  630. return start + " ~ " + end;
  631. } else {
  632. ele.val('');
  633. }
  634. return "";
  635. },
  636. submit: function(obj){
  637. var self = this;
  638. layer.confirm("确认提交项目【"+obj.data.subName+"】?", function(){
  639. App.postJson("/api/subject/subInfo/statusToSubmit", {id: obj.data.id}, function(res) {
  640. layer.closeAll();
  641. self.getData();
  642. });
  643. })
  644. },
  645. impExcel: function() {
  646. $("#importExc").click();
  647. },
  648. downTemplate: function() {
  649. window.location.href = App.getUrl("/subject/subInfo/downImportExcel");
  650. },
  651. search : function(){
  652. this.pageNo = 1;
  653. this.getData();
  654. }
  655. }
  656. });
  657. </script>
  658. </body>
  659. </html>