能耗补录

master
FCD 2 weeks ago
parent 54fe4927cc
commit 240738c2d6

@ -95,6 +95,16 @@
>导出</el-button >导出</el-button
> >
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-upload2"
size="mini"
@click="upload.open = true"
>补录</el-button
>
</el-col>
<div class="total"> <div class="total">
<div class="number">合计电量:</div> <div class="number">合计电量:</div>
<div class="alltotal"> <div class="alltotal">
@ -253,6 +263,36 @@
<el-button @click="canceltwo"> </el-button> <el-button @click="canceltwo"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="'补录数据'" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.importUrl"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitImport"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -321,21 +361,6 @@ export default {
children: "children", children: "children",
label: "lable", 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: { queryParams: {
pageNum: NaN, pageNum: NaN,
@ -409,6 +434,19 @@ export default {
}, },
// //
number: "", 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: { watch: {
@ -635,6 +673,27 @@ export default {
handleExport() { handleExport() {
handleExport("bootstrap-table", "能耗统计", true); 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("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
submitImport(){
this.$refs.upload.submit();
}
}, },
}; };
</script> </script>

Loading…
Cancel
Save