From e5c518611876cb6cf5b6fc43850a56505c6956d3 Mon Sep 17 00:00:00 2001 From: xiaoning <1097449274@qq.com> Date: Fri, 5 Jul 2024 11:42:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E6=96=99=E5=9B=BEpdf=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8A=E4=BC=A0=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sjzx/bomwh.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/sjzx/bomwh.vue b/src/views/sjzx/bomwh.vue index d82d625..70b327f 100644 --- a/src/views/sjzx/bomwh.vue +++ b/src/views/sjzx/bomwh.vue @@ -1191,7 +1191,10 @@ export default { const formData = new FormData() // 你可以使用FormData.append来添加键/值对到表单里面; this.fileList.forEach((file) => { - formData.append('file', file.raw) + if (!file.name.includes(".PDF")){ + formData.append('file', file.raw) + } + }) this.tltList2.forEach((file) => { formData.append('tltList', file.raw) @@ -1201,6 +1204,7 @@ export default { formData.append('pl', this.queryParam.dcpl) formData.append('isupload', '01') uploadBom(formData).then(res=>{ + if (res.data.zt == "01") { this.dialogVisible=false; this.tableData=res.data.data; @@ -1212,7 +1216,6 @@ export default { distinguishCancelAndClose: true, type: 'warning' }).then(type => { - formData formData.set('isupload', '02') uploadBom(formData).then(res => { console.log(res.data) @@ -1223,9 +1226,11 @@ export default { } }) }) + }else if (res.data.zt == "03") { + this.$message.error('上传的套料图PDF格式错误,请联系开发人员!'); } - - this.fileList = [] + this.fileList = [] + this.tltList=[] }) //自定义的接口也可以用ajax或者自己封装的接口