|
|
|
@ -7,9 +7,9 @@ |
|
|
|
<el-form-item label="自评周期"> |
|
|
|
<!-- <el-input v-model="formData.name" placeholder="请输入" size="small" class="u-item-width-normal" |
|
|
|
clearable></el-input> --> |
|
|
|
<el-date-picker v-model="formData.period" type="date" value-format="yyyy-MM" |
|
|
|
placeholder="选择日期" style="width: 202px" clearable> |
|
|
|
</el-date-picker> |
|
|
|
<el-date-picker v-model="formData.period" type="date" value-format="yyyy-MM" placeholder="选择日期" |
|
|
|
style="width: 202px" clearable> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<div style="float: right; margin-top:5px"> |
|
|
|
<el-button style="margin-left: 30px" size="small" type="primary " |
|
|
|
@ -20,34 +20,37 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="m-table"> |
|
|
|
<div class="div_btn"> |
|
|
|
<el-button type="primary" size="small" |
|
|
|
class="diy-button--white el-button--default">导入</el-button> |
|
|
|
<el-button type="primary" size="small" |
|
|
|
class="diy-button--white el-button--default">下载导入模板</el-button> |
|
|
|
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" |
|
|
|
:limit="1" :accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" |
|
|
|
:auto-upload="true" :before-upload="beforeExcelUpload" :http-request="uploadHttpRequest"> |
|
|
|
<el-button type="primary" size="small" class="diy-button--white el-button--default" |
|
|
|
:loading="importLoading">导入</el-button> |
|
|
|
</el-upload> |
|
|
|
<el-button type="primary" style="margin-left:10px" size="small" class="diy-button--white el-button--default" |
|
|
|
@click="handleExportModule">下载模板</el-button> |
|
|
|
</div> |
|
|
|
<div class="m-table-item" :style="{ height: maxTableHeight + 'px', width: '100%' }"> |
|
|
|
<div>本月已参与调研人数 500人</div> |
|
|
|
<div id="myCharts"></div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<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"> |
|
|
|
<form-list ref="ref_add_form" @handleClose="handleClose" |
|
|
|
:satisfactionCategoryStr="satisfactionCategoryStr" :period="period"></form-list> |
|
|
|
<form-list ref="ref_add_form" @handleClose="handleClose" :satisfactionCategoryStr="satisfactionCategoryStr" |
|
|
|
:period="formData.period"></form-list> |
|
|
|
<el-dialog width="820px" class="dialog-h" title="省满意度调查详情" :close-on-click-modal="false" |
|
|
|
v-if="showProvinceFollowUpDetail" :visible.sync="showProvinceFollowUpDetail" append-to-body > |
|
|
|
<follow-Detail></follow-Detail> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { requestPost,requestGet } from "@/js/dai/request"; |
|
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import axios from "axios"; |
|
|
|
import * as echarts from 'echarts' |
|
|
|
@ -61,8 +64,8 @@ export default { |
|
|
|
searchH: 20, |
|
|
|
showFormList: false, |
|
|
|
formData: { |
|
|
|
period:"", |
|
|
|
inspRecordId:"" |
|
|
|
period: "", |
|
|
|
inspRecordId: "" |
|
|
|
}, |
|
|
|
|
|
|
|
multiSelection: [], // 多选结果 |
|
|
|
@ -131,7 +134,7 @@ export default { |
|
|
|
satisfactionCategoryName: [], |
|
|
|
satisfactionCategory: [], |
|
|
|
score: [], |
|
|
|
|
|
|
|
showProvinceFollowUpDetail:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -312,7 +315,89 @@ export default { |
|
|
|
// this.$message.error(msg); |
|
|
|
// } |
|
|
|
}, |
|
|
|
async handleExportModule() { |
|
|
|
let url = "/governance/provinceEvaluationRecord/provinceStatis/downloadImportTemplate"; |
|
|
|
let params = {}; |
|
|
|
await this.$http({ |
|
|
|
method: "get", |
|
|
|
url, |
|
|
|
responseType: "blob", |
|
|
|
data: params, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
console.log("res----dddd", res); |
|
|
|
// this.download(res.data, title + '.xls') |
|
|
|
if (res.headers["content-disposition"]) { |
|
|
|
let fileName = window.decodeURI( |
|
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
); |
|
|
|
console.log("filename", fileName); |
|
|
|
let blob = new Blob([res.data], { |
|
|
|
type: "application/vnd.ms-excel", |
|
|
|
}); |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
var aLink = document.createElement("a"); |
|
|
|
aLink.style.display = "none"; |
|
|
|
aLink.href = url; |
|
|
|
aLink.setAttribute("download", fileName); |
|
|
|
document.body.appendChild(aLink); |
|
|
|
aLink.click(); |
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
} else this.$message.error("下载失败"); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("err", err); |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
beforeExcelUpload(file) { |
|
|
|
console.log("file", file); |
|
|
|
const isType = file.type === "application/vnd.ms-excel"; |
|
|
|
const isTypeComputer = |
|
|
|
file.type === |
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
|
|
const fileType = isType || isTypeComputer; |
|
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
|
if (!fileType) { |
|
|
|
this.$message.error("上传文件只能是xls/xlsx格式!"); |
|
|
|
} |
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
|
this.$message.error("上传文件大小不能超过 10MB!"); |
|
|
|
} |
|
|
|
return fileType && isLt1M; |
|
|
|
}, |
|
|
|
async uploadHttpRequest(file) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
message: |
|
|
|
"导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度", |
|
|
|
duration: 3000, |
|
|
|
}); |
|
|
|
let than = this; |
|
|
|
document.getElementById("clickA").addEventListener("click", function () { |
|
|
|
than.$router.replace("/main/importRecord-index"); |
|
|
|
}); |
|
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
|
formData.append("file", file.file); //添加文件对象 |
|
|
|
await this.$http |
|
|
|
.post("/governance/satisfaction/provinceEvaluationRecord/StaticPeopleNum/2023-09", formData) |
|
|
|
.then((res) => { |
|
|
|
console.log("res-up", res); |
|
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
|
this.$message.success("导入成功"); |
|
|
|
this.getTableData(); |
|
|
|
this.$refs.upload.clearFiles(); |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("失败", err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
this.$message.error('导入失败') |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 重置 |
|
|
|
resetSearch() { |
|
|
|
this.formData = {}; |
|
|
|
|