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. 203
      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组包页面刷新时间(毫秒) //pad-kitting组包页面刷新时间(毫秒)
window.SITE_CONFIG['padKittingPackUpdate'] = 180000 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['showGrabimageIframeTest'] = false//登录页调试高拍仪显示按钮
window.SITE_CONFIG['grabRegulateIframePage'] = 'http://10.164.230.173:33336/video/index4.html'//高拍仪-iframe内嵌对焦界面 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' 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 // 客户退拆任务-完成 todo
// export async function productionRecycleJobComplete(id) { // export async function productionRecycleJobComplete(id) {
// return request({ // return request({

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

@ -426,19 +426,29 @@
{{item.buttonText}} {{item.buttonText}}
</el-button> </el-button>
<!-- 图片显示及查看图片 --> <!-- 图片显示及查看图片 -->
<el-image <div v-if="item.type == 'viewImg'">
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 <div
slot="error" v-for="(img,img_key) in item.srcList"
style="font-size:12px" :key="img_key"
:style="{lineHeight: item.height || '100px'}" v-if="item.srcList && item.srcList.length > 0"
>{{item.errorTip}}</div> class="imgOneBlock"
</el-image> >
<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-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -935,4 +945,15 @@ export default {
color: #999 !important; color: #999 !important;
font-weight: normal !important; font-weight: normal !important;
} }
.imgOneBlock{
display:inline-block;
position:relative;
.delete-btn{
position:absolute;
left:-10px;
top:-10px;
padding:3px;
}
}
</style> </style>

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

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

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

