标准预警导出功能

This commit is contained in:
yanyizhou
2021-12-09 17:07:14 +08:00
parent dd9290a165
commit a8680402a6
+51 -1
View File
@@ -113,6 +113,9 @@
</el-row>
</el-form>
</div>
<div style="float: right;margin: 0 3% 10px 0">
<el-button type="primary" size="mini" @click="exportExcelBtn">导出Excel</el-button>
</div>
<div class="content">
<!-- <el-divider content-position="left" class="dynamic-child-title">实施日期预警</el-divider>-->
<el-table
@@ -123,7 +126,13 @@
:resizable="false"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
v-loading="warningTableLoading"
@selection-change="selectChange"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column prop="standType" label="类型" width="100" align="center">
<template slot-scope="scope">
<div v-if="scope.row.sortName === 'BUSINESS_STAND'">企业标准</div>
@@ -199,17 +208,33 @@
</div>
</div>
<adc-back-top scroll-bind="dynamicInformation"></adc-back-top>
<!--导出模态框区域-->
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="300px">
<el-form :inline="true" class="label-input-form search-area">
<el-form-item label="导出名称" class="search-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称"/>
</el-form-item>
</el-form>
<span slot="footer" class="demo-drawer-footer">
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="cancal">取消</el-button>
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check"
@click="exportExcel">提交</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {mapMutations} from "vuex";
import {interfaceUrl} from "@/sysConfig";
export default {
name: "standardWarning",
data() {
return {
//
selectedList: [],
exportName: '',
exportModelFlag: false,
warningTableDatas:[],
warningTableHeight: '',
applyArcticOptions: [], // 适用车型下拉框
@@ -259,6 +284,31 @@ export default {
};
},
methods: {
//取消导出
cancal() {
this.exportModelFlag = false
},
//确认导出
exportExcel() {
console.log('293',this.selectedList)
const exportURL = interfaceUrl + 'sys/EarlyWarning/exportWarning?' +
'&ids=' + this.selectedList.join(',') + '&exportName=' + this.exportName
window.open(exportURL)
this.$message.success('导出信息成功')
this.exportModelFlag = false
},
exportExcelBtn(){
console.log('302',this.selectedList)
this.exportName = ''
this.exportModelFlag = true
},
selectChange(alldata){
console.log('307',alldata)
this.selectedList = []
for (let i = 0; i < alldata.length; i++) {
this.selectedList.push(alldata[i]['id'])
}
},
// 获取标准预警数据 (type用于区别分页器切换)
getEarlyDate() {
this.warningTableLoading = true