| | |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | @click="handleExportTemplate" |
| | | v-hasPermi="['family:note:export']" |
| | | >导入模板下载</el-button> |
| | | </el-col> |
| | |
| | | |
| | | //在system/note/index.js中导入接口函数 |
| | | import {listProperty,enload, getPropertyInfo, delProperty, getCategory, addProperty, uploadPic} from "@/api/note/index"; |
| | | import {Message} from "element-ui"; |
| | | export default { |
| | | name: "Role", |
| | | dicts: ['sys_normal_disable'], |
| | |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }, |
| | | //导入模板 |
| | | handleExportTemplate(){ |
| | | this.download('/family/property/model', { |
| | | |
| | | }, `property${new Date().getTime()}.xlsx`) |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | const Ids = this.ids; |
| | |
| | | }, `property_${new Date().getTime()}.xlsx`) |
| | | } |
| | | }, |
| | | |
| | | /** 导入操作*/ |
| | | handleEnport(params){ |
| | | var file = params.file; |
| | | var formData = new FormData(); |
| | | formData.append('excelImport', file); |
| | | let _this = this |
| | | alert(file) |
| | | |
| | | enload(formData).then(response => { |
| | | _this.getList(); |
| | | Message({ message: "导入成功", type: 'warning' }) |
| | | |
| | | }).catch(err) |
| | | { |
| | | Message({ message: "导入失败", type: 'error' }) |
| | | } |
| | | }).catch(() => { Message({ message: "导入失败", type: 'error' })}); |
| | | |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
| | | <style> |