@ -1,7 +1,7 @@
<template> <template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading"> <div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading">
<!-- 高拍仪调获取base64页面 --> <!-- 高拍仪调获取base64页面 v-if="!isRemoveImageIframe" -->
<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="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> <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 <el-image-viewer
v-if="isShowBase64" v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})" :on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" /> :url-list="imgListViews" />
<!-- 拆箱弹窗 --> <!-- 拆箱弹窗 -->
<el-dialog <el-dialog
title="拆箱" title="拆箱"
@ -287,7 +287,8 @@ import {
getListByItemcode, getListByItemcode,
getDetailed, getDetailed,
getFilestore, getFilestore,
InspectSplitPackingk InspectSplitPackingk,
getGPYInfo
} from "@/api/wms-api" } from "@/api/wms-api"
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core" import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core"
import { import {
@ -363,6 +364,8 @@ export default {
rowReceiveQty: null, rowReceiveQty: null,
// pdf // pdf
urlPDF: '', urlPDF: '',
//
imgListViews:[],
// base64data:application/pdf;base64, // base64data:application/pdf;base64,
base64PDF:'', base64PDF:'',
// titlePDF // titlePDF
@ -549,9 +552,11 @@ export default {
{ type: "input", label: "合格数量", prop: "goodQty", 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: "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: "button", label: "供应商自检报告", colSpan:2 ,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.clearGrabimageHandle()})},
{ type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimage()})}, { type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24,
deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)})
},
], ],
inspectNoticeDetailsRules: { inspectNoticeDetailsRules: {
// formFile: { required: true, trigger: "change", message: "" }, // formFile: { required: true, trigger: "change", message: "" },
@ -614,32 +619,90 @@ export default {
// //
isBatchInspect:false, isBatchInspect:false,
selectedDetailZJ:[], selectedDetailZJ:[],
fileBase64:'', currentFileBase64:'',
gpy_setTimeout:null fileBase64List:[],
gpy_setTimeout:null,
isRemoveImageIframe:true
}; };
}, },
mounted () { mounted () {
this.paging(); this.paging();
let _this = this this.addGrabimageEvent()
// // var myHeaders = new Headers();
window.addEventListener('message', function(event) { // myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
console.log(666666666,event) // myHeaders.append("Content-Type", "application/json");
// if (event.origin === 'http://192.168.1.75:33336') { // iframe // myHeaders.append("Accept", "*/*");
var result = event.data; // // myHeaders.append("Host", "192.168.1.75:38088");
_this.fileBase64 = 'data:image/png;base64,'+result // myHeaders.append("Connection", "keep-alive");
_this.inspectNoticeDetailsForm[11].url = _this.fileBase64
_this.inspectNoticeDetailsForm[11].srcList = [_this.fileBase64] // var raw = JSON.stringify({
console.log(615,_this.fileBase64) // "camidx": "0",
_this.Loading.appMainLoading = false // "make_uuid": "1",
clearTimeout(_this.gpy_setTimeout) // "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: { 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(){ getGrabimage(){
this.Loading.appMainLoading = true this.Loading.appMainLoading = true
this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime() this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime()
this.isRemoveImageIframe = false
this.$nextTick(()=>{ this.$nextTick(()=>{
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow; var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*'); iframeWindow.postMessage('callMyFunction', '*');
@ -652,10 +715,21 @@ export default {
},30000) },30000)
}, },
// //
clearGrabimageHandle(){
this.$confirm('您确定清除报告吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.clearGrabimage()
}).catch(() => {
});
},
clearGrabimage(){ clearGrabimage(){
this.fileBase64 = '' this.fileBase64List = []
this.inspectNoticeDetailsForm[11].url = this.fileBase64 this.inspectNoticeDetailsForm[12].url = this.fileBase64List[0]
this.inspectNoticeDetailsForm[11].srcList = [this.fileBase64] this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List
}, },
// //
initDomIfBatch(){ initDomIfBatch(){
@ -730,20 +804,34 @@ export default {
currenDrawerButtonClick(val,index, label,item){ currenDrawerButtonClick(val,index, label,item){
if(item.prop == "inspectReport"){ if(item.prop == "inspectReport"){
// //
let _file_id = JSON.parse(val.inspectReport)[0].FileKey if(this.Loading.appMainLoading)return
if(this.loadingPDF)return let _imgs = JSON.parse(val.inspectReport)
this.loadingPDF = true this.Loading.appMainLoading = true
getFilestore({blobName:_file_id}).then(res=>{ let _httpNumber=0
this.urlPDF = 'data:application/pdf;base64,'+res.bytes let _urls = {}
// pdf _imgs.forEach((item,key)=>{
this.base64PDF=res.bytes let _file_id = item.FileKey
this.titlePDF = res.fileName //
// this.isShowPDF = true getFilestore({blobName:_file_id}).then(res=>{
// base64 _httpNumber++
this.isShowBase64 = true // this.urlPDF = 'data:application/pdf;base64,'+res.bytes
this.loadingPDF = false _urls[key] = 'data:application/pdf;base64,'+res.bytes
}).catch(res=>{ // pdf
this.loadingPDF = false // 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){ formClick(val){
if (val[0] == 0) { if (val[0] == 0) {
this.inspectNoticeDetailsShow = false this.inspectNoticeDetailsShow = false
this.clearGrabimage()
} }
// else if (val[0] == 1) { // else if (val[0] == 1) {
// console.log('') // console.log('')
@ -1133,11 +1222,13 @@ export default {
} }
// //
that.inspectNoticeDetailsFormData.filesList = [] that.inspectNoticeDetailsFormData.filesList = []
if(that.fileBase64 && that.fileBase64.length > 0){ if(that.fileBase64List && that.fileBase64List.length > 0){
let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + '.jpg' this.fileBase64List.forEach((item,key)=>{
that.inspectNoticeDetailsFormData.filesList.push({ let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + 'index_' + key + '.jpg'
fileName: fileName, that.inspectNoticeDetailsFormData.filesList.push({
bytes: that.fileBase64.substring(that.fileBase64.lastIndexOf(',')+1,that.fileBase64.length) fileName: fileName,
bytes: item.substring(item.lastIndexOf(',')+1,item.length)
})
}) })
} }
this.loading = true this.loading = true
@ -1153,6 +1244,7 @@ export default {
}) })
that.paging() that.paging()
that.$message.success('成功完成检验!') that.$message.success('成功完成检验!')
this.clearGrabimage()
}).catch(err => { }).catch(err => {
that.loading = false that.loading = false
that.$message.error('检验失败,请重试!') that.$message.error('检验失败,请重试!')
@ -1402,6 +1494,7 @@ export default {
closePDF(){ closePDF(){
this.isShowPDF = false this.isShowPDF = false
this.urlPDF = '' this.urlPDF = ''
this.imgListViews = []
this.titlePDF = '' this.titlePDF = ''
this.loadingPDF = false this.loadingPDF = false
}, },

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

@ -1,6 +1,9 @@
<template> <template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading"> <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 <tablePagination
:currenButtonData="currenButtonData" :currenButtonData="currenButtonData"
@ -106,7 +109,7 @@
</curren-Form> </curren-Form>
</el-col> </el-col>
<el-col :span="10" > <el-col :span="10" >
<div style="padding-bottom:10px">作业指导书</div> <div style="padding-bottom:10px">作业指导书:</div>
<curren-descriptions <curren-descriptions
border border
:column="1" :column="1"
@ -170,6 +173,8 @@
:show-close="false" :show-close="false"
> >
<curren-Form <curren-Form
v-loading="gpyLoading"
element-loading-text="正在加载高拍仪"
class="handleForm" class="handleForm"
size="medium" size="medium"
:searchData="inspectNoticeDetailsFormData" :searchData="inspectNoticeDetailsFormData"
@ -235,7 +240,7 @@
<el-image-viewer <el-image-viewer
v-if="isShowBase64" v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})" :on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" /> :url-list="imgListViews" />
<!-- 拆箱弹窗 --> <!-- 拆箱弹窗 -->
<el-dialog <el-dialog
title="拆箱" title="拆箱"
@ -282,7 +287,8 @@ import {
getListByItemcode, getListByItemcode,
getDetailed, getDetailed,
getFilestore, getFilestore,
InspectSplitPackingk InspectSplitPackingk,
getGPYInfo
} from "@/api/wms-api" } from "@/api/wms-api"
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core" import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core"
import { import {
@ -322,7 +328,9 @@ export default {
}, },
data () { data () {
return { return {
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'), gpyLoading:false,
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'),//-
grabRegulateIframePage:localStorage.getItem('grabRegulateIframePage'),//-iframe
URL: 'wms/store/inspect-job', URL: 'wms/store/inspect-job',
// tab // tab
currentTagName:'hz', currentTagName:'hz',
@ -356,6 +364,8 @@ export default {
rowReceiveQty: null, rowReceiveQty: null,
// pdf // pdf
urlPDF: '', urlPDF: '',
//
imgListViews:[],
// base64data:application/pdf;base64, // base64data:application/pdf;base64,
base64PDF:'', base64PDF:'',
// titlePDF // titlePDF
@ -542,9 +552,11 @@ export default {
{ type: "input", label: "合格数量", prop: "goodQty", 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: "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: "button", label: "供应商自检报告", colSpan:2 ,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.clearGrabimageHandle()})},
{ type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimage()})}, { type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24,
deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)})
},
], ],
inspectNoticeDetailsRules: { inspectNoticeDetailsRules: {
// formFile: { required: true, trigger: "change", message: "" }, // formFile: { required: true, trigger: "change", message: "" },
@ -607,32 +619,91 @@ export default {
// //
isBatchInspect:false, isBatchInspect:false,
selectedDetailZJ:[], selectedDetailZJ:[],
fileBase64:'', currentFileBase64:'',
gpy_setTimeout:null fileBase64List:[],
gpy_setTimeout:null,
isRemoveImageIframe:true
}; };
}, },
mounted () { mounted () {
this.paging(); this.paging();
let _this = this this.addGrabimageEvent()
// // var myHeaders = new Headers();
window.addEventListener('message', function(event) { // myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
console.log(666666666,event) // myHeaders.append("Content-Type", "application/json");
// if (event.origin === 'http://192.168.1.75:33336') { // iframe // myHeaders.append("Accept", "*/*");
var result = event.data; // // myHeaders.append("Host", "192.168.1.75:38088");
_this.fileBase64 = 'data:image/png;base64,'+result // myHeaders.append("Connection", "keep-alive");
_this.inspectNoticeDetailsForm[11].url = _this.fileBase64
_this.inspectNoticeDetailsForm[11].srcList = [_this.fileBase64] // var raw = JSON.stringify({
console.log(615,_this.fileBase64) // "camidx": "0",
_this.Loading.appMainLoading = false // "make_uuid": "1",
clearTimeout(_this.gpy_setTimeout) // "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: { 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(){ getGrabimage(){
this.Loading.appMainLoading = true this.Loading.appMainLoading = true
this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime() this.getGrabimageIframeUrl = localStorage.getItem('grabimageURL') + '?time='+new Date().getTime()
this.isRemoveImageIframe = false
console.log(670,window.message)
this.$nextTick(()=>{ this.$nextTick(()=>{
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow; var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*'); iframeWindow.postMessage('callMyFunction', '*');
@ -645,10 +716,21 @@ export default {
},30000) },30000)
}, },
// //
clearGrabimageHandle(){
this.$confirm('您确定清除报告吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.clearGrabimage()
}).catch(() => {
});
},
clearGrabimage(){ clearGrabimage(){
this.fileBase64 = '' this.fileBase64List = []
this.inspectNoticeDetailsForm[11].url = this.fileBase64 this.inspectNoticeDetailsForm[12].url = this.fileBase64List[0]
this.inspectNoticeDetailsForm[11].srcList = [this.fileBase64] this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List
}, },
// //
initDomIfBatch(){ initDomIfBatch(){
@ -723,20 +805,34 @@ export default {
currenDrawerButtonClick(val,index, label,item){ currenDrawerButtonClick(val,index, label,item){
if(item.prop == "inspectReport"){ if(item.prop == "inspectReport"){
// //
let _file_id = JSON.parse(val.inspectReport)[0].FileKey if(this.Loading.appMainLoading)return
if(this.loadingPDF)return let _imgs = JSON.parse(val.inspectReport)
this.loadingPDF = true this.Loading.appMainLoading = true
getFilestore({blobName:_file_id}).then(res=>{ let _httpNumber=0
this.urlPDF = 'data:application/pdf;base64,'+res.bytes let _urls = {}
// pdf _imgs.forEach((item,key)=>{
this.base64PDF=res.bytes let _file_id = item.FileKey
this.titlePDF = res.fileName //
// this.isShowPDF = true getFilestore({blobName:_file_id}).then(res=>{
// base64 _httpNumber++
this.isShowBase64 = true // this.urlPDF = 'data:application/pdf;base64,'+res.bytes
this.loadingPDF = false _urls[key] = 'data:application/pdf;base64,'+res.bytes
}).catch(res=>{ // pdf
this.loadingPDF = false // 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.Loading.appMainLoading = false
}) })
this.inspectNoticeDetailsShow = true this.inspectNoticeDetailsShow = true
this.gpyLoading=true
let _time = localStorage.getItem('gpyLoadingTime') !="undefined" ? localStorage.getItem('gpyLoadingTime') : 5000
setTimeout(()=>{
this.gpyLoading=false
},Number(_time))
},300) },300)
}, },
// - // -
@ -1089,6 +1190,7 @@ export default {
formClick(val){ formClick(val){
if (val[0] == 0) { if (val[0] == 0) {
this.inspectNoticeDetailsShow = false this.inspectNoticeDetailsShow = false
this.clearGrabimage()
} }
// else if (val[0] == 1) { // else if (val[0] == 1) {
// console.log('') // console.log('')
@ -1121,11 +1223,13 @@ export default {
} }
// //
that.inspectNoticeDetailsFormData.filesList = [] that.inspectNoticeDetailsFormData.filesList = []
if(that.fileBase64 && that.fileBase64.length > 0){ if(that.fileBase64List && that.fileBase64List.length > 0){
let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + '.jpg' this.fileBase64List.forEach((item,key)=>{
that.inspectNoticeDetailsFormData.filesList.push({ let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + 'index_' + key + '.jpg'
fileName: fileName, that.inspectNoticeDetailsFormData.filesList.push({
bytes: that.fileBase64.substring(that.fileBase64.lastIndexOf(',')+1,that.fileBase64.length) fileName: fileName,
bytes: item.substring(item.lastIndexOf(',')+1,item.length)
})
}) })
} }
this.loading = true this.loading = true
@ -1141,6 +1245,7 @@ export default {
}) })
that.paging() that.paging()
that.$message.success('成功完成检验!') that.$message.success('成功完成检验!')
this.clearGrabimage()
}).catch(err => { }).catch(err => {
that.loading = false that.loading = false
that.$message.error('检验失败,请重试!') that.$message.error('检验失败,请重试!')
@ -1390,6 +1495,7 @@ export default {
closePDF(){ closePDF(){
this.isShowPDF = false this.isShowPDF = false
this.urlPDF = '' this.urlPDF = ''
this.imgListViews = []
this.titlePDF = '' this.titlePDF = ''
this.loadingPDF = false this.loadingPDF = false
}, },

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

@ -1,5 +1,10 @@
<template> <template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading"> <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 <tablePagination
:currenButtonData="currenButtonData" :currenButtonData="currenButtonData"
:tableData="tableData" :tableData="tableData"
@ -104,7 +109,7 @@
</curren-Form> </curren-Form>
</el-col> </el-col>
<el-col :span="10" > <el-col :span="10" >
<div style="padding-bottom:10px">作业指导书</div> <div style="padding-bottom:10px">作业指导书:</div>
<curren-descriptions <curren-descriptions
border border
:column="1" :column="1"
@ -168,6 +173,8 @@
:show-close="false" :show-close="false"
> >
<curren-Form <curren-Form
v-loading="gpyLoading"
element-loading-text="正在加载高拍仪"
class="handleForm" class="handleForm"
size="medium" size="medium"
:searchData="inspectNoticeDetailsFormData" :searchData="inspectNoticeDetailsFormData"
@ -229,6 +236,11 @@
@closePDF="closePDF" @closePDF="closePDF"
:showDownLoad="true" :showDownLoad="true"
></pdf> ></pdf>
<!-- 抽屉查看报告弹窗 -->
<el-image-viewer
v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" />
<!-- 拆箱弹窗 --> <!-- 拆箱弹窗 -->
<el-dialog <el-dialog
title="拆箱" title="拆箱"
@ -268,6 +280,7 @@
</template> </template>
<script> <script>
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import { import {
getPageList, getPageList,
fileStorage, fileStorage,
@ -284,6 +297,7 @@ import {
setDetailNookStatus, setDetailNookStatus,
setBatchDetailStatus setBatchDetailStatus
} from "@/api/wms-job" } from "@/api/wms-job"
import { formatTimeStampToNorm } from '@/utils/formatTime'
import { tableMixins } from "@/mixins/TableMixins" import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins" import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins" import { drawerMixins } from "@/mixins/drawerMixins"
@ -308,10 +322,14 @@ export default {
components: { components: {
currenDescriptions, currenDescriptions,
currenTableFlex, currenTableFlex,
pdf pdf,
ElImageViewer
}, },
data () { data () {
return { return {
gpyLoading:false,
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'),//-
grabRegulateIframePage:localStorage.getItem('grabRegulateIframePage'),//-iframe
URL: 'wms/store/inspect-job', URL: 'wms/store/inspect-job',
// tab // tab
currentTagName:'hz', currentTagName:'hz',
@ -351,6 +369,7 @@ export default {
titlePDF: '', titlePDF: '',
// //
isShowPDF: false, isShowPDF: false,
isShowBase64:false,
// PDF // PDF
loadingPDF: false, loadingPDF: false,
// //
@ -529,7 +548,10 @@ export default {
{ type: "input", label: "不合格数量", prop: "failedQty", disabled: true, colSpan: 8 }, { type: "input", label: "不合格数量", prop: "failedQty", disabled: true, colSpan: 8 },
{ type: "input", label: "合格数量", prop: "goodQty", 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: "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: { inspectNoticeDetailsRules: {
// formFile: { required: true, trigger: "change", message: "" }, // formFile: { required: true, trigger: "change", message: "" },
@ -592,12 +614,49 @@ export default {
// //
isBatchInspect:false, isBatchInspect:false,
selectedDetailZJ:[], selectedDetailZJ:[],
fileBase64:'',
gpy_setTimeout:null
}; };
}, },
mounted () { 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: { 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(){ initDomIfBatch(){
this.initInspectRules() this.initInspectRules()
@ -672,13 +731,16 @@ export default {
if(item.prop == "inspectReport"){ if(item.prop == "inspectReport"){
// //
let _file_id = JSON.parse(val.inspectReport)[0].FileKey let _file_id = JSON.parse(val.inspectReport)[0].FileKey
this.isShowPDF = true
if(this.loadingPDF)return if(this.loadingPDF)return
this.loadingPDF = true this.loadingPDF = true
getFilestore({blobName:_file_id}).then(res=>{ getFilestore({blobName:_file_id}).then(res=>{
this.urlPDF = 'data:application/pdf;base64,'+res.bytes this.urlPDF = 'data:application/pdf;base64,'+res.bytes
// pdf
this.base64PDF=res.bytes this.base64PDF=res.bytes
this.titlePDF = res.fileName this.titlePDF = res.fileName
// this.isShowPDF = true
// base64
this.isShowBase64 = true
this.loadingPDF = false this.loadingPDF = false
}).catch(res=>{ }).catch(res=>{
this.loadingPDF = false this.loadingPDF = false
@ -859,6 +921,11 @@ export default {
this.Loading.appMainLoading = false this.Loading.appMainLoading = false
}) })
this.inspectNoticeDetailsShow = true this.inspectNoticeDetailsShow = true
this.gpyLoading=true
let _time = localStorage.getItem('gpyLoadingTime') !="undefined" ? localStorage.getItem('gpyLoadingTime') : 5000
setTimeout(()=>{
this.gpyLoading=false
},Number(_time))
},300) },300)
}, },
// - // -
@ -1064,58 +1131,86 @@ export default {
this.$message.error('实际检验数量小于要求检验数量,请继续检验!'); this.$message.error('实际检验数量小于要求检验数量,请继续检验!');
return return
} }
this.loading = true //
// that.inspectNoticeDetailsFormData.filesList = []
if (this.inspectNoticeDetailsFormData.formFile.length !== 0) { if(that.fileBase64 && that.fileBase64.length > 0){
let rd = new FileReader(); // let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime') + '.jpg'
let fileName = this.inspectNoticeDetailsFormData.formFile[0].name that.inspectNoticeDetailsFormData.filesList.push({
rd.readAsDataURL(this.inspectNoticeDetailsFormData.formFile[0]) fileName: fileName,
rd.onloadend = function(){ bytes: that.fileBase64.substring(that.fileBase64.lastIndexOf(',')+1,that.fileBase64.length)
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)
}) })
} }
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