Browse Source

【nev-pc】质检-高拍仪暂存

ag_report_nev
安虹睿 10 months ago
parent
commit
af506542a4
  1. 4
      fe/PC/public/config.js
  2. 8
      fe/PC/src/api/wms-api.js
  3. 45
      fe/PC/src/components/currenForm/index.vue
  4. 30
      fe/PC/src/views/login/index.vue
  5. 183
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue
  6. 198
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest_new.vue
  7. 205
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest_old.vue

4
fe/PC/public/config.js

@ -26,10 +26,10 @@ window.SITE_CONFIG['companyAddress'] = '长春市高新开发区成缘路556号'
//pad-kitting组包页面刷新时间(毫秒)
window.SITE_CONFIG['padKittingPackUpdate'] = 180000
// 高拍仪获取地址
window.SITE_CONFIG['grabimageURL'] = 'http://192.168.1.75:33336/video/index.html'
window.SITE_CONFIG['grabimageURL'] = 'http://192.168.1.75:33336/video/index100.html'
window.SITE_CONFIG['showGrabimageIframeTest'] = false//登录页调试高拍仪显示按钮
window.SITE_CONFIG['grabRegulateIframePage'] = 'http://10.164.230.173:33336/video/index4.html'//高拍仪-iframe内嵌对焦界面
window.SITE_CONFIG['gpyLoadingTime'] = 6000 //高拍仪加载时间
window.SITE_CONFIG['gpyLoadingTime'] = 5000 //高拍仪加载时间
// 供应商接口地址(如立体库等)
window.SITE_CONFIG['supplierOuterURL'] = 'http://7e42682n64.goho.co:21171'

8
fe/PC/src/api/wms-api.js

@ -809,6 +809,14 @@ export function deliverRequestDelete(id) {
})
}
export function getGPYInfo(data) {
return request({
url: 'http://192.168.1.75:38088/video=grabimage&tid=100',
method: 'post',
data:data
})
}
// 客户退拆任务-完成 todo
// export async function productionRecycleJobComplete(id) {
// return request({

45
fe/PC/src/components/currenForm/index.vue

@ -426,19 +426,29 @@
{{item.buttonText}}
</el-button>
<!-- 图片显示及查看图片 -->
<el-image
style="line-height: 14px;"
v-if="item.type == 'viewImg'"
:style="{width: item.width || '100px', height: item.height || '100px'}"
:src="item.url"
:preview-src-list="item.srcList"
>
<div v-if="item.type == 'viewImg'">
<div
slot="error"
style="font-size:12px"
:style="{lineHeight: item.height || '100px'}"
>{{item.errorTip}}</div>
</el-image>
v-for="(img,img_key) in item.srcList"
:key="img_key"
v-if="item.srcList && item.srcList.length > 0"
class="imgOneBlock"
>
<el-image
style="line-height: 14px;"
:style="{width: item.width || '100px', height: item.height || '100px',marginRight:'25px'}"
:src="img"
:preview-src-list="item.srcList"
>
<div
slot="error"
style="font-size:12px"
:style="{lineHeight: item.height || '100px'}"
>{{item.errorTip || '加载失败'}}</div>
</el-image>
<el-button class="delete-btn" size="mini" v-if="!item.noDelete" @click="item.deleteViewImgHandle(item,img,img_key)" type="danger" icon="el-icon-delete" circle></el-button>
</div>
<span v-if="!item.srcList || item.srcList.length <= 0">暂无数据</span>
</div>
</el-form-item>
</el-col>
</el-row>
@ -935,4 +945,15 @@ export default {
color: #999 !important;
font-weight: normal !important;
}
.imgOneBlock{
display:inline-block;
position:relative;
.delete-btn{
position:absolute;
left:-10px;
top:-10px;
padding:3px;
}
}
</style>

30
fe/PC/src/views/login/index.vue

