| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <el-row>
- <el-col :span="leftCol" ref="elw">
- <el-card :body-style="{'padding':'0'}">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">工程信息</p>
- <export-tree-list-slgc
- @provTreeSelectChange="provTreeSelectChange"
- :height="dxdcAsideHeight"
- :width="treeWidth"
- ></export-tree-list-slgc>
- </el-card>
- </el-col>
- <el-col :span="rightCol">
- <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="myForm" id="myForm" target="myIframe" :action="reportSrc" method="post">
- <input type="hidden" name="width" v-model="windowWidth">
- <input type="hidden" name="height" v-model="windowHeight">
- <input type="hidden" name="objId" ref="objId" id="objId">
- <input type="hidden" name="excelName" v-model="excelName">
- <input type="hidden" name="stm" v-model="stm" ref="stm" id="stm">
- <input type="hidden" name="etm" v-model="etm" ref="etm" kd="etm">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="myIframe" id="myIframe" name="myIframe" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- import request from '../../../utils/gw_ajax_request.js';
- import exportTreeListSlgc from '../exportTreeList_slgc.vue';
- import {dateFormat,formatDateTime11} from '../../../utils/gw_date.js';
- import globalVariable from "@api/globalVariable.js";
- export default {
- components: {
- exportTreeListSlgc:exportTreeListSlgc,
- },
- data() {
- return {
- dxdcMainHeight: window.innerHeight-180,
- dxdcAsideHeight: window.innerHeight-130,
- windowHeight:window.innerHeight - 160,
- windowWidth:window.innerWidth - 250,
- reportSrc:'/JsReport/reportFiles/reportjsp/showReport_doc.jsp?raq=dc_zdslgc_word.raq',
- loading:true,
- leftCol:4,
- rightCol:20,
- excelName:'水利工程建设督查报告',
- findTime: [
- new Date(formatDateTime11(15,new Date())),
- new Date()
- ],
- objId:'',
- stm: dateFormat(new Date(formatDateTime11(15,new Date())),'yyyy-MM-dd'),
- etm: dateFormat(new Date(),'yyyy-MM-dd'),
- treeWidth: 200,
- }
- },
- mounted() {
- this.treeWidth = this.$refs.elw.$el.clientWidth;
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- }
- },
- methods: {
- provTreeSelectChange(data){
- //
- document.getElementById("id").value = data.objId;
- this.searchExecl();
- // console.log(globalVariable)
- // console.log(globalVariable)
- },
- // 获取Excel数据
- searchExecl(){
- //
- let findTime = this.findTime;
- if(!(findTime[0] instanceof Date)){
- this.stm = findTime[0];
- this.etm = findTime[1];
- }
- this.loading = true;
- // 有一个问题v-model绑定滞后一个节点
- this.$refs.stm = this.etm;
- this.$refs.etm = this.etm;
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.myForm.submit();
- // 使用_this
- let _this = this;
- this.$refs.myIframe.onload = function(){
- _this.loading = false;
- };
- },
- // 导出word数据
- exportExecl(){
- v = window.frames["myIframe"];
- // v.contentWindow.report1_saveAsWord();
- v.report1_saveAsWord();
- },
- },
-
-
- watch:{
-
- },
- activated() {
- this.searchExecl();
- }
- }
- </script>
- <style scoped>
- </style>
|