diff --git a/src/views/sjzx/bomwh.vue b/src/views/sjzx/bomwh.vue index 95cb92e..608c17f 100644 --- a/src/views/sjzx/bomwh.vue +++ b/src/views/sjzx/bomwh.vue @@ -267,28 +267,28 @@ - - - + + + + + + + + + + + + + + + + + + + + + + @@ -1057,7 +1057,7 @@ export default { handleChange(file, fileList) { this.fileList = fileList const bcph="" - if (file.name.includes(".BC")||file.name.includes(".LST")||file.name.includes(".XC")){ + if (file.name.includes(".BC")||file.name.includes(".LST")||file.name.includes(".XC") || file.name.includes(".txt") ){ if (file.name.includes("板材领取表")) { this.czbhu= file.name.split("_")[0] var underscoreIndex = file.name.indexOf("_"); @@ -1105,7 +1105,8 @@ export default { this.tableupload.push(a); } // console.log(file.name) - if((file.name.match(/-/g)).length ===3){ + // if((file.name.match(/-/g)).length ===3){ + if(file.name.includes(".txt")){ this.ljList.push(file.name); var parts = file.name.split('-') var result = parts.slice(0, 3).join('-') @@ -1117,25 +1118,34 @@ export default { this.tableupload.push(a); } //this.title=this.czbhu+" "+this.phu+"批" - this.tableupload.sort((a,b)=>{ - //return( a[age] - b[age]) - return( a.sort - b.sort) - }) - this.queryParam.dcch=this.czbhu - this.queryParam.dcpl=this.phu + // 请求后台 得到需求期 } - //上传pdf 20240530 - - if ( file.name.includes("数控套料图")&&file.name.includes('.pdf') ) { + // else + // //上传pdf 20240530 + // + if ( file.name.includes('.pdf') ) { this.tltList2.push(file) - let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"数控套料图",name:file.name,sort:6} + let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"数控套料图",name:file.name,sort:7} this.tableupload.push(a); this.tableupload.sort((a,b)=>{ return( a.sort - b.sort) }) } - + if ( file.name.includes('.QG') ) { + this.tltList2.push(file) + let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"切割文件",name:file.name,sort:8} + this.tableupload.push(a); + this.tableupload.sort((a,b)=>{ + return( a.sort - b.sort) + }) + } + this.tableupload.sort((a,b)=>{ + //return( a[age] - b[age]) + return( a.sort - b.sort) + }) + this.queryParam.dcch=this.czbhu + this.queryParam.dcpl=this.phu this.dialogVisible=true; }, // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。function(file, fileList) @@ -1173,6 +1183,7 @@ export default { }, //上传服务器 submitUpload() { + console.log(this.fileList2.length) //判断是否有文件再上传 if (this.fileList.length === 0) { @@ -1196,11 +1207,12 @@ export default { const formData = new FormData() // 你可以使用FormData.append来添加键/值对到表单里面; this.fileList.forEach((file) => { - if (!file.name.includes(".PDF")&&!file.name.includes('.pdf')){ + if ((!file.name.includes(".PDF")&&!file.name.includes('.pdf')) || !file.name.includes('.QG')){ formData.append('file', file.raw) } }) + console.log(this.fileList) this.tltList2.forEach((file) => { formData.append('tltList', file.raw) }) @@ -1208,6 +1220,7 @@ export default { formData.append('czbh', this.queryParam.dcch) formData.append('pl', this.queryParam.dcpl) formData.append('isupload', '01') + uploadBom(formData).then(res=>{ if (res.data.zt == "01") {