123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html>
- <html>
- <head>
- <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
- <jsp:include page="../common/common-js-include.jsp"></jsp:include>
- <jsp:include page="../common/common-css-include.jsp"></jsp:include>
- <!--[if lt IE 9]>
- <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
- <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <div id="app"></div>
- <template id="template">
- <div class="layui-layout layui-layout-admin detail" style="padding: 0 20px 150px;overflow: auto">
- <!-- 内容区域 -->
- <div class="right_title">
- <div class="layui-collapse">
- <div class="layui-colla-item">
- <h2 class="layui-colla-title return">
- <button class="btn" @click="backHis">返回</button>
- </h2>
- </div>
- </div>
- <form class="layui-form" lay-filter="searchForm">
- <input type="hidden" id="subId" value="${subId }">
- <input type="hidden" id="beginDate" value="${beginDate }">
- <div class="layui-form-item">
- <label class="layui-form-label"><span class="red">*</span>月报期间</label>
- <div class="layui-input-block">
- <input type="text" name="kjMonth" disabled class="layui-input"
- style="background-color: #F6F6F6; color: #ccc;" v-model="info.kjMonth">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span class="red">*</span>项目名称</label>
- <div class="layui-input-block">
- <input type="text" name="projName" v-model="info.projName" disabled class="layui-input"
- style="background-color: #F6F6F6; color: #ccc;">
- </div>
- </div>
- <!-- <div class="layui-form-item">
- <label class="layui-form-label">当前阶段</label>
- <div class="layui-input-block">
- <select name="subPlanId" lay-filter="subPlanId" id="subPlanId">
- <option value="">--请选择--</option>
- <option v-for="(item,index) in currPlan" :index="index" :value="item.id">{{item.beginDate}} 至 {{item.endDate}}</option>
- </select>
- </div>
- </div>
- <div class="layui-form-item" v-if="currPlanIndex != null">
- <label class="layui-form-label">计划内容</label>
- <div class="layui-input-block">
- <textarea class="layui-textarea" readonly="readonly">{{currPlan[currPlanIndex-1].content}}</textarea>
- </div>
- </div> -->
- <div class="layui-form-item">
- <label class="layui-form-label"><span class="red">*</span>进度比例(%)</label>
- <div class="layui-input-block">
- <input type="number" name="numBl" min="0" v-model="info.numBl" max="100"
- placeholder="请输入比例范围在0-100 单位%" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">本月实际投资(万元)</label>
- <div class="layui-input-block">
- <input type="number" id="amt" name="amt" v-model="info.amt" placeholder="请输入金额"
- class="layui-input"> 本月实际投资严格按照入统金额填写
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">下月计划投资(万元)</label>
- <div class="layui-input-block">
- <input type="number" name="amtLast" v-model="info.amtLast" placeholder="请输入金额"
- class="layui-input">
- </div>
- </div>
- <%-- <div class="layui-form-item">--%>
- <%-- <label class="layui-form-label">入统金额(万元)</label>--%>
- <%-- <div class="layui-input-block">--%>
- <%-- <input type="number" id="amtRt" name="amtRt" v-model="info.amtRt" placeholder="请输入金额" class="layui-input">--%>
- <%-- </div>--%>
- <%-- </div>--%>
- <div class="layui-form-item">
- <label class="layui-form-label"><span class="red">*</span>项目进展情况</label>
- <div class="layui-input-block">
- <textarea placeholder="请输入内容" style="height: 80px;width: 400px; " v-model="info.content"
- name="content" class="layui-textarea"></textarea>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span class="red"></span>项目延期原因</label>
- <div class="layui-input-block">
- <textarea placeholder="请输入内容" style="height: 80px;width: 400px; " v-model="info.reason"
- name="reason" class="layui-textarea"></textarea>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="table_box" style="margin-left: 20px;">
- <div class="layui-form-label required">附件信息</div>
- <ul class="img_ls">
- <li v-for="(item, index) in imgLs" :key="index">
- <div class="img" id="attachDiv" :title="showTitle(item)">
- <img :id="item.fileAddre" :src="picShow(item.fileAddre,item.fileType)"
- @click="showImage(item.fileAddre,item.fileType, item.createTime)"
- :alt="item.fileName"/>
- <div class="download_icon" @click="download(item.fileAddre,item.fileName)"></div>
- <i class="layui-icon layui-icon-close-fill" @click="delPic(index)"></i>
- </div>
- {{item.fileName}}
- </li>
- <li class="add" id="addPic">
- <div class="bg"><i class="layui-icon layui-icon-add-circle"></i></div>
- </li>
- </ul>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button type="button" class="layui-btn" @click="save">保存</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </template>
- <script>
- new Vue({
- el: "#app",
- template: "#template",
- data: {
- winH: 0,
- imgLs: [],
- imgLsDel: [],
- tableName: 'test',
- info: {},
- pageNo: 1,
- pageSize: 10
- },
- mounted: function () {
- this.init();
- },
- methods: {
- init: function () {
- this.winH = document.body.clientHeight;
- const {laydate, table, laypage, util} = layui;
- var self = this;
- App.common.utils.uploadFile('#addPic', App.getUrl('/static/file/upload'), {
- 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'
- , exts: 'png|jpg|jpeg|pdf|xls|xlsx|doc|docx|mp4'
- }, null, function (res) {
- for (var i = 0; i < res.resultList.length; i++) {
- var pic = {};
- pic.fileAddre = res.resultList[i].id;
- pic.fileName = res.resultList[i].name;
- pic.fileType = res.resultList[i].ftype;
- pic.logicDeleteFlag = 0;
- self.imgLs.push(pic);
- }
- });
- window.showImage = this.showImage;
- this.getData();
- },
- getData: function () {
- var self = this;
- var subId = $("#subId").val();
- var beginDate = $("#beginDate").val();
- beginDate = beginDate + "-01";
- var year = beginDate.split("-")[0];
- App.postJson("/api/monthReport/getInfoById", {
- subId: subId,
- startDate: beginDate,
- year: year
- }, function (res) {
- if (res.success) {
- self.info = res.data;
- self.imgLs = res.data.listFile||[];
- layui.form.render();
- }
- });
- },
- showTitle(obj) {
- return "附件名称:" + obj.fileName;
- },
- delPic(index) {
- this.imgLs[index].logicDeleteFlag = 1;
- this.imgLsDel.push(this.imgLs[index]);
- this.imgLs.splice(index, 1);
- },
- download(fileId, fileName) {
- var url = "static/file/download/" + fileId;
- App.common.utils.downFile(App.getUrl(url));
- },
- showImage: function (fileId, type, createTime) {
- var imageUrl = "";
- var realUrl = "";
- var mp4Url = "";
- if (type == 8) {
- imageUrl = "${domain}/static/file/" + fileId + "/showfile";
- } else if (type == null || type == "") {
- } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
- imageUrl = "${domain}/static/file/" + fileId + "/showfile";
- } else if (type == 4 || type == 5) {
- imageUrl = "${WebSite.asset}/css/images/excel.png";
- realUrl = "/static/file/download/" + fileId + "";
- } else if (type == 2 || type == 3) {
- imageUrl = "${WebSite.asset}/css/images/word.png";
- realUrl = "/static/file/download/" + fileId + "";
- } else {
- 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>';
- }
- if (imageUrl) {
- if (type == 2 || type == 3 || type == 4 || type == 5) {
- window.location.href = App.getUrl(realUrl);
- } else if (type == 203) {
- layer.open({
- type: 1,
- title: '播放视频',
- content: imageUrl,
- offset: 'auto',
- area: ['60%', '60%'],
- shade: 0.5,
- shadeClose: true
- });
- } else {
- if (type == 8) {
- window.open(imageUrl)
- // var pdfIndex = layer.open({
- // type: 2,
- // content: imageUrl,
- // area: ['80%','80%'],
- // offset: 'auto'
- // });
- // layer.full(pdfIndex);
- } else {
- App.common.utils.imageWater(imageUrl, createTime, function (image) {
- layer.photos({
- photos: {
- "title": "",
- "id": fileId,
- "start": 0,
- "data": [
- {
- "alt": "",
- "pid": fileId,
- "src": image,
- "thumb": imageUrl
- }
- ]
- },
- anim: 5
- });
- });
- }
- }
- }
- },
- picShow(fileId, type) {
- var tempId = "#" + fileId;
- if (type == 8) {
- return "${WebSite.asset}/css/images/pdf.png";
- } else if (type == null || type == "") {
- } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
- return "${domain}/static/file/" + fileId + "/showfile";
- } else if (type == 4 || type == 5) {
- return "${WebSite.asset}/css/images/excel.png";
- } else if (type == 2 || type == 3) {
- return "${WebSite.asset}/css/images/word.png";
- } else if (type == 203) {
- return "${WebSite.asset}/css/images/video.png";
- }
- },
- picShow1(fileId) {
- return "${domain}/static/file/" + fileId + "/showfile";
- },
- save: function () {
- var self = this;
- var formData = layui.form.getValue("searchForm");
- self.info.subId = $("#subId").val();
- self.info.beginDate = self.info.kjMonth + "-01";
- self.info.year = self.info.kjMonth.split("-")[0];
- for (var i = 0; i < self.imgLsDel.length; i++) {
- self.imgLs.push(self.imgLsDel[i]);
- }
- self.info.listFile = self.imgLs;
- if (!self.isNum(self.info.numBl) || Number(self.info.numBl) < 0 || Number(self.info.numBl) > 100) {
- App.msg.warn("请输入0到100的进度比例");
- return false;
- }
- if (self.info.content == "") {
- layer.msg("请先填写项目进度情况");
- return false;
- }
- if (self.info.amt===undefined || self.info.amt == "") {
- layer.msg("请先填写本月实际投资");
- return false;
- }
- if (self.info.amtLast===undefined || self.info.amtLast == "") {
- layer.msg("请先填写下月计划投资");
- return false;
- }
- App.postJson("/api/monthReport/saveReport", self.info, function (res) {
- if (res.success) {
- layer.msg("保存成功");
- window.history.back(-1);
- }
- });
- },
- isNum(num) {
- var regPos = /^\d+(\.\d+)?$/;
- if (regPos.test(num)) {
- return true;
- } else {
- return false;
- }
- },
- backHis: function () {
- window.history.back(-1);
- }
- },
- });
- </script>
- </body>
- </html>
|