| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <template>
- <el-row>
- <el-col :span="leftCol" ref="elw">
- <el-card :body-style="{'padding':'0'}">
- <export-tree-list-with-check-box-sk
- :pid="pid"
- :type="type"
- :pidNodes="pidNodes"
- @treeCheckedDataChange="treeCheckedDataChange"
- :height="dxdcAsideHeight"
- :width="treeWidth"
- @changeYear="changeYear"
- ></export-tree-list-with-check-box-sk>
- </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="forMainFb2" id="forMainFb2" target="frameMainFb2" :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" 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">
- <input type="hidden" name="persid" v-model="userId">
- <input type="hidden" name="year" v-model="newYear">
- </form>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe ref="frameMainFb2" id="frameMainFb2" name="frameMainFb2" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- import exportTreeListWithCheckBoxSk from './exportTreeListWithCheckBox_sk'
- import {dateFormat} from '../../utils/gw_date.js'
- import {reportUrl} from '@util/global_variable.js'
- export default {
- components: {
- exportTreeListWithCheckBoxSk:exportTreeListWithCheckBoxSk,
- },
- data() {
- return {
- ids:[],
- pid:'000',
- pidNodes:[],
- type:'003',
- dxdcMainHeight: window.innerHeight-190,
- dxdcAsideHeight: window.innerHeight-180,
- windowHeight:window.innerHeight - 200,
- windowWidth:window.innerWidth - 350,
- radioTable:1,
- loading:false,
- leftCol:4,
- rightCol:20,
- excelName:'防洪工程设施水毁修复督查问题汇总表',
- monthValue:dateFormat(new Date(), 'yyyy-MM'),
- sttm:'',
- ettm:'',
- treeWidth: 250,
- newYear: ""
- }
- },
- mounted() {
- this.treeWidth = this.$refs.elw.$el.clientWidth;
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- reportSrc(){
- return `/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=sh02.raq`
- }
- },
- methods: {
- //树节点选中或取消事件
- treeCheckedDataChange(params){
- // 如果是选中状态,把元素id加入到ids里
- if(params.newStatus){
- params.newCheckedArray.forEach((element,index) => {
- let id = element.id;
- if(id != null && id !== undefined && id !=='' ){
- this.ids.push(id)
- }
- });
- }else {
- // 删除取消的元素id
- params.changedItem.forEach((element,index) => {
- let id = element.id;
- let inx = this.ids.indexOf(id);
- if(inx > -1) {
- delete this.ids[inx]
- }
- });
- }
- // 去重
- this.ids = Array.from(new Set(this.ids));
- console.log("ids:" + this.ids)
- },
- // 获取Excel数据
- searchExecl(){
- this.loading = true;
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.forMainFb2.submit();
- // 使用_this
- let _this = this;
- this.$refs.frameMainFb2.onload = function(){
- _this.loading = false;
- };
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainFb2"];
- // v.contentWindow.report1_saveAsExcel();
- v.report1_saveAsExcel();
- },
- changeYear(val) {
- this.newYear = val;
- this.ids = [];
- },
- },
- watch:{
- 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>
|