| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;" v-if="vShow">
- <p>水利工程名称</p>
- <el-input v-model="nm" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
- <p>水利工程类型</p>
- <el-select clearable v-model="ptype" placeholder="请选择水利工程类型" style="margin-left:10px;margin-right:15px">
- <el-option
- v-for="item in ptypeOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <el-button type="primary" icon="el-icon-search" style="margin-left:5px;" plain @click="searchExecl">查询</el-button>
- <!-- <el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button> -->
- <span style="margin-left:15px;">(<b style="color:red;">注意:Excel文件导入操作会覆盖本页所有数据,请谨慎操作。</b>)</span>
- </el-header>
- <el-main id="dcjhMain">
- <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
- <iframe ref="myIframe" id="frameMainSlgc" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-main>
- </el-container>
- </template>
- <script>
- const ptypeOption = [
- // {
- // value:'all',
- // label:'全部'
- // },
- {
- value:'0',
- label:'重大农业节水工程'
- },{
- value:'1',
- label:'重大引调水工程'
- },{
- value:'2',
- label:'重点水源工程'
- },{
- value:'3',
- label:'江河湖泊治理骨干工程'
- },{
- value:'4',
- label:'新建大型灌区工程'
- },{
- value:'5',
- label:'非水利部下达投资计划'
- },{
- value:'6',
- label:'全部由地方投资'
- },{
- value:'7',
- label:'其他项目'
- }];
- import request from '../../../utils/gw_ajax_request.js';
- import {dateFormat} from '../../../utils/gw_date.js'
- export default {
- props: ['show','nmStr','heightStr','widthStr','dxdcMainHeightStr'],
- components: {
- },
- data() {
- return {
- loading:false,
- // reportSrc:'http://localhost:6868/demo/reportJsp/previewInput.jsp?sht=%2Fslgc_baseInfo_line.sht&rpxHome=D%3A%2F1%2Freport%2F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2F%E8%A1%8C%E5%BC%8F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2Fslgc&dfxHome=',
- reportSrc:'/demo/reportJsp/showInput.jsp?sht=slgc_baseInfo_line.sht',
- excelName:'水利工程基础信息表',
- dxdcMainHeight: window.innerHeight - 130,
- windowHeight:window.innerHeight - 130,
- windowWidth:window.innerWidth - 10,
- sttm:'',
- ettm:'',
- monthValue:'',
- nm:'',
- ptype:'',
- ptypeOption:ptypeOption,
- vShow:true,
- }
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- },
- watch:{
- sttm(n,o){
- if(n == null){
- this.sttm = "";
- }
- },
- ettm(n,o){
- if(n == null){
- this.ettm = "";
- }
- },
- monthValue(n,o){
- if(n == null){
- this.monthValue = "";
- }
- },
- },
- mounted(){
- if(this.show != undefined){
- this.vShow = this.show;
- }
- if(this.nmStr != undefined){
- this.nm = this.nmStr;
- }
- if(this.heightStr != undefined){
- this.windowHeight = this.heightStr;
- }
- if(this.widthStr != undefined){
- this.windowWidth = this.widthStr;
- }
- if(this.dxdcMainHeightStr != undefined){
- this.dxdcMainHeight = this.dxdcMainHeightStr;
- }
- this.searchExecl();
- },
- methods:{
- // 获取Excel数据
- searchExecl(){
- // this.loading = true;
- let _this = this;
- let iframe = document.getElementById("frameMainSlgc");
- let src = this.reportSrc;
- let _ptype = this.ptype;
- if(_ptype == null || _ptype == ''){
- _ptype = 'all'
- }
- let _nm = this.nm;
- if(_nm == ''){
- _nm = 'all'
- }
-
- iframe.src= src
- + "&width=" + this.windowWidth
- + "&height=" + this.windowHeight
- + "&excelName=" + this.excelName
- + "&sttm=" + this.sttm
- + "&ettm=" + this.ettm
- + "&nm=" + _nm
- + "&ptype=" + _ptype
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- _this.loading = false;
- });
- } else {
- iframe.onload = function(){
- _this.loading = false;
- };
- }
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainSlgc"];
- v.contentWindow.report1_saveAsExcel();
- },
- },
- activated() {
- }
- }
- </script>
- <style>
- #dcjhMain {
- /* overflow: hidden; */
- padding:0;
- }
- </style>
|