| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 1)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 1)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 2)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 2)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 3)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 3)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 4)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 4)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | </div> |
| | | <div style="display: block;"> |
| | | <input type="file" ref="file" :accept="accept" @change="getFile" /> |
| | | <progress id="progressBar" value="0" max="100" ></progress> |
| | | <span id="status">0%</span> |
| | | <!-- <progress id="progressBar" value="0" max="100" ></progress>--> |
| | | <!-- <span id="status">0%</span>--> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | data () { |
| | | return { |
| | | loading:null, |
| | | uuid: null, |
| | | message:'开始上传', |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload', |
| | | uploadProgressUrl: process.env.VUE_APP_API_PREFIX + '/public' |
| | | } |
| | |
| | | }, |
| | | getFile (e) { |
| | | if (e.target && e.target.files.length > 0) { |
| | | var that = this |
| | | const config = { |
| | | onUploadProgress: function (progressEvent) { |
| | | console.log(progressEvent) |
| | | const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) |
| | | document.getElementById('progressBar').value = percentCompleted |
| | | document.getElementById('status').textContent = '准备' + percentCompleted + '%' |
| | | // document.getElementById('progressBar').value = percentCompleted |
| | | // document.getElementById('status').textContent = '准备' + percentCompleted + '%' |
| | | that.loading.setText('准备【 ' + percentCompleted + ' 】%') |
| | | }, |
| | | headers: { |
| | | 'Content-Type': 'multipart/form-data' |
| | | } |
| | | } |
| | | // const loading = this.$loading({ |
| | | // lock: true, |
| | | // text: '上传中,请等待', |
| | | // spinner: 'el-icon-loading', |
| | | // background: 'rgba(0, 0, 0, 0.7)' |
| | | // }) |
| | | // this.$emit('loading') |
| | | this.loading = this.$loading({ |
| | | lock: true, |
| | | text: '上传中,请等待', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'loadingclz', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | this.$emit('loading') |
| | | const formdate = new FormData() |
| | | this.uuid = this.generateUUID().replaceAll('-', '') |
| | | formdate.append('file', e.target.files[0]) |
| | |
| | | formdate.append('uuid', this.uuid) |
| | | axios.post(this.uploadImgUrl, formdate, config) |
| | | .then(res => { |
| | | if(res.data.data == null || res.data.data.imgaddr == null){ |
| | | this.$message.error('数据上传失败!') |
| | | }else{ |
| | | this.$emit('success', res.data.data) |
| | | } |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error(e) |
| | | }) |
| | | .finally(() => { |
| | | // loading.close() |
| | | that.loading.close() |
| | | this.$refs.file.value = null |
| | | }) |
| | | this.startProgress() |
| | |
| | | if (res != null && res.data && res.data.data) { |
| | | if (res.data.data.status === 1) { |
| | | const percentCompleted = Math.round(res.data.data.rate || 0) |
| | | document.getElementById('progressBar').value = percentCompleted |
| | | document.getElementById('status').textContent = '上传中' + percentCompleted + '%' |
| | | // document.getElementById('progressBar').value = percentCompleted |
| | | // document.getElementById('status').textContent = '上传中' + percentCompleted + '%' |
| | | that.loading.setText('上传中 【 ' + percentCompleted + ' 】%') |
| | | } else if (res.data.data.status === 2){ |
| | | document.getElementById('progressBar').value = 100 |
| | | document.getElementById('status').textContent = '已完成' + 100 + '%' |
| | | // document.getElementById('progressBar').value = 100 |
| | | // document.getElementById('status').textContent = '已完成' + 100 + '%' |
| | | that.loading.setText( '已完成 【 ' + 100 + ' 】%') |
| | | clearInterval(timer) |
| | | } else if (res.data.data.status === 3){ |
| | | const percentCompleted = Math.round(res.data.data.rate || 0) |
| | | document.getElementById('progressBar').value = percentCompleted |
| | | document.getElementById('status').textContent = '上传失败' + percentCompleted + '%' |
| | | // document.getElementById('progressBar').value = percentCompleted |
| | | // document.getElementById('status').textContent = '上传失败' + percentCompleted + '%' |
| | | that.loading.setText('上传失败 【 ' + percentCompleted + ' 】%') |
| | | clearInterval(timer) |
| | | } |
| | | } |
| | | }) |
| | | }, 2000) |
| | | }, 1000) |
| | | }, |
| | | generateUUID () { |
| | | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { |
| | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .loadingclz { |
| | | .el-loading-text{ |
| | | font-size: 18px !important; |
| | | color: #2977f8 !important; |
| | | } |
| | | .el-loading-spinner i { |
| | | color: #2977f8 !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="scss" scoped> |
| | | .file { |
| | | /*width: 100%;*/ |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 6)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 6)" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 1)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 1)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 2)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 2)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 3)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 3)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 4)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 4)" /> |
| | | </div> |
| | | </div> |
| | | <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;"> |
| | |
| | | <span>{{ item.name }}</span> |
| | | </div> |
| | | </div> |
| | | <upload width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 5)" /> |
| | | <uploadProgress width="100px" height="100px" :list="[]" folder="settle" @success="claimsUploadFile($event, 5)" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import upload from '@/components/common/upload' |
| | | import uploadProgress from '@/components/common/uploadProgress' |
| | | import { saveSettleClaims } from '@/api/business/settleRisk' |
| | | import { findById } from '@/api/business/settleClaims' |
| | | import { findListByDTO } from '@/api/business/member' |
| | |
| | | export default { |
| | | name: 'onlineReporting', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow, upload, OperaSettleClaimsWindow, OperaWtbApplyShopWindow, OperaInsuranceApplyDetails }, |
| | | components: { GlobalWindow, upload,uploadProgress, OperaSettleClaimsWindow, OperaWtbApplyShopWindow, OperaInsuranceApplyDetails }, |
| | | computed: { |
| | | ...mapState(['userInfo']) |
| | | }, |