| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <el-row>
- <el-col :span="24">
- <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
- <form ref="formMain1" id="formMain1" target="frameMain1" :action="reportSrc" method="post">
- <input type="hidden" name="width" v-model="windowWidth">
- <input type="hidden" name="height" v-model="windowHeight">
- <input type="hidden" name="ids">
- <input type="hidden" name="host" v-model="hostUrl">
- <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="state" v-model="dcType">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="frameMain1" id="frameMain1" name="frameMain1" src="" frameborder="0" width="100%" height="100%"
- style="overflow: auto"></iframe>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- import {dateFormat, getFirstDayOfMonth} from '@util/gw_date.js';
- import {hostUrl} from "@util/global_variable";
- export default {
- props: ['ids', 'newYear', 'type'],
- data() {
- return {
- pid: '000',
- pidNodes: [],
- dxdcMainHeight: window.innerHeight - 200,
- dxdcAsideHeight: window.innerHeight - 180,
- windowHeight: window.innerHeight - 200,
- windowWidth: window.innerWidth - 350,
- reportSrc: '/demo/reportJsp/showReport.jsp?rpx=dc_wtgth_01.rpx',
- radioTable: 1,
- loading: true,
- leftCol: 4,
- rightCol: 20,
- excelName: '取水许可管理对象核实-水电站',
- 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',
- }
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- hostUrl: function () {
- return hostUrl
- }
- },
- methods: {
- // 获取Excel数据
- searchExecl(id) {
- if (id !== undefined){
- $('input[name="ids"]').val(id);
- this.ids = id;
- } else {
- $('input[name="ids"]').val(this.ids);
- }
- this.loading = true;
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.formMain1.submit();
- // 使用_this
- let _this = this;
- this.$refs.frameMain1.onload = function () {
- _this.loading = false;
- };
- },
- // 导出Excel数据
- exportExecl() {
- v = window.frames["frameMain1"];
- // 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];
- }
- }
- },
- activated() {
- this.searchExecl();
- }
- }
- </script>
- <style scoped>
- </style>
|