Commit a74d0ae77cdf771fb5cc86a8b051e9b66ee9d0e5
1 parent
30fb7566
修复bug
Showing
7 changed files
with
199 additions
and
121 deletions
trash-ui/src/api/leave.js
| @@ -12,6 +12,7 @@ import {getDict} from "@/api/dict"; | @@ -12,6 +12,7 @@ import {getDict} from "@/api/dict"; | ||
| 12 | 12 | ||
| 13 | import h5Page from '@/views/h5/Pagination'; | 13 | import h5Page from '@/views/h5/Pagination'; |
| 14 | import h5Info from "@/views/h5/leaveApplication/leaveApplicationInfo"; | 14 | import h5Info from "@/views/h5/leaveApplication/leaveApplicationInfo"; |
| 15 | +import {getBase64} from "@/api/business/threestep"; | ||
| 15 | 16 | ||
| 16 | export default { | 17 | export default { |
| 17 | name: "LeaveApplication", | 18 | name: "LeaveApplication", |
trash-ui/src/api/warningInfo.js
| @@ -28,6 +28,7 @@ import { | @@ -28,6 +28,7 @@ import { | ||
| 28 | getCompanyList, | 28 | getCompanyList, |
| 29 | getAreaList | 29 | getAreaList |
| 30 | } from "@/api/casefile/remoteServer"; | 30 | } from "@/api/casefile/remoteServer"; |
| 31 | +import {getBase64} from "@/api/business/threestep"; | ||
| 31 | 32 | ||
| 32 | export default { | 33 | export default { |
| 33 | name: "ViolationWarningInformation", | 34 | name: "ViolationWarningInformation", |
| @@ -176,6 +177,8 @@ export default { | @@ -176,6 +177,8 @@ export default { | ||
| 176 | openInfo: false, | 177 | openInfo: false, |
| 177 | areas: [], | 178 | areas: [], |
| 178 | data: {}, | 179 | data: {}, |
| 180 | + showPic: null, | ||
| 181 | + picImage: null, | ||
| 179 | }; | 182 | }; |
| 180 | }, | 183 | }, |
| 181 | created() { | 184 | created() { |
| @@ -483,6 +486,17 @@ export default { | @@ -483,6 +486,17 @@ export default { | ||
| 483 | let name = row.name; | 486 | let name = row.name; |
| 484 | let url = row.url; | 487 | let url = row.url; |
| 485 | const a = document.createElement('a') | 488 | const a = document.createElement('a') |
| 489 | + if (url.indexOf(".jpg") > -1 || url.indexOf(".png") > -1 || url.indexOf(".jpeg") > -1 || url.indexOf(".jpg") > -1) { | ||
| 490 | + const fileType = url.substring(url.lastIndexOf('.') + 1).toLowerCase(); | ||
| 491 | + getBase64({"path": url}).then(res => { | ||
| 492 | + if (res) { | ||
| 493 | + this.picImage = "data:image/" + fileType + ";base64," + res; | ||
| 494 | + this.showPic = true; | ||
| 495 | + } | ||
| 496 | + }); | ||
| 497 | + | ||
| 498 | + return; | ||
| 499 | + } | ||
| 486 | a.setAttribute('download', name) | 500 | a.setAttribute('download', name) |
| 487 | a.setAttribute('target', '_blank') | 501 | a.setAttribute('target', '_blank') |
| 488 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); | 502 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); |
trash-ui/src/views/casefile/violationCaseFile/violationCaseFileInfo.vue
| @@ -139,12 +139,16 @@ | @@ -139,12 +139,16 @@ | ||
| 139 | <el-dialog title="预览" :visible.sync="openImg" append-to-body v-if="entryType==0"> | 139 | <el-dialog title="预览" :visible.sync="openImg" append-to-body v-if="entryType==0"> |
| 140 | <img :src="img" width="100%" height="750px" /> | 140 | <img :src="img" width="100%" height="750px" /> |
| 141 | </el-dialog> | 141 | </el-dialog> |
| 142 | + <el-dialog title="" :visible.sync="showPic" append-to-body width="400px"> | ||
| 143 | + <img :src="picImage" width="100%" height="400px"/> | ||
| 144 | + </el-dialog> | ||
| 142 | </el-form> | 145 | </el-form> |
| 143 | </template> | 146 | </template> |
| 144 | 147 | ||
| 145 | <script> | 148 | <script> |
| 146 | import {getViolationCaseFile} from "@/api/casefile/violationCaseFile"; | 149 | import {getViolationCaseFile} from "@/api/casefile/violationCaseFile"; |
| 147 | import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess"; | 150 | import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess"; |
| 151 | +import {getBase64} from "@/api/business/threestep"; | ||
| 148 | export default { | 152 | export default { |
| 149 | name: "violationWarningInformationInfo", | 153 | name: "violationWarningInformationInfo", |
| 150 | props: { | 154 | props: { |
| @@ -166,6 +170,9 @@ export default { | @@ -166,6 +170,9 @@ export default { | ||
| 166 | replyApprovalProcessList:[], | 170 | replyApprovalProcessList:[], |
| 167 | openImg:false, | 171 | openImg:false, |
| 168 | img:null, | 172 | img:null, |
| 173 | + showPic: null, | ||
| 174 | + picImage: null, | ||
| 175 | + | ||
| 169 | } | 176 | } |
| 170 | }, | 177 | }, |
| 171 | created() { | 178 | created() { |
| @@ -200,6 +207,17 @@ export default { | @@ -200,6 +207,17 @@ export default { | ||
| 200 | let name = row.name; | 207 | let name = row.name; |
| 201 | let url = row.url; | 208 | let url = row.url; |
| 202 | const a = document.createElement('a') | 209 | const a = document.createElement('a') |
| 210 | + if (url.indexOf(".jpg") > -1 || url.indexOf(".png") > -1 || url.indexOf(".jpeg") > -1 || url.indexOf(".jpg") > -1) { | ||
| 211 | + const fileType = url.substring(url.lastIndexOf('.') + 1).toLowerCase(); | ||
| 212 | + getBase64({"path": url}).then(res => { | ||
| 213 | + if (res) { | ||
| 214 | + this.picImage = "data:image/" + fileType + ";base64," + res; | ||
| 215 | + this.showPic = true; | ||
| 216 | + } | ||
| 217 | + }); | ||
| 218 | + | ||
| 219 | + return; | ||
| 220 | + } | ||
| 203 | a.setAttribute('download', name) | 221 | a.setAttribute('download', name) |
| 204 | a.setAttribute('target', '_blank') | 222 | a.setAttribute('target', '_blank') |
| 205 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); | 223 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); |
trash-ui/src/views/h5/leaveApplication/index.vue
| @@ -191,9 +191,9 @@ | @@ -191,9 +191,9 @@ | ||
| 191 | </div> | 191 | </div> |
| 192 | </template> | 192 | </template> |
| 193 | 193 | ||
| 194 | -<script src="../../../api/leave.js"> | 194 | +<script src="../../../api/leave.js"/> |
| 195 | <style scope> | 195 | <style scope> |
| 196 | .el-select-dropdown__item{ | 196 | .el-select-dropdown__item{ |
| 197 | width:300px; | 197 | width:300px; |
| 198 | } | 198 | } |
| 199 | -</style> | ||
| 200 | \ No newline at end of file | 199 | \ No newline at end of file |
| 200 | +</style> |
trash-ui/src/views/h5/leaveApplication/leaveApplicationInfo.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-form ref="form" :model="form" label-width="80px"> | 2 | + <div> |
| 3 | + <el-form ref="form" :model="form" label-width="80px"> | ||
| 3 | 4 | ||
| 4 | - <el-form-item label="联系方式" prop="phone"> | ||
| 5 | - <el-input v-model="form.phone" placeholder="请输入联系方式" :maxlength="11" show-word-limit :disabled="true"/> | ||
| 6 | - </el-form-item> | 5 | + <el-form-item label="联系方式" prop="phone"> |
| 6 | + <el-input v-model="form.phone" placeholder="请输入联系方式" :maxlength="11" show-word-limit :disabled="true"/> | ||
| 7 | + </el-form-item> | ||
| 7 | 8 | ||
| 8 | - <el-form-item label="请假类型" prop="type"> | ||
| 9 | - <el-select v-model="form.type" placeholder="请选择请假类型" style="width: 100%" :disabled="true"> | ||
| 10 | - <el-option label="事假" value="事假"/> | ||
| 11 | - <el-option label="病假" value="病假"/> | ||
| 12 | - <el-option label="年假" value="年假"/> | ||
| 13 | - <el-option label="婚假" value="婚假"/> | ||
| 14 | - <el-option label="产假" value="产假"/> | ||
| 15 | - <el-option label="丧假" value="丧假"/> | ||
| 16 | - <el-option label="探亲假" value="探亲假"/> | ||
| 17 | - <el-option label="护理假" value="护理假"/> | ||
| 18 | - </el-select> | ||
| 19 | - </el-form-item> | 9 | + <el-form-item label="请假类型" prop="type"> |
| 10 | + <el-select v-model="form.type" placeholder="请选择请假类型" style="width: 100%" :disabled="true"> | ||
| 11 | + <el-option label="事假" value="事假"/> | ||
| 12 | + <el-option label="病假" value="病假"/> | ||
| 13 | + <el-option label="年假" value="年假"/> | ||
| 14 | + <el-option label="婚假" value="婚假"/> | ||
| 15 | + <el-option label="产假" value="产假"/> | ||
| 16 | + <el-option label="丧假" value="丧假"/> | ||
| 17 | + <el-option label="探亲假" value="探亲假"/> | ||
| 18 | + <el-option label="护理假" value="护理假"/> | ||
| 19 | + </el-select> | ||
| 20 | + </el-form-item> | ||
| 20 | 21 | ||
| 21 | - <el-form-item label="请假天数" prop="numberDays"> | ||
| 22 | - <el-input v-model="form.numberDays" placeholder="请输入请假天数" :disabled="true"/> | ||
| 23 | - </el-form-item> | 22 | + <el-form-item label="请假天数" prop="numberDays"> |
| 23 | + <el-input v-model="form.numberDays" placeholder="请输入请假天数" :disabled="true"/> | ||
| 24 | + </el-form-item> | ||
| 24 | 25 | ||
| 25 | - <el-form-item label="开始时间" prop="beginDate"> | ||
| 26 | - <el-date-picker size="small" style="width: 100%" | ||
| 27 | - v-model="form.beginDate" | ||
| 28 | - type="datetime" | ||
| 29 | - value-format="yyyy-MM-dd HH:mm:ss" | ||
| 30 | - :disabled="true" | ||
| 31 | - placeholder="选择请假开始时间"> | ||
| 32 | - </el-date-picker> | ||
| 33 | - </el-form-item> | ||
| 34 | - <el-form-item label="结束时间" prop="endDate"> | ||
| 35 | - <el-date-picker size="small" style="width: 100%" | ||
| 36 | - v-model="form.endDate" | ||
| 37 | - type="datetime" | ||
| 38 | - value-format="yyyy-MM-dd HH:mm:ss" | ||
| 39 | - :disabled="true" | ||
| 40 | - placeholder="选择请假结束时间"> | ||
| 41 | - </el-date-picker> | ||
| 42 | - </el-form-item> | ||
| 43 | - <el-form-item label="请假事由"> | ||
| 44 | - <el-input v-model="form.content" type="textarea" :rows="4" :disabled="true"/> | ||
| 45 | - </el-form-item> | ||
| 46 | - <el-table :data="fileEntityList"> | ||
| 47 | - <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column> | ||
| 48 | - <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center"> | ||
| 49 | - <template slot-scope="scope"> | ||
| 50 | - <el-button | ||
| 51 | - size="small" type="success" | ||
| 52 | - icon="el-icon-download" | ||
| 53 | - @click="downloadFA(scope.row)" | ||
| 54 | - v-hasPermi="['office:management:edit']" | ||
| 55 | - v-if="form.id!=null" | ||
| 56 | - round>下载 | ||
| 57 | - </el-button> | ||
| 58 | - </template> | ||
| 59 | - </el-table-column> | ||
| 60 | - </el-table> | ||
| 61 | - </el-form> | 26 | + <el-form-item label="开始时间" prop="beginDate"> |
| 27 | + <el-date-picker size="small" style="width: 100%" | ||
| 28 | + v-model="form.beginDate" | ||
| 29 | + type="datetime" | ||
| 30 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 31 | + :disabled="true" | ||
| 32 | + placeholder="选择请假开始时间"> | ||
| 33 | + </el-date-picker> | ||
| 34 | + </el-form-item> | ||
| 35 | + <el-form-item label="结束时间" prop="endDate"> | ||
| 36 | + <el-date-picker size="small" style="width: 100%" | ||
| 37 | + v-model="form.endDate" | ||
| 38 | + type="datetime" | ||
| 39 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 40 | + :disabled="true" | ||
| 41 | + placeholder="选择请假结束时间"> | ||
| 42 | + </el-date-picker> | ||
| 43 | + </el-form-item> | ||
| 44 | + <el-form-item label="请假事由"> | ||
| 45 | + <el-input v-model="form.content" type="textarea" :rows="4" :disabled="true"/> | ||
| 46 | + </el-form-item> | ||
| 47 | + <el-table :data="fileEntityList"> | ||
| 48 | + <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column> | ||
| 49 | + <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center"> | ||
| 50 | + <template slot-scope="scope"> | ||
| 51 | + <el-button | ||
| 52 | + size="small" type="success" | ||
| 53 | + icon="el-icon-download" | ||
| 54 | + @click="downloadFA(scope.row)" | ||
| 55 | + v-hasPermi="['office:management:edit']" | ||
| 56 | + v-if="form.id!=null" | ||
| 57 | + round>下载 | ||
| 58 | + </el-button> | ||
| 59 | + </template> | ||
| 60 | + </el-table-column> | ||
| 61 | + </el-table> | ||
| 62 | + </el-form> | ||
| 63 | + | ||
| 64 | + <el-dialog title="" :visible.sync="showPic" append-to-body width="400px"> | ||
| 65 | + <img :src="picImage" width="100%" height="400px"/> | ||
| 66 | + </el-dialog> | ||
| 67 | + </div> | ||
| 62 | </template> | 68 | </template> |
| 63 | 69 | ||
| 64 | <script> | 70 | <script> |
| 65 | import {getLeaveApplication} from "@/api/office/leaveApplication"; | 71 | import {getLeaveApplication} from "@/api/office/leaveApplication"; |
| 66 | import Editor from '@/components/ZcEditor'; | 72 | import Editor from '@/components/ZcEditor'; |
| 73 | +import {getBase64} from "@/api/business/threestep"; | ||
| 74 | + | ||
| 67 | export default { | 75 | export default { |
| 68 | name: "leaveApplicationInfo", | 76 | name: "leaveApplicationInfo", |
| 69 | - components: { Editor }, | 77 | + components: {Editor}, |
| 70 | props: { | 78 | props: { |
| 71 | businessKey: { | 79 | businessKey: { |
| 72 | type: String | 80 | type: String |
| @@ -79,13 +87,15 @@ export default { | @@ -79,13 +87,15 @@ export default { | ||
| 79 | return { | 87 | return { |
| 80 | form: {}, | 88 | form: {}, |
| 81 | fileEntityList: [], | 89 | fileEntityList: [], |
| 90 | + showPic: null, | ||
| 91 | + picImage: null, | ||
| 82 | } | 92 | } |
| 83 | }, | 93 | }, |
| 84 | created() { | 94 | created() { |
| 85 | this.init(); | 95 | this.init(); |
| 86 | }, | 96 | }, |
| 87 | - methods:{ | ||
| 88 | - init(){ | 97 | + methods: { |
| 98 | + init() { | ||
| 89 | getLeaveApplication(this.idInfo).then(response => { | 99 | getLeaveApplication(this.idInfo).then(response => { |
| 90 | this.form = response.data.leaveApplication; | 100 | this.form = response.data.leaveApplication; |
| 91 | let files = JSON.stringify(response.data.uploadFiles); | 101 | let files = JSON.stringify(response.data.uploadFiles); |
| @@ -97,6 +107,18 @@ export default { | @@ -97,6 +107,18 @@ export default { | ||
| 97 | let name = row.name; | 107 | let name = row.name; |
| 98 | let url = row.url; | 108 | let url = row.url; |
| 99 | const a = document.createElement('a') | 109 | const a = document.createElement('a') |
| 110 | + if (url.indexOf(".jpg") > -1 || url.indexOf(".png") > -1 || url.indexOf(".jpeg") > -1 || url.indexOf(".jpg") > -1) { | ||
| 111 | + const fileType = url.substring(url.lastIndexOf('.') + 1).toLowerCase(); | ||
| 112 | + getBase64({"path": url}).then(res => { | ||
| 113 | + if (res) { | ||
| 114 | + this.picImage = "data:image/" + fileType + ";base64," + res; | ||
| 115 | + this.showPic = true; | ||
| 116 | + } | ||
| 117 | + }); | ||
| 118 | + | ||
| 119 | + return; | ||
| 120 | + } | ||
| 121 | + | ||
| 100 | a.setAttribute('download', name) | 122 | a.setAttribute('download', name) |
| 101 | a.setAttribute('target', '_blank') | 123 | a.setAttribute('target', '_blank') |
| 102 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); | 124 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); |
trash-ui/src/views/h5/violationWarningInformation/index.vue
| @@ -187,6 +187,9 @@ | @@ -187,6 +187,9 @@ | ||
| 187 | <el-button @click="cancel">取 消</el-button> | 187 | <el-button @click="cancel">取 消</el-button> |
| 188 | </div> | 188 | </div> |
| 189 | </el-dialog> | 189 | </el-dialog> |
| 190 | + <el-dialog title="" :visible.sync="showPic" append-to-body width="400px"> | ||
| 191 | + <img :src="picImage" width="100%" height="400px"/> | ||
| 192 | + </el-dialog> | ||
| 190 | </div> | 193 | </div> |
| 191 | </template> | 194 | </template> |
| 192 | 195 | ||
| @@ -195,4 +198,4 @@ | @@ -195,4 +198,4 @@ | ||
| 195 | .el-select-dropdown__item{ | 198 | .el-select-dropdown__item{ |
| 196 | width:300px; | 199 | width:300px; |
| 197 | } | 200 | } |
| 198 | -</style> | ||
| 199 | \ No newline at end of file | 201 | \ No newline at end of file |
| 202 | +</style> |
trash-ui/src/views/office/leaveApplication/leaveApplicationInfo.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-form ref="form" :model="form" label-width="80px"> | 2 | + <div> |
| 3 | + <el-form ref="form" :model="form" label-width="80px"> | ||
| 3 | 4 | ||
| 4 | - <el-form-item label="联系方式" prop="phone"> | ||
| 5 | - <el-input v-model="form.phone" placeholder="请输入联系方式" :maxlength="11" show-word-limit :disabled="true"/> | ||
| 6 | - </el-form-item> | 5 | + <el-form-item label="联系方式" prop="phone"> |
| 6 | + <el-input v-model="form.phone" placeholder="请输入联系方式" :maxlength="11" show-word-limit :disabled="true"/> | ||
| 7 | + </el-form-item> | ||
| 7 | 8 | ||
| 8 | - <el-form-item label="请假类型" prop="type"> | ||
| 9 | - <el-select v-model="form.type" placeholder="请选择请假类型" style="width: 100%" :disabled="true"> | ||
| 10 | - <el-option label="事假" value="事假"/> | ||
| 11 | - <el-option label="病假" value="病假"/> | ||
| 12 | - <el-option label="年假" value="年假"/> | ||
| 13 | - <el-option label="婚假" value="婚假"/> | ||
| 14 | - <el-option label="产假" value="产假"/> | ||
| 15 | - <el-option label="丧假" value="丧假"/> | ||
| 16 | - <el-option label="探亲假" value="探亲假"/> | ||
| 17 | - <el-option label="护理假" value="护理假"/> | ||
| 18 | - </el-select> | ||
| 19 | - </el-form-item> | 9 | + <el-form-item label="请假类型" prop="type"> |
| 10 | + <el-select v-model="form.type" placeholder="请选择请假类型" style="width: 100%" :disabled="true"> | ||
| 11 | + <el-option label="事假" value="事假"/> | ||
| 12 | + <el-option label="病假" value="病假"/> | ||
| 13 | + <el-option label="年假" value="年假"/> | ||
| 14 | + <el-option label="婚假" value="婚假"/> | ||
| 15 | + <el-option label="产假" value="产假"/> | ||
| 16 | + <el-option label="丧假" value="丧假"/> | ||
| 17 | + <el-option label="探亲假" value="探亲假"/> | ||
| 18 | + <el-option label="护理假" value="护理假"/> | ||
| 19 | + </el-select> | ||
| 20 | + </el-form-item> | ||
| 20 | 21 | ||
| 21 | - <el-form-item label="请假天数" prop="numberDays"> | ||
| 22 | - <el-input v-model="form.numberDays" placeholder="请输入请假天数" :disabled="true"/> | ||
| 23 | - </el-form-item> | 22 | + <el-form-item label="请假天数" prop="numberDays"> |
| 23 | + <el-input v-model="form.numberDays" placeholder="请输入请假天数" :disabled="true"/> | ||
| 24 | + </el-form-item> | ||
| 24 | 25 | ||
| 25 | - <el-form-item label="开始时间" prop="beginDate"> | ||
| 26 | - <el-date-picker size="small" style="width: 100%" | ||
| 27 | - v-model="form.beginDate" | ||
| 28 | - type="datetime" | ||
| 29 | - value-format="yyyy-MM-dd HH:mm:ss" | ||
| 30 | - :disabled="true" | ||
| 31 | - placeholder="选择请假开始时间"> | ||
| 32 | - </el-date-picker> | ||
| 33 | - </el-form-item> | ||
| 34 | - <el-form-item label="结束时间" prop="endDate"> | ||
| 35 | - <el-date-picker size="small" style="width: 100%" | ||
| 36 | - v-model="form.endDate" | ||
| 37 | - type="datetime" | ||
| 38 | - value-format="yyyy-MM-dd HH:mm:ss" | ||
| 39 | - :disabled="true" | ||
| 40 | - placeholder="选择请假结束时间"> | ||
| 41 | - </el-date-picker> | ||
| 42 | - </el-form-item> | ||
| 43 | - <el-form-item label="请假事由"> | ||
| 44 | - <el-input v-model="form.content" type="textarea" :rows="4" :disabled="true"/> | ||
| 45 | - </el-form-item> | ||
| 46 | - <el-table :data="fileEntityList"> | ||
| 47 | - <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column> | ||
| 48 | - <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center"> | ||
| 49 | - <template slot-scope="scope"> | ||
| 50 | - <el-button | ||
| 51 | - size="small" type="success" | ||
| 52 | - icon="el-icon-download" | ||
| 53 | - @click="downloadFA(scope.row)" | ||
| 54 | - v-hasPermi="['office:management:edit']" | ||
| 55 | - v-if="form.id!=null" | ||
| 56 | - round>下载 | ||
| 57 | - </el-button> | ||
| 58 | - </template> | ||
| 59 | - </el-table-column> | ||
| 60 | - </el-table> | ||
| 61 | - </el-form> | 26 | + <el-form-item label="开始时间" prop="beginDate"> |
| 27 | + <el-date-picker size="small" style="width: 100%" | ||
| 28 | + v-model="form.beginDate" | ||
| 29 | + type="datetime" | ||
| 30 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 31 | + :disabled="true" | ||
| 32 | + placeholder="选择请假开始时间"> | ||
| 33 | + </el-date-picker> | ||
| 34 | + </el-form-item> | ||
| 35 | + <el-form-item label="结束时间" prop="endDate"> | ||
| 36 | + <el-date-picker size="small" style="width: 100%" | ||
| 37 | + v-model="form.endDate" | ||
| 38 | + type="datetime" | ||
| 39 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 40 | + :disabled="true" | ||
| 41 | + placeholder="选择请假结束时间"> | ||
| 42 | + </el-date-picker> | ||
| 43 | + </el-form-item> | ||
| 44 | + <el-form-item label="请假事由"> | ||
| 45 | + <el-input v-model="form.content" type="textarea" :rows="4" :disabled="true"/> | ||
| 46 | + </el-form-item> | ||
| 47 | + <el-table :data="fileEntityList"> | ||
| 48 | + <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column> | ||
| 49 | + <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center"> | ||
| 50 | + <template slot-scope="scope"> | ||
| 51 | + <el-button | ||
| 52 | + size="small" type="success" | ||
| 53 | + icon="el-icon-download" | ||
| 54 | + @click="downloadFA(scope.row)" | ||
| 55 | + v-hasPermi="['office:management:edit']" | ||
| 56 | + v-if="form.id!=null" | ||
| 57 | + round>下载 | ||
| 58 | + </el-button> | ||
| 59 | + </template> | ||
| 60 | + </el-table-column> | ||
| 61 | + </el-table> | ||
| 62 | + </el-form> | ||
| 63 | + <el-dialog title="" :visible.sync="showPic" append-to-body width="400px"> | ||
| 64 | + <img :src="picImage" width="100%" height="400px"/> | ||
| 65 | + </el-dialog> | ||
| 66 | + </div> | ||
| 62 | </template> | 67 | </template> |
| 63 | 68 | ||
| 64 | <script> | 69 | <script> |
| 65 | import {getLeaveApplication} from "@/api/office/leaveApplication"; | 70 | import {getLeaveApplication} from "@/api/office/leaveApplication"; |
| 66 | import Editor from '@/components/ZcEditor'; | 71 | import Editor from '@/components/ZcEditor'; |
| 72 | +import {getBase64} from "@/api/business/threestep"; | ||
| 73 | + | ||
| 67 | export default { | 74 | export default { |
| 68 | name: "leaveApplicationInfo", | 75 | name: "leaveApplicationInfo", |
| 69 | - components: { Editor }, | 76 | + components: {Editor}, |
| 70 | props: { | 77 | props: { |
| 71 | businessKey: { | 78 | businessKey: { |
| 72 | type: String | 79 | type: String |
| @@ -79,13 +86,15 @@ export default { | @@ -79,13 +86,15 @@ export default { | ||
| 79 | return { | 86 | return { |
| 80 | form: {}, | 87 | form: {}, |
| 81 | fileEntityList: [], | 88 | fileEntityList: [], |
| 89 | + showPic: null, | ||
| 90 | + picImage: null, | ||
| 82 | } | 91 | } |
| 83 | }, | 92 | }, |
| 84 | created() { | 93 | created() { |
| 85 | this.init(); | 94 | this.init(); |
| 86 | }, | 95 | }, |
| 87 | - methods:{ | ||
| 88 | - init(){ | 96 | + methods: { |
| 97 | + init() { | ||
| 89 | getLeaveApplication(this.idInfo).then(response => { | 98 | getLeaveApplication(this.idInfo).then(response => { |
| 90 | this.form = response.data.leaveApplication; | 99 | this.form = response.data.leaveApplication; |
| 91 | let files = JSON.stringify(response.data.uploadFiles); | 100 | let files = JSON.stringify(response.data.uploadFiles); |
| @@ -97,6 +106,17 @@ export default { | @@ -97,6 +106,17 @@ export default { | ||
| 97 | let name = row.name; | 106 | let name = row.name; |
| 98 | let url = row.url; | 107 | let url = row.url; |
| 99 | const a = document.createElement('a') | 108 | const a = document.createElement('a') |
| 109 | + if (url.indexOf(".jpg") > -1 || url.indexOf(".png") > -1 || url.indexOf(".jpeg") > -1 || url.indexOf(".jpg") > -1) { | ||
| 110 | + const fileType = url.substring(url.lastIndexOf('.') + 1).toLowerCase(); | ||
| 111 | + getBase64({"path": url}).then(res => { | ||
| 112 | + if (res) { | ||
| 113 | + this.picImage = "data:image/" + fileType + ";base64," + res; | ||
| 114 | + this.showPic = true; | ||
| 115 | + } | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + return; | ||
| 119 | + } | ||
| 100 | a.setAttribute('download', name) | 120 | a.setAttribute('download', name) |
| 101 | a.setAttribute('target', '_blank') | 121 | a.setAttribute('target', '_blank') |
| 102 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); | 122 | a.setAttribute('href', process.env.VUE_APP_BASE_API + url); |