|
@@ -103,7 +103,7 @@
|
|
|
<a-button type="primary" @click="openEnclosure">附件</a-button>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="8" class="noprint">
|
|
|
- <a-upload name="file" :showUploadList="true" :file-list="fileList" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel" :data="{code:this.planNO,name:this.fileName}" :customRequest="uploadFlie" :remove="removeFile">
|
|
|
+ <a-upload productName="file" :showUploadList="true" :file-list="fileList" :headers="tokenHeader" :multiple="false" :action="importExcelUrl" @change="handleImportExcel" :data="{code:this.planNO,name:this.fileName}" :beforeUpload="uploadFlie" :remove="removeFile">
|
|
|
<a-button type="primary" >附件上传</a-button>
|
|
|
</a-upload>
|
|
|
<!-- <j-upload v-model="fabricLoss.attachs" ></j-upload> -->
|
|
@@ -809,19 +809,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
uploadFlie(file) {
|
|
|
- this.fileName = file.file.name
|
|
|
- fileDetail({code:this.planNO,name:this.fileName}).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.onSearch(this.planNO,'0')
|
|
|
- }else{
|
|
|
- this.$message.error(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
+ this.fileName = file.name
|
|
|
+ // const formData = new FormData()
|
|
|
+ // formData.append('file',file.file)
|
|
|
+ // fileDetail({code:this.planNO,name:this.fileName}).then(res => {
|
|
|
+ // if (res.success) {
|
|
|
+ // this.onSearch(this.planNO,'0')
|
|
|
+ // }else{
|
|
|
+ // this.$message.error(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
handleImportExcel(data){
|
|
|
- // if(data.fileList.length>this.fileList.length){
|
|
|
- // this.fileList=data.fileList
|
|
|
- // }
|
|
|
+ if(data.fileList.length>this.fileList.length&&data.file.status=='uploading'){
|
|
|
+ this.onSearch(this.planNO,'0')
|
|
|
+ }
|
|
|
|
|
|
|
|
|
},
|