@ -1,10 +1,10 @@
<template>
<div class="login-container">
<iframe v-show="showGrabimageIframe == 'true'" id="getGrabimageIframe" :src='getGrabimageIframeUrl' style="z-index:200;background:#fff;width:200px;height:200px;position:fixed;left:0"></iframe>
<!-- <iframe v-show="showGrabimageIframe == 'true'" id="getGrabimageIframe" :src='getGrabimageIframeUrl' style="z-index:200;background:#fff;width:200px;height:200px;position:fixed;left:0"></iframe>
<el-button v-if="showGrabimageIframe == 'true'" style="z-index:200;position:fixed;left:0;bottom:0;background:#000737;border:none" @click="getBase64">获取base64</el-button>
<div v-if="showGrabimageIframe == 'true'" style="z-index:200;position:fixed;left:0;bottom:40px;background:#000737;border:none" @click="getBase64">
<img :src="getGrabimageUrl"/>
</div>
</div> -->
<img class="loginLogoImg" src="../../../public/login_logo.png" alt="">
<div class="login-form-wrapper">
<div class="left"></div>
@ -152,24 +152,24 @@ export default {
}
let _this = this
window.addEventListener('message', function(event) {
// if (event.origin === 'http://iframe-domain.com') { // iframe
var result = event.data; //
_this.getGrabimageUrl = result.data;
console.log('登录页返回base64',result)
// }
});
// window.addEventListener('message', function(event) {
// // if (event.origin === 'http://iframe-domain.com') { // iframe
// var result = event.data; //
// _this.getGrabimageUrl = result.data;
// console.log('base64',result)
// // }
// });
},
destroyed () {
// window.removeEventListener('storage', this.afterQRScan)
},
methods: {
getBase64(){
//
this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime()
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*');
},
// getBase64(){
// //
// this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime()
// var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
// iframeWindow.postMessage('callMyFunction', '*');
// },
checkCapslock (e) {
const { key } = e
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')

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

@ -1,7 +1,7 @@
<template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading">
<!-- 高拍仪调获取base64页面 -->
<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>
@ -240,7 +240,7 @@
<el-image-viewer
v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" />
:url-list="imgListViews" />
<!-- 拆箱弹窗 -->
<el-dialog
title="拆箱"
@ -287,7 +287,8 @@ import {
getListByItemcode,
getDetailed,
getFilestore,
InspectSplitPackingk
InspectSplitPackingk,
getGPYInfo
} from "@/api/wms-api"
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core"
import {
@ -363,6 +364,8 @@ export default {
rowReceiveQty: null,
// pdf
urlPDF: '',
//
imgListViews:[],
// base64data:application/pdf;base64,
base64PDF:'',
// titlePDF
@ -549,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: "" },
@ -614,32 +619,90 @@ 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
this.$nextTick(()=>{
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*');
@ -652,10 +715,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(){
@ -730,20 +804,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++
})
})
}
},
@ -1101,6 +1189,7 @@ export default {
formClick(val){
if (val[0] == 0) {
this.inspectNoticeDetailsShow = false
this.clearGrabimage()
}
// else if (val[0] == 1) {
// console.log('')
@ -1133,11 +1222,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
@ -1153,6 +1244,7 @@ export default {
})
that.paging()
that.$message.success('成功完成检验!')
this.clearGrabimage()
}).catch(err => {
that.loading = false
that.$message.error('检验失败,请重试!')
@ -1402,6 +1494,7 @@ export default {
closePDF(){
this.isShowPDF = false
this.urlPDF = ''
this.imgListViews = []
this.titlePDF = ''
this.loadingPDF = false
},

198
fe/PC/src/views/rawMaterialManage/quality/InspectRequest_new.vue

@ -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:[],
// base64data: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
},

205
fe/PC/src/views/rawMaterialManage/quality/InspectRequest_old.vue

@ -1,5 +1,10 @@
<template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading">
<!-- 高拍仪调获取base64页面 -->
<iframe v-show="false" id="getGrabimageIframe" :src='getGrabimageIframeUrl' style="z-index:200;background:#fff;width:100px;height:100px;position:fixed;left:0"></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"
:tableData="tableData"
@ -104,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"
@ -168,6 +173,8 @@
:show-close="false"
>
<curren-Form
v-loading="gpyLoading"
element-loading-text="正在加载高拍仪"
class="handleForm"
size="medium"
:searchData="inspectNoticeDetailsFormData"
@ -229,6 +236,11 @@
@closePDF="closePDF"
:showDownLoad="true"
></pdf>
<!-- 抽屉查看报告弹窗 -->
<el-image-viewer
v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" />
<!-- 拆箱弹窗 -->
<el-dialog
title="拆箱"
@ -268,6 +280,7 @@
</template>
<script>
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import {
getPageList,
fileStorage,
@ -284,6 +297,7 @@ import {
setDetailNookStatus,
setBatchDetailStatus
} from "@/api/wms-job"
import { formatTimeStampToNorm } from '@/utils/formatTime'
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
@ -308,10 +322,14 @@ export default {
components: {
currenDescriptions,
currenTableFlex,
pdf
pdf,
ElImageViewer
},
data () {
return {
gpyLoading:false,
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'),//-
grabRegulateIframePage:localStorage.getItem('grabRegulateIframePage'),//-iframe
URL: 'wms/store/inspect-job',
// tab
currentTagName:'hz',
@ -351,6 +369,7 @@ export default {
titlePDF: '',
//
isShowPDF: false,
isShowBase64:false,
// PDF
loadingPDF: false,
//
@ -529,7 +548,10 @@ export default {
{ type: "input", label: "不合格数量", prop: "failedQty", disabled: true, colSpan: 8 },
{ 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: "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()})},
],
inspectNoticeDetailsRules: {
// formFile: { required: true, trigger: "change", message: "" },
@ -592,12 +614,49 @@ export default {
//
isBatchInspect:false,
selectedDetailZJ:[],
fileBase64:'',
gpy_setTimeout:null
};
},
mounted () {
this.paging();
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)
// }
});
},
methods: {
//
getGrabimage(){
this.Loading.appMainLoading = true
this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime()
this.$nextTick(()=>{
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*');
})
this.gpy_setTimeout = setTimeout(()=>{
if(this.Loading.appMainLoading){
this.Loading.appMainLoading = false
this.$warningMsg("获取失败,请重试")
}
},30000)
},
//
clearGrabimage(){
this.fileBase64 = ''
this.inspectNoticeDetailsForm[11].url = this.fileBase64
this.inspectNoticeDetailsForm[11].srcList = [this.fileBase64]
},
//
initDomIfBatch(){
this.initInspectRules()
@ -672,13 +731,16 @@ export default {
if(item.prop == "inspectReport"){
//
let _file_id = JSON.parse(val.inspectReport)[0].FileKey
this.isShowPDF = true
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
@ -859,6 +921,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)
},
// -
@ -1064,58 +1131,86 @@ export default {
this.$message.error('实际检验数量小于要求检验数量,请继续检验!');
return
}
this.loading = true
//
if (this.inspectNoticeDetailsFormData.formFile.length !== 0) {
let rd = new FileReader(); //
let fileName = this.inspectNoticeDetailsFormData.formFile[0].name
rd.readAsDataURL(this.inspectNoticeDetailsFormData.formFile[0])
rd.onloadend = function(){
var arrayBuffer = rd.result
that.inspectNoticeDetailsFormData.filesList = []
that.inspectNoticeDetailsFormData.filesList.push(
{
fileName: fileName,
bytes: arrayBuffer.substring(arrayBuffer.lastIndexOf(',')+1,arrayBuffer.length)
}
)
completeSummaryDetailStatus(
{id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },
that.inspectNoticeDetailsFormData,
).then(res => {
// ============================================================
that.inspectNoticeDetailsShow = false
this.loading = false
getDetailed(that.propsData.id, that.URL).then(res1 => {
that.propsData = res1
})
that.paging()
that.$message.success('成功完成检验!')
}).catch(err => {
that.loading = false
that.$message.error('检验失败,请重试!')
console.log(err)
})
}
} else {
completeSummaryDetailStatus(
{id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },
that.inspectNoticeDetailsFormData
).then(res => {
// ============================================================
that.inspectNoticeDetailsShow = false
this.loading = false
getDetailed(that.propsData.id, that.URL).then(res1 => {
that.propsData = res1
})
that.paging()
that.$message.success('成功完成检验!')
}).catch(err => {
that.loading = false
that.$message.error('检验失败,请重试!')
console.log(err)
//
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)
})
}
this.loading = true
completeSummaryDetailStatus(
{id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },
that.inspectNoticeDetailsFormData
).then(res => {
// ============================================================
that.inspectNoticeDetailsShow = false
this.loading = false
getDetailed(that.propsData.id, that.URL).then(res1 => {
that.propsData = res1
})
that.paging()
that.$message.success('成功完成检验!')
}).catch(err => {
that.loading = false
that.$message.error('检验失败,请重试!')
console.log(err)
})
// 使
// if (this.inspectNoticeDetailsFormData.formFile.length !== 0) {
// let rd = new FileReader(); //
// let fileName = this.inspectNoticeDetailsFormData.formFile[0].name
// rd.readAsDataURL(this.inspectNoticeDetailsFormData.formFile[0])
// rd.onloadend = function(){
// var arrayBuffer = rd.result
// that.inspectNoticeDetailsFormData.filesList = []
// that.inspectNoticeDetailsFormData.filesList.push(
// {
// fileName: fileName,
// bytes: arrayBuffer.substring(arrayBuffer.lastIndexOf(',')+1,arrayBuffer.length)
// }
// )
// completeSummaryDetailStatus(
// {id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },
// that.inspectNoticeDetailsFormData,
// ).then(res => {
// // ============================================================
// that.inspectNoticeDetailsShow = false
// this.loading = false
// getDetailed(that.propsData.id, that.URL).then(res1 => {
// that.propsData = res1
// })
// that.paging()
// that.$message.success('')
// }).catch(err => {
// that.loading = false
// that.$message.error(',!')
// console.log(err)
// })
// }
// } else {
// console.log(1150,that.inspectNoticeDetailsFormData)
// return
// completeSummaryDetailStatus(
// {id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },
// that.inspectNoticeDetailsFormData
// ).then(res => {
// // ============================================================
// that.inspectNoticeDetailsShow = false
// this.loading = false
// getDetailed(that.propsData.id, that.URL).then(res1 => {
// that.propsData = res1
// })
// that.paging()
// that.$message.success('')
// }).catch(err => {
// that.loading = false
// that.$message.error('')
// console.log(err)
// })
// }
}
},
//

Loading…
Cancel
Save