|
|
@ -1,5 +1,7 @@ |
|
|
|
<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> |
|
|
|
|
|
|
|
<tablePagination |
|
|
|
:currenButtonData="currenButtonData" |
|
|
|
:tableData="tableData" |
|
|
@ -229,6 +231,11 @@ |
|
|
|
@closePDF="closePDF" |
|
|
|
:showDownLoad="true" |
|
|
|
></pdf> |
|
|
|
<!-- 抽屉查看报告弹窗 --> |
|
|
|
<el-image-viewer |
|
|
|
v-if="isShowBase64" |
|
|
|
:on-close="(()=>{isShowBase64 = false})" |
|
|
|
:url-list="[urlPDF]" /> |
|
|
|
<!-- 拆箱弹窗 --> |
|
|
|
<el-dialog |
|
|
|
title="拆箱" |
|
|
@ -268,6 +275,7 @@ |
|
|
|
|
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import ElImageViewer from 'element-ui/packages/image/src/image-viewer' |
|
|
|
import { |
|
|
|
getPageList, |
|
|
|
fileStorage, |
|
|
@ -284,6 +292,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 +317,12 @@ export default { |
|
|
|
components: { |
|
|
|
currenDescriptions, |
|
|
|
currenTableFlex, |
|
|
|
pdf |
|
|
|
pdf, |
|
|
|
ElImageViewer |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
getGrabimageIframeUrl:localStorage.getItem('grabimageURL'), |
|
|
|
URL: 'wms/store/inspect-job', |
|
|
|
// tab标签值 |
|
|
|
currentTagName:'hz', |
|
|
@ -351,6 +362,7 @@ export default { |
|
|
|
titlePDF: '', |
|
|
|
// 是否显示文件预览框 |
|
|
|
isShowPDF: false, |
|
|
|
isShowBase64:false, |
|
|
|
// 加载PDF |
|
|
|
loadingPDF: false, |
|
|
|
// 箱码查询输入框 |
|
|
@ -529,7 +541,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 +607,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 +724,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 |
|
|
@ -1064,58 +1119,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) |
|
|
|
// }) |
|
|
|
// } |
|
|
|
} |
|
|
|
}, |
|
|
|
// 供应商查看 底部按钮 |
|
|
|