master
xhj 5 months ago
parent d43a3e8319
commit 2a27232719

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

Loading…
Cancel
Save