From a56f601cc94a589a1d91ef53684220d845fbfc28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com>
Date: Mon, 5 Aug 2024 16:02:35 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90nev-pc=E3=80=91=E6=8A=A5=E6=A3=80?=
=?UTF-8?q?=E5=8D=95=E8=B4=A8=E6=A3=80=E6=8A=A5=E5=91=8A=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E5=85=BC=E5=AE=B9=E5=BC=80=E5=8F=91+form?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BAuploadList=E7=BB=84=E4=BB=B6?=
=?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
fe/PC/public/config.js | 2 +-
fe/PC/src/components/currenForm/index.vue | 2 +
.../src/components/currenUploadList/index.vue | 13 +++++-
.../quality/InspectRequest.vue | 42 ++++++++++++++-----
4 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/fe/PC/public/config.js b/fe/PC/public/config.js
index 6e3adc936..0315a687e 100644
--- a/fe/PC/public/config.js
+++ b/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['showGrabimageIframeTest'] = false//登录页调试高拍仪显示按钮
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'
diff --git a/fe/PC/src/components/currenForm/index.vue b/fe/PC/src/components/currenForm/index.vue
index 03ed1c0b4..80e93de06 100644
--- a/fe/PC/src/components/currenForm/index.vue
+++ b/fe/PC/src/components/currenForm/index.vue
@@ -404,6 +404,8 @@
@uploadListView="uploadListView"
@changeUpload="changeUpload($event, item)"
@handleRemove="handleRemove($event, item.prop)"
+ :hideFileList="item.hideFileList"
+ :hideViewBtn="item.hideViewBtn"
>
diff --git a/fe/PC/src/components/currenUploadList/index.vue b/fe/PC/src/components/currenUploadList/index.vue
index e3430abd0..64f6b8c2a 100644
--- a/fe/PC/src/components/currenUploadList/index.vue
+++ b/fe/PC/src/components/currenUploadList/index.vue
@@ -12,9 +12,10 @@
:limit="limit"
:accept="picExt"
:auto-upload="false"
+ :show-file-list="!hideFileList"
>
上传
- 查看
+ 查看
@@ -33,6 +34,16 @@ export default {
return []
}
},
+ // 隐藏导入列表
+ hideFileList: {
+ type: Boolean,
+ default: false
+ },
+ // 隐藏查看按钮
+ hideViewBtn: {
+ type: Boolean,
+ default: false
+ },
picExt: {
type: String,
default: "",
diff --git a/fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue b/fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue
index 3202e8cc6..6050d713f 100644
--- a/fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue
+++ b/fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue
@@ -183,6 +183,7 @@
:rules="inspectNoticeDetailsRules"
@uploadListView="uploadListView"
@submitForm="formClick(arguments)"
+ @changeUpload="uploadReportImg"
>
@@ -527,6 +528,7 @@ export default {
filesList:[],
formFile: [],
details: [],
+ uploadFormFile:[],
// inspectUserEmail: null,
// supplierPackQty: 0,
// tenantId: null,
@@ -551,8 +553,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: ".jpg,.png", colSpan: 12 },
{ 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: "viewImg", label: "预览报告",width:"40px",height:'40px', url:null ,srcList:[],colSpan: 24,
deleteViewImgHandle:((item,img,img_key)=>{this.deleteViewImgHandle(item,img,img_key)})
@@ -675,7 +679,7 @@ export default {
var result = event.data; // 接收函数执行结果
_this.currentFileBase64 = 'data:image/png;base64,'+result
_this.fileBase64List.push(_this.currentFileBase64)
- _this.inspectNoticeDetailsForm[12].srcList = _this.fileBase64List
+ _this.inspectNoticeDetailsForm[_this.inspectNoticeDetailsForm.length - 1].srcList = _this.fileBase64List
_this.Loading.appMainLoading = false
clearTimeout(_this.gpy_setTimeout)
this.isRemoveImageIframe = true
@@ -694,11 +698,23 @@ export default {
type: 'warning'
}).then(() => {
this.fileBase64List.splice(img_key, 1)
- this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List
+ this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].srcList = this.fileBase64List
}).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(){
this.Loading.appMainLoading = true
@@ -729,8 +745,8 @@ export default {
},
clearGrabimage(){
this.fileBase64List = []
- this.inspectNoticeDetailsForm[12].url = this.fileBase64List[0]
- this.inspectNoticeDetailsForm[12].srcList = this.fileBase64List
+ this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].url = this.fileBase64List[0]
+ this.inspectNoticeDetailsForm[this.inspectNoticeDetailsForm.length - 1].srcList = this.fileBase64List
},
// 节点根据是否批量判断显示
initDomIfBatch(){
@@ -946,7 +962,8 @@ export default {
sampleQty: 0, // 要求检验数量
filesList:[],
formFile: [],
- details: []
+ details: [],
+ uploadFormFile:[]
// inspectUserEmail: null,
// supplierPackQty: 0,
// tenantId: null,
@@ -1204,7 +1221,12 @@ export default {
// 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
that.masterID = that.propsData.id
// 取消质检报告上传必填项
@@ -1501,11 +1523,11 @@ export default {
},
//设置指定行、列、具体单元格颜色
cellClassName({row, column, rowIndex, columnIndex}){
- if (row.detailInspectStatus == 1 && columnIndex === 6) {
+ if (row.detailInspectStatus == 1 && columnIndex === 7) {
return 'cell-class-mrhg' //默认合格
- } else if (row.detailInspectStatus == 2 && columnIndex === 6) {
+ } else if (row.detailInspectStatus == 2 && columnIndex === 7) {
return 'cell-class-hg'//合格
- } else if (row.detailInspectStatus == 3 && columnIndex === 6) {
+ } else if (row.detailInspectStatus == 3 && columnIndex === 7) {
return 'cell-class-nohg'//不合格
}else{
return ''