|
@@ -32,18 +32,19 @@
|
|
|
<div class="PeriodBtn">
|
|
|
<btns
|
|
|
:showImport="false"
|
|
|
+ :showExport="false"
|
|
|
:showSave="false"
|
|
|
:showAdd="false"
|
|
|
:showDelete="false"
|
|
|
:disDelete="changeDateSelect.length === 0"
|
|
|
- :disExport="true"
|
|
|
+ @handleExport="exportDataMsg"
|
|
|
></btns>
|
|
|
</div>
|
|
|
<div class="evaluationReportTableData">
|
|
|
<el-table :data="evaluationReportData" style="width: 100%" @select="rowClick" @select-all="rowClick">
|
|
|
<el-table-column type="selection" label="操作" align="center"></el-table-column>
|
|
|
- <el-table-column label="业务编号" prop="responsibilityCode" width="300" />
|
|
|
- <el-table-column label="考评单位" prop="organizationName" width="330" />
|
|
|
+ <el-table-column label="报告名称" prop="evaluateReportName" width="330" />
|
|
|
+ <el-table-column label="业务属性" prop="binSectionName" />
|
|
|
<el-table-column label="业务类别">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.checkCycle === 'YDKP'" style="font-size: 12px;">月度考评</span>
|
|
@@ -53,7 +54,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="年度" prop="year" />
|
|
|
<el-table-column label="月度/季度" prop="month" />
|
|
|
- <el-table-column label="业务属性" prop="binsection" />
|
|
|
<el-table-column label="业务简述" prop="des" />
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
@@ -71,15 +71,20 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <evaluation-report-table ref="reportTable"></evaluation-report-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import btns from '../elbuttonS.vue'
|
|
|
-import {apiGetdeptresponsibilityList, apiGetdatadictionaryList, apiGetbinsectionList} from '../../api/api'
|
|
|
+import ExcelJS from 'exceljs'
|
|
|
+import fileSave from 'file-saver'
|
|
|
+import evaluationReportTable from './evaluationReportTable.vue'
|
|
|
+import {apiGetEvalReportList, apiGetdatadictionaryList, apiGetbinsectionList} from '../../api/api'
|
|
|
export default {
|
|
|
components: {
|
|
|
- btns
|
|
|
+ btns,
|
|
|
+ evaluationReportTable
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -107,14 +112,13 @@ export default {
|
|
|
let that = this
|
|
|
let params = {
|
|
|
pageNum: that.page.currentPage,
|
|
|
- pageSize: that.page.pagesize,
|
|
|
- chechCycle: 'NDKP'
|
|
|
+ pageSize: that.page.pagesize
|
|
|
}
|
|
|
if (type) {
|
|
|
params.responsibilityCode = that.rescode
|
|
|
params.des = that.resDes
|
|
|
}
|
|
|
- apiGetdeptresponsibilityList(params).then(datas =>{
|
|
|
+ apiGetEvalReportList(params).then(datas =>{
|
|
|
if (datas && datas.data) {
|
|
|
that.evaluationReportData = datas.data.records
|
|
|
that.page.total = datas.data.total
|
|
@@ -143,7 +147,7 @@ export default {
|
|
|
},
|
|
|
//明细
|
|
|
getDetail(row) {
|
|
|
- this.$refs.startFromDetail.init(row)
|
|
|
+ this.$refs.reportTable.init(row)
|
|
|
},
|
|
|
getSeachData() {
|
|
|
this.page.currentPage = 1
|
|
@@ -166,6 +170,64 @@ export default {
|
|
|
rowClick(selection, row) {
|
|
|
this.changeDateSelect = selection
|
|
|
},
|
|
|
+ exportDataMsg() {
|
|
|
+ let data = this.evaluationReportData //接口返回数据
|
|
|
+ let col = [
|
|
|
+ { name: '报告名称'},
|
|
|
+ { name: '业务属性'},
|
|
|
+ { name: '考评周期'},
|
|
|
+ { name: '年'},
|
|
|
+ { name: '月'}
|
|
|
+ ]
|
|
|
+ let colEn = ['evaluateReportName', 'binSectionName', 'checkCycle', 'year', 'month']
|
|
|
+ let rowData = []
|
|
|
+ for(let i =0; i<data.length; i++) {
|
|
|
+ let item = data[i]
|
|
|
+ let arr = []
|
|
|
+ for(let j =0; j<colEn.length; j++) {
|
|
|
+ let it = colEn[j]
|
|
|
+ arr.push(item[it])
|
|
|
+ }
|
|
|
+ rowData.push(arr)
|
|
|
+ }
|
|
|
+ const workbook = new ExcelJS.Workbook()
|
|
|
+ const worksheet = workbook.addWorksheet('Sheet1')
|
|
|
+ //定义表格标题
|
|
|
+ const Targetrow = worksheet.getRow(1);
|
|
|
+ Targetrow.height = 30;
|
|
|
+ const Targetcell = worksheet.getCell(`A1`);
|
|
|
+ worksheet.mergeCells(`A1:E1`);
|
|
|
+ Targetcell.value = `测试表格`;
|
|
|
+ Targetcell.font = { name: "宋体", family: 4, size: 11, bold: true }; // 字体
|
|
|
+ Targetcell.alignment = { vertical: "middle", horizontal: "center" }; //对齐
|
|
|
+
|
|
|
+ worksheet.columns = [
|
|
|
+ { header: '月份', key: 'name', width: 24 },
|
|
|
+ { header: '合计', key: 'statistic', width: 24 },
|
|
|
+ { header: '一月', key: 'january' },
|
|
|
+ { header: '二月', key: 'february' },
|
|
|
+ { header: '三月', key: 'march' },
|
|
|
+ { header: '四月', key: 'april' },
|
|
|
+ { header: '五月', key: 'may' },
|
|
|
+ { header: '六月', key: 'june' },
|
|
|
+ { header: '七月', key: 'july' },
|
|
|
+ { header: '八月', key: 'august' },
|
|
|
+ { header: '九月', key: 'september' },
|
|
|
+ { header: '十月', key: 'october' },
|
|
|
+ { header: '十一月', key: 'november' },
|
|
|
+ { header: '十二月', key: 'december' }
|
|
|
+ ]
|
|
|
+ worksheet.getRow(1).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`)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|