diff --git a/src/views/energy/powerUse/Energystatistics/index.vue b/src/views/energy/powerUse/Energystatistics/index.vue index e3b2e3e..9707a0b 100644 --- a/src/views/energy/powerUse/Energystatistics/index.vue +++ b/src/views/energy/powerUse/Energystatistics/index.vue @@ -95,6 +95,16 @@ >导出 + + 补录 +
合计电量:
@@ -253,6 +263,36 @@ 取 消
+ + + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 + 下载模板 + +
+
+ +
+
@@ -321,21 +361,6 @@ export default { children: "children", label: "lable", }, - // 用户导入参数 - upload: { - // 是否显示弹出层(用户导入) - open: false, - // 弹出层标题(用户导入) - title: "", - // 是否禁用上传 - isUploading: false, - // 是否更新已经存在的用户数据 - updateSupport: 0, - // 设置上传的请求头部 - headers: { Authorization: "Bearer " + getToken() }, - // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/system/user/importData", - }, // 查询参数 queryParams: { pageNum: NaN, @@ -409,6 +434,19 @@ export default { }, // 合计电量 number: "", + upload: { + // 是否显示弹出层 + open: false, + // 弹出层标题 + title: "", + // 是否禁用上传 + isUploading: false, + // 设置上传的请求头部 + headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()}, + // 上传的地址 + importUrl: process.env.VUE_APP_BASE_API + "/energy/report/analysis/energyImport", + templateUrl:"" + } }; }, watch: { @@ -635,6 +673,27 @@ export default { handleExport() { handleExport("bootstrap-table", "能耗统计", true); }, + + // 导入-下载模板 + importTemplate() { + this.download('/energy/report/analysis/energyTemplate', {}, `能耗补录模版_${new Date().getTime()}.xlsx`) + }, + + // 导入-文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 导入-文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert("
" + response.msg + "
", "导入结果", {dangerouslyUseHTMLString: true}); + this.getList(); + }, + submitImport(){ + this.$refs.upload.submit(); + } }, };