1d852bad66d969534a4e0b15a817125db38d17ba.svn-base 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <el-row style="width: 100%;height:100%;">
  3. <el-col :span="leftCol" style="height:100%;">
  4. <el-card :body-style="{'padding':'0','height':'100%'}" style="height:100%;">
  5. <export-tree-list-sk-fs
  6. :pid="pid"
  7. :type="type"
  8. :pidNodes="pidNodes"
  9. :level="level"
  10. @provTreeSelectChange="provTreeSelectChange"
  11. ></export-tree-list-sk-fs>
  12. </el-card>
  13. </el-col>
  14. <el-col :span="rightCol" style="height:100%;">
  15. <el-card :body-style="{'padding-top':'10px'}">
  16. <span style="font-size: 14px;color:#434343;">平均单座水库发现问题个数:</span>
  17. <el-input v-model="numBzMin" style="width: 150px">
  18. <template slot="prepend">
  19. 最小值
  20. </template>
  21. </el-input>
  22. -
  23. <el-input v-model="numBzMax" style="width: 150px">
  24. <template slot="prepend">
  25. 最大值
  26. </template>
  27. </el-input>
  28. <!-- &lt;!&ndash; <el-radio-group v-model="radioTable">-->
  29. <!-- <el-radio :label="1">小型水库督查工作报告</el-radio>-->
  30. <!-- </el-radio-group> &ndash;&gt;-->
  31. <!-- <div class="block">-->
  32. <!-- <span class="demonstration">选择月份</span>-->
  33. <!-- <el-date-picker-->
  34. <!-- v-model="monthValue"-->
  35. <!-- type="month"-->
  36. <!-- value-format="yyyy-MM"-->
  37. <!-- placeholder="选择月">-->
  38. <!-- </el-date-picker>-->
  39. <!-- <el-button type="primary" icon="el-icon-download"-->
  40. <!-- style="float: right;margin:0 5px"-->
  41. <!-- @click="exportExecl">导出-->
  42. <!-- </el-button>-->
  43. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  44. <!-- </div>-->
  45. </el-card>
  46. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}" style="height:100%;">
  47. <div style="width: 100%;height: 100%;display:flex;flex-direction:row;justify-content:center;align-items:center;" v-loading="loading">
  48. <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
  49. <p v-if="firstToShow" style="font-weight: bolder;color: #868686;font-size: larger;">请通过左侧树点击指定省份小水库督察,查看报告</p>
  50. <iframe v-show="!firstToShow" ref="myIframe" id="frameMain_sk7" src="" frameborder="0" width="100%" height="100%"
  51. style="overflow: auto"></iframe>
  52. </div>
  53. </el-card>
  54. </el-col>
  55. </el-row>
  56. </template>
  57. <script>
  58. import exportTreeListSkFs from './exportReport'
  59. import {dateFormat} from '../../utils/gw_date.js'
  60. export default {
  61. components: {
  62. exportTreeListSkFs: exportTreeListSkFs,
  63. },
  64. data() {
  65. return {
  66. firstToShow:true,
  67. id: '',
  68. pid: '000',
  69. pidNodes: [],
  70. type: '001',
  71. level: '1',
  72. dxdcMainHeight: window.innerHeight - 180,
  73. dxdcAsideHeight: window.innerHeight - 90,
  74. windowHeight: window.innerHeight - 160,
  75. windowWidth: window.innerWidth - 250,
  76. reportSrc: '/pageofficePath/dc/pageoffice/rsvr/report/show',
  77. radioTable: 1,
  78. loading: false,
  79. leftCol: 4,
  80. rightCol: 20,
  81. excelName: '小型水库督查工作报告',
  82. monthValue: dateFormat(new Date(), 'yyyy-MM'),
  83. numBzMin:2,
  84. numBzMax:5
  85. }
  86. },
  87. mounted() {
  88. // this.init()
  89. },
  90. computed: {
  91. userId: function () {
  92. return localStorage.getItem("userid")
  93. ? localStorage.getItem("userid")
  94. : "1098101939614724096";
  95. }
  96. },
  97. methods: {
  98. // init() {
  99. // let _this = this;
  100. // this.searchExecl();
  101. // },
  102. provTreeSelectChange(data) {
  103. this.id = data.id;
  104. this.searchExecl();
  105. },
  106. // 获取Excel数据
  107. searchExecl() {
  108. if(!this.numBzMin || !this.numBzMax){
  109. this.$message.warning("请输入水库问题标准数范围值");
  110. return;
  111. }
  112. let _this = this;
  113. if (_this.id === '') {
  114. this.firstToShow = true;
  115. return;
  116. }
  117. let iframe = document.getElementById("frameMain_sk7");
  118. iframe.src = _this.reportSrc + "?ids=" + _this.id+"&numBzMax="+_this.numBzMax+"&numBzMin="+_this.numBzMin;
  119. iframe.onload = function () {
  120. _this.firstToShow = false;
  121. };
  122. },
  123. openMessage() {
  124. const h = this.$createElement;
  125. this.$notify({
  126. title: '提示',
  127. message: h('i', {style: 'color: teal'}, '点击流域才会生成工作报告')
  128. });
  129. },
  130. // 导出Excel数据
  131. exportExecl() {
  132. v = window.frames["frameMain_sk7"];
  133. v.contentWindow.report1_saveAsWord();
  134. },
  135. },
  136. watch: {
  137. monthValue(n, o) {
  138. if (n == null) {
  139. this.monthValue = "";
  140. }
  141. }
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. </style>