<template>
|
<el-button icon="Download" type="success" @click="dialogVisible = true"
|
>规范性评估与分析报告</el-button
|
>
|
<el-dialog
|
v-model="dialogVisible"
|
title="规范性评估与分析报告生成"
|
width="500"
|
>
|
<el-text tag="b" size="large">数据范围确认</el-text>
|
<el-text tag="div">区域:{{ locationText }}</el-text>
|
<el-text tag="div">类型:{{ scenetype.label }}</el-text>
|
<el-text tag="div">时间:{{ timeText }}</el-text>
|
<template #footer>
|
<div class="dialog-footer">
|
<el-row align="middle">
|
<el-checkbox v-model="forceUpdate" label="强制生成新报告" />
|
<el-tooltip placement="bottom-start" effect="light">
|
<template #content>
|
<el-text tag="b" size="small">不勾选:</el-text><br />
|
<el-text size="small"
|
>不勾选时,如果已生成过相同区域的报告,则直接获取该份报告记录</el-text
|
><br />
|
<el-text tag="b" size="small">勾选:</el-text><br />
|
<el-text size="small"
|
>勾选时,无论是否有历史记录,都会启动报告生成任务覆盖旧记录,可在后台任务界面查看任务进度</el-text
|
><br />
|
</template>
|
<el-icon class="m-l-8 cursor-p" :size="16" color="var(--el-color-warning)"
|
><QuestionFilled
|
/></el-icon>
|
</el-tooltip>
|
</el-row>
|
<div>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button type="primary" @click="download">确定</el-button>
|
</div>
|
</div>
|
</template>
|
</el-dialog>
|
</template>
|
|
<script>
|
import dayjs from 'dayjs';
|
import evaluateApi from '@/api/fysp/evaluateApi';
|
|
export default {
|
props: ['locations', 'time', 'scenetype'],
|
data() {
|
return {
|
dialogVisible: false,
|
forceUpdate: false
|
};
|
},
|
computed: {
|
locationText() {
|
const loc = this.locations;
|
let text = '';
|
text = loc.pName == loc.cName ? loc.pName : loc.pName + loc.cName;
|
text += loc.dName;
|
return text;
|
},
|
timeText() {
|
return dayjs(this.time).format('YYYY年MM月');
|
}
|
},
|
methods: {
|
// 规范性评估与分析报告后台生成任务
|
download() {
|
const locations = this.locations;
|
const time = this.time;
|
const scenetype = this.scenetype;
|
const area = {
|
provincecode: locations.pCode,
|
provincename: locations.pName,
|
citycode: locations.cCode,
|
cityname: locations.cName,
|
districtcode: locations.dCode,
|
districtname: locations.dName,
|
starttime: dayjs(this.time).format('YYYY-MM-DD HH:mm:ss'),
|
scensetypeid: scenetype.value
|
};
|
evaluateApi.downloadAutoEvaluation(area, this.forceUpdate).then((res) => {
|
if (res == false) {
|
// 未下载文档,而是开启了文档生成后台任务
|
this.$parent;
|
}
|
this.dialogVisible = false;
|
});
|
}
|
}
|
};
|
</script>
|
<style scoped>
|
.dialog-footer {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
gap: 2px;
|
}
|
</style>
|