|
@@ -23,10 +23,20 @@
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <div class="detaTableBtns">
|
|
|
|
+ <div class="tableBtn import" @click="handleImport">
|
|
|
|
+ <img :src="importIcon" alt="">
|
|
|
|
+ <span>导入</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="tableBtn export" @click="handleExport">
|
|
|
|
+ <img :src="exportIcon" alt="">
|
|
|
|
+ <span>导出</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
<el-tab-pane label="权重分配" name="first">
|
|
<el-tab-pane label="权重分配" name="first">
|
|
<!-- @select="rowClick" @select-all="rowClick" -->
|
|
<!-- @select="rowClick" @select-all="rowClick" -->
|
|
- <el-table :data="weightAllocation" style="width: 100%">
|
|
|
|
|
|
+ <el-table :data="weightAllocation" style="width: 100%" ref="report-table_day">
|
|
<!-- <el-table-column type="selection" label="操作" align="center"></el-table-column> -->
|
|
<!-- <el-table-column type="selection" label="操作" align="center"></el-table-column> -->
|
|
<el-table-column type="index" label="序号" width="80" />
|
|
<el-table-column type="index" label="序号" width="80" />
|
|
<el-table-column label="考评单位" prop="organizationName" width="300"/>
|
|
<el-table-column label="考评单位" prop="organizationName" width="300"/>
|
|
@@ -49,7 +59,7 @@
|
|
<el-table-column label="K4" prop="k4" />
|
|
<el-table-column label="K4" prop="k4" />
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="K" prop="k" />
|
|
<el-table-column label="K" prop="k" />
|
|
- <el-table-column label="填报人" prop="createBy" />
|
|
|
|
|
|
+ <el-table-column label="填报人" prop="createName" />
|
|
<el-table-column label="填报日期" prop="createTime" width="160" />
|
|
<el-table-column label="填报日期" prop="createTime" width="160" />
|
|
</el-table>
|
|
</el-table>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
@@ -62,16 +72,24 @@
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <import-dailog ref="importPage" @successImport="successImport"></import-dailog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import importDailog from '../importPage/importDailog.vue'
|
|
import {apigetyeargroupcoefficientlistById} from '../../api/api'
|
|
import {apigetyeargroupcoefficientlistById} from '../../api/api'
|
|
-import addIcon from '../../assets/btnIcon/add.png'
|
|
|
|
-import saveIcon from '../../assets/btnIcon/save.png'
|
|
|
|
-import editIcon from '../../assets/btnIcon/edit.png'
|
|
|
|
-import deleteIcon from '../../assets/btnIcon/delete.png'
|
|
|
|
|
|
+import exportIcon from '../../assets/btnIcon/export.png'
|
|
|
|
+import importIcon from '../../assets/btnIcon/import.png'
|
|
|
|
+import ExcelJS from 'exceljs'
|
|
|
|
+import fileSave from 'file-saver'
|
|
|
|
+import * as XLSX from 'xlsx'
|
|
|
|
+import { saveAs } from 'file-saver'
|
|
|
|
+import * as XLSXD from 'xlsx-js-style'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ importDailog
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
@@ -84,10 +102,8 @@ export default {
|
|
des: '',
|
|
des: '',
|
|
year: '',
|
|
year: '',
|
|
},
|
|
},
|
|
- addIcon: addIcon,
|
|
|
|
- saveIcon: saveIcon,
|
|
|
|
- editIcon: editIcon,
|
|
|
|
- deleteIcon: deleteIcon,
|
|
|
|
|
|
+ exportIcon: exportIcon,
|
|
|
|
+ importIcon: importIcon,
|
|
rowMsg: {},
|
|
rowMsg: {},
|
|
weightAllocation: []
|
|
weightAllocation: []
|
|
}
|
|
}
|
|
@@ -123,6 +139,91 @@ export default {
|
|
that.weightAllocation = datas.data.coefficientList
|
|
that.weightAllocation = datas.data.coefficientList
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ handleImport() {
|
|
|
|
+ this.$refs.importPage.upload.title = "业绩考核系数信息导入"
|
|
|
|
+ this.$refs.importPage.upload.open = true
|
|
|
|
+ this.$refs.importPage.upload.url = '/year-operating-coefficient/import'
|
|
|
|
+ },
|
|
|
|
+ successImport(val) {
|
|
|
|
+ this.getDetails(this.rowMsg.id)
|
|
|
|
+ },
|
|
|
|
+ handleExport() {
|
|
|
|
+ let data = [] //接口返回数据
|
|
|
|
+ data = this.weightAllocation
|
|
|
|
+ const workbook = new ExcelJS.Workbook()
|
|
|
|
+ const worksheet = workbook.addWorksheet('Sheet1')
|
|
|
|
+ //根据数据自己调整
|
|
|
|
+ worksheet.columns = [
|
|
|
|
+ { header: 'ID', key: 'id', width: 26 },
|
|
|
|
+ { header: '考评单位', key: 'organizationName', width: 26 },
|
|
|
|
+ { header: '资产管理系数', key: 'zzc', width: 18},
|
|
|
|
+ { header: '', key: 'k1', width: 18 },
|
|
|
|
+ { header: '幅度管理系数', key: 'jzs', width: 18 },
|
|
|
|
+ { header: '', key: 'k2', width: 18 },
|
|
|
|
+ { header: '效益贡献系数', key: 'zmlrze', width: 18 },
|
|
|
|
+ { header: '', key: 'fdl', width: 18 },
|
|
|
|
+ { header: '', key: 'ddlr', width: 18 },
|
|
|
|
+ { header: '', key: 'k3', width: 18 },
|
|
|
|
+ { header: '定员管理系数', key: 'dy', width: 18 },
|
|
|
|
+ { header: '', key: 'k4', width: 18 },
|
|
|
|
+ { header: 'K', key: 'k', width: 26 },
|
|
|
|
+ { header: '填报人', key: 'createName', width: 26 },
|
|
|
|
+ { header: '填报日期', key: 'createTime', width: 26 },
|
|
|
|
+ ]
|
|
|
|
+ worksheet.getColumn(3).values = ['资产管理系数', '资产总额'];
|
|
|
|
+ worksheet.getColumn(4).values = ['', 'K1'];
|
|
|
|
+ worksheet.getColumn(5).values = ['幅度管理系数', '机组'];
|
|
|
|
+ worksheet.getColumn(6).values = ['', 'K2'];
|
|
|
|
+ worksheet.getColumn(7).values = ['效益贡献系数', '账面利润总额'];
|
|
|
|
+ worksheet.getColumn(8).values = ['', '发电量'];
|
|
|
|
+ worksheet.getColumn(9).values = ['', '度电利润'];
|
|
|
|
+ worksheet.getColumn(10).values = ['', 'K3'];
|
|
|
|
+ worksheet.getColumn(11).values = ['定员管理系数', '定员'];
|
|
|
|
+ worksheet.getColumn(12).values = ['', 'K4'];
|
|
|
|
+ //合并单元格
|
|
|
|
+ worksheet.mergeCells('A1:A2');
|
|
|
|
+ worksheet.mergeCells('B1:B2');
|
|
|
|
+ worksheet.mergeCells('C1:D1');
|
|
|
|
+ worksheet.mergeCells('E1:F1');
|
|
|
|
+ worksheet.mergeCells('G1:H1:I1:G1');
|
|
|
|
+ worksheet.mergeCells('K1:L1');
|
|
|
|
+ worksheet.mergeCells('M1:M2');
|
|
|
|
+ worksheet.mergeCells('N1:N2');
|
|
|
|
+ worksheet.mergeCells('O1:O2');
|
|
|
|
+ worksheet.getRow(1).font = {
|
|
|
|
+ size: 12,
|
|
|
|
+ bold: true
|
|
|
|
+ }
|
|
|
|
+ worksheet.getRow(2).font = {
|
|
|
|
+ size: 12,
|
|
|
|
+ bold: true
|
|
|
|
+ }
|
|
|
|
+ worksheet.addRows(data)
|
|
|
|
+
|
|
|
|
+ workbook.xlsx.writeBuffer().then(buffer => {
|
|
|
|
+ //这里为type
|
|
|
|
+ const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
|
|
|
|
+ fileSave(blob, `数据导出.xlsx`)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ exportExcel() {
|
|
|
|
+ let $e = this.$refs['report-table_day'].$el
|
|
|
|
+ try {
|
|
|
|
+ let $table = $e.querySelector('.el-table__fixed')
|
|
|
|
+ if(!$table) {
|
|
|
|
+ $table = $e
|
|
|
|
+ }
|
|
|
|
+ const wb = XLSX.utils.table_to_book($table, {raw:true})
|
|
|
|
+
|
|
|
|
+ const wbout = XLSXD.write(wb, {bookType: 'xlsx', bookSST:true, type: 'array'})
|
|
|
|
+ saveAs(
|
|
|
|
+ new Blob([wbout],{type: 'application/octet-stream'}),
|
|
|
|
+ `权重分配数据导出.xlsx`,
|
|
|
|
+ )
|
|
|
|
+ } catch (e) {
|
|
|
|
+ if (typeof console !== 'undefined') console.error(e)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -148,7 +249,6 @@ export default {
|
|
border: 1px solid #D6DBEA;
|
|
border: 1px solid #D6DBEA;
|
|
padding: 10px 20px;
|
|
padding: 10px 20px;
|
|
border-radius: 10px;
|
|
border-radius: 10px;
|
|
- margin-bottom: 20px;
|
|
|
|
.danjuMsg_data{
|
|
.danjuMsg_data{
|
|
padding: 5px 0 10px 0;
|
|
padding: 5px 0 10px 0;
|
|
.data_tit{
|
|
.data_tit{
|
|
@@ -180,6 +280,39 @@ export default {
|
|
.el-select, .el-input{
|
|
.el-select, .el-input{
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
+ .detaTableBtns{
|
|
|
|
+ display: flex;
|
|
|
|
+ width: 200px;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 32px;
|
|
|
|
+ left: 88vw;
|
|
|
|
+ z-index: 11111;
|
|
|
|
+ .tableBtn {
|
|
|
|
+ display: flex;
|
|
|
|
+ margin-right: 30px;
|
|
|
|
+ img{
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ margin-top: 1px;
|
|
|
|
+ }
|
|
|
|
+ span{
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .import{
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ span{
|
|
|
|
+ color: #ce1e78;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .export{
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ span{
|
|
|
|
+ color: #2baa8a;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.el-tabs{
|
|
.el-tabs{
|
|
.el-tabs__header{
|
|
.el-tabs__header{
|
|
.el-tabs__nav{
|
|
.el-tabs__nav{
|