Browse Source

【nev-pc】高拍仪优化

ag_report_nev
安虹睿 9 months ago
parent
commit
6e71cdb425
  1. 35
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue

35
fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue

@ -123,7 +123,7 @@
:key="index" :key="index"
> >
<span v-if="item.type == 'uploadPictureCard'" > <span v-if="item.type == 'uploadPictureCard'" >
<div v-loading="guideBookLoading" id="uploadPictureCardGuideBook"></div> <div @click="isShowGuideBook = true" v-loading="guideBookLoading" id="uploadPictureCardGuideBook"></div>
</span> </span>
<!-- 文本域 --> <!-- 文本域 -->
<span v-else> <span v-else>
@ -171,6 +171,7 @@
:modal="false" :modal="false"
:modal-append-to-body="false" :modal-append-to-body="false"
:show-close="false" :show-close="false"
class="inspectNoticeDetailsPop"
> >
<curren-Form <curren-Form
v-loading="gpyLoading" v-loading="gpyLoading"
@ -237,7 +238,13 @@
@closePDF="closePDF" @closePDF="closePDF"
:showDownLoad="true" :showDownLoad="true"
></pdf> ></pdf>
<!-- 抽屉查看报告弹窗 --> <!-- 抽屉查看作业指导书报告弹窗 -->
<el-image-viewer
style="z-index:9999999"
v-if="isShowGuideBook"
:on-close="(()=>{isShowGuideBook = false})"
:url-list="imgListGuideBookViews" />
<!-- 抽屉查看供应商报告弹窗 -->
<el-image-viewer <el-image-viewer
v-if="isShowBase64" v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})" :on-close="(()=>{isShowBase64 = false})"
@ -365,7 +372,7 @@ export default {
rowReceiveQty: null, rowReceiveQty: null,
// pdf // pdf
urlPDF: '', urlPDF: '',
// //
imgListViews:[], imgListViews:[],
// base64data:application/pdf;base64, // base64data:application/pdf;base64,
base64PDF:'', base64PDF:'',
@ -374,6 +381,9 @@ export default {
// //
isShowPDF: false, isShowPDF: false,
isShowBase64:false, isShowBase64:false,
isShowGuideBook:false,
//
imgListGuideBookViews:[],
// PDF // PDF
loadingPDF: false, loadingPDF: false,
// //
@ -673,16 +683,25 @@ export default {
addGrabimageEvent(){ addGrabimageEvent(){
let _this = this let _this = this
// //
let _ids = []
window.addEventListener('message', function(event) { window.addEventListener('message', function(event) {
console.log(3333,event.data)
// if (event.origin === 'http://192.168.1.75:33336') { // iframe // if (event.origin === 'http://192.168.1.75:33336') { // iframe
var result = event.data; // var result = event.data.base64; //
var timeId = event.data.timeid
if(_ids.indexOf(timeId) >= 0){
clearTimeout(_this.gpy_setTimeout)
setTimeout(()=>{
_this.getGrabimage()
},2000)
return
}
_ids.push(timeId)
_this.currentFileBase64 = 'data:image/png;base64,'+result _this.currentFileBase64 = 'data:image/png;base64,'+result
_this.fileBase64List.push(_this.currentFileBase64) _this.fileBase64List.push(_this.currentFileBase64)
_this.inspectNoticeDetailsForm[_this.inspectNoticeDetailsForm.length - 1].srcList = _this.fileBase64List _this.inspectNoticeDetailsForm[_this.inspectNoticeDetailsForm.length - 1].srcList = _this.fileBase64List
_this.Loading.appMainLoading = false _this.Loading.appMainLoading = false
clearTimeout(_this.gpy_setTimeout) clearTimeout(_this.gpy_setTimeout)
this.isRemoveImageIframe = true _this.isRemoveImageIframe = true
// document.getElementById('getGrabimageIframe').parentNode.removeChild(document.getElementById('getGrabimageIframe')); // document.getElementById('getGrabimageIframe').parentNode.removeChild(document.getElementById('getGrabimageIframe'));
// window.removeEventListener("message",(()=>{ // window.removeEventListener("message",(()=>{
// this.isRemoveImageIframe = true // this.isRemoveImageIframe = true
@ -833,7 +852,7 @@ export default {
_httpNumber++ _httpNumber++
// this.urlPDF = 'data:application/pdf;base64,'+res.bytes // this.urlPDF = 'data:application/pdf;base64,'+res.bytes
_urls[key] = 'data:application/pdf;base64,'+res.bytes _urls[key] = 'data:application/pdf;base64,'+res.bytes
// pdf // pdfisShowGuideBook
// this.base64PDF=res.bytes // this.base64PDF=res.bytes
// this.titlePDF = res.fileName // this.titlePDF = res.fileName
// this.isShowPDF = true // this.isShowPDF = true
@ -1485,7 +1504,9 @@ export default {
img.width="300" img.width="300"
img.height="300" img.height="300"
img.src = URL.createObjectURL(blob) img.src = URL.createObjectURL(blob)
this.imgListGuideBookViews = [URL.createObjectURL(blob)]
var otest = document.getElementById("uploadPictureCardGuideBook") var otest = document.getElementById("uploadPictureCardGuideBook")
otest.innerHTML = ""
otest.appendChild(img) otest.appendChild(img)
this.guideBookLoading = false this.guideBookLoading = false
}).catch(err => { }).catch(err => {

Loading…
Cancel
Save