Browse Source

项目分类统计

dev
jiangyy 4 years ago
parent
commit
b7d719a674
  1. 433
      epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/classifyList.vue
  2. 373
      epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/projectDetail.vue
  3. 461
      epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/projectList.vue

433
epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/classifyList.vue

@ -0,0 +1,433 @@
<template>
<div>
<div v-if="flag==='classify'">
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-demo__demo}">
<el-form :inline="true"
:model="tableParams"
@keyup.enter.native="loadTable()">
<div>
<el-form-item label="所属组织"
:label-width="labelWidth">
<el-cascader ref="myCascader"
v-model="agencyIdArray"
style="width:480px"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
@change="handleChange"
clearable></el-cascader>
</el-form-item>
<div>
<el-form-item label="统计类型"
:label-width="labelWidth">
<el-radio v-model="staticType"
label="end">截止累计值</el-radio>
<el-radio v-model="staticType"
label="Interval">区间新增值</el-radio>
<el-date-picker style="margin-left:30px"
v-if="staticType==='Interval'"
v-model="timeArray"
type="daterange"
range-separator="至"
@change="handleTimeChange"
format="yyyy-MM-dd"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-date-picker style="margin-left:30px"
v-if="staticType==='end'"
v-model="endTimeModel"
@change="handleEndTimeChange"
:picker-options="pickerOptions"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-left:10px">
<el-button @click="loadTable()"
type="primary">查询</el-button>
</el-form-item>
<el-form-item style="margin-left:10px">
<el-button @click="loadOutTableData()"
type="primary">导出</el-button>
</el-form-item>
</div>
</div>
</el-form>
<el-table :data="tableData"
ref="ref_table"
style="width: 100%;margin-bottom: 20px;"
row-key="categoryCode"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column prop="categoryName"
label="所属类别"
min-width="280px"
header-align="center">
</el-table-column>
<el-table-column prop="projectTotal"
label="项目总数"
header-align="center"
align="center"
min-width="180px">
<template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;"
size="small"
@click="handleToProjectList(scope.row,'all')">{{scope.row.projectTotal}}</el-button>
</template>
</el-table-column>
<el-table-column prop="totalRatio"
header-align="center"
align="center"
min-width="180px"
label="项目总数占比">
</el-table-column>
<el-table-column prop="closedProjectTotal"
header-align="center"
align="center"
min-width="180px"
label="结案项目数">
<template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;"
size="small"
@click="handleToProjectList(scope.row,'closed')">{{scope.row.projectTotal}}</el-button>
</template>
</el-table-column>
<el-table-column prop="closedRatio"
header-align="center"
align="center"
min-width="180px"
label="项目结案率">
</el-table-column>
</el-table>
</div>
</el-card>
</div>
<project-list ref="ref_projectList"
v-if="flag==='project'"
@back="backToClassify"></project-list>
</div>
</template>
<script>
import util from '@js/util.js';
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import ProjectList from "./projectList"
let loading //
export default {
data () {
return {
flag: "classify",//
tableData: [],
downloadLoading: false,
//
labelWidth: '70px',
casOptions: [],
agencyIdArray: [],
selAgencyObj: {},
iscascaderShow: 0,
optionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
pickerOptions: { //
disabledDate (time) {
return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000))
}
},
staticType: 'end',
tableParams: {
orgId: '', //ID
orgType: '', // agencygrid
startTime: '', //yyyymmdd ,
endTime: '', //yyyymmdd,
},
timeArray: ['', ''],
//
agencyName: '',
startTimeShow: '',//
endTimeShow: '', //
endTimeModel: new Date() - 60 * 60 * 24 * 2,
}
},
mounted () {
this.customerId = localStorage.getItem('customerId')
this.initData()
},
methods: {
async initData () {
this.startLoading()
this.initDate()
await this.getAgencylist()//
await this.loadTable()//
this.endLoading()
},
async getAgencylist () {
const url = '/gov/org/customeragency/orgtree'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist'
const params = {
customerId: this.customerId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
this.tableParams.orgId = ''
if (data) {
this.casOptions.push(data)
}
} else {
this.$message.error(msg)
}
},
async loadTable () {
if (this.validate()) {
// const url = '/data/report/screenproject/selectprojectcategory'
const url = 'http://yapi.elinkservice.cn/mock/102/data/report/screenproject/selectprojectcategory'
if (this.staticType === 'end') {
this.tableParams.startTime = ''
}
const { data, code, msg } = await requestPost(url, this.tableParams)
if (code === 0) {
this.tableData = data
} else {
this.$message.error(msg)
}
}
},
//
handleToProjectList (row, type) {
this.flag = "project"
this.$nextTick(() => {
this.$refs.ref_projectList.initData(this.agencyIdArray, row, type, this.casOptions, this.selAgencyObj)
})
},
//
backToClassify () {
this.flag = "classify"
},
handleChange (value) {
if (value && value.length > 0) {
this.selAgencyObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.tableParams.orgId = this.selAgencyObj.agencyId
this.tableParams.orgType = this.selAgencyObj.level
this.agencyName = this.selAgencyObj.agencyName
} else {
this.selAgencyObj = {}
this.tableParams.orgId = ''
this.tableParams.orgType = ''
this.agencyName = ''
}
},
initDate () {
//
const date = new Date()
const month = date.getMonth() + 1 > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)
const day = date.getDate() - 1 > 9 ? (date.getDate() - 1) : '0' + (date.getDate() - 1)
const yesterday = date.getFullYear() + '-' + month + '-' + day
this.timeArray = ['', yesterday]
this.endTimeModel = yesterday
let yesterdayArray = yesterday.split('-')
this.tableParams.endTime = yesterdayArray[0] + yesterdayArray[1] + yesterdayArray[2]
this.endTimeShow = yesterdayArray[0] + '年' + yesterdayArray[1] + '月' + yesterdayArray[2] + '日'
},
handleEndTimeChange (item) {
if (item) {
const endTimeArray = util.dateFormatter(item, 'date').split('-')
this.tableParams.endTime = endTimeArray[0] + endTimeArray[1] + endTimeArray[2]
this.endTime = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日'
} else {
this.tableParams.endTime = ''
this.endTimeShow = ''
}
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.tableParams.startTime = startTimeArray[0] + startTimeArray[1] + startTimeArray[2]
this.tableParams.endTime = endTimeArray[0] + endTimeArray[1] + endTimeArray[2]
this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日'
this.endTimeShow = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日'
} else {
this.tableParams.startTime = ''
this.tableParams.endTime = ''
this.startTimeShow = ''
this.endTimeShow = ''
}
},
validate () {
if (this.staticType === 'end' && !this.tableParams.endTime) {
this.$message.info("请选择结束日期")
return false
}
return true
},
//
async loadOutTableData () {
if (!this.validate()) {
return false
}
let title = this.agencyName
if (this.staticType === 'Interval') {
title = title + ' ' + this.startTimeShow + '-' + this.endTimeShow + '区间增长值'
} else {
title = title + ' 截止至' + this.endTimeShow + '累计值'
}
console.log(title)
const url = "/data/report/screenproject/selectprojectcategory/export"
console.log(this.tableParams)
app.ajax.exportFilePost(
url,
this.tableParams,
(data, rspMsg) => {
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 100
},
...mapGetters(['clientHeight', 'env'])
},
components: {
ProjectList
},
activated () {
this.$nextTick(() => {
this.$refs.ref_table.doLayout() //
})
},
}
</script>
<style lang="css" scoped>
.myNote {
display: -webkit-box;
text-overflow: ellipsis;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* .register .el-table .el-table__header-wrapper {
position: absolute;
top: 0;
left: 0;
}*/
/*
.register .el-table .el-table__fixed-body-wrapper {
height: calc(100% - 44px);
margin-top: 44px;
overflow-y: auto !important;
} */
</style>

373
epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/projectDetail.vue

@ -0,0 +1,373 @@
<template>
<div>
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-demo__demo}">
<div class="div_info_item">
<span class="span_item_title">项目标题</span>
<span>{{info.projectTitle}}</span>
</div>
<div class="div_info_item">
<span class="span_item_title">项目内容</span>
<span v-if="info.projectContent">{{info.projectContent}}</span>
<span v-else></span>
</div>
<div class="div_info_item">
<span class="span_item_title">上报时间</span>
<span v-if="info.reportTime">{{info.reportTime}}</span>
<span v-else></span>
</div>
<div class="div_info_item">
<span class="span_item_title">上报人</span>
<span v-if="info.reportUserName">{{info.reportUserName}}</span>
<span v-else></span>
</div>
<div class="div_info_item">
<span class="span_item_title">电话</span>
<span v-if="info.mobile">{{info.mobile}}</span>
<span v-else></span>
</div>
<div class="div_info_item">
<span class="span_item_title">地点</span>
<span v-if="info.reportAddress">{{info.reportAddress}}</span>
<span v-else></span>
</div>
<div class="div_info_item">
<span class="span_item_title">所属分类</span>
<span v-if="info.categoryName">{{info.categoryName}}</span>
<span v-else></span>
</div>
</div>
<div class="div_process">
<div class="m-list"
v-show="info.processList.length>0">
<div class="title">处理进展</div>
<div class="list">
<div :class="['item',{'z-on': index===0}]"
v-for="(item,index) in info.processList"
:key="index">
<div class="name">{{ item.operationShow}}</div>
<div class="date">
<span>{{ item.reponseTime }}</span>
</div>
<div class="detail">
<span class="detail-field">处理部门</span>
<span class="detail-value">{{ item. handleDeptName }}</span>
</div>
<div class="detail">
<span class="detail-field">处理意见</span>
<span class="detail-value">
<span>{{ item.suggestion}}</span>
</span>
</div>
<div class="detail">
<el-upload class="upload-demo"
action=""
:on-preview="handleFileDownload"
:limit="50"
:file-list="fileList">
</el-upload>
<!-- <attachment-list list="{{item.attachments}}" /> -->
</div>
</div>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
let loading //
export default {
data () {
return {
projectId: "",//id
formData: {},
//
labelWidth: '100px',
info: {
projectTitle: "",//
projectId: "",//id
projectContent: "",//
imgList: "",//
reportTime: "",//;yyyy-MM-dd HH:mm
categoryName: "",//
reportUserId: "",//Id
reportUserRoleSet: "",//grid_member:
reportUserName: "",//-
mobile: "",//
reportAddress: "",//
processList: [],//
},
fileList: [
// {
// name: 'food.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }, {
// name: 'food2.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }
],
}
},
mounted () {
},
methods: {
async initData (projectId) {
this.startLoading()
this.projectId = projectId
await this.loadDetail()//
this.endLoading()
},
async loadDetail () {
const url = '/data/report/screen/project/projectdetailv2'
// const params = {
// projectId: this.projectId
// }
const params = {
projectId: "440dfb6f22d9860fb1c2d1fc044a901f"
}
const { data, code, msg } = await requestPost(url, params)
if (msg === "success" && code === 0 && data.length > 0) {
this.info = data[0]
// info = copyKeyHave(info, data[0]);
this.info.processList.forEach(element => {
//close; responseclosed_case退returntransfercreated
if (element.operation === 'close') {
element.operationShow = '关闭'
} else if (element.operation === 'response') {
element.operationShow = '回应'
} else if (element.operation === 'closed_case') {
element.operationShow = '结案'
} else if (element.operation === 'return') {
element.operationShow = '退回'
} else if (element.operation === 'transfer') {
element.operationShow = '部门流转'
} else if (element.operation === 'created') {
element.operationShow = '创建项目'
}
});
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 100
},
...mapGetters(['clientHeight', 'env'])
},
components: {},
activated () {
this.$nextTick(() => {
this.$refs.ref_table.doLayout() //
})
},
}
</script>
<style lang="scss" scoped>
.div_info_item {
line-height: 25px;
padding: 10px;
font-size: 15px;
display: flex;
.span_item_title {
flex: 0 0 100px;
text-align: right;
display: inline-block;
}
}
.div_process {
padding: 0 10px 10px 10px;
}
.m-list {
position: relative;
margin-top: 10px;
padding-bottom: 15px;
background-color: #ffffff;
.title {
line-height: 40px;
border-bottom: 1px solid #e7eeee;
font-size: 18px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.more-btn {
position: absolute;
z-index: 1;
top: 10px;
right: 10px;
line-height: 25px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(12, 74, 157, 1);
}
.list {
position: relative;
box-sizing: border-box;
margin-top: 15px;
margin-left: 25px;
padding: 0 0 0 15px;
border-left: 1px solid #e7eeee;
&::before {
content: "";
position: absolute;
z-index: 1;
display: block;
top: -1px;
left: -1px;
width: 2px;
height: 10px;
background-color: #ffffff;
}
.item {
position: relative;
z-index: 2;
margin-bottom: 5px;
padding-bottom: 5px;
border-bottom: 1px solid #e7eeee;
&::before {
content: "";
display: block;
position: absolute;
top: 9px;
left: -20px;
width: 10px;
height: 10px;
background: #999;
border-radius: 100%;
}
&.z-on {
&::before {
background: rgba(230, 0, 0, 1);
}
}
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.btn {
position: absolute;
top: 0;
right: 0;
width: 47px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255, 255, 255, 1);
border: 1px solid rgba(153, 153, 153, 1);
border-radius: 10px;
font-size: 13px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.name {
position: relative;
margin-bottom: 5px;
margin-left: -7px;
line-height: 25px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.date {
line-height: 20px;
font-size: 13px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.detail {
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
line-height: 25px;
.detail-field {
width: 22%;
text-align: justify;
text-align-last: justify;
color: rgba(153, 153, 153, 1);
}
.detail-value {
width: 78%;
color: #333333;
.detail-link {
display: inline;
color: #0c4a9d;
}
}
}
}
}
}
</style>

461
epmet-oper-web/src/views/modules/workPc/projectClassifyStatic/projectList.vue

@ -0,0 +1,461 @@
<template>
<div>
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-demo__demo}">
<el-form :inline="true"
:model="tableParams"
@keyup.enter.native="loadTable()">
<div>
<el-form-item style="margin-left:10px">
<el-button @click="handleBack()"
type="primary">返回</el-button>
</el-form-item>
<el-form-item label="所属组织"
:label-width="labelWidth">
<el-cascader ref="myCascader"
v-model="agencyIdArray"
style="width:480px"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
@change="handleChange"
clearable></el-cascader>
</el-form-item>
<div>
<el-form-item label="统计类型"
:label-width="labelWidth">
<el-radio v-model="staticType"
label="end">截止累计值</el-radio>
<el-radio v-model="staticType"
label="Interval">区间新增值</el-radio>
<el-date-picker style="margin-left:30px"
v-if="staticType==='Interval'"
v-model="timeArray"
type="daterange"
range-separator="至"
@change="handleTimeChange"
format="yyyy-MM-dd"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-date-picker style="margin-left:30px"
v-if="staticType==='end'"
v-model="endTimeModel"
@change="handleEndTimeChange"
:picker-options="pickerOptions"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-left:10px">
<el-button @click="loadTable()"
type="primary">查询</el-button>
</el-form-item>
<el-form-item style="margin-left:10px">
<el-button @click="loadOutTableData()"
type="primary">导出</el-button>
</el-form-item>
</div>
</div>
</el-form>
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="category"
label="类别"
min-width="180">
</el-table-column>
<el-table-column prop="projectTitle"
label="项目标题"
min-width="260">
</el-table-column>
<el-table-column prop="gridName"
label="所属网格"
min-width="240">
</el-table-column>
<el-table-column prop="projectStatus"
label="状态">
<template slot-scope="scope">
<span v-if="scope.row.projectStatus==='pending'"
style="color:#feb349;"
size="small">处理中</span>
<span v-if="scope.row.projectStatus==='closed'"
style="color:#00A7A9;"
size="small">已结案</span>
</template>
</el-table-column>
<el-table-column prop="createTime"
label="创建时间"
min-width="140">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
style="color:#D51010;"
size="small"
@click="handleDetail(scope.row)">查看详情</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="tableParams.pageNo"
:page-sizes="[20, 30, 50]"
:page-size="tableParams.pageSize"
layout="sizes, prev, pager, next"
:total="total">
</el-pagination>
</div>
</div>
</el-card>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="diaShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'项目详情'"
top="5vh"
width="50%"
@closed="diaClose">
<project-Detail ref="ref_projectDetail">
</project-Detail>
</el-dialog>
</div>
</template>
<script>
import util from '@js/util.js';
import ProjectDetail from "./projectDetail"
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
let loading //
export default {
data () {
return {
tableData: [],
downloadLoading: false,
//
labelWidth: '70px',
casOptions: [],
agencyIdArray: [],
selAgencyObj: {},
iscascaderShow: 0,
optionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
pickerOptions: { //
disabledDate (time) {
return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000))
}
},
staticType: 'end',
tableParams: {
status: '', //closedall
categoryCode: '', //code
orgId: '', //ID
pageSize: 20,
pageNo: 1,
startTime: '', //yyyymmdd ,
endTime: '', //yyyymmdd,
},
total: 0,
timeArray: ['', ''],
agencyName: '',
startTimeShow: '',//
endTimeShow: '', //
endTimeModel: new Date() - 60 * 60 * 24 * 2,
//
diaShow: false,
}
},
mounted () {
this.customerId = localStorage.getItem('customerId')
},
methods: {
async initData (agencyIdArray, row, type, casOptions, selAgencyObj) {
this.startLoading()
//
this.initDate()
//
this.initAgencyList(casOptions)
this.tableParams.status = type
this.tableParams.categoryCode = row.categoryCode
this.agencyIdArray = agencyIdArray
this.selAgencyObj = selAgencyObj
this.tableParams.orgId = this.selAgencyObj.agencyId
await this.loadTable()//
this.endLoading()
},
initAgencyList (casOptions) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
this.tableParams.orgId = ''
if (casOptions) {
this.casOptions = casOptions
}
},
async loadTable () {
if (this.validate()) {
// const url = '/data/report/screenproject/selectcategoryprojectlist'
const url = 'http://yapi.elinkservice.cn/mock/102/data/report/screenproject/selectcategoryprojectlist'
if (this.staticType === 'end') {
this.tableParams.startTime = ''
}
const { data, code, msg } = await requestPost(url, this.tableParams)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
}
},
//
handleDetail (row) {
this.diaShow = true
this.$nextTick(() => {
this.$refs.ref_projectDetail.initData(row.projectId)
})
},
//
diaClose () {
this.diaShow = false
},
handleChange (value) {
if (value && value.length > 0) {
this.selAgencyObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.tableParams.orgId = this.selAgencyObj.agencyId
this.agencyName = this.selAgencyObj.agencyName
} else {
this.selAgencyObj = {}
this.tableParams.orgId = ''
this.agencyName = ''
}
},
initDate () {
//
const date = new Date()
const month = date.getMonth() + 1 > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)
const day = date.getDate() - 1 > 9 ? (date.getDate() - 1) : '0' + (date.getDate() - 1)
const yesterday = date.getFullYear() + '-' + month + '-' + day
this.timeArray = ['', yesterday]
this.endTimeModel = yesterday
let yesterdayArray = yesterday.split('-')
this.tableParams.endTime = yesterdayArray[0] + yesterdayArray[1] + yesterdayArray[2]
this.endTimeShow = yesterdayArray[0] + '年' + yesterdayArray[1] + '月' + yesterdayArray[2] + '日'
},
handleEndTimeChange (item) {
if (item) {
const endTimeArray = util.dateFormatter(item, 'date').split('-')
this.tableParams.endTime = endTimeArray[0] + endTimeArray[1] + endTimeArray[2]
this.endTime = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日'
} else {
this.tableParams.endTime = ''
this.endTimeShow = ''
}
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.tableParams.startTime = startTimeArray[0] + startTimeArray[1] + startTimeArray[2]
this.tableParams.endTime = endTimeArray[0] + endTimeArray[1] + endTimeArray[2]
this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日'
this.endTimeShow = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日'
} else {
this.tableParams.startTime = ''
this.tableParams.endTime = ''
this.startTimeShow = ''
this.endTimeShow = ''
}
},
handleSizeChange (val) {
this.tableParams.pageSize = val
this.tableParams.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.tableParams.pageNo = val
this.loadTable()
},
handleBack () {
this.$emit('back')
},
validate () {
if (this.staticType === 'end' && !this.tableParams.endTime) {
this.$message.info("请选择结束日期")
return false
}
return true
},
//
async loadOutTableData () {
if (!this.validate()) {
return false
}
let title = this.agencyName
if (this.staticType === 'Interval') {
title = title + ' ' + this.startTimeShow + '-' + this.endTimeShow + '区间增长值'
} else {
title = title + ' 截止至' + this.endTimeShow + '累计值'
}
console.log(title)
const url = "/data/report/screenproject/selectcategoryprojectlist/export"
app.ajax.exportFilePost(
url,
this.tableParams,
(data, rspMsg) => {
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 100
},
...mapGetters(['clientHeight', 'env'])
},
components: {
ProjectDetail
},
activated () {
this.$nextTick(() => {
this.$refs.ref_table.doLayout() //
})
},
}
</script>
<style lang="css" scoped>
.myNote {
display: -webkit-box;
text-overflow: ellipsis;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* .register .el-table .el-table__header-wrapper {
position: absolute;
top: 0;
left: 0;
}*/
/*
.register .el-table .el-table__fixed-body-wrapper {
height: calc(100% - 44px);
margin-top: 44px;
overflow-y: auto !important;
} */
</style>
Loading…
Cancel
Save