| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <el-row>
- <el-col :span="leftCol" ref="elw">
- <el-card :body-style="{'padding':'0'}">
- <export-tree-list-fs
- :pid="pid"
- :type="type"
- :pidNodes="pidNodes"
- :level="level"
- :height="dxdcAsideHeight"
- :width="treeWidth"
- @provTreeSelectChange="provTreeSelectChange"
- ></export-tree-list-fs>
- </el-card>
- </el-col>
- <el-col :span="rightCol">
- <el-card :body-style="{'padding-top':'10px'}">
- <div class="block">
- <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="formMain3" id="formMain3" target="frameMain3" :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" name="id" v-model="id" id="id">
- <input type="hidden" name="adcode" v-model="adcode" id="adcode">
- <input type="hidden" name="objId" ref="objId" id="objId">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="frameMain3" id="frameMain3" name="frameMain3" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- import request from '@util/gw_ajax_request.js';
- import exportTreeListFs from '../exportTreeList_fs'
- import {dateFormat} from '@util/gw_date.js'
- import globalVariable from '@api/globalVariable';
- export default {
- components: {
- exportTreeListFs:exportTreeListFs,
- },
- data() {
- return {
- ids:[],
- id:'',
- pid:'000',
- pidNodes:[],
- type:'001',
- level:'3',
- dxdcMainHeight: window.innerHeight-180,
- dxdcAsideHeight: window.innerHeight-130,
- windowHeight:window.innerHeight - 160,
- windowWidth:window.innerWidth - 250,
- reportSrc:'/demo/reportJsp/showReport.jsp?rpx=fj_dz_matter',
- // reportSrc:'http://localhost:6868/demo/reportJsp/preview.jsp?rpx=%2Ffj_sk_matter.rpx&rpxHome=C%3A%2FUsers%2Fa%2FDesktop&dfxHome=',
- radioTable:1,
- loading:false,
- leftCol:4,
- rightCol:20,
- excelName:'小型水库(含电站水库)督查检查报告',
- monthValue:dateFormat(new Date(), 'yyyy-MM'),
- findTime: [],
- sttm:'',
- ettm:'',
- treeWidth: 250,
- dcType: '',
- adcode:'',
- objId:'',
- }
- },
- mounted() {
- this.treeWidth = this.$refs.elw.$el.clientWidth;
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- }
- },
- methods: {
- openMessage(){
- const h = this.$createElement;
- this.$notify({
- title: '提示',
- message: h('i', { style: 'color: teal'}, '点击县才会生成报告')
- });
- },
- provTreeSelectChange(data){
- //
- this.id = data.pid;
- document.getElementById("id").value = data.pid;
- this.adcode = data.id;
- document.getElementById("adcode").value = data.id;
- this.searchExecl();
- },
- // 获取Excel数据
- searchExecl(){
- let _this = this;
- console.log(_this.adcode)
- if((_this.adcode != '' && _this.adcode.length != 12) || (_this.adcode.substr(0,1)=='0')){
- this.openMessage();
- return;
- }
-
- this.loading = true;
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.formMain3.submit();
- // 使用_this
- // let _this = this;
- this.$refs.frameMain3.onload = function(){
- _this.loading = false;
- };
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMain3"];
- // v.contentWindow.report1_saveAsExcel();
- v.report1_saveAsExcel();
- },
- },
- watch:{
- },
- activated() {
- this.searchExecl();
- }
- }
- </script>
- <style scoped>
- </style>
|