ソースを参照

考勤管理-导入-错误文件不显示

jingbb 1 年間 前
コミット
104dc080b8

+ 4 - 1
src/views/oa/salary_management/Attendance/modules/uploadModal.vue

@@ -36,7 +36,7 @@
                         </a-col>
                         <a-col :md="24">
                             <a-form-model-item label="文件" >
-                                <a-upload name="file" :multiple="false"  action="/jeecg-boot/salary/salaryAttendance/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'yearWithMonth':formState.yearWithMonth,'type':formState.type,'id':this.checked}"  :headers="tokenHeader" >
+                                <a-upload name="file" :multiple="false" :showUploadList="showUploadList" action="/jeecg-boot/salary/salaryAttendance/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'yearWithMonth':formState.yearWithMonth,'type':formState.type,'id':this.checked}"  :headers="tokenHeader" >
                                     <a-button> <a-icon type="upload" /> 上  传 </a-button>
                                 </a-upload>
                             </a-form-model-item>
@@ -67,6 +67,7 @@
                 type:'考勤表',
                 yearWithMonth:moment().subtract(1, 'months')
               },
+              showUploadList:true,
               dataSource: [{}],
               visible:false,
               loading:false,
@@ -98,10 +99,12 @@
             },
             handleUploadChange({ file, fileList }){
                 if (file.status === 'done'&&file.response.success) {
+                    this.showUploadList = true
                     this.$message.success(file.response.message)
                     this.$emit('ok')
                     this.handleCancel()
                 }else if(file.status === 'done'&&!file.response.success){
+                    this.showUploadList = false
                     this.$message.error(file.response.message)
                 }