|
@@ -103,9 +103,9 @@
|
|
|
<a-button type="primary" @click="openEnclosure">附件</a-button>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="8" class="noprint">
|
|
|
- <a-upload :file-list="fileList" :multiple="true" :action="importExcelUrl" :data="{code:this.planNO}" :customRequest="uploadFlie" :remove="removeFile">
|
|
|
+ <a-upload name="file" :showUploadList="true" :file-list="fileList" :multiple="true" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel" :data="{code:this.planNO,name:this.fileName}" :beforeUpload="uploadFlie" :remove="removeFile">
|
|
|
<a-button type="primary" >附件上传</a-button>
|
|
|
- </a-upload>
|
|
|
+ </a-upload>
|
|
|
<!-- <j-upload v-model="fabricLoss.attachs" ></j-upload> -->
|
|
|
<!-- <a-upload name="file" action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :multiple="true" :default-file-list="fileList">
|
|
|
<a-button type="primary" >附件上传</a-button>
|
|
@@ -509,6 +509,7 @@ export default {
|
|
|
},
|
|
|
fileList: [
|
|
|
],
|
|
|
+ fileName:'',
|
|
|
edit:'0',
|
|
|
planNO:'',//计划单号
|
|
|
isView:false,//是否查看状态
|
|
@@ -807,24 +808,21 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
uploadFlie(file) {
|
|
|
- fileDetail({code:this.planNO,name:file.file.name}).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success('上传成功');
|
|
|
- this.message = res.message.split(';').filter((element) => {
|
|
|
- return element !== "";
|
|
|
- });
|
|
|
- this.file = file
|
|
|
- this.fileList.push({
|
|
|
- uid: '-1',
|
|
|
- name: file.file.name,
|
|
|
- status: 'done',
|
|
|
- url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+file.file.name
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.loading = false
|
|
|
- this.$message.error(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
+ this.fileName = file.name
|
|
|
+ // fileDetail({code:this.planNO,name:file.file.name}).then(res => {
|
|
|
+ // if (res.success) {
|
|
|
+ // this.$message.success('上传成功');
|
|
|
+ // this.fileList.push({
|
|
|
+ // uid: '-1',
|
|
|
+ // name: file.file.name,
|
|
|
+ // status: 'done',
|
|
|
+ // url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+file.file.name
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+ // this.loading = false
|
|
|
+ // this.$message.error(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
// const formData = new FormData()
|
|
|
// formData.append('file', file.file)
|
|
|
},
|