| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <el-row>
- <el-col :span="24">
- <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="formMain" id="formMain" target="frameMain" :action="reportUrl" method="post">
- <input type="hidden" name="width" v-model="windowWidth">
- <input type="hidden" name="height" v-model="windowHeight">
- <input type="hidden" name="ids" v-model="ids">
- <input type="hidden" name="excelName" v-model="excelName">
- <input type="hidden" name="dt" v-model="monthValue">
- <input type="hidden" name="sttm" v-model="sttm">
- <input type="hidden" name="ettm" v-model="ettm">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="frameMain" id="frameMain" name="frameMain" :src="reportUrl" 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 {dateFormat} from '@util/gw_date.js';
- import globalVariable from '@api/globalVariable';
- export default {
- components: {
- },
- props: ['ids','type','excelName','reportSrc'],
- data() {
- return {
- pid:'000',
- pidNodes:[],
- dxdcMainHeight: window.innerHeight-200,
- dxdcAsideHeight: window.innerHeight-180,
- windowHeight:window.innerHeight - 200,
- windowWidth:window.innerWidth - 350,
- radioTable:1,
- loading:false,
- leftCol:4,
- rightCol:20,
- monthValue:dateFormat(new Date(), 'yyyy-MM'),
- sttm:'',
- ettm:'',
- treeWidth: 250,
- reportUrl: ''
- }
- },
- mounted() {
- this.reportUrl = this.reportSrc
- },
- methods: {
- // 获取Excel数据
- searchExecl(){
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.formMain.submit();
- // 使用_this
- let _this = this;
- this.$refs.frameMain.onload = function(){
- };
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMain"];
- // v.contentWindow.report1_saveAsExcel();
- v.report1_saveAsExcel();
- },
- },
- watch:{
- ids(val){
- if(val){
- this.reportUrl = this.reportSrc + val
- }else{
- this.reportUrl = this.reportSrc
- }
- },
- reportSrc(val){
- this.reportUrl = val
- },
- monthValue(n,o){
- if(n == null){
- this.monthValue = "";
- }
- },
- sttm(n,o){
- if(n == null){
- this.sttm = "";
- }
- },
- ettm(n,o){
- if(n == null){
- this.ettm = "";
- }
- }
- },
- activated() {
- this.searchExecl();
- }
- }
- </script>
- <style scoped>
- </style>
|