Browse Source

【nev-pc】报检单质检报告上传图片兼容开发+form类型为uploadList组件兼容开发

ag_report_nev
安虹睿 9 months ago
parent
commit
a56f601cc9
  1. 2
      fe/PC/public/config.js
  2. 2
      fe/PC/src/components/currenForm/index.vue
  3. 13
      fe/PC/src/components/currenUploadList/index.vue
  4. 42
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue

2
fe/PC/public/config.js

@ -29,7 +29,7 @@ window.SITE_CONFIG['padKittingPackUpdate'] = 180000
window.SITE_CONFIG['grabimageURL'] = 'http://192.168.1.75:33336/video/index100.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'] = 5000 //高拍仪加载时间 window.SITE_CONFIG['gpyLoadingTime'] = 0 //高拍仪加载时间
// 供应商接口地址(如立体库等) // 供应商接口地址(如立体库等)
window.SITE_CONFIG['supplierOuterURL'] = 'http://7e42682n64.goho.co:21171' window.SITE_CONFIG['supplierOuterURL'] = 'http://7e42682n64.goho.co:21171'

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

@ -404,6 +404,8 @@
@uploadListView="uploadListView" @uploadListView="uploadListView"
@changeUpload="changeUpload($event, item)" @changeUpload="changeUpload($event, item)"
@handleRemove="handleRemove($event, item.prop)" @handleRemove="handleRemove($event, item.prop)"
:hideFileList="item.hideFileList"
:hideViewBtn="item.hideViewBtn"
> >
</currenUploadList> </currenUploadList>
<!-- 缩略图上传 --> <!-- 缩略图上传 -->

13
fe/PC/src/components/currenUploadList/index.vue

