|
|
@ -1,6 +1,9 @@ |
|
|
|
<template> |
|
|
|
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading"> |
|
|
|
<iframe v-show="false" id="getGrabimageIframe" :src='getGrabimageIframeUrl' style="z-index:200;background:#fff;width:100px;height:100px;position:fixed;left:0"></iframe> |
|
|
|
<!-- 高拍仪调获取base64页面 v-if="!isRemoveImageIframe" --> |
|
|
|
<iframe v-show="false" id="getGrabimageIframe" :src='getGrabimageIframeUrl' style="z-index:200;background:#fff;width:100px;height:100px;position:fixed;top:50px;right:20px"></iframe> |
|
|
|
<!-- 高拍仪调试页面-目的:自动对焦 --> |
|
|
|
<iframe v-show="false" id="grabRegulateIframePage" :src='grabRegulateIframePage' style="background:#fff;width:200px;height:200px;position:fixed;right:15px;bottom:10px;opacity:0"></iframe> |
|
|
|
|
|
|
|
<tablePagination |
|
|
|
:currenButtonData="currenButtonData" |
|
|
@ -106,7 +109,7 @@ |
|
|
|
</curren-Form> |
|
|
|
</el-col> |
|
|
|
<el-col :span="10" > |
|
|
|
<div style="padding-bottom:10px">作业指导书:</div> |
|
|
|
<div style="padding-bottom:10px">作业指导书:</div> |
|
|
|
<curren-descriptions |
|
|
|
border |
|
|
|
:column="1" |
|
|
@ -170,6 +173,8 @@ |
|
|
|
:show-close="false" |
|
|
|
> |
|
|
|
<curren-Form |
|
|
|
v-loading="gpyLoading" |
|
|
|
element-loading-text="正在加载高拍仪" |
|
|
|
class="handleForm" |
|
|
|
size="medium" |
|
|
|
:searchData="inspectNoticeDetailsFormData" |
|
|
@ -235,7 +240,7 @@ |
|
|
|
<el-image-viewer |
|
|
|
v-if="isShowBase64" |
|
|
|
:on-close="(()=>{isShowBase64 = false})" |
|
|
|
:url-list="[urlPDF]" /> |
|
|
|
:url-list="imgListViews" /> |
|
|
|
<!-- 拆箱弹窗 --> |
|
|
|
<el-dialog |
|
|
|
title="拆箱" |
|
|
@ -282,7 +287,8 @@ import { |
|
|
|
getListByItemcode, |
|
|
|
getDetailed, |
|
|
|
getFilestore, |
|
|
|
InspectSplitPackingk |
|
|
|
InspectSplitPackingk, |
|
|
|
getGPYInfo |
|
|
|
} from "@/api/wms-api" |
|
|
|
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core" |
|
|
|
import { |
|
|
@ -322,7 +328,9 @@ export default { |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'), |
|
|
|
gpyLoading:false, |
|
|
|
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'),//高拍仪-获取图片 |
|
|
|
grabRegulateIframePage:localStorage.getItem('grabRegulateIframePage'),//高拍仪-iframe内嵌调节页面(目的:一直对焦) |
|
|
|
URL: 'wms/store/inspect-job', |
|
|
|
// tab标签值 |
|
|
|
currentTagName:'hz', |
|
|
@ -356,6 +364,8 @@ export default { |
|
|
|
rowReceiveQty: null, |
|
|
|
// pdf预览路径 |
|
|
|
urlPDF: '', |
|
|
|
//列表图片预览集合 |
|
|
|
imgListViews:[], |
|
|
|
// 纯base64(去掉data:application/pdf;base64,) |
|
|
|
base64PDF:'', |
|
|
|
// titlePDF 文件预览标题 |
|
|
@ -542,9 +552,11 @@ export default { |
|
|
|
{ type: "input", label: "合格数量", prop: "goodQty", disabled: true, colSpan: 8 }, |
|
|
|
{ type: "select", label: "ABC类", prop: "abcClass", options: "abcClass", clearable: true, filterable: true, disabled: true, allowCreate: true, colSpan: 8 }, |
|
|
|
// { type: "uploadList", label: "供应商自检报告", prop: "formFile", limit: 1, picExt: ".pdf", colSpan: 12 }, |
|
|
|
{ type: "button", label: "供应商自检报告", colSpan:4 ,buttonText:'获取报告',click:(()=>{this.getGrabimage()})}, |
|
|
|
{ type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 2,errorTip:'未获取'}, |
|
|
|
{ type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimage()})}, |
|
|
|
{ type: "button", label: "供应商自检报告", colSpan:2 ,buttonText:'获取报告',click:(()=>{this.getGrabimage()})}, |
|
|
|
{ type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimageHandle()})}, |
|
|
|
{ type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24, |
|
|
|
deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)}) |
|
|
|
}, |
|
|
|
], |
|
|
|
inspectNoticeDetailsRules: { |
|
|
|
// formFile: { required: true, trigger: "change", message: "不可为空" }, |
|
|
@ -607,32 +619,91 @@ export default { |
|
|
|
// 是否是批量检验 |
|
|
|
isBatchInspect:false, |
|
|
|
selectedDetailZJ:[], |
|
|
|
fileBase64:'', |
|
|
|
gpy_setTimeout:null |
|
|
|
currentFileBase64:'', |
|
|
|
fileBase64List:[], |
|
|
|
gpy_setTimeout:null, |
|
|
|
isRemoveImageIframe:true |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.paging(); |
|
|
|
let _this = this |
|
|
|
// 获取高拍仪返回结果 |
|
|
|
window.addEventListener('message', function(event) { |
|
|
|
console.log(666666666,event) |
|
|
|
// if (event.origin === 'http://192.168.1.75:33336') { // 确保消息来自iframe的域 |
|
|
|
var result = event.data; // 接收函数执行结果 |
|
|
|
_this.fileBase64 = 'data:image/png;base64,'+result |
|
|
|
_this.inspectNoticeDetailsForm[11].url = _this.fileBase64 |
|
|
|
_this.inspectNoticeDetailsForm[11].srcList = [_this.fileBase64] |
|
|
|
console.log(615,_this.fileBase64) |
|
|
|
_this.Loading.appMainLoading = false |
|
|
|
clearTimeout(_this.gpy_setTimeout) |
|
|
|
// } |
|
|
|
}); |
|
|
|
this.addGrabimageEvent() |
|
|
|
// var myHeaders = new Headers(); |
|
|
|
// myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)"); |
|
|
|
// myHeaders.append("Content-Type", "application/json"); |
|
|
|
// myHeaders.append("Accept", "*/*"); |
|
|
|
// myHeaders.append("Host", "192.168.1.75:38088"); |
|
|
|
// myHeaders.append("Connection", "keep-alive"); |
|
|
|
|
|
|
|
// var raw = JSON.stringify({ |
|
|
|
// "camidx": "0", |
|
|
|
// "make_uuid": "1", |
|
|
|
// "image_storage_info": { |
|
|
|
// "xdpi": "200", |
|
|
|
// "ydpi": "200", |
|
|
|
// "jpg_quality": "60" |
|
|
|
// }, |
|
|
|
// "image_process_info": { |
|
|
|
// "cut_type": "1", |
|
|
|
// "multi_object": "0", |
|
|
|
// "rotate": "0" |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
// var requestOptions = { |
|
|
|
// method: 'POST', |
|
|
|
// headers: myHeaders, |
|
|
|
// body: raw, |
|
|
|
// redirect: 'follow' |
|
|
|
// }; |
|
|
|
|
|
|
|
// fetch("http://192.168.1.75:38088/video=grabimage?tid=30", requestOptions) |
|
|
|
// .then(response => response.text()) |
|
|
|
// .then(result => console.log(result)) |
|
|
|
// .catch(error => console.log('error', error)); |
|
|
|
// let _data = {"camidx":"0","make_uuid":"1","image_storage_info":{ "xdpi":"200", "ydpi":"200", "jpg_quality":"60" },"image_process_info":{"cut_type":"1", "multi_object":"0", "rotate":"0"}} |
|
|
|
// getGPYInfo(_data) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
addGrabimageEvent(){ |
|
|
|
let _this = this |
|
|
|
// 获取高拍仪返回结果 |
|
|
|
window.addEventListener('message', function(event) { |
|
|
|
console.log(3333,event.data) |
|
|
|
// if (event.origin === 'http://192.168.1.75:33336') { // 确保消息来自iframe的域 |
|
|
|
var result = event.data; // 接收函数执行结果 |
|
|
|
_this.currentFileBase64 = 'data:image/png;base64,'+result |
|
|
|
_this.fileBase64List.push(_this.currentFileBase64) |
|
|
|
_this.inspectNoticeDetailsForm[12].srcList = _this.fileBase64List |
|
|
|
_this.Loading.appMainLoading = false |
|
|
|
clearTimeout(_this.gpy_setTimeout) |
|
|
|
this.isRemoveImageIframe = true |
|
|
|
// document.getElementById('getGrabimageIframe').parentNode.removeChild(document.getElementById('getGrabimageIframe')); |
|
|
|
// window.removeEventListener("message",(()=>{ |
|
|
|
// this.isRemoveImageIframe = true |
|
|
|
// }),false) |
|
|
|
// } |
|
|
|
},false); |
|
|
|
}, |
|
|
|
// 删除高拍仪图片 |
|
|
|
deleteViewImgHandle(item,img,img_key){ |
|
|
|
this.$confirm('您确定删除吗, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.fileBase64List.splice(img_key, 1) |
|
|
|
this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List |
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取高拍仪图片 |
|
|
|
getGrabimage(){ |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime() |
|
|
|
this.isRemoveImageIframe = false |
|
|
|
console.log(670,window.message) |
|
|
|
this.$nextTick(()=>{ |
|
|
|
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow; |
|
|
|
iframeWindow.postMessage('callMyFunction', '*'); |
|
|
@ -645,10 +716,21 @@ export default { |
|
|
|
},30000) |
|
|
|
}, |
|
|
|
// 清除报告 |
|
|
|
clearGrabimageHandle(){ |
|
|
|
this.$confirm('您确定清除报告吗, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.clearGrabimage() |
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
clearGrabimage(){ |
|
|
|
this.fileBase64 = '' |
|
|
|
this.inspectNoticeDetailsForm[11].url = this.fileBase64 |
|
|
|
this.inspectNoticeDetailsForm[11].srcList = [this.fileBase64] |
|
|
|
this.fileBase64List = [] |
|
|
|
this.inspectNoticeDetailsForm[12].url = this.fileBase64List[0] |
|
|
|
this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List |
|
|
|
}, |
|
|
|
// 节点根据是否批量判断显示 |
|
|
|
initDomIfBatch(){ |
|
|
@ -723,20 +805,34 @@ export default { |
|
|
|
currenDrawerButtonClick(val,index, label,item){ |
|
|
|
if(item.prop == "inspectReport"){ |
|
|
|
// 查看检验报告 |
|
|
|
let _file_id = JSON.parse(val.inspectReport)[0].FileKey |
|
|
|
if(this.loadingPDF)return |
|
|
|
this.loadingPDF = true |
|
|
|
getFilestore({blobName:_file_id}).then(res=>{ |
|
|
|
this.urlPDF = 'data:application/pdf;base64,'+res.bytes |
|
|
|
// 原查看pdf方法 |
|
|
|
this.base64PDF=res.bytes |
|
|
|
this.titlePDF = res.fileName |
|
|
|
// this.isShowPDF = true |
|
|
|
// 新查看base64 |
|
|
|
this.isShowBase64 = true |
|
|
|
this.loadingPDF = false |
|
|
|
}).catch(res=>{ |
|
|
|
this.loadingPDF = false |
|
|
|
if(this.Loading.appMainLoading)return |
|
|
|
let _imgs = JSON.parse(val.inspectReport) |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
let _httpNumber=0 |
|
|
|
let _urls = {} |
|
|
|
_imgs.forEach((item,key)=>{ |
|
|
|
let _file_id = item.FileKey |
|
|
|
// 按顺序反查数据 |
|
|
|
getFilestore({blobName:_file_id}).then(res=>{ |
|
|
|
_httpNumber++ |
|
|
|
// this.urlPDF = 'data:application/pdf;base64,'+res.bytes |
|
|
|
_urls[key] = 'data:application/pdf;base64,'+res.bytes |
|
|
|
// 原查看pdf方法 |
|
|
|
// this.base64PDF=res.bytes |
|
|
|
// this.titlePDF = res.fileName |
|
|
|
// this.isShowPDF = true |
|
|
|
// 新查看base64 |
|
|
|
if(Number(_httpNumber) >= _imgs.length){ |
|
|
|
this.imgListViews = [] |
|
|
|
for(let i in _urls){ |
|
|
|
this.imgListViews.push(_urls[i]) |
|
|
|
} |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
this.isShowBase64 = true |
|
|
|
} |
|
|
|
}).catch(res=>{ |
|
|
|
_httpNumber++ |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
@ -914,6 +1010,11 @@ export default { |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
this.inspectNoticeDetailsShow = true |
|
|
|
this.gpyLoading=true |
|
|
|
let _time = localStorage.getItem('gpyLoadingTime') !="undefined" ? localStorage.getItem('gpyLoadingTime') : 5000 |
|
|
|
setTimeout(()=>{ |
|
|
|
this.gpyLoading=false |
|
|
|
},Number(_time)) |
|
|
|
},300) |
|
|
|
}, |
|
|
|
// 质检合格不合格-删除按钮 |
|
|
@ -1089,6 +1190,7 @@ export default { |
|
|
|
formClick(val){ |
|
|
|
if (val[0] == 0) { |
|
|
|
this.inspectNoticeDetailsShow = false |
|
|
|
this.clearGrabimage() |
|
|
|
} |
|
|
|
// else if (val[0] == 1) { |
|
|
|
// console.log('查看供应商质检报告') |
|
|
@ -1121,11 +1223,13 @@ export default { |
|
|
|
} |
|
|
|
// 提交时候处理高拍仪数据 |
|
|
|
that.inspectNoticeDetailsFormData.filesList = [] |
|
|
|
if(that.fileBase64 && that.fileBase64.length > 0){ |
|
|
|
let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + '.jpg' |
|
|
|
that.inspectNoticeDetailsFormData.filesList.push({ |
|
|
|
fileName: fileName, |
|
|
|
bytes: that.fileBase64.substring(that.fileBase64.lastIndexOf(',')+1,that.fileBase64.length) |
|
|
|
if(that.fileBase64List && that.fileBase64List.length > 0){ |
|
|
|
this.fileBase64List.forEach((item,key)=>{ |
|
|
|
let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + 'index_' + key + '.jpg' |
|
|
|
that.inspectNoticeDetailsFormData.filesList.push({ |
|
|
|
fileName: fileName, |
|
|
|
bytes: item.substring(item.lastIndexOf(',')+1,item.length) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.loading = true |
|
|
@ -1141,6 +1245,7 @@ export default { |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.$message.success('成功完成检验!') |
|
|
|
this.clearGrabimage() |
|
|
|
}).catch(err => { |
|
|
|
that.loading = false |
|
|
|
that.$message.error('检验失败,请重试!') |
|
|
@ -1390,6 +1495,7 @@ export default { |
|
|
|
closePDF(){ |
|
|
|
this.isShowPDF = false |
|
|
|
this.urlPDF = '' |
|
|
|
this.imgListViews = [] |
|
|
|
this.titlePDF = '' |
|
|
|
this.loadingPDF = false |
|
|
|
}, |
|
|
|