src/views/reservation/resercopy/index.vue
@@ -208,6 +208,7 @@ <el-upload ref="upload" :limit="1" :key="uploadKey" accept=".xlsx, .xls" :headers="upload.headers" :data="data" @@ -437,7 +438,7 @@ } }; return { uploadKey: 0, leftList: "", isdisabled: true, setDisabled: { @@ -871,6 +872,10 @@ /** 导入按钮操作 */ handleImport() { if (this.objs.drugManufacturerId && this.objs.reservationTime) { // 清空组件内部状态(含已上传文件) this.$refs.upload?.clearFiles(); this.uploadKey = Date.now(); // 改变 key 强制重新渲染组件 // 同步数据源(Vue2 需用 $set 确保响应式) this.upload.title = "用户导入"; this.upload.open = true; } else {