bom 上传文件

master
xhj 8 months ago
parent 4d320617aa
commit 807c823946

@ -267,28 +267,28 @@
</div>
</template>
</vxe-modal>
<vxe-modal v-model="dialogVisible2" width="1200" title="导入文件">
<template #default>
<el-row class="query_wrapper">
<el-row>
<el-button style="margin-right: 10px;" size="small" type="success" @click="submitUpload2"></el-button>
</el-row>
</el-row>
<div class="mytable">
<vxe-table
border
show-header-overflow
show-overflow
height="500px"
align="center"
:data="tableupload2">
<vxe-column type="seq" width="50"></vxe-column>
<vxe-column field="tzmc" title="图纸名称" width="300"></vxe-column>
</vxe-table>
</div>
</template>
</vxe-modal>
<!-- <vxe-modal v-model="dialogVisible2" width="1200" title="导入文件">-->
<!-- <template #default>-->
<!-- <el-row class="query_wrapper">-->
<!-- <el-row>-->
<!-- <el-button style="margin-right: 10px;" size="small" type="success" @click="submitUpload2"></el-button>-->
<!-- </el-row>-->
<!-- </el-row>-->
<!-- <div class="mytable">-->
<!-- <vxe-table-->
<!-- border-->
<!-- show-header-overflow-->
<!-- show-overflow-->
<!-- height="500px"-->
<!-- align="center"-->
<!-- :data="tableupload2">-->
<!-- <vxe-column type="seq" width="50"></vxe-column>-->
<!-- <vxe-column field="tzmc" title="图纸名称" width="300"></vxe-column>-->
<!-- </vxe-table>-->
<!-- </div>-->
<!-- </template>-->
<!-- </vxe-modal>-->
</el-container>
</template>
@ -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 rejectfunction(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") {

Loading…
Cancel
Save