monthReport.jsp 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
  4. <%@ page isELIgnored="false" %>
  5. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  6. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  7. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <meta charset="utf-8"/>
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  13. <meta name="viewport"
  14. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
  15. <title>项目月报</title>
  16. <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
  17. <jsp:include page="../common/common-js-include.jsp"></jsp:include>
  18. <jsp:include page="../common/common-css-include.jsp"></jsp:include>
  19. <style>
  20. .layui-table-body::-webkit-scrollbar {
  21. width: 0px;
  22. /*height: 10px;*/
  23. }
  24. .pop_info .layui-icon {
  25. background: none;
  26. }
  27. .pop_info .layui-form-item {
  28. display: flex;
  29. }
  30. .pop_info .layui-input-block {
  31. width: unset;
  32. flex: 1;
  33. }
  34. .table_box .img_ls .img .layui-icon {
  35. font-size: 16px;
  36. }
  37. .table_box,
  38. .table_box .table_process {
  39. overflow: visible;
  40. }
  41. .layui-table-view .layui-table td > div > span {
  42. /*min-height: 85px !important;*/
  43. /*white-space: normal;*/
  44. line-height: 22px !important;
  45. display: -webkit-box; /* 使用旧版的弹性盒子布局 */
  46. -webkit-box-orient: vertical; /* 设置为垂直方向排列 */
  47. overflow: hidden; /* 隐藏溢出内容 */
  48. text-overflow: ellipsis; /* 使用省略号表示溢出内容 */
  49. -webkit-line-clamp: 2; /* 显示的行数 */
  50. }
  51. .table_box .img_ls {
  52. padding: 0;
  53. }
  54. .table_box .img_ls li {
  55. margin-left: 0;
  56. }
  57. .layui-table-body .layui-table-cell {
  58. padding: 5px !important;
  59. height: 64px !important;
  60. }
  61. .layui-table-header .layui-table-cell {
  62. height: 42px !important;
  63. }
  64. .vidio-list {
  65. width: 100%;
  66. right: 0;
  67. z-index: 1000;
  68. display: flex;
  69. flex-wrap: wrap;
  70. /*justify-content: space-between;*/
  71. align-content: space-between;
  72. /*width: calc(100% - 310px);*/
  73. height: 100%;
  74. }
  75. .vidio-dispaly {
  76. margin-left: 15%;
  77. margin-top: 10px;
  78. margin-bottom: 10px;
  79. }
  80. .imageList {
  81. width: 70%;
  82. display: flex;
  83. flex-wrap: wrap;
  84. margin-left: 2%;
  85. /*padding-left: 3rem;*/
  86. /*padding-top: 3rem;*/
  87. }
  88. .img1 {
  89. width: 72px;
  90. height: 72px;
  91. margin-right: 10px;
  92. margin-bottom: 25px;
  93. }
  94. .img1 img {
  95. width: 72px;
  96. height: 72px;
  97. }
  98. .vidio-list .toolbar {
  99. width: 72px;
  100. position: absolute;
  101. }
  102. .vidio-list .subName {
  103. position: absolute;
  104. font-size: 20px;
  105. font-weight: 200;
  106. padding-left: 1rem;
  107. }
  108. .vidio-list .detailbar {
  109. width: 72px;
  110. display: inline-grid;
  111. align-content: space-evenly;
  112. justify-content: center;
  113. text-align: center;
  114. }
  115. .vidio-list .detailbar .remark {
  116. text-overflow: ellipsis;
  117. overflow: hidden;
  118. white-space: nowrap;
  119. color: #b6b2ad;
  120. }
  121. .vidio-list .toolbar .editButton {
  122. cursor: pointer;
  123. }
  124. .vidio-list .toolbar .delButton {
  125. float: right;
  126. /*padding-right: 12px;*/
  127. color: red;
  128. cursor: pointer;
  129. }
  130. </style>
  131. </head>
  132. <body>
  133. <div id="app"></div>
  134. <template id="template">
  135. <div>
  136. <div class="layui-layout layui-layout-admin">
  137. <!-- 内容区域 -->
  138. <div class="right_title">
  139. <span class="txt">项目月报</span>
  140. <div class="layui-collapse">
  141. <div class="layui-colla-item">
  142. <%-- <h2 class="layui-colla-title">筛选</h2>--%>
  143. <div class="layui-colla-content layui-show">
  144. <form class="layui-form">
  145. <div class="layui-row">
  146. <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
  147. <div class="layui-form-item">
  148. <label class="layui-form-label ">项目名称</label>
  149. <div class="layui-input-block time_box">
  150. <input type="text" name="proName" placeholder="请输入"
  151. autocomplete="off"
  152. class="layui-input">
  153. </div>
  154. </div>
  155. </div>
  156. <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
  157. <div class="layui-form-item">
  158. <label class="layui-form-label ">项目属地</label>
  159. <div class="layui-input-block">
  160. <select name="jsdd">
  161. <option value="">请选择</option>
  162. <c:forEach items="${JSDD }" var="js">
  163. <option value="${js.code }">${js.title }</option>
  164. </c:forEach>
  165. </select>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  170. <div class="layui-form-item">
  171. <label class="layui-form-label ">行业类别</label>
  172. <div class="layui-input-block">
  173. <select name="hyfl" lay-search="">
  174. <option value="">请选择</option>
  175. <c:forEach items="${HYFL }" var="hy">
  176. <c:if test="${indusKind == hy.title}">
  177. <option value="${hy.id }"
  178. selected="selected">${hy.title }</option>
  179. </c:if>
  180. <c:if test="${indusKind != hy.title}">
  181. <option value="${hy.id }">${hy.title }</option>
  182. </c:if>
  183. </c:forEach>
  184. </select>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="layui-col-xs6 layui-col-sm6 layui-col-md5">
  189. <div class="layui-form-item">
  190. <label class="layui-form-label ">月报期间</label>
  191. <div class="layui-input-block time_box">
  192. <input type="text" id="startTime" name="title" placeholder="请选择时间"
  193. autocomplete="off" class="layui-input">
  194. <span class="split_txt">至</span>
  195. <input type="text" id="endTime" name="title"
  196. placeholder="请选择结束时间"
  197. autocomplete="off" class="layui-input">
  198. </div>
  199. </div>
  200. </div>
  201. <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
  202. <div class="layui-form-item">
  203. <label class="layui-form-label ">月报状态</label>
  204. <div class="layui-input-block">
  205. <select name="isDo">
  206. <option value="0">所有</option>
  207. <option value="1">已做</option>
  208. <option value="2">未做</option>
  209. </select>
  210. </div>
  211. </div>
  212. </div>
  213. <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
  214. <div class="layui-form-item">
  215. <label class="layui-form-label">项目状态</label>
  216. <div class="layui-input-block">
  217. <select name="projStatus" lay-verify="required">
  218. <option value="0">所有</option>
  219. <option value="1">已开工</option>
  220. <option value="2">已停工</option>
  221. </select>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="layui-row">
  227. <div class="layui-col-xs6 layui-col-sm6 layui-col-md12">
  228. <div class="layui-form-item">
  229. <button type="button" class="layui-btn layui-btn-normal" @click="onSearch">
  230. 查询
  231. </button>
  232. <%-- <button type="button" class="layui-btn layui-btn-export" @click="exportExcelByIndusKind">下载模板</button>--%>
  233. <%-- <button type="button" class="layui-btn layui-btn-export" @click="exportSchedulingExcel">导入</button>--%>
  234. <button type="button" class="layui-btn layui-btn-export"
  235. @click="exportExcel">导出
  236. </button>
  237. </div>
  238. </div>
  239. </div>
  240. </form>
  241. </div>
  242. </div>
  243. </div>
  244. </div>
  245. <div class="table_box" style="padding-top: 0;">
  246. <div class="table_process" style="position: relative;">
  247. <table id="table1" lay-filter="test"></table>
  248. <div class="pagination-box" id="pagination"></div>
  249. </div>
  250. </div>
  251. <div style="height: 20px;"></div>
  252. </div>
  253. <div class="pop_info" id="popInfo">
  254. <div class="pop_con_form" style="width: 100%; padding: 0px 40px; box-sizing: border-box;">
  255. <form class="layui-form">
  256. <div class="layui-form-item">
  257. <label class="layui-form-label label-longer"><span class="red">*</span>月报期间</label>
  258. <div class="layui-input-block">
  259. <input type="text" name="kjMonth" disabled class="layui-input"
  260. style="background-color: #F6F6F6; color: #ccc;">
  261. </div>
  262. </div>
  263. <div class="layui-form-item">
  264. <label class="layui-form-label label-longer"><span class="red">*</span>项目名称</label>
  265. <div class="layui-input-block">
  266. <input type="text" name="projName" disabled class="layui-input"
  267. style="background-color: #F6F6F6; color: #ccc;">
  268. </div>
  269. </div>
  270. <%-- <div class="layui-form-item">--%>
  271. <%-- <label class="layui-form-label label-longer"><span class="red">*</span>当前阶段</label>--%>
  272. <%-- <div class="layui-input-block" >--%>
  273. <%-- <select name="subPlanId" lay-filter="subPlanId" id="subPlanId">--%>
  274. <%-- <option value="">--请选择--</option>--%>
  275. <%-- <option v-for="(item,index) in currPlan" :index="index" :value="item.id">{{item.beginDate}} 至 {{item.endDate}}</option>--%>
  276. <%-- </select>--%>
  277. <%-- </div>--%>
  278. <%-- </div>--%>
  279. <%-- <div class="layui-form-item" v-if="currPlanIndex != null">--%>
  280. <%-- <label class="layui-form-label label-longer">计划内容</label>--%>
  281. <%-- <div class="layui-input-block" >--%>
  282. <%-- <textarea class="layui-textarea">{{currPlan[currPlanIndex-1].content}}</textarea>--%>
  283. <%-- </div>--%>
  284. <%-- </div>--%>
  285. <div class="layui-form-item">
  286. <label class="layui-form-label label-longer required">进度比例(%)</label>
  287. <div class="layui-input-block">
  288. <input type="number" name="numBl" min="0" max="100"
  289. placeholder="请输入比例范围在0-100 单位%"
  290. class="layui-input">
  291. </div>
  292. </div>
  293. <div class="layui-form-item">
  294. <label class="layui-form-label label-longer required">本月实际投资(万元)</label>
  295. <div class="layui-input-block">
  296. <input type="number" id="amt" name="amt" placeholder="请输入金额" class="layui-input">
  297. <span style="color: red">注:本月实际投资严格按照报统金额填写</span>
  298. </div>
  299. </div>
  300. <div class="layui-form-item">
  301. <label class="layui-form-label label-longer required">下月计划投资(万元)</label>
  302. <div class="layui-input-block">
  303. <input type="number" name="amtLast" placeholder="请输入金额" class="layui-input">
  304. </div>
  305. </div>
  306. <%-- <div class="layui-form-item">--%>
  307. <%-- <label class="layui-form-label label-longer">入统金额(万元)</label>--%>
  308. <%-- <div class="layui-input-block">--%>
  309. <%-- <input type="number" id="amtRt" name="amtRt" placeholder="请输入金额" class="layui-input">--%>
  310. <%-- </div>--%>
  311. <%-- </div>--%>
  312. <div class="layui-form-item">
  313. <label class="layui-form-label label-longer"><span class="red">*</span>项目进展情况</label>
  314. <div class="layui-input-block">
  315. <textarea placeholder="请输入内容" style="height: 80px" name="ybContent"
  316. class="layui-textarea">{{yuebaoInfo.content}}</textarea>
  317. </div>
  318. </div>
  319. <div class="layui-form-item">
  320. <label class="layui-form-label label-longer"><span class="red"></span>项目延期原因</label>
  321. <div class="layui-input-block">
  322. <textarea placeholder="请输入内容" style="height: 80px" name="ybReason"
  323. class="layui-textarea">{{yuebaoInfo.reason}}</textarea>
  324. </div>
  325. </div>
  326. <div class="layui-form-item">
  327. <div class="table_box" style="display: flex;">
  328. <div class="layui-form-label label-longer required">附件信息</div>
  329. <ul class="img_ls">
  330. <li v-for="(item, index) in imgLs" :key="index">
  331. <div class="img" id="attachDiv" :title="showTitle(item)">
  332. <%-- //:layer-src="picShow1(item.fileAddre)"--%>
  333. <img :id="item.fileAddre" :src="picShow(item.fileAddre,item.fileType)"
  334. @click="showImage(item.fileAddre,item.fileType,item.createTime)"
  335. :alt="item.fileName"/>
  336. <div class="download_icon"
  337. @click="download(item.fileAddre,item.fileName)"></div>
  338. <i class="layui-icon layui-icon-close-fill"
  339. style="position: absolute;right: 0;top: 0" @click="delPic(index)"></i>
  340. </div>
  341. {{item.fileName}}
  342. </li>
  343. <li class="add" id="addPic">
  344. <div class="bg"><i class="layui-icon layui-icon-add-circle"></i></div>
  345. </li>
  346. </ul>
  347. </div>
  348. </div>
  349. <div class="layui-form-item">
  350. <div class="vidio-list">
  351. <span class="vidio-dispaly">航拍展示</span>
  352. <div class="imageList">
  353. <div class="img1" v-for="(item,index ) in imgList">
  354. <span class="toolbar">
  355. <span class="editButton" title="编辑" @click="edit(item)">编辑</span>
  356. <span class="delButton" title="删除" @click="del(item)">X</span>
  357. </span>
  358. <img @dblclick="showAerial(item)"
  359. :src="`${domain }/static/file/`+item.imgId+`/showfile`">
  360. <span class="detailbar">
  361. <span class="time">{{item.aerialDate}}</span>
  362. <span class="remark" :title="item.remark">{{item.remark}}</span>
  363. </span>
  364. </div>
  365. <div style="width: 72px;height: 72px;text-align: center;border: 1px solid #e7e7e7;display: flex;justify-content: center;align-items: center">
  366. <div style="width: 62px;height: 62px;background-color: #5e8fe5">
  367. <i style="display: block;margin-top: 5px;font-size: 30px"
  368. class="layui-icon layui-icon-add-circle" @click="add"></i>
  369. </div>
  370. <%-- <img src="${WebSite.asset }/css/images/jiahao.png" title="新增" style="width:72px;height:72px;">--%>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. <div class="layui-form-item">
  376. <div class="table_box" style="display: flex;">
  377. <div class="layui-form-label label-longer">鸟瞰图</div>
  378. <ul class="img_ls">
  379. <li v-for="(item, index) in imgLsPlus" :key="index">
  380. <div class="img" id="attachDivPlus" style="position: relative">
  381. <%-- //:layer-src="picShow1(item.fileAddre)"--%>
  382. <img :id="item.fileAddre" :src="picShowPlus(item.imgId)"
  383. @click="showImagePlus(item.imgId)"
  384. :alt="item.fileName"/>
  385. <div class="download_icon"
  386. @click="download(item.imgId,item.fileName)"></div>
  387. <i class="layui-icon layui-icon-close-fill"
  388. style="position: absolute;right: 0;top: 0" @click="delPicPlus(index)"></i>
  389. </div>
  390. </li>
  391. <li class="add" id="addPicPlus">
  392. <div class="bg"><i class="layui-icon layui-icon-add-circle"></i></div>
  393. </li>
  394. </ul>
  395. </div>
  396. </div>
  397. </form>
  398. </div>
  399. </div>
  400. <div id="addForm" style="display: none;">
  401. <div class="layuimini-container">
  402. <div class="layuimini-main">
  403. <div class="layui-form">
  404. <div class="layui-form-item">
  405. <label class="layui-form-label required">航拍日期</label>
  406. <div class="layui-input-block">
  407. <input readonly="readonly" class="layui-input" id="aerialDate"
  408. v-model="editInfo.aerialDate">
  409. </div>
  410. </div>
  411. <div class="layui-form-item">
  412. <label class="layui-form-label">备注</label>
  413. <div class="layui-input-block">
  414. <input class="layui-input" v-model="editInfo.remark">
  415. </div>
  416. </div>
  417. <div class="layui-form-item">
  418. <label class="layui-form-label required">航拍图片</label>
  419. <div class="layui-input-block">
  420. <img src="${WebSite.asset }/css/images/jiahao.png" id="upFile"
  421. style="width: 100px;height: 100px;">
  422. </div>
  423. </div>
  424. <div class="layui-form-item">
  425. <div class="layui-input-block">
  426. <button type="button" class="layui-btn" @click="save">保存</button>
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. <div class="pop_info" id="rtInfo">
  434. <div class="pop_con_form" style="width: 100%; padding: 0px 40px; box-sizing: border-box;">
  435. <form class="layui-form" style="margin-top: 20px">
  436. <div class="layui-form-item">
  437. <label class="layui-form-label label-longer">本月固投金额(万元)</label>
  438. <div class="layui-input-block">
  439. <input type="number" id="amtRt" name="amtRt" placeholder="请输入金额" class="layui-input">
  440. </div>
  441. </div>
  442. </form>
  443. </div>
  444. </div>
  445. </div>
  446. </template>
  447. <div id="importExc" style="display: none;">
  448. </div>
  449. <script>
  450. new Vue({
  451. el: "#app",
  452. template: "#template",
  453. data: {
  454. winH: 0,
  455. collapse: false,
  456. tabActive: 1,
  457. startMonth: "",
  458. endMonth: "",
  459. currPlan: [],
  460. yuebaoInfo: {},
  461. active: 7, // 左侧菜单选中项
  462. imgLs: 10,
  463. pageNo: 1,
  464. orderType: "",
  465. pageSize: 20,
  466. currWeekStart: "",
  467. currWeekEnd: "",
  468. currPlanIndex: null,
  469. imgLs: [],
  470. imgLsPlus: [],
  471. editInfo: {},
  472. imgList: [],
  473. imgLsDel: [],
  474. imgLsDelPlus: [],
  475. showExport: false
  476. },
  477. mounted() {
  478. this.init()
  479. },
  480. methods: {
  481. init() {
  482. this.winH = document.body.clientHeight
  483. const {laydate, table, laypage, util} = layui;
  484. var self = this;
  485. var beginWeek = self.genTime(-1);
  486. self.startMonth = beginWeek;
  487. var endWeek = self.genTime(0);
  488. self.endMonth = endWeek;
  489. laydate.render({
  490. elem: '#startTime',
  491. type: 'month',
  492. value: beginWeek,
  493. btns: ['clear', 'confirm'],
  494. done: function (value) {
  495. self.startMonth = value;
  496. }
  497. });
  498. App.common.utils.uploadFile('#upFile', App.getUrl('static/file/upload'), {
  499. acceptMime: 'image/png,image/jpg,image/jpeg',
  500. exts: 'png|jpg|jpeg'
  501. }, function (index, file, result) {
  502. $('#upFile').attr('src', result); // 图片链接(base64)
  503. }, function (res) {
  504. self.editInfo.imgId = res.resultList[0].id;
  505. }, function () {
  506. $("#upFile").attr("src", "${WebSite.asset}/css/images/jiahao.png");
  507. });
  508. App.common.utils.uploadFile('#addPic', App.getUrl('/static/file/upload'), {
  509. acceptMime: 'image/png,video/mp4,image/jpg,image/jpeg,application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  510. exts: 'png|jpg|jpeg|pdf|xls|xlsx|doc|docx|mp4'
  511. }, null, function (res) {
  512. for (var i = 0; i < res.resultList.length; i++) {
  513. var pic = {};
  514. pic.fileAddre = res.resultList[i].id;
  515. pic.fileName = res.resultList[i].name;
  516. pic.fileType = res.resultList[i].ftype;
  517. pic.logicDeleteFlag = 0;
  518. self.imgLs.push(pic);
  519. }
  520. });
  521. App.common.utils.uploadFile('#addPicPlus', App.getUrl('/static/file/upload'), {
  522. acceptMime: 'image/png,video/mp4,image/jpg,image/jpeg,application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  523. exts: 'png|jpg|jpeg'
  524. }, null, function (res) {
  525. for (var i = 0; i < res.resultList.length; i++) {
  526. var pic = {};
  527. pic.imgId = res.resultList[i].id;
  528. pic.logicDeleteFlag = 0;
  529. pic.subId = "";
  530. self.imgLsPlus.push(pic);
  531. }
  532. });
  533. laydate.render({
  534. elem: '#endTime',
  535. type: 'month',
  536. value: endWeek,
  537. btns: ['clear', 'confirm'],
  538. done: function (value) {
  539. self.endMonth = value;
  540. }
  541. });
  542. layui.laydate.render({
  543. elem: "#aerialDate",
  544. theme: layDateTheme,
  545. done: function (value) {
  546. self.editInfo.aerialDate = value;
  547. }
  548. })
  549. layui.upload.render({
  550. elem: '#importExc'
  551. , url: App.getUrl('/api/monthReport/importMonthReport')
  552. , done: function (res, index, upload) { //上传后的回调
  553. if (res.success) {
  554. layer.msg("导入成功", {icon: 1, time: 1000});
  555. }
  556. }
  557. , accept: 'file' //允许上传的文件类型
  558. , exts: 'xls|xlsx'
  559. , multiple: false //允许上传多个文件
  560. });
  561. window.detail = this.detail;
  562. window.onEdit = this.onEdit;
  563. window.onEditRt = this.onEditRt;
  564. window.sptranskg = this.sptranskg;
  565. var check = "${isSfgw}";
  566. if (check !== "false") {
  567. this.getData();
  568. } else {
  569. self.loadTable([]);
  570. }
  571. },
  572. /**
  573. * 航拍展示 信息
  574. * @param monthNum
  575. * @returns {*}
  576. */
  577. showAerial: function (item) {
  578. var index = top.layer.open({
  579. type: 2,
  580. area: ['500px', '1000px'],
  581. offset: 'auto',
  582. content: App.getUrl("/aerial/imgShow?subId=" + item.subId + "&imgId=" + item.imgId),
  583. });
  584. top.layer.full(index);
  585. },
  586. add: function () {
  587. this.editInfo = {};
  588. $("#upFile").attr("src", "${WebSite.asset }/css/images/jiahao.png");
  589. this.layerIndex = layer.open({
  590. type: 1,
  591. title: "新增航拍图片",
  592. content: $("#addForm"),
  593. area: ['600px', '400px']
  594. })
  595. },
  596. edit: function (item) {
  597. this.editInfo = item;
  598. if (item.imgId) {
  599. $("#upFile").attr("src", App.common.utils.imgShow(item.imgId));
  600. } else {
  601. $("#upFile").attr("src", "${WebSite.asset }/css/images/jiahao.png");
  602. }
  603. this.layerIndex = layer.open({
  604. type: 1,
  605. title: "编辑航拍图片",
  606. content: $("#addForm"),
  607. area: ['600px', '400px']
  608. });
  609. },
  610. del: function (item) {
  611. var self = this;
  612. App.msg.confirm("确认删除该照片吗?", function () {
  613. App.postJson("/api/aerial/del", {id: item.id}, function (res) {
  614. if (res.success) {
  615. self.getImgList();
  616. }
  617. })
  618. })
  619. },
  620. save: function () {
  621. var self = this;
  622. App.msg.confirm("确认保存吗?", function () {
  623. if (!self.editInfo.imgId) {
  624. App.msg.warn("航拍图片不能为空");
  625. return;
  626. }
  627. if (!self.editInfo.aerialDate) {
  628. App.msg.warn("航拍日期不能为空");
  629. return;
  630. }
  631. console.log(self.yuebaoInfo);
  632. self.editInfo.subId = self.yuebaoInfo.subId;
  633. // console.log(self.editInfo);
  634. // return;
  635. App.postJson("/api/aerial/save", self.editInfo, function (res) {
  636. if (res.success) {
  637. self.editInfo = {};
  638. layer.close(self.layerIndex);
  639. self.getImgList();
  640. }
  641. })
  642. })
  643. },
  644. getImgList: function () {
  645. var self = this;
  646. this.imgList = [];
  647. App.postJson("/api/aerial/list", {subId: self.yuebaoInfo.subId, type: "0"}, function (res) {
  648. if (res.success) {
  649. self.imgList = res.data;
  650. }
  651. })
  652. App.postJson("/api/aerial/list", {subId: self.yuebaoInfo.subId, type: "1"}, function (res) {
  653. if (res.success) {
  654. self.imgLsPlus = res.data;
  655. }
  656. })
  657. },
  658. // showImage: function(imgId) {
  659. // if(imgId) {
  660. // layer.open({
  661. // title: '图片预览',
  662. // type: 2,
  663. // content: App.common.utils.imgShow(imgId),
  664. // area: ['500px', '1000px'],
  665. // offset: 'auto',
  666. // success: function(obj,index){
  667. // layer.full(index);
  668. // }
  669. // })
  670. // }
  671. // },
  672. genTime: function (monthNum) {
  673. if (!monthNum) {
  674. monthNum = 0;
  675. }
  676. let today = new Date().addMonths(monthNum);
  677. return today.format("yyyy-MM");
  678. },
  679. exportExcel: function () {
  680. var self = this;
  681. if (this.startMonth == "") {
  682. layui.layer.msg("必须选择月报期间");
  683. return;
  684. }
  685. if (this.endMonth == "") {
  686. layui.layer.msg("必须选择月报期间");
  687. return;
  688. }
  689. if (this.endAmt=="" || this.endAmt==undefined){
  690. endAmt=""
  691. }else {
  692. endAmt=this.endAmt
  693. }
  694. if (this.startAmt=="" || this.startAmt==undefined){
  695. startAmt=""
  696. }else {
  697. startAmt=this.startAmt
  698. }
  699. if (this.amtSj=="" || this.amtSj==undefined){
  700. amtSj=""
  701. }else {
  702. amtSj=this.amtSj
  703. }
  704. if (this.amtYc=="" || this.amtYc==undefined){
  705. amtYc=""
  706. }else {
  707. amtYc=this.amtYc
  708. }
  709. var param = {
  710. startMonth: this.startMonth + "-01",
  711. endMonth: this.endMonth + "-01",
  712. status: $("[name='projStatus']").val(),
  713. subName: $("[name='proName']").val(),
  714. isDo: $("[name='isDo']").val(),
  715. startAmt: startAmt,
  716. endAmt: endAmt,
  717. hyfl: $("[name='hyfl']").val(),
  718. amtSj: amtSj,
  719. amtYc: amtYc,
  720. jsdd: $("[name='jsdd']").val()
  721. };
  722. App.common.utils.downFile(App.getUrl("/monthReport/exportExcel"), "GET", param, "项目月报.xlsx", "项目月报导出失败");
  723. //window.location.href=App.getUrl("/monthReport/exportExcel?startMonth="+param.startMonth+"&endMonth="+param.endMonth+"&status="+param.status+"&subName="+param.subName+"&isDo="+param.isDo+"&startAmt="+param.startAmt+"&endAmt="+param.endAmt+"&hyfl="+param.hyfl);
  724. },
  725. loadTable(data) {
  726. var self = this;
  727. layui.table.render({
  728. elem: '#table1', // 指定原始表格元素选择器(推荐id选择器)
  729. even: true,
  730. autoSort: false,
  731. limit: data.length,
  732. fixed: true,
  733. height: window.screen.availHeight - 400,
  734. cols: [[ // 设置表头
  735. {type: 'numbers', fixed: 'left', align: 'center', width: 44, title: '序号'},
  736. {
  737. field: 'sub_name',
  738. title: '项目名称',
  739. minWidth: 280,
  740. fixed: 'left',
  741. templet: function (row) {
  742. return "<a title=" + row.sub_name + ">" + row.sub_name + "</a>";
  743. }
  744. },
  745. {field: 'amt', title: '总投资', minWidth: 100, templet : function(row){
  746. if(row.amt){
  747. return '<span>'+row.amt+'万元</span>';
  748. }else{
  749. return "";
  750. }
  751. }},
  752. {field: 'kj_month', title: '月报期间', minWidth: 80},
  753. {field: 'unit_name', title: '项目单位',width: 200,templet: function(row) {
  754. if(row.unit_name != null) {
  755. return '<span title="' + row.unit_name + '">' + row.unit_name + '</span>';
  756. }
  757. return "";
  758. }},
  759. {
  760. field: 'content', title: '项目进展情况', minWidth: 200, templet: function (row) {
  761. if (row.content != null) {
  762. return '<span title="' + row.content + '">' + row.content + '</span>';
  763. }
  764. return "";
  765. }
  766. },
  767. {
  768. field: 'num_bl', title: '完成比例', minWidth: 100, templet: function (row) {
  769. if (row.num_bl != null && row.num_bl + '' != '') {
  770. return row.num_bl + "%";
  771. } else {
  772. return "";
  773. }
  774. }
  775. },
  776. {
  777. field: 'reason', title: '项目延期原因', minWidth: 150, templet: function (row) {
  778. if (row.reason != null) {
  779. return '<span title="' + row.reason + '">' + row.reason + '</span>';
  780. }
  781. return "";
  782. }
  783. },
  784. /* {field: 'sub_plan_content', title: '阶段内容', minWidth: 100}, */
  785. {
  786. title: '操作', fixed: 'right', width: 113, align: 'center', templet: function (row) {
  787. var temp = "";
  788. if (row.unit_id === '${unitId}' || '${checkEdit}' == "true") {
  789. temp = '<div class="toolBar"><span onClick=\'onEdit(' + JSON.stringify(row) + ')\'>项目信息</span></div>';
  790. } else {
  791. temp = '<div class="toolBar"><span onClick=\'detail(' + JSON.stringify(row) + ')\'>项目信息</span></div>';
  792. }
  793. return temp;
  794. }
  795. },
  796. ]],
  797. fixed: true,
  798. height: window.screen.availHeight - 450,
  799. data: data,
  800. done: function (res, curr, count) {
  801. /* res.data.forEach(function(item, index) {
  802. //1.当前行的背景颜色cur_color
  803. // if (item.usersub == 1) {
  804. // $('.layui-table').find('tr[data-index="' + index + '"]').find("td").css('background-color', "#0a99eb");
  805. // }
  806. // }); */
  807. res.data.forEach(function (item, index) {
  808. //1.当前行的背景颜色cur_color
  809. // if (item.usersub == 1) {
  810. // $('.layui-table').find('tr[data-index="' + index + '"]').find("td").css('background-color', "#0a99eb");
  811. // }
  812. // $(".layui-table-body tr").resize(function () {
  813. // $(".layui-table-body tr").each(function (index, val) {
  814. // $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
  815. // });
  816. // });
  817. // //初始化高度,使得冻结行表体高度一致
  818. // $(".layui-table-body tr").each(function (index, val) {
  819. // $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
  820. // });
  821. });
  822. }
  823. });
  824. layui.table.reload("table1", {
  825. initSort: {
  826. field: 'amt',
  827. type: self.orderType
  828. }
  829. })
  830. layui.table.on("sort(test)", function (obj) {
  831. self.orderType = obj.type;
  832. self.getData();
  833. });
  834. },
  835. showTitle: function (obj) {
  836. return "附件名称:" + obj.fileName;
  837. },
  838. delPic: function (index) {
  839. this.imgLs[index].logicDeleteFlag = 1;
  840. this.imgLsDel.push(this.imgLs[index]);
  841. this.imgLs.splice(index, 1);
  842. },
  843. delPicPlus: function (index) {
  844. this.imgLsPlus[index].logicDeleteFlag = 1;
  845. this.imgLsDelPlus.push(this.imgLsPlus[index]);
  846. this.imgLsPlus.splice(index, 1);
  847. },
  848. download(fileId, fileName) {
  849. var url = "static/file/download/" + fileId;
  850. App.common.utils.downFile(App.getUrl(url), "GET", null, fileName);
  851. },
  852. showImage: function (fileId, type, createTime) {
  853. var imageUrl = "";
  854. var realUrl = "";
  855. var mp4Url = "";
  856. if (type == 8) {
  857. <%--imageUrl= "${WebSite.asset}/css/images/pdf.png";--%>
  858. imageUrl = "${domain}/static/file/" + fileId + "/showfile";
  859. //$(tempId).attr("realUrl", "${domain}/static/file/"+fileId+"/showfile");
  860. } else if (type == null || type == "") {
  861. } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
  862. imageUrl = "${domain}/static/file/" + fileId + "/showfile";
  863. //$(tempId).attr("realUrl", "${domain}/static/file/"+fileId+"/showfile");
  864. } else if (type == 4 || type == 5) {
  865. imageUrl = "${WebSite.asset}/css/images/excel.png";
  866. realUrl = "/static/file/download/" + fileId + "";
  867. } else if (type == 2 || type == 3) {
  868. imageUrl = "${WebSite.asset}/css/images/word.png";
  869. realUrl = "/static/file/download/" + fileId + "";
  870. } else {
  871. imageUrl = '<video width="100%" height="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop"><source src="${domain}/static/file/' + fileId + '/showfile" type="video/mp4"></source></video>';
  872. }
  873. if (imageUrl) {
  874. if (type == 2 || type == 3 || type == 4 || type == 5) {
  875. window.location.href = App.getUrl(realUrl);
  876. } else if (type == 203) {
  877. layer.open({
  878. type: 1,
  879. title: '播放视频',
  880. content: imageUrl,
  881. offset: 'auto',
  882. area: ['60%', '60%'],
  883. shade: 0.5,
  884. shadeClose: true
  885. });
  886. } else {
  887. if (type == 8) {
  888. // var pdfIndex = layer.open({
  889. // type: 2,
  890. // content: imageUrl,
  891. // area: ['80%', '80%'],
  892. // offset: 'auto'
  893. // });
  894. // layer.full(pdfIndex);
  895. window.open(imageUrl)
  896. } else {
  897. App.common.utils.imageWater(imageUrl, createTime, function (image) {
  898. layer.photos({
  899. photos: {
  900. "title": "",
  901. "id": fileId,
  902. "start": 0,
  903. "data": [
  904. {
  905. "alt": "",
  906. "pid": fileId,
  907. "src": image,
  908. "thumb": imageUrl
  909. }
  910. ]
  911. },
  912. anim: 5
  913. });
  914. });
  915. }
  916. }
  917. }
  918. },
  919. showImagePlus: function (fileId) {
  920. var imageUrl = "";
  921. imageUrl = "${domain}/static/file/" + fileId + "/showfile";
  922. var type = "101";
  923. var createTime = "";
  924. if (imageUrl) {
  925. if (type == 2 || type == 3 || type == 4 || type == 5) {
  926. window.location.href = App.getUrl(realUrl);
  927. } else if (type == 203) {
  928. layer.open({
  929. type: 1,
  930. title: '播放视频',
  931. content: imageUrl,
  932. offset: 'auto',
  933. area: ['60%', '60%'],
  934. shade: 0.5,
  935. shadeClose: true
  936. });
  937. } else {
  938. if (type == 8) {
  939. // var pdfIndex = layer.open({
  940. // type: 2,
  941. // content: imageUrl,
  942. // area: ['80%', '80%'],
  943. // offset: 'auto'
  944. // });
  945. // layer.full(pdfIndex);
  946. window.open(imageUrl)
  947. } else {
  948. App.common.utils.imageWater(imageUrl, createTime, function (image) {
  949. layer.photos({
  950. photos: {
  951. "title": "",
  952. "id": fileId,
  953. "start": 0,
  954. "data": [
  955. {
  956. "alt": "",
  957. "pid": fileId,
  958. "src": image,
  959. "thumb": imageUrl
  960. }
  961. ]
  962. },
  963. anim: 5
  964. });
  965. });
  966. }
  967. }
  968. }
  969. },
  970. picShow(fileId, type) {
  971. var tempId = "#" + fileId;
  972. if (type == 8) {
  973. return "${WebSite.asset}/css/images/pdf.png";
  974. } else if (type == null || type == "") {
  975. } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
  976. return "${domain}/static/file/" + fileId + "/showfile";
  977. } else if (type == 4 || type == 5) {
  978. return "${WebSite.asset}/css/images/excel.png";
  979. } else if (type == 2 || type == 3) {
  980. return "${WebSite.asset}/css/images/word.png";
  981. } else if (type == 203) {
  982. return "${WebSite.asset}/css/images/video.png";
  983. }
  984. },
  985. picShowPlus(fileId) {
  986. return "${domain}/static/file/" + fileId + "/showfile";
  987. },
  988. getData() {
  989. var self = this;
  990. if (this.startMonth == "") {
  991. layui.layer.msg("必须选择月报期间");
  992. return;
  993. }
  994. if (this.endMonth == "") {
  995. layui.layer.msg("必须选择月报期间");
  996. return;
  997. }
  998. var param = {
  999. pageNo: this.pageNo,
  1000. pageSize: this.pageSize,
  1001. startMonth: this.startMonth + "-01",
  1002. endMonth: this.endMonth + "-01",
  1003. status: $("[name='projStatus']").val(),
  1004. subName: $("[name='proName']").val(),
  1005. isDo: $("[name='isDo']").val(),
  1006. startAmt: $("[name='startAmt']").val(),
  1007. endAmt: $("[name='endAmt']").val(),
  1008. hyfl: $("[name='hyfl']").val(),
  1009. amtSj: $("[name='amtSj']").val(),
  1010. amtYc: $("[name='amtYc']").val(),
  1011. jsdd: $("[name='jsdd']").val(),
  1012. orderType: this.orderType || null
  1013. };
  1014. App.postJson("/api/monthReport/queryReport", param, function (res) {
  1015. if (res.success) {
  1016. self.loadTable(res.rows);
  1017. self.loadPage(res.total);
  1018. }
  1019. });
  1020. },
  1021. loadPage: function (totalCount) {
  1022. var self = this;
  1023. layui.laypage.render({
  1024. elem: 'pagination',
  1025. count: totalCount,
  1026. curr: self.pageNo,
  1027. limit: self.pageSize,
  1028. layout: ['count', 'prev', 'page', 'next', 'skip'],
  1029. jump: function (obj, first) {
  1030. //首次不执行
  1031. if (!first) {
  1032. self.pageNo = obj.curr;
  1033. self.getData();
  1034. }
  1035. }
  1036. });
  1037. },
  1038. detail_rt: function (row) {
  1039. this.yuebaoInfo.amtRt = row.rt_amt || 0;
  1040. $("[name='amtRt']").val(row.amt_rt);
  1041. layer.open({
  1042. type: 1,
  1043. title: '本月固投金额',
  1044. skin: 'pop_info_class',
  1045. id: 'layerPop', //防止重复弹出
  1046. content: $('#rtInfo'),
  1047. area: ['700px', '630px']
  1048. });
  1049. },
  1050. detail: function (row) {
  1051. $("#popInfo").find("input").attr("readOnly", true);
  1052. $("#popInfo").find("textarea").attr("readOnly", true);
  1053. this.setEditPlanValue(row);
  1054. this.setFileValue(row);
  1055. layer.open({
  1056. type: 1,
  1057. title: '月报信息',
  1058. skin: 'pop_info_class',
  1059. id: 'layerPop', //防止重复弹出
  1060. content: $('#popInfo'),
  1061. area: ['700px', '630px']
  1062. });
  1063. },
  1064. sptranskg: function (row) {
  1065. App.postJson("/api/monthReport/ToKG", {subId: row.sub_id}, function (res) {
  1066. if (res.success) {
  1067. layer.msg("成功");
  1068. }
  1069. });
  1070. },
  1071. setEditPlanValue: function (row) {
  1072. var self = this;
  1073. this.yuebaoInfo.subId = row.sub_id;
  1074. // if (row.sub_plan_id==undefined){
  1075. // this.yuebaoInfo.subPlanId ="";
  1076. // self.currPlanIndex = null;
  1077. // }else{
  1078. // this.yuebaoInfo.subPlanId = row.sub_plan_id;
  1079. // }
  1080. this.yuebaoInfo.subName = row.sub_name;
  1081. if (row.content != undefined) {
  1082. this.yuebaoInfo.content = row.content;
  1083. } else {
  1084. this.yuebaoInfo.content = "";
  1085. }
  1086. if (row.num_bl == undefined) {
  1087. this.yuebaoInfo.numBl = "";
  1088. } else {
  1089. this.yuebaoInfo.numBl = row.num_bl;
  1090. }
  1091. this.yuebaoInfo.amt = row.amt;
  1092. this.yuebaoInfo.amtLast = row.amt_last;
  1093. this.setValueEdit(row);
  1094. },
  1095. onEdit: function (row) {
  1096. var self = this;
  1097. const {layer} = layui
  1098. const $ = layui.jquery
  1099. $("#popInfo").find("input").attr("readOnly", false);
  1100. $("#popInfo").find("textarea").attr("readOnly", false);
  1101. /* if(row.status == '1'){
  1102. layer.msg("该项目未开工,无需填写周报!");
  1103. return;
  1104. }
  1105. if(row.status == '9'){
  1106. layer.msg("该项目已竣工,无需填写周报!");
  1107. return;
  1108. } */
  1109. this.setEditPlanValue(row);
  1110. this.setFileValue(row);
  1111. var date = new Date();
  1112. var year = row.kj_month.split("年")[0];
  1113. var month = row.kj_month.split("年")[1].split("月")[0];
  1114. //获取了 年
  1115. var yearCheck = date.getFullYear();
  1116. //获取月
  1117. var monthCheck = date.getMonth() + 1;
  1118. var currDay = date.getDate();
  1119. self.getImgList();
  1120. //判断是否要填 实际金额
  1121. var check = 0;
  1122. if (year == yearCheck) {
  1123. if (Number(month) > Number(monthCheck) || (Number(month) == Number(monthCheck) && currDay < 0)) {
  1124. //不能输入实际资金
  1125. $("#amt").attr("disabled", "disabled");
  1126. $("#amt").attr("style", "background-color:#F6F6F6");
  1127. $("#amtRt").attr("disabled", "disabled");
  1128. $("#amtRt").attr("style", "background-color:#F6F6F6");
  1129. } else {
  1130. $("#amt").removeAttr("disabled");
  1131. $("#amt").attr("style", "");
  1132. $("#amtRt").removeAttr("disabled");
  1133. $("#amtRt").attr("style", "");
  1134. // $("#amt").attr("lay-verify","required");
  1135. check = 1;
  1136. }
  1137. } else if (year > yearCheck) {
  1138. //不能输入实际资金
  1139. $("#amt").attr("disabled", "disabled");
  1140. $("#amt").attr("style", "background-color:#F6F6F6");
  1141. $("#amtRt").attr("disabled", "disabled");
  1142. $("#amtRt").attr("style", "background-color:#F6F6F6");
  1143. } else {
  1144. $("#amt").removeAttr("disabled");
  1145. $("#amt").attr("style", "");
  1146. $("#amtRt").removeAttr("disabled");
  1147. $("#amtRt").attr("style", "");
  1148. // $("#amt").attr("lay-verify","required");
  1149. check = 1;
  1150. }
  1151. layer.open({
  1152. type: 1,
  1153. title: '月报信息',
  1154. skin: 'pop_info_class',
  1155. id: 'layerPop', //防止重复弹出
  1156. content: $('#popInfo'),
  1157. area: ['700px', '630px'],
  1158. btn: ['取消', '提交'],
  1159. btnAlign: 'c', //按钮居中
  1160. yes() {
  1161. layer.closeAll();
  1162. },
  1163. btn2() {
  1164. self.yuebaoInfo.content = $("[name='ybContent']").val();
  1165. self.yuebaoInfo.reason = $("[name='ybReason']").val();
  1166. self.yuebaoInfo.amt = $("[name='amt']").val();
  1167. self.yuebaoInfo.amtLast = $("[name='amtLast']").val();
  1168. // self.yuebaoInfo.amtRt = $("[name='amtRt']").val();
  1169. self.yuebaoInfo.numBl = $("[name='numBl']").val();
  1170. // self.yuebaoInfo.subPlanId = $("[name='subPlanId']").val();
  1171. self.yuebaoInfo.year = row.year;
  1172. var date = new Date();
  1173. date.setFullYear(row.kj_month.split("年")[0]);
  1174. date.setDate(1);
  1175. date.setMonth(Number(row.kj_month.split("年")[1].split("月")[0]) - 1);
  1176. self.yuebaoInfo.beginDate = date.format("yyyy-MM-dd");
  1177. self.yuebaoInfo.endDate = null;
  1178. for (var i = 0; i < self.imgLsDel.length; i++) {
  1179. self.imgLs.push(self.imgLsDel[i]);
  1180. }
  1181. for (var i = 0; i < self.imgLsDelPlus.length; i++) {
  1182. self.imgLsPlus.push(self.imgLsDelPlus[i]);
  1183. }
  1184. for (var i = 0; i < self.imgLsPlus.length; i++) {
  1185. self.imgLsPlus[i].subId = self.yuebaoInfo.subId;
  1186. }
  1187. console.log(self.imgLsPlus);
  1188. self.yuebaoInfo.listFile = self.imgLs;
  1189. // if(self.yuebaoInfo.subPlanId == ""){
  1190. // App.msg.warn("请选择当前阶段");
  1191. // return false;
  1192. // }
  1193. // if(!self.isNum(self.yuebaoInfo.amt)&&check=="1"){
  1194. // App.msg.warn("请输入正数的投资金额");
  1195. // return false;
  1196. // }
  1197. // if(!self.isNum(self.yuebaoInfo.amtLast)){
  1198. // App.msg.warn("请输入正数的预测投资金额");
  1199. // return false;
  1200. // }
  1201. /* if(!self.isNum(self.yuebaoInfo.amtRt)){
  1202. App.msg.warn("请输入正数入统金额");
  1203. return false;
  1204. } */
  1205. if (!self.isNum(self.yuebaoInfo.numBl) || Number(self.yuebaoInfo.numBl) < 0 || Number(self.yuebaoInfo.numBl) > 100) {
  1206. App.msg.warn("请输入0到100的进度比例");
  1207. return false;
  1208. }
  1209. if (self.yuebaoInfo.content == "") {
  1210. layer.msg("请先填写月报内容");
  1211. return false;
  1212. }
  1213. if (self.yuebaoInfo.amt==="") {
  1214. layer.msg("请先填写本月实际投资");
  1215. return false;
  1216. }
  1217. if ( self.yuebaoInfo.amtLast==="") {
  1218. layer.msg("请先填写下月计划投资");
  1219. return false;
  1220. }
  1221. //alert(JSON.stringify(self.yuebaoInfo))
  1222. App.postJson("/api/monthReport/saveReport", self.yuebaoInfo, function (res) {
  1223. if (res.success) {
  1224. layer.msg("保存成功");
  1225. self.getData();
  1226. }
  1227. });
  1228. App.postJson("/api/aerial/saveNk", self.imgLsPlus, function (res) {
  1229. });
  1230. },
  1231. cancel() {
  1232. layer.closeAll();
  1233. }
  1234. })
  1235. },
  1236. onEditRt: function (row) {
  1237. var self = this;
  1238. const {layer} = layui
  1239. const $ = layui.jquery
  1240. $("[name='amtRt']").val(row.amt_rt || 0);
  1241. self.yuebaoInfo.subId = row.sub_id;
  1242. self.yuebaoInfo.subName = row.sub_name;
  1243. layer.open({
  1244. type: 1,
  1245. title: '本月固投金额',
  1246. skin: 'pop_info_class',
  1247. id: 'layerPop', //防止重复弹出
  1248. content: $('#rtInfo'),
  1249. area: ['500px', '330px'],
  1250. btn: ['取消', '提交'],
  1251. btnAlign: 'c', //按钮居中
  1252. yes() {
  1253. layer.closeAll();
  1254. },
  1255. btn2() {
  1256. self.yuebaoInfo.amtRt = $("[name='amtRt']").val();
  1257. self.yuebaoInfo.year = row.year;
  1258. var date = new Date();
  1259. date.setFullYear(row.kj_month.split("年")[0]);
  1260. date.setDate(1);
  1261. date.setMonth(Number(row.kj_month.split("年")[1].split("月")[0]) - 1);
  1262. self.yuebaoInfo.beginDate = date.format("yyyy-MM-dd");
  1263. self.yuebaoInfo.endDate = null;
  1264. App.postJson("/api/monthReport/saveReportRtAmt", self.yuebaoInfo, function (res) {
  1265. if (res.success) {
  1266. layer.msg("保存成功");
  1267. self.getData();
  1268. }
  1269. });
  1270. },
  1271. cancel() {
  1272. layer.closeAll();
  1273. }
  1274. })
  1275. },
  1276. setFileValue: function (row) {
  1277. var self = this;
  1278. var subId = row.sub_id;
  1279. var year = row.year;
  1280. var date = new Date();
  1281. date.setFullYear(row.kj_month.split("年")[0]);
  1282. date.setMonth(row.kj_month.split("年")[1].split("月")[0] - 1);
  1283. date.setDate(1);
  1284. App.postJson("/api/monthReport/getByInfo", {
  1285. subId: subId,
  1286. year: year,
  1287. startDate: date.format("yyyy-MM-dd")
  1288. }, function (res) {
  1289. setTimeout(() => {
  1290. self.imgLs = res.data || [];
  1291. layui.form.render();
  1292. }, 300);
  1293. });
  1294. // this.setValueEdit(row);
  1295. },
  1296. isNum(num) {
  1297. var regPos = /^\d+(\.\d+)?$/;
  1298. if (regPos.test(num)) {
  1299. return true;
  1300. } else {
  1301. return false;
  1302. }
  1303. },
  1304. impExcel: function () {
  1305. $("#importExc").click();
  1306. },
  1307. downTemplate: function () {
  1308. window.location.href = App.getUrl("rptCont/downImportExcel");
  1309. },
  1310. setValueEdit(row) {
  1311. $("[name='kjMonth']").val(row.kj_month);
  1312. $("[name='projName']").val(row.sub_name);
  1313. $("[name='ybContent']").val(row.content);
  1314. $("[name='amt']").val(row.amt);
  1315. // $("[name='amtLast']").val(row.amt_last);
  1316. // $("[name='amtRt']").val(row.amt_rt);
  1317. $("[name='numBl']").val(row.num_bl);
  1318. },
  1319. onSearch() {
  1320. this.pageNo = 1;
  1321. this.getData();
  1322. },
  1323. openExport: function () {
  1324. this.showExport = true;
  1325. },
  1326. choseExport: function () {
  1327. this.showExport = false;
  1328. }
  1329. }
  1330. })
  1331. </script>
  1332. </body>
  1333. </html>