| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <el-row>
- <el-col :span="24">
- <el-card :body-style="{'padding-top':'10px'}">
- <div class="block">
- <span class="demonstration" style="margin-right: 5px">选择时间段</span>
- <el-date-picker
- v-model="findTime"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- <el-button type="primary" icon="el-icon-download"
- style="float: right;margin:0 5px"
- @click="exportExecl">导出</el-button>
- <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
- </div>
- </el-card>
- <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
- <form ref="formMain11" id="formMain11" target="frameMain11" :action="reportSrc" method="post">
- <input type="hidden" name="width" v-model="windowWidth">
- <input type="hidden" name="height" v-model="windowHeight">
- <input type="hidden" name="excelName" v-model="excelName">
- <input type="hidden" id="sttm" name="sttm" v-model="sttm">
- <input type="hidden" id="ettm" name="ettm" v-model="ettm">
- <input type="hidden" name="year" v-model="newYear">
- <input type="hidden" name="adcode" v-model="adCode">
- <input type="hidden" name="level" v-model="level">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="frameMain11" id="frameMain11" name="frameMain11" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- import {dateFormat,getFirstDayOfMonth} from '../../utils/gw_date.js';
- export default {
- props: ['newYear','table','adCode','adGrad'],
- data() {
- return {
- pid:'000',
- pidNodes:[],
- type:'111',
- dxdcMainHeight: window.innerHeight-200,
- dxdcAsideHeight: window.innerHeight-180,
- windowHeight:window.innerHeight - 200,
- windowWidth:window.innerWidth - 350,
- reportSrc:'/demo/reportJsp/showReport.jsp?rpx=dx_total_shi_fj03&scroll=yes',
- radioTable:1,
- loading:false,
- leftCol:4,
- rightCol:20,
- excelName:"2024年度汛安全综合检查问题情况表",
- findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
- sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
- ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
- treeWidth: 250,
- dcType: ["0","1","2"],
- level:null,
- }
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- currentRlcode() {
- return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
- }
- },
- mounted() {
- this.searchExecl();
- },
- methods: {
- // 获取Excel数据
- searchExecl(){
- if(!this.adGrad || !this.adCode){
- return;
- }
- this.loading = true;
- this.level = this.adGrad=='3'?4:this.adGrad=='2'?2:6
- this.$nextTick(()=>{
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.formMain11.submit();
- // 使用_this
- let _this = this;
- this.$refs.frameMain11.onload = function(){
- _this.loading = false;
- };
- })
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMain11"];
- // v.contentWindow.report1_saveAsExcel();
- v.report1_saveAsExcel();
- },
- },
- watch:{
- findTime(n,o){
- if(!n){
- this.sttm = "";
- this.ettm = "";
- }else{
- this.sttm = n[0];
- this.ettm = n[1];
- }
- },
- adCode: {
- immediate: true, // immediate选项可以开启首次赋值监听
- async handler(newVal, oldVal) {
- this.$nextTick(()=>{
- this.searchExecl();
- })
- }
- },
- adGrad: {
- immediate: true,
- async handler(newVal, oldVal) {
- this.$nextTick(()=>{
- this.searchExecl();
- })
- }
- }
- }
- }
- </script>
- <style scoped>
- </style>
|