Browse Source

【nev-pc】质检连高拍仪数据开发+列表查看大图功能修改开发

ag_report_nev
安虹睿 11 months ago
parent
commit
5407064d58
  1. 3
      fe/PC/public/config.js
  2. 1
      fe/PC/src/App.vue
  3. 2
      fe/PC/src/views/ThirdLocationManage/ThirdLocationRequest.vue
  4. 2
      fe/PC/src/views/inventoryManage/InventoryQuery/InventoryBalanceActive.vue
  5. 189
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue
  6. 49
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest_new.vue

3
fe/PC/public/config.js

@ -24,6 +24,9 @@ window.SITE_CONFIG['versionUrl'] = 'http://dev.ccwin-in.com:60070'
window.SITE_CONFIG['companyName'] = '长春一汽富维东阳汽车塑料零部件(安徽)有限公司'
//pad-kitting组包页面刷新时间(毫秒)
window.SITE_CONFIG['padKittingPackUpdate'] = 180000
// 高拍仪获取地址
window.SITE_CONFIG['grabimageURL'] = 'http://192.168.1.75:33336/video/index.html'
// 接口看板地址
window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60090/'
// 主子表

1
fe/PC/src/App.vue

@ -23,6 +23,7 @@ localStorage.setItem('warehouseCode',window.SITE_CONFIG['warehouseCode'])
localStorage.setItem('company',window.SITE_CONFIG['company'])
localStorage.setItem('largeScreen',window.SITE_CONFIG['largeScreen'])
localStorage.setItem('padKittingPackUpdate',window.SITE_CONFIG['padKittingPackUpdate'])
localStorage.setItem('grabimageURL',window.SITE_CONFIG['grabimageURL'])
localStorage.setItem('apifoxToken',window.SITE_CONFIG['apifoxToken'])
localStorage.setItem('reportsUrl',window.SITE_CONFIG['reportsUrl'])
localStorage.setItem('companyName',window.SITE_CONFIG['companyName'])

2
fe/PC/src/views/ThirdLocationManage/ThirdLocationRequest.vue

@ -104,7 +104,7 @@ export default {
{
type: 'success',
label: '完成',
hide: () => { return this.hideButton([9])},//todo
hide: () => { return this.hideButton([9])},//
name: "complete",
size: 'mini'
},

2
fe/PC/src/views/inventoryManage/InventoryQuery/InventoryBalanceActive.vue

@ -106,7 +106,7 @@ export default {
URL: 'wms/inventory/inventory-balance',
//
currenButtonData: [
this.defaultImportBtn(),//
// this.defaultImportBtn(),//
this.defaultExportBtn(),//
{
type: "success",

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

@ -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();
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)
// })
// }
}
},
//

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

@ -1,6 +1,6 @@
<template>
<div class="page-box InspectNoticePage" v-loading="Loading.appMainLoading">
<iframe v-show="false" id="getGrabimageIframe" src='http://192.168.1.75:33336/video/index.html' 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;left:0"></iframe>
<tablePagination
:currenButtonData="currenButtonData"
@ -231,6 +231,11 @@
@closePDF="closePDF"
:showDownLoad="true"
></pdf>
<!-- 抽屉查看报告弹窗 -->
<el-image-viewer
v-if="isShowBase64"
:on-close="(()=>{isShowBase64 = false})"
:url-list="[urlPDF]" />
<!-- 拆箱弹窗 -->
<el-dialog
title="拆箱"
@ -270,14 +275,14 @@
</template>
<script>
import axios from 'axios'
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import {
getPageList,
fileStorage,
getListByItemcode,
getDetailed,
getFilestore,
InspectSplitPackingk,
InspectSplitPackingk
} from "@/api/wms-api"
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core"
import {
@ -312,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',
@ -355,6 +362,7 @@ export default {
titlePDF: '',
//
isShowPDF: false,
isShowBase64:false,
// PDF
loadingPDF: false,
//
@ -534,7 +542,7 @@ 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:3 ,buttonText:'获取报告',click:(()=>{this.getGrabimage()})},
{ 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()})},
],
@ -600,27 +608,41 @@ export default {
isBatchInspect:false,
selectedDetailZJ:[],
fileBase64:'',
gpy_setTimeout:null
};
},
mounted () {
this.paging();
let _this = this
//
window.addEventListener('message', function(event) {
// todo:
// if (event.origin === 'http://iframe-domain.com') { // iframe
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(){
var iframeWindow = document.getElementById('getGrabimageIframe').contentWindow;
iframeWindow.postMessage('callMyFunction', '*');
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(){
@ -702,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
@ -1097,14 +1122,12 @@ export default {
//
that.inspectNoticeDetailsFormData.filesList = []
if(that.fileBase64 && that.fileBase64.length > 0){
let fileName = 'Grabimage ' + formatTimeStampToNorm(new Date(),'datetime')
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)
})
}
console.log(1120,that.inspectNoticeDetailsFormData)
return
this.loading = true
completeSummaryDetailStatus(
{id: that.masterID, summaryDetailId: that.inspectNoticeDetailsFormData.id },

Loading…
Cancel
Save