linwenling
2023-09-26 3e177af9004b9d5d5b5fc9b6c5fb393d6f61b377
家庭资产管理导入导出成功
1个文件已修改
17 ■■■■■ 已修改文件
ruoyi-ui/src/views/note/index.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/note/index.vue
@@ -125,7 +125,7 @@
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          @click="handleExportTemplate"
          v-hasPermi="['family:note:export']"
        >导入模板下载</el-button>
      </el-col>
@@ -341,6 +341,7 @@
//在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'],
@@ -670,7 +671,12 @@
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    //导入模板
    handleExportTemplate(){
      this.download('/family/property/model', {
      }, `property${new Date().getTime()}.xlsx`)
    },
    /** 导出按钮操作 */
    handleExport() {
      const Ids = this.ids;
@@ -686,24 +692,23 @@
        }, `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>