@ -12,9 +12,10 @@
:limit="limit" :limit="limit"
:accept="picExt" :accept="picExt"
:auto-upload="false" :auto-upload="false"
:show-file-list="!hideFileList"
> >
<el-button slot="trigger" size="mini" type="primary">上传</el-button> <el-button slot="trigger" size="mini" type="primary">上传</el-button>
<el-button style="margin-left: 10px;" size="mini" type="info" @click="uploadListView">查看</el-button> <el-button v-if="!hideViewBtn" style="margin-left: 10px;" size="mini" type="info" @click="uploadListView">查看</el-button>
</el-upload> </el-upload>
</div> </div>
@ -33,6 +34,16 @@ export default {
return [] return []
} }
}, },
//
hideFileList: {
type: Boolean,
default: false
},
//
hideViewBtn: {
type: Boolean,
default: false
},
picExt: { picExt: {
type: String, type: String,
default: "", default: "",

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

@ -183,6 +183,7 @@
:rules="inspectNoticeDetailsRules" :rules="inspectNoticeDetailsRules"
@uploadListView="uploadListView" @uploadListView="uploadListView"
@submitForm="formClick(arguments)" @submitForm="formClick(arguments)"
@changeUpload="uploadReportImg"
> >
<template> <template>
<template> <template>
@ -527,6 +528,7 @@ export default {
filesList:[], filesList:[],
formFile: [], formFile: [],
details: [], details: [],
uploadFormFile:[],
// inspectUserEmail: null, // inspectUserEmail: null,
// supplierPackQty: 0, // supplierPackQty: 0,
// tenantId: null, // tenantId: null,
@ -551,8 +553,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: ".jpg,.png", colSpan: 12 },
{ type: "button", label: "供应商自检报告", colSpan:2 ,buttonText:'获取报告',click:(()=>{this.getGrabimage()})}, { type: "button", label: "供应商自检报告", colSpan:2 ,buttonText:'获取报告',click:(()=>{this.getGrabimage()})},
{ type: "uploadList", label: "",hideFileList:true,hideViewBtn:true, prop: "uploadFormFile", colSpan:2 ,picExt: ".jpg,.png" },
// { type: "button", colSpan:2 ,buttonText:'',buttonType:'warning',click:(()=>{this.uploadImg()})},
{ type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimageHandle()})}, { type: "button", label: "", colSpan:3 ,buttonText:'清除报告',buttonType:'danger',click:(()=>{this.clearGrabimageHandle()})},
{ type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24, { type: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24,
deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)}) deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)})
@ -675,7 +679,7 @@ export default {
var result = event.data; // var result = event.data; //
_this.currentFileBase64 = 'data:image/png;base64,'+result _this.currentFileBase64 = 'data:image/png;base64,'+result
_this.fileBase64List.push(_this.currentFileBase64) _this.fileBase64List.push(_this.currentFileBase64)
_this.inspectNoticeDetailsForm[12].srcList = _this.fileBase64List _this.inspectNoticeDetailsForm[_this.inspectNoticeDetailsForm.length - 1].srcList = _this.fileBase64List
_this.Loading.appMainLoading = false _this.Loading.appMainLoading = false
clearTimeout(_this.gpy_setTimeout) clearTimeout(_this.gpy_setTimeout)
this.isRemoveImageIframe = true this.isRemoveImageIframe = true
@ -694,11 +698,23 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.fileBase64List.splice(img_key, 1) this.fileBase64List.splice(img_key, 1)
this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].srcList = this.fileBase64List
}).catch(() => { }).catch(() => {
}); });
}, },
//
uploadReportImg(file,item){
let _base64img = []
let reader = new FileReader(); //
reader.readAsDataURL(file); // DataURL,base64
reader.onload = (e)=> { //
let dataURL = e.target.result; //DataURL,base64
this.fileBase64List.push(dataURL)
this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].srcList = this.fileBase64List
}
console.log(716,this.fileBase64List)
},
// //
getGrabimage(){ getGrabimage(){
this.Loading.appMainLoading = true this.Loading.appMainLoading = true
@ -729,8 +745,8 @@ export default {
}, },
clearGrabimage(){ clearGrabimage(){
this.fileBase64List = [] this.fileBase64List = []
this.inspectNoticeDetailsForm[12].url = this.fileBase64List[0] this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].url = this.fileBase64List[0]
this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].srcList = this.fileBase64List
}, },
// //
initDomIfBatch(){ initDomIfBatch(){
@ -946,7 +962,8 @@ export default {
sampleQty: 0, // sampleQty: 0, //
filesList:[], filesList:[],
formFile: [], formFile: [],
details: [] details: [],
uploadFormFile:[]
// inspectUserEmail: null, // inspectUserEmail: null,
// supplierPackQty: 0, // supplierPackQty: 0,
// tenantId: null, // tenantId: null,
@ -1204,7 +1221,12 @@ export default {
// colSpan: 12 // colSpan: 12
// }) // })
// } // }
else if (val[0] == 1) {
//
else if (val[0] == 1) {
if(!this.fileBase64List || this.fileBase64List.length <= 0){
return this.$errorMsg("请提供供应商自检报告")
}
let that = this let that = this
that.masterID = that.propsData.id that.masterID = that.propsData.id
// //
@ -1501,11 +1523,11 @@ export default {
}, },
// //
cellClassName({row, column, rowIndex, columnIndex}){ cellClassName({row, column, rowIndex, columnIndex}){
if (row.detailInspectStatus == 1 && columnIndex === 6) { if (row.detailInspectStatus == 1 && columnIndex === 7) {
return 'cell-class-mrhg' // return 'cell-class-mrhg' //
} else if (row.detailInspectStatus == 2 && columnIndex === 6) { } else if (row.detailInspectStatus == 2 && columnIndex === 7) {
return 'cell-class-hg'// return 'cell-class-hg'//
} else if (row.detailInspectStatus == 3 && columnIndex === 6) { } else if (row.detailInspectStatus == 3 && columnIndex === 7) {
return 'cell-class-nohg'// return 'cell-class-nohg'//
}else{ }else{
return '' return ''

Loading…
Cancel
Save