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或者自己封装的接口