c828583b832aa6ca03653a238b4177602794977d.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <el-row>
  3. <el-col :span="leftCol" ref="elw">
  4. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  5. <provTreeList
  6. :rootCode="rootCode" :rootType="rootType"
  7. @provTreeSelectChange="provTreeSelectChangeHandler"
  8. :style="{'max-height':dxdcAsideHeight+'px'}"
  9. :defaultExpandedKeys="defaultExpandedKeys">
  10. </provTreeList>
  11. </el-card>
  12. </el-col>
  13. <el-col :span="rightCol">
  14. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  15. <div class="block" style="height:40px;line-height: 40px;font-size: 14px;">
  16. <span style="color:red;">(*左侧树请选择区、县)</span>
  17. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  18. <el-date-picker
  19. v-model="findTime"
  20. type="daterange"
  21. value-format="yyyy-MM-dd"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. end-placeholder="结束日期">
  25. </el-date-picker>
  26. <el-button type="primary" icon="el-icon-search" @click="searchExecl">查询</el-button>
  27. </div>
  28. <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="post">
  29. <input id="id" type="hidden" name="id">
  30. <input id="adCode" type="hidden" name="adCode">
  31. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  32. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  33. </form>
  34. <div v-loading="loading" style="width: 100%;height: calc(100% - 50px);display:flex;flex-direction:row;justify-content:center;align-items:center;">
  35. <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
  36. <p v-if="firstToShow" style="font-weight: bolder;color: #868686;font-size: larger;">请通过左侧树点击指定地区,导出报告</p>
  37. <iframe v-show="!firstToShow" ref="frameMain8" id="frameMain8" name="frameMain8" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  38. </div>
  39. </el-card>
  40. </el-col>
  41. </el-row>
  42. </template>
  43. <script>
  44. import {dateFormat,getFirstDayOfMonth} from '../../../../utils/gw_date.js';
  45. import provTreeList from '@widget/provTreeList_preflood.vue';
  46. export default {
  47. components: {
  48. provTreeList:provTreeList,
  49. },
  50. data() {
  51. return {
  52. defaultExpandedKeys:[this.currentRlcode],
  53. adCode:'',
  54. dxdcMainHeight: window.innerHeight-90,
  55. dxdcAsideHeight: window.innerHeight-100,
  56. windowHeight:window.innerHeight - 200,
  57. windowWidth:window.innerWidth - 350,
  58. reportSrc:'/pageofficePath/dc/pageoffice/preFlood/show',
  59. loading:false,
  60. leftCol:4,
  61. rightCol:20,
  62. excelName:'汛前检查报告',
  63. treeWidth: 250,
  64. firstToShow:true,
  65. rootCode:'000000',
  66. rootType:'2',
  67. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  68. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  69. ettm: dateFormat(new Date(), 'yyyy-MM-dd')
  70. }
  71. },
  72. mounted() {
  73. this.treeWidth = this.$refs.elw.$el.clientWidth;
  74. },
  75. //生命周期 - 创建完成(可以访问当前this实例)
  76. created() {
  77. // 注意是数组
  78. },
  79. computed: {
  80. userId: function () {
  81. return localStorage.getItem("userid")
  82. ? localStorage.getItem("userid")
  83. : "1098101939614724096";
  84. },
  85. currentRlcode() {
  86. return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
  87. }
  88. },
  89. methods: {
  90. provTreeSelectChangeHandler: function(params) {
  91. if(params.adGrad=="4" || params.adGrad=="3"){
  92. this.adCode = params.code;
  93. this.searchExecl();
  94. }else{
  95. this.$message.warning("请选择市、区、县");
  96. }
  97. },
  98. // 获取Excel数据
  99. searchExecl(){
  100. let _this = this;
  101. if( _this.adCode == ''){
  102. return;
  103. }
  104. // v-model 不同步,只能手动同步了
  105. document.getElementById("adCode").value = _this.adCode;
  106. this.firstToShow = false;
  107. this.loading = true;
  108. // 使用form表单post提交,彻底解决参数值过长的问题
  109. this.$refs.formMain8.submit();
  110. // 使用_this
  111. this.$refs.frameMain8.onload = function(){
  112. _this.loading = false;
  113. };
  114. },
  115. },
  116. watch:{
  117. findTime(n,o){
  118. if(!n){
  119. this.sttm = "";
  120. this.ettm = "";
  121. }else{
  122. this.sttm = n[0];
  123. this.ettm = n[1];
  124. }
  125. },
  126. },
  127. activated() {
  128. this.searchExecl();
  129. }
  130. }
  131. </script>
  132. <style >
  133. </style>