master
xhj 5 months ago
parent d43a3e8319
commit 2a27232719

@ -91,6 +91,7 @@
<!-- @click="bomClick"-->
<!-- >生成bom</el-button>-->
<div style="float: right;" >
<el-upload
ref="upload"
action=""
@ -102,7 +103,7 @@
:directory="true"
:show-file-list="false"
>
<el-button type="primary" @click="handleAddFolder"></el-button>
<el-button type="primary" @click="handleAddFolder"> </el-button>
</el-upload>
@ -153,7 +154,7 @@
</el-container>
</el-container>
<!-- 弹出层-->
<vxe-modal v-model="dialogVisible" width="1200" title="导入文件">
<vxe-modal v-model="dialogVisible" width="1200" title="导入文件" @close="handleClose">
<template #default>
@ -1023,17 +1024,24 @@ export default {
// this.xclqList=[],
// this.bctjList=[],
// this.xctjList=[],
this.tltList=[],
this.tltList2=[],
this.tltList=[]
this.tltList2=[]
// this.ljList=[],
this.tableupload=[],
this.tableupload=[]
this.$refs.upload.clearFiles()
this.$nextTick(() => {
// if (this.queryParam.dcch === ''|| this.queryParam.dcpl === '' ) {
// this.filedis=true
// this.$message.error(' ')
// }else{
this.$refs.upload.clearFiles()
this.filedis=false
this.tltList=[]
this.tltList2=[]
// this.ljList=[],
this.tableupload=[]
this.fileList=[]
this.fileList2=[]
this.$refs.upload.$children[0].$refs.input.webkitdirectory = true
// }
@ -1057,6 +1065,8 @@ export default {
this.dialogVisible2=true;
},
handleChange(file, fileList) {
console.log(fileList)
console.log(file)
this.fileList = fileList
const bcph=""
if (file.name.includes(".BC")||file.name.includes(".LST")||file.name.includes(".XC") || file.name.includes(".txt") ){
@ -1126,17 +1136,17 @@ export default {
// else
// //pdf 20240530
//
if ( file.name.includes('.pdf') ) {
else if ( file.name.includes('.pdf') ) {
this.tltList2.push(file)
let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"数控套料图",name:file.name,sort:7}
let a={czbh:'',ph:'',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') ) {
else if ( file.name.includes('.QG') ) {
this.tltList2.push(file)
let a={czbh:this.czbhu,ph:this.phu,type:"",stype:"切割文件",name:file.name,sort:8}
let a={czbh:'',ph:'',type:"",stype:"切割文件",name:file.name,sort:8}
this.tableupload.push(a);
this.tableupload.sort((a,b)=>{
return( a.sort - b.sort)
@ -1224,11 +1234,12 @@ export default {
formData.append('isupload', '01')
uploadBom(formData).then(res=>{
this.tltList2=[]
if (res.data.zt == "01") {
this.dialogVisible=false;
this.tableData=res.data.data;
this.$message.success('上传成功');
this.$refs.upload.clearFiles()
} else if (res.data.zt == "02") { //
this.$alert('该批量已导入数据,是否重新导入并覆盖该批量数据?', '提示', {
confirmButtonText: '确定',
@ -1242,7 +1253,7 @@ export default {
this.$message({ message: '导入成功', type: 'success' })
this.dialogVisible=false;
this.tableData=res.data.data;
this.tableupload=[]
//this.tableupload=[]
// if (res.data.zt == "01") {
// this.$message({ message: '', type: 'success' })
// this.dialogVisible=false;
@ -1257,9 +1268,12 @@ export default {
//fixme
//this.$message.error('PDF');
}
this.fileList = []
this.tltList=[]
})
this.fileList = []
this.tltList=[]
this.tltList2=[]
this.tableupload=[]
//ajax
},
@ -1304,6 +1318,16 @@ export default {
})
},
handleClose(){
console.log("1");
console.log(this.fileList)
this.fileList=[];
this.uploadData=[];
console.log("1");
console.log(this.fileList)
console.log(this.uploadData)
location.reload();
},
initList() {
// if (this.queryParam.dcch === '') {
// this.$message.warning('')

Loading…
Cancel
Save