monthDetail.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. </head>
  15. <body>
  16. <div id="app"></div>
  17. <template id="template">
  18. <div class="layui-layout layui-layout-admin detail" style="padding: 0 20px 150px;overflow: auto">
  19. <!-- 内容区域 -->
  20. <div class="right_title">
  21. <div class="layui-collapse">
  22. <div class="layui-colla-item">
  23. <h2 class="layui-colla-title return">
  24. <button class="btn" @click="backHis">返回</button>
  25. </h2>
  26. </div>
  27. </div>
  28. <form class="layui-form" lay-filter="searchForm">
  29. <input type="hidden" id="subId" value="${subId }">
  30. <input type="hidden" id="beginDate" value="${beginDate }">
  31. <div class="layui-form-item">
  32. <label class="layui-form-label"><span class="red">*</span>月报期间</label>
  33. <div class="layui-input-block">
  34. <input type="text" name="kjMonth" disabled class="layui-input"
  35. style="background-color: #F6F6F6; color: #ccc;" v-model="info.kjMonth">
  36. </div>
  37. </div>
  38. <div class="layui-form-item">
  39. <label class="layui-form-label"><span class="red">*</span>项目名称</label>
  40. <div class="layui-input-block">
  41. <input type="text" name="projName" v-model="info.projName" disabled class="layui-input"
  42. style="background-color: #F6F6F6; color: #ccc;">
  43. </div>
  44. </div>
  45. <!-- <div class="layui-form-item">
  46. <label class="layui-form-label">当前阶段</label>
  47. <div class="layui-input-block">
  48. <select name="subPlanId" lay-filter="subPlanId" id="subPlanId">
  49. <option value="">--请选择--</option>
  50. <option v-for="(item,index) in currPlan" :index="index" :value="item.id">{{item.beginDate}} 至 {{item.endDate}}</option>
  51. </select>
  52. </div>
  53. </div>
  54. <div class="layui-form-item" v-if="currPlanIndex != null">
  55. <label class="layui-form-label">计划内容</label>
  56. <div class="layui-input-block">
  57. <textarea class="layui-textarea" readonly="readonly">{{currPlan[currPlanIndex-1].content}}</textarea>
  58. </div>
  59. </div> -->
  60. <div class="layui-form-item">
  61. <label class="layui-form-label"><span class="red">*</span>进度比例(%)</label>
  62. <div class="layui-input-block">
  63. <input type="number" name="numBl" min="0" v-model="info.numBl" max="100"
  64. placeholder="请输入比例范围在0-100 单位%" class="layui-input">
  65. </div>
  66. </div>
  67. <div class="layui-form-item">
  68. <label class="layui-form-label required">本月实际投资(万元)</label>
  69. <div class="layui-input-block">
  70. <input type="number" id="amt" name="amt" v-model="info.amt" placeholder="请输入金额"
  71. class="layui-input"> 本月实际投资严格按照入统金额填写
  72. </div>
  73. </div>
  74. <div class="layui-form-item">
  75. <label class="layui-form-label required">下月计划投资(万元)</label>
  76. <div class="layui-input-block">
  77. <input type="number" name="amtLast" v-model="info.amtLast" placeholder="请输入金额"
  78. class="layui-input">
  79. </div>
  80. </div>
  81. <%-- <div class="layui-form-item">--%>
  82. <%-- <label class="layui-form-label">入统金额(万元)</label>--%>
  83. <%-- <div class="layui-input-block">--%>
  84. <%-- <input type="number" id="amtRt" name="amtRt" v-model="info.amtRt" placeholder="请输入金额" class="layui-input">--%>
  85. <%-- </div>--%>
  86. <%-- </div>--%>
  87. <div class="layui-form-item">
  88. <label class="layui-form-label"><span class="red">*</span>项目进展情况</label>
  89. <div class="layui-input-block">
  90. <textarea placeholder="请输入内容" style="height: 80px;width: 400px; " v-model="info.content"
  91. name="content" class="layui-textarea"></textarea>
  92. </div>
  93. </div>
  94. <div class="layui-form-item">
  95. <label class="layui-form-label"><span class="red"></span>项目延期原因</label>
  96. <div class="layui-input-block">
  97. <textarea placeholder="请输入内容" style="height: 80px;width: 400px; " v-model="info.reason"
  98. name="reason" class="layui-textarea"></textarea>
  99. </div>
  100. </div>
  101. <div class="layui-form-item">
  102. <div class="table_box" style="margin-left: 20px;">
  103. <div class="layui-form-label required">附件信息</div>
  104. <ul class="img_ls">
  105. <li v-for="(item, index) in imgLs" :key="index">
  106. <div class="img" id="attachDiv" :title="showTitle(item)">
  107. <img :id="item.fileAddre" :src="picShow(item.fileAddre,item.fileType)"
  108. @click="showImage(item.fileAddre,item.fileType, item.createTime)"
  109. :alt="item.fileName"/>
  110. <div class="download_icon" @click="download(item.fileAddre,item.fileName)"></div>
  111. <i class="layui-icon layui-icon-close-fill" @click="delPic(index)"></i>
  112. </div>
  113. {{item.fileName}}
  114. </li>
  115. <li class="add" id="addPic">
  116. <div class="bg"><i class="layui-icon layui-icon-add-circle"></i></div>
  117. </li>
  118. </ul>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <div class="layui-input-block">
  123. <button type="button" class="layui-btn" @click="save">保存</button>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. </div>
  129. </template>
  130. <script>
  131. new Vue({
  132. el: "#app",
  133. template: "#template",
  134. data: {
  135. winH: 0,
  136. imgLs: [],
  137. imgLsDel: [],
  138. tableName: 'test',
  139. info: {},
  140. pageNo: 1,
  141. pageSize: 10
  142. },
  143. mounted: function () {
  144. this.init();
  145. },
  146. methods: {
  147. init: function () {
  148. this.winH = document.body.clientHeight;
  149. const {laydate, table, laypage, util} = layui;
  150. var self = this;
  151. App.common.utils.uploadFile('#addPic', App.getUrl('/static/file/upload'), {
  152. 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'
  153. , exts: 'png|jpg|jpeg|pdf|xls|xlsx|doc|docx|mp4'
  154. }, null, function (res) {
  155. for (var i = 0; i < res.resultList.length; i++) {
  156. var pic = {};
  157. pic.fileAddre = res.resultList[i].id;
  158. pic.fileName = res.resultList[i].name;
  159. pic.fileType = res.resultList[i].ftype;
  160. pic.logicDeleteFlag = 0;
  161. self.imgLs.push(pic);
  162. }
  163. });
  164. window.showImage = this.showImage;
  165. this.getData();
  166. },
  167. getData: function () {
  168. var self = this;
  169. var subId = $("#subId").val();
  170. var beginDate = $("#beginDate").val();
  171. beginDate = beginDate + "-01";
  172. var year = beginDate.split("-")[0];
  173. App.postJson("/api/monthReport/getInfoById", {
  174. subId: subId,
  175. startDate: beginDate,
  176. year: year
  177. }, function (res) {
  178. if (res.success) {
  179. self.info = res.data;
  180. self.imgLs = res.data.listFile||[];
  181. layui.form.render();
  182. }
  183. });
  184. },
  185. showTitle(obj) {
  186. return "附件名称:" + obj.fileName;
  187. },
  188. delPic(index) {
  189. this.imgLs[index].logicDeleteFlag = 1;
  190. this.imgLsDel.push(this.imgLs[index]);
  191. this.imgLs.splice(index, 1);
  192. },
  193. download(fileId, fileName) {
  194. var url = "static/file/download/" + fileId;
  195. App.common.utils.downFile(App.getUrl(url));
  196. },
  197. showImage: function (fileId, type, createTime) {
  198. var imageUrl = "";
  199. var realUrl = "";
  200. var mp4Url = "";
  201. if (type == 8) {
  202. imageUrl = "${domain}/static/file/" + fileId + "/showfile";
  203. } else if (type == null || type == "") {
  204. } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
  205. imageUrl = "${domain}/static/file/" + fileId + "/showfile";
  206. } else if (type == 4 || type == 5) {
  207. imageUrl = "${WebSite.asset}/css/images/excel.png";
  208. realUrl = "/static/file/download/" + fileId + "";
  209. } else if (type == 2 || type == 3) {
  210. imageUrl = "${WebSite.asset}/css/images/word.png";
  211. realUrl = "/static/file/download/" + fileId + "";
  212. } else {
  213. 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>';
  214. }
  215. if (imageUrl) {
  216. if (type == 2 || type == 3 || type == 4 || type == 5) {
  217. window.location.href = App.getUrl(realUrl);
  218. } else if (type == 203) {
  219. layer.open({
  220. type: 1,
  221. title: '播放视频',
  222. content: imageUrl,
  223. offset: 'auto',
  224. area: ['60%', '60%'],
  225. shade: 0.5,
  226. shadeClose: true
  227. });
  228. } else {
  229. if (type == 8) {
  230. window.open(imageUrl)
  231. // var pdfIndex = layer.open({
  232. // type: 2,
  233. // content: imageUrl,
  234. // area: ['80%','80%'],
  235. // offset: 'auto'
  236. // });
  237. // layer.full(pdfIndex);
  238. } else {
  239. App.common.utils.imageWater(imageUrl, createTime, function (image) {
  240. layer.photos({
  241. photos: {
  242. "title": "",
  243. "id": fileId,
  244. "start": 0,
  245. "data": [
  246. {
  247. "alt": "",
  248. "pid": fileId,
  249. "src": image,
  250. "thumb": imageUrl
  251. }
  252. ]
  253. },
  254. anim: 5
  255. });
  256. });
  257. }
  258. }
  259. }
  260. },
  261. picShow(fileId, type) {
  262. var tempId = "#" + fileId;
  263. if (type == 8) {
  264. return "${WebSite.asset}/css/images/pdf.png";
  265. } else if (type == null || type == "") {
  266. } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
  267. return "${domain}/static/file/" + fileId + "/showfile";
  268. } else if (type == 4 || type == 5) {
  269. return "${WebSite.asset}/css/images/excel.png";
  270. } else if (type == 2 || type == 3) {
  271. return "${WebSite.asset}/css/images/word.png";
  272. } else if (type == 203) {
  273. return "${WebSite.asset}/css/images/video.png";
  274. }
  275. },
  276. picShow1(fileId) {
  277. return "${domain}/static/file/" + fileId + "/showfile";
  278. },
  279. save: function () {
  280. var self = this;
  281. var formData = layui.form.getValue("searchForm");
  282. self.info.subId = $("#subId").val();
  283. self.info.beginDate = self.info.kjMonth + "-01";
  284. self.info.year = self.info.kjMonth.split("-")[0];
  285. for (var i = 0; i < self.imgLsDel.length; i++) {
  286. self.imgLs.push(self.imgLsDel[i]);
  287. }
  288. self.info.listFile = self.imgLs;
  289. if (!self.isNum(self.info.numBl) || Number(self.info.numBl) < 0 || Number(self.info.numBl) > 100) {
  290. App.msg.warn("请输入0到100的进度比例");
  291. return false;
  292. }
  293. if (self.info.content == "") {
  294. layer.msg("请先填写项目进度情况");
  295. return false;
  296. }
  297. if (self.info.amt===undefined || self.info.amt == "") {
  298. layer.msg("请先填写本月实际投资");
  299. return false;
  300. }
  301. if (self.info.amtLast===undefined || self.info.amtLast == "") {
  302. layer.msg("请先填写下月计划投资");
  303. return false;
  304. }
  305. App.postJson("/api/monthReport/saveReport", self.info, function (res) {
  306. if (res.success) {
  307. layer.msg("保存成功");
  308. window.history.back(-1);
  309. }
  310. });
  311. },
  312. isNum(num) {
  313. var regPos = /^\d+(\.\d+)?$/;
  314. if (regPos.test(num)) {
  315. return true;
  316. } else {
  317. return false;
  318. }
  319. },
  320. backHis: function () {
  321. window.history.back(-1);
  322. }
  323. },
  324. });
  325. </script>
  326. </body>
  327. </html>