|
|
@ -1,59 +1,59 @@ |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div class="g-main"> |
|
|
<div class="g-main"> |
|
|
<div> |
|
|
<div> |
|
|
<div class="m-search"> |
|
|
<div class="m-search"> |
|
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> |
|
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> |
|
|
<el-form-item label="自评周期"> |
|
|
<el-form-item label="自评周期"> |
|
|
<el-date-picker v-model="formData.periodStart" type="month" value-format="yyyy-MM" placeholder="选择日期" |
|
|
<el-date-picker v-model="formData.periodStart" type="month" value-format="yyyy-MM" placeholder="选择日期" |
|
|
style="width: 202px" clearable> |
|
|
style="width: 202px" clearable> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<div style="float: right; margin-top:5px"> |
|
|
<div style="float: right; margin-top:5px"> |
|
|
<el-button style="margin-left: 30px" size="small" type="primary " |
|
|
<el-button style="margin-left: 30px" size="small" type="primary " |
|
|
@click="handleSearch">查询</el-button> |
|
|
@click="handleSearch">查询</el-button> |
|
|
<el-button style="margin-left: 10px" is-plain class="diy-button--white el-button--default" |
|
|
<el-button style="margin-left: 10px" is-plain class="diy-button--white el-button--default" |
|
|
size="small" @click="resetSearch">重置</el-button> |
|
|
size="small" @click="resetSearch">重置</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="m-table"> |
|
|
<div class="m-table"> |
|
|
<div class="div_btn"> |
|
|
<div class="div_btn"> |
|
|
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" |
|
|
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" |
|
|
:limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" |
|
|
:limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" |
|
|
:auto-upload="true" :before-upload="beforeExcelUpload" :http-request="uploadHttpRequest"> |
|
|
:auto-upload="true" :before-upload="beforeExcelUpload" :http-request="uploadHttpRequest"> |
|
|
<el-button type="primary" size="small" class="diy-button--white el-button--default" |
|
|
<el-button type="primary" size="small" class="diy-button--white el-button--default" |
|
|
:loading="importLoading">导入</el-button> |
|
|
:loading="importLoading">导入</el-button> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
<el-button type="primary" style="margin-left:10px" size="small" |
|
|
<el-button type="primary" style="margin-left:10px" size="small" |
|
|
class="diy-button--white el-button--default" @click="handleExportModule">下载模板</el-button> |
|
|
class="diy-button--white el-button--default" @click="handleExportModule">下载模板</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<el-radio-group v-model="formData.orgCategoryCode" @change="handelChangeCategory" style="margin: 20px 0 0;"> |
|
|
<el-radio-group v-model="formData.orgCategoryCode" @change="handelChangeCategory" style="margin: 20px 0 0;"> |
|
|
<el-radio-button label="province">省满意度调查</el-radio-button> |
|
|
<el-radio-button label="province">省满意度调查</el-radio-button> |
|
|
<el-radio-button label="city">市满意度调查</el-radio-button> |
|
|
<el-radio-button label="city">市满意度调查</el-radio-button> |
|
|
<el-radio-button label="district">区满意度调查</el-radio-button> |
|
|
<el-radio-button label="district">区满意度调查</el-radio-button> |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
<div class="m-table-item" :style="{ height: maxTableHeight + 'px', width: '100%' }"> |
|
|
<div class="m-table-item" :style="{ height: maxTableHeight + 'px', width: '100%' }"> |
|
|
<div id="myCharts"></div> |
|
|
<div id="myCharts"></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<el-dialog v-if="showFormList" :visible.sync="showFormList" :close-on-click-modal="false" |
|
|
<el-dialog v-if="showFormList" :visible.sync="showFormList" :close-on-click-modal="false" |
|
|
:close-on-press-escape="false" title="省满意度调查列表" :modal-append-to-body="false" width="820px" top="5vh" |
|
|
:close-on-press-escape="false" title="省满意度调查列表" :modal-append-to-body="false" width="820px" top="5vh" |
|
|
class="dialog-h" @closed="showFormList = false"> |
|
|
class="dialog-h" @closed="showFormList = false"> |
|
|
<form-list ref="ref_form_list" @handleClose="handleClose" :satisfactionCategoryStr="satisfactionCategoryStr" |
|
|
<form-list ref="ref_form_list" @handleClose="handleClose" :satisfactionCategoryStr="satisfactionCategoryStr" |
|
|
:formObj="formData" @handelClickDetail="handelClickDetail" |
|
|
:formObj="formData" @handelClickDetail="handelClickDetail" |
|
|
@handelClickEdit="handelClickEdit"></form-list> |
|
|
@handelClickEdit="handelClickEdit"></form-list> |
|
|
<el-dialog width="820px" class="dialog-h" title="省满意度调查详情" :close-on-click-modal="false" |
|
|
<el-dialog width="820px" class="dialog-h" title="省满意度调查详情" :close-on-click-modal="false" |
|
|
v-if="showProvinceFollowUpDetail" :visible.sync="showProvinceFollowUpDetail" append-to-body> |
|
|
v-if="showProvinceFollowUpDetail" :visible.sync="showProvinceFollowUpDetail" append-to-body> |
|
|
<follow-detail :detailObj="detailObj" :formType="formType" |
|
|
<follow-detail :detailObj="detailObj" :formType="formType" |
|
|
@handleCancle="showProvinceFollowUpDetail = false" @handleComfirm="handleComfirm"></follow-detail> |
|
|
@handleCancle="showProvinceFollowUpDetail = false" @handleComfirm="handleComfirm"></follow-detail> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
import { mapGetters } from "vuex"; |
|
|
import { mapGetters } from "vuex"; |
|
|
@ -63,313 +63,313 @@ import formList from "./formList"; |
|
|
import util from "@js/util.js"; |
|
|
import util from "@js/util.js"; |
|
|
import followDetail from "./followDetail" |
|
|
import followDetail from "./followDetail" |
|
|
export default { |
|
|
export default { |
|
|
components: { formList, followDetail }, |
|
|
components: { formList, followDetail }, |
|
|
|
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
searchH: 20, |
|
|
searchH: 20, |
|
|
showFormList: false, |
|
|
showFormList: false, |
|
|
formData: { |
|
|
formData: { |
|
|
periodStart: "", |
|
|
periodStart: "", |
|
|
orgCategoryCode:"province" |
|
|
orgCategoryCode:"province" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
multiSelection: [], // 多选结果 |
|
|
multiSelection: [], // 多选结果 |
|
|
importLoading: false, |
|
|
importLoading: false, |
|
|
|
|
|
|
|
|
dicts: { |
|
|
dicts: { |
|
|
satisfaction_category: [] |
|
|
satisfaction_category: [] |
|
|
}, //字典对象 |
|
|
}, //字典对象 |
|
|
|
|
|
|
|
|
myChart: {}, |
|
|
myChart: {}, |
|
|
option: { |
|
|
option: { |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'axis' |
|
|
trigger: 'axis' |
|
|
}, |
|
|
}, |
|
|
legend: { |
|
|
legend: { |
|
|
data: ['不满意'], |
|
|
data: ['不满意'], |
|
|
bottom: '10%', |
|
|
bottom: '10%', |
|
|
icon: 'rect', |
|
|
icon: 'rect', |
|
|
itemWidth: 20, |
|
|
itemWidth: 20, |
|
|
itemHeight: 5, |
|
|
itemHeight: 5, |
|
|
itemGap: 20, |
|
|
itemGap: 20, |
|
|
}, |
|
|
}, |
|
|
grid: { |
|
|
grid: { |
|
|
left: '3%', |
|
|
left: '3%', |
|
|
right: '4%', |
|
|
right: '4%', |
|
|
bottom: '25%', |
|
|
bottom: '25%', |
|
|
containLabel: true |
|
|
containLabel: true |
|
|
}, |
|
|
}, |
|
|
toolbox: {}, |
|
|
toolbox: {}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xAxis: { |
|
|
xAxis: { |
|
|
type: 'category', |
|
|
type: 'category', |
|
|
boundaryGap: true, |
|
|
boundaryGap: true, |
|
|
data: [], |
|
|
data: [], |
|
|
}, |
|
|
}, |
|
|
yAxis: { |
|
|
yAxis: { |
|
|
type: 'value', |
|
|
type: 'value', |
|
|
name: '单位(个)', |
|
|
name: '单位(个)', |
|
|
min: 0, |
|
|
min: 0, |
|
|
}, |
|
|
}, |
|
|
series: [ |
|
|
series: [ |
|
|
{ |
|
|
{ |
|
|
name: '不满意', |
|
|
name: '不满意', |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
data: [], |
|
|
data: [], |
|
|
barWidth: 24, // 设置柱子宽度 |
|
|
barWidth: 24, // 设置柱子宽度 |
|
|
barCategoryGap: 0, // 设置柱子间的间隔为0 |
|
|
barCategoryGap: 0, // 设置柱子间的间隔为0 |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
color: new echarts.graphic.LinearGradient( |
|
|
color: new echarts.graphic.LinearGradient( |
|
|
0, 0, 0, 1, |
|
|
0, 0, 0, 1, |
|
|
[ |
|
|
[ |
|
|
{ offset: 0, color: '#2c7cf2' }, // 从顶部开始 |
|
|
{ offset: 0, color: '#2c7cf2' }, // 从顶部开始 |
|
|
{ offset: 1, color: '#80b3ff' } // 到底部结束 |
|
|
{ offset: 1, color: '#80b3ff' } // 到底部结束 |
|
|
] |
|
|
] |
|
|
) |
|
|
) |
|
|
}, |
|
|
}, |
|
|
showBackground: true, |
|
|
showBackground: true, |
|
|
backgroundStyle: { |
|
|
backgroundStyle: { |
|
|
color: '#fafbfc', |
|
|
color: '#fafbfc', |
|
|
opacity: "0.5" |
|
|
opacity: "0.5" |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
satisfactionCategoryName: [], |
|
|
satisfactionCategoryName: [], |
|
|
satisfactionCategory: [], |
|
|
satisfactionCategory: [], |
|
|
score: [], |
|
|
score: [], |
|
|
showProvinceFollowUpDetail: false, |
|
|
showProvinceFollowUpDetail: false, |
|
|
|
|
|
|
|
|
detailObj: {}, |
|
|
detailObj: {}, |
|
|
|
|
|
|
|
|
formType: '' |
|
|
formType: '' |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
|
maxTableHeight() { |
|
|
maxTableHeight() { |
|
|
const h = this.clientHeight - this.searchH - 330 + this.iframeHeight; |
|
|
const h = this.clientHeight - this.searchH - 330 + this.iframeHeight; |
|
|
const _h = this.clientHeight - 330 - this.searchH; |
|
|
const _h = this.clientHeight - 330 - this.searchH; |
|
|
return this.$store.state.inIframe ? h : _h; |
|
|
return this.$store.state.inIframe ? h : _h; |
|
|
}, |
|
|
}, |
|
|
...mapGetters(["clientHeight", "iframeHeight"]), |
|
|
...mapGetters(["clientHeight", "iframeHeight"]), |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
let date = new Date() |
|
|
let date = new Date() |
|
|
this.formData.periodStart = util.formatDate(date, 'yyyy-MM') |
|
|
this.formData.periodStart = util.formatDate(date, 'yyyy-MM') |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async mounted() { |
|
|
async mounted() { |
|
|
this.user = this.$store.state.user; |
|
|
this.user = this.$store.state.user; |
|
|
this.agencyId = this.user.agencyId; |
|
|
this.agencyId = this.user.agencyId; |
|
|
await this.getDicts(); |
|
|
await this.getDicts(); |
|
|
await this.getTableData(); |
|
|
await this.getTableData(); |
|
|
await this.initEcharts() |
|
|
await this.initEcharts() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// --------------------------------------字典------------------------------------------ |
|
|
// --------------------------------------字典------------------------------------------ |
|
|
async getDicts() { |
|
|
async getDicts() { |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
const requests = [ |
|
|
const requests = [ |
|
|
this.$http.post("sys/dict/data/dictlist", { |
|
|
this.$http.post("sys/dict/data/dictlist", { |
|
|
dictType: "satisfaction_category", |
|
|
dictType: "satisfaction_category", |
|
|
}), |
|
|
}), |
|
|
]; |
|
|
]; |
|
|
const dictKeys = ['satisfaction_category']; // 对应的键名 |
|
|
const dictKeys = ['satisfaction_category']; // 对应的键名 |
|
|
|
|
|
|
|
|
const results = await Promise.all(requests); |
|
|
const results = await Promise.all(requests); |
|
|
results.forEach((result, index) => { |
|
|
results.forEach((result, index) => { |
|
|
if (result.data.code === 0) { |
|
|
if (result.data.code === 0) { |
|
|
this.dicts[dictKeys[index]].push(...result.data.data); |
|
|
this.dicts[dictKeys[index]].push(...result.data.data); |
|
|
} else { |
|
|
} else { |
|
|
console.log(`获取${dictKeys[index]}失败: ${result.data.msg}`); |
|
|
console.log(`获取${dictKeys[index]}失败: ${result.data.msg}`); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log("获取字典失败: ", error); |
|
|
console.log("获取字典失败: ", error); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// ------------------------------------事件------------------------------------------ |
|
|
// ------------------------------------事件------------------------------------------ |
|
|
initEcharts() { |
|
|
initEcharts() { |
|
|
this.myChart = echarts.init(document.getElementById('myCharts')); |
|
|
this.myChart = echarts.init(document.getElementById('myCharts')); |
|
|
this.myChart.setOption(this.option) |
|
|
this.myChart.setOption(this.option) |
|
|
let than = this |
|
|
let than = this |
|
|
this.myChart.on('click', function (params) { |
|
|
this.myChart.on('click', function (params) { |
|
|
than.handelClickChart(params.name) |
|
|
than.handelClickChart(params.name) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
window.addEventListener('resize', this.handleWindowResize); |
|
|
window.addEventListener('resize', this.handleWindowResize); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
handleWindowResize() { |
|
|
handleWindowResize() { |
|
|
if (this.myChart) { |
|
|
if (this.myChart) { |
|
|
this.myChart.resize(); |
|
|
this.myChart.resize(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handelClickChart(name) { |
|
|
handelClickChart(name) { |
|
|
this.showFormList = true |
|
|
this.showFormList = true |
|
|
this.satisfactionCategoryStr = this.dicts.satisfaction_category.filter(item => item.label == name)[0].value |
|
|
this.satisfactionCategoryStr = this.dicts.satisfaction_category.filter(item => item.label == name)[0].value |
|
|
}, |
|
|
}, |
|
|
handleClose() { |
|
|
handleClose() { |
|
|
this.showFormList = false |
|
|
this.showFormList = false |
|
|
}, |
|
|
}, |
|
|
handelClickDetail(row) { |
|
|
handelClickDetail(row) { |
|
|
this.formType = 'detail' |
|
|
this.formType = 'detail' |
|
|
this.showProvinceFollowUpDetail = true |
|
|
this.showProvinceFollowUpDetail = true |
|
|
this.detailObj = row || {} |
|
|
this.detailObj = row || {} |
|
|
}, |
|
|
}, |
|
|
handelClickEdit(row) { |
|
|
handelClickEdit(row) { |
|
|
this.formType = 'edit' |
|
|
this.formType = 'edit' |
|
|
this.showProvinceFollowUpDetail = true |
|
|
this.showProvinceFollowUpDetail = true |
|
|
this.detailObj = row || {} |
|
|
this.detailObj = row || {} |
|
|
}, |
|
|
}, |
|
|
handelChangeCategory(){ |
|
|
handelChangeCategory(){ |
|
|
this.getTableData() |
|
|
this.getTableData() |
|
|
}, |
|
|
}, |
|
|
handleComfirm(form) { |
|
|
handleComfirm(form) { |
|
|
this.showProvinceFollowUpDetail = false |
|
|
this.showProvinceFollowUpDetail = false |
|
|
this.save(form) |
|
|
this.save(form) |
|
|
}, |
|
|
}, |
|
|
async save(form) { |
|
|
async save(form) { |
|
|
try { |
|
|
try { |
|
|
const url = '/governance/provinceEvaluationRecord/updateInfo' |
|
|
const url = '/governance/provinceEvaluationRecord/updateInfo' |
|
|
form.periodName = null |
|
|
form.periodName = null |
|
|
const { code } = await requestPost(url, form) |
|
|
const { code } = await requestPost(url, form) |
|
|
if (code == 0) { |
|
|
if (code == 0) { |
|
|
this.getTableData() |
|
|
this.getTableData() |
|
|
this.$refs['ref_form_list'].getTableData() |
|
|
this.$refs['ref_form_list'].getTableData() |
|
|
this.$message.success('保存成功') |
|
|
this.$message.success('保存成功') |
|
|
this.showProvinceFollowUpDetail = false |
|
|
this.showProvinceFollowUpDetail = false |
|
|
} |
|
|
} |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 搜索事件 |
|
|
// 搜索事件 |
|
|
handleSearch(val) { |
|
|
handleSearch(val) { |
|
|
console.log(this.formData); |
|
|
console.log(this.formData); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 获取列表 |
|
|
// 获取列表 |
|
|
async getTableData() { |
|
|
async getTableData() { |
|
|
try { |
|
|
try { |
|
|
const allowedCategories = this.dicts.satisfaction_category.map(item => item.value) |
|
|
const allowedCategories = this.dicts.satisfaction_category.map(item => item.value) |
|
|
const { data } = await this.$http.post( |
|
|
const { data } = await this.$http.post( |
|
|
`/governance/provinceEvaluationRecord/staticPeopleNum`, |
|
|
`/governance/provinceEvaluationRecord/staticPeopleNum`, |
|
|
{ ...this.formData } |
|
|
{ ...this.formData } |
|
|
); |
|
|
); |
|
|
this.option.series[0].data = [] |
|
|
this.option.series[0].data = [] |
|
|
this.option.xAxis.data = [] |
|
|
this.option.xAxis.data = [] |
|
|
this.tableData = data |
|
|
this.tableData = data |
|
|
this.tableData.forEach(item => { |
|
|
this.tableData.forEach(item => { |
|
|
if (allowedCategories.includes(item.scopeId)) { |
|
|
if (allowedCategories.includes(item.scopeId)) { |
|
|
this.option.series[0].data.push(item.peopleNum) |
|
|
this.option.series[0].data.push(item.peopleNum) |
|
|
this.option.xAxis.data.push(item.scopeName) |
|
|
this.option.xAxis.data.push(item.scopeName) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
this.myChart.setOption(this.option) |
|
|
this.myChart.setOption(this.option) |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log(error); |
|
|
console.log(error); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async handleExportModule() { |
|
|
async handleExportModule() { |
|
|
let url = "/governance/provinceEvaluationRecord/provinceStatis/downloadImportTemplate"; |
|
|
let url = "/governance/provinceEvaluationRecord/provinceStatis/downloadImportTemplate"; |
|
|
let params = {}; |
|
|
let params = {}; |
|
|
await this.$http({ |
|
|
await this.$http({ |
|
|
method: "get", |
|
|
method: "get", |
|
|
url, |
|
|
url, |
|
|
responseType: "blob", |
|
|
responseType: "blob", |
|
|
data: params, |
|
|
data: params, |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
console.log("res----dddd", res); |
|
|
console.log("res----dddd", res); |
|
|
// this.download(res.data, title + '.xls') |
|
|
// this.download(res.data, title + '.xls') |
|
|
if (res.headers["content-disposition"]) { |
|
|
if (res.headers["content-disposition"]) { |
|
|
let fileName = window.decodeURI( |
|
|
let fileName = window.decodeURI( |
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
); |
|
|
); |
|
|
console.log("filename", fileName); |
|
|
console.log("filename", fileName); |
|
|
let blob = new Blob([res.data], { |
|
|
let blob = new Blob([res.data], { |
|
|
type: "application/vnd.ms-excel", |
|
|
type: "application/vnd.ms-excel", |
|
|
}); |
|
|
}); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var aLink = document.createElement("a"); |
|
|
var aLink = document.createElement("a"); |
|
|
aLink.style.display = "none"; |
|
|
aLink.style.display = "none"; |
|
|
aLink.href = url; |
|
|
aLink.href = url; |
|
|
aLink.setAttribute("download", fileName); |
|
|
aLink.setAttribute("download", fileName); |
|
|
document.body.appendChild(aLink); |
|
|
document.body.appendChild(aLink); |
|
|
aLink.click(); |
|
|
aLink.click(); |
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
} else this.$message.error("下载失败"); |
|
|
} else this.$message.error("下载失败"); |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log("err", err); |
|
|
console.log("err", err); |
|
|
return this.$message.error("网络错误"); |
|
|
return this.$message.error("网络错误"); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
beforeExcelUpload(file) { |
|
|
beforeExcelUpload(file) { |
|
|
console.log("file", file); |
|
|
console.log("file", file); |
|
|
const isType = file.type === "application/vnd.ms-excel"; |
|
|
const isType = file.type === "application/vnd.ms-excel"; |
|
|
const isTypeComputer = |
|
|
const isTypeComputer = |
|
|
file.type === |
|
|
file.type === |
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
|
const fileType = isType || isTypeComputer; |
|
|
const fileType = isType || isTypeComputer; |
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
if (!fileType) { |
|
|
if (!fileType) { |
|
|
this.$message.error("上传文件只能是xls/xlsx格式!"); |
|
|
this.$message.error("上传文件只能是xls/xlsx格式!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
if (!isLt1M) { |
|
|
this.$message.error("上传文件大小不能超过 10MB!"); |
|
|
this.$message.error("上传文件大小不能超过 10MB!"); |
|
|
} |
|
|
} |
|
|
return fileType && isLt1M; |
|
|
return fileType && isLt1M; |
|
|
}, |
|
|
}, |
|
|
async uploadHttpRequest(file) { |
|
|
async uploadHttpRequest(file) { |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
showClose: true, |
|
|
showClose: true, |
|
|
dangerouslyUseHTMLString: true, |
|
|
dangerouslyUseHTMLString: true, |
|
|
message: |
|
|
message: |
|
|
"导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度", |
|
|
"导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度", |
|
|
duration: 3000, |
|
|
duration: 3000, |
|
|
}); |
|
|
}); |
|
|
let than = this; |
|
|
let than = this; |
|
|
document.getElementById("clickA").addEventListener("click", function () { |
|
|
document.getElementById("clickA").addEventListener("click", function () { |
|
|
than.$router.replace("/main/importRecord-index"); |
|
|
than.$router.replace("/main/importRecord-index"); |
|
|
}); |
|
|
}); |
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
formData.append("file", file.file); //添加文件对象 |
|
|
formData.append("file", file.file); //添加文件对象 |
|
|
formData.append("orgCategory",than.formData.orgCategoryCode); //添加文件对象 |
|
|
formData.append("orgCategory",than.formData.orgCategoryCode); //添加文件对象 |
|
|
await this.$http |
|
|
await this.$http |
|
|
.post(`/governance/provinceEvaluationRecord/importDataByExcel`, formData) |
|
|
.post(`/governance/provinceEvaluationRecord/importDataByExcel`, formData) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
console.log("res-up", res); |
|
|
console.log("res-up", res); |
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
this.$message.success("导入成功"); |
|
|
this.$message.success("导入成功"); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
this.$refs.upload.clearFiles(); |
|
|
this.$refs.upload.clearFiles(); |
|
|
} else this.$message.error(res.data.msg); |
|
|
} else this.$message.error(res.data.msg); |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log("失败", err); |
|
|
console.log("失败", err); |
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
this.$message.error('导入失败') |
|
|
this.$message.error('导入失败') |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 重置 |
|
|
// 重置 |
|
|
resetSearch() { |
|
|
resetSearch() { |
|
|
this.formData = {}; |
|
|
this.formData = {}; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
activated() { |
|
|
activated() { |
|
|
this.handleWindowResize() |
|
|
this.handleWindowResize() |
|
|
}, |
|
|
}, |
|
|
props: {}, |
|
|
props: {}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@ -378,88 +378,88 @@ export default { |
|
|
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|
|
@import "@/assets/scss/modules/shequzhili/event-info.scss"; |
|
|
|
|
|
|
|
|
.div_btn_left>* { |
|
|
.div_btn_left>* { |
|
|
margin-right: 10px; |
|
|
margin-right: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.m-table-item { |
|
|
.m-table-item { |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.content_box { |
|
|
.content_box { |
|
|
display: flex; |
|
|
display: flex; |
|
|
height: 160px; |
|
|
height: 160px; |
|
|
margin-top: 24px; |
|
|
margin-top: 24px; |
|
|
|
|
|
|
|
|
.left { |
|
|
.left { |
|
|
background: #f7faff; |
|
|
background: #f7faff; |
|
|
margin-right: 10px; |
|
|
margin-right: 10px; |
|
|
min-width: 300px; |
|
|
min-width: 300px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
border-radius: 5px; |
|
|
border-radius: 5px; |
|
|
|
|
|
|
|
|
img { |
|
|
img { |
|
|
margin-right: 8px; |
|
|
margin-right: 8px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
img { |
|
|
img { |
|
|
width: 50px; |
|
|
width: 50px; |
|
|
height: 50px; |
|
|
height: 50px; |
|
|
margin-right: 15px; |
|
|
margin-right: 15px; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.left_right, |
|
|
.left_right, |
|
|
.right_right { |
|
|
.right_right { |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
|
|
|
|
|
|
:nth-child(1) { |
|
|
:nth-child(1) { |
|
|
font-size: 18px; |
|
|
font-size: 18px; |
|
|
font-family: PingFang SC; |
|
|
font-family: PingFang SC; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
color: #333333; |
|
|
color: #333333; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
:nth-child(2) { |
|
|
:nth-child(2) { |
|
|
font-size: 14px; |
|
|
font-size: 14px; |
|
|
font-family: PingFang SC; |
|
|
font-family: PingFang SC; |
|
|
color: #333333; |
|
|
color: #333333; |
|
|
opacity: 0.6; |
|
|
opacity: 0.6; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.right { |
|
|
.right { |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
display: grid; |
|
|
display: grid; |
|
|
grid-template-columns: repeat(4, 1fr); |
|
|
grid-template-columns: repeat(4, 1fr); |
|
|
|
|
|
|
|
|
.box { |
|
|
.box { |
|
|
height: 75px; |
|
|
height: 75px; |
|
|
margin: 0 10px 10px 0; |
|
|
margin: 0 10px 10px 0; |
|
|
|
|
|
|
|
|
.card { |
|
|
.card { |
|
|
background: #f7faff; |
|
|
background: #f7faff; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
border-radius: 5px; |
|
|
border-radius: 5px; |
|
|
padding: 20px; |
|
|
padding: 20px; |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#myCharts { |
|
|
#myCharts { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|