b462988c3e813a276e21ede69f22e3dab2a8f551.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <el-row>
  3. <el-col :span="leftCol">
  4. <el-card :body-style="{'padding':'0'}">
  5. <export-tree-list-ly
  6. :pid="pid"
  7. :type="type"
  8. :pidNodes="pidNodes"
  9. :style="{'max-height':dxdcAsideHeight+'px'}"
  10. @provTreeSelectChange="provTreeSelectChange"
  11. ></export-tree-list-ly>
  12. </el-card>
  13. </el-col>
  14. <el-col :span="rightCol">
  15. <el-card :body-style="{'padding-top':'10px'}">
  16. <div class="block">
  17. <span class="demonstration">选择月份</span>
  18. <el-date-picker
  19. v-model="monthValue"
  20. type="month"
  21. value-format="yyyy-MM"
  22. placeholder="选择月"
  23. ></el-date-picker>
  24. <!-- <el-button-->
  25. <!-- type="primary"-->
  26. <!-- icon="el-icon-download"-->
  27. <!-- style="float: right;margin:0 5px"-->
  28. <!-- @click="exportExecl"-->
  29. <!-- >导出</el-button>-->
  30. <el-button
  31. type="primary"
  32. icon="el-icon-search"
  33. style="float: right;margin:0 5px"
  34. @click="searchExecl"
  35. >查询</el-button>
  36. </div>
  37. </el-card>
  38. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  39. <div style="width: 100%;height: 100%;" v-loading="loading">
  40. <iframe
  41. ref="myIframe"
  42. id="frameMain_szdoc"
  43. src
  44. frameborder="0"
  45. width="100%"
  46. height="100%"
  47. style="overflow: auto"
  48. ></iframe>
  49. </div>
  50. </el-card>
  51. </el-col>
  52. </el-row>
  53. </template>
  54. <script>
  55. import request from '../../../utils/gw_ajax_request.js'
  56. import exportTreeListLy from '../exportTreeList_ly'
  57. import { dateFormat } from '../../../utils/gw_date.js'
  58. import globalVariable from "@api/globalVariable.js"
  59. export default {
  60. components: {
  61. exportTreeListLy: exportTreeListLy,
  62. },
  63. data () {
  64. return {
  65. id: '', // 长江委
  66. pid: '000',
  67. pidNodes: [],
  68. type: '006',
  69. dxdcMainHeight: window.innerHeight - 180,
  70. dxdcAsideHeight: window.innerHeight - 90,
  71. windowHeight: window.innerHeight - 160,
  72. windowWidth: window.innerWidth - 250,
  73. reportSrc: '/pageofficePath/dc/pageoffice/lyzz/report/show',
  74. radioTable: 1,
  75. loading: true,
  76. leftCol: 4,
  77. rightCol: 20,
  78. excelName: '流域水闸专项检查工作报告',
  79. monthValue: dateFormat(new Date(), 'yyyy-MM'),
  80. }
  81. },
  82. mounted () {
  83. },
  84. computed: {
  85. userId: function () {
  86. return localStorage.getItem("userid")
  87. ? localStorage.getItem("userid")
  88. : "1098101939614724096"
  89. }
  90. },
  91. methods: {
  92. provTreeSelectChange (data) {
  93. this.id = data.id
  94. this.searchExecl()
  95. },
  96. // 获取Excel数据
  97. searchExecl () {
  98. //
  99. let _this = this
  100. if (_this.id == '') {
  101. this.id = globalVariable.firstNode
  102. }
  103. if (_this.id == '') {
  104. return
  105. }
  106. if (_this.id != '' && _this.id.length != 6) {
  107. this.openMessage()
  108. return
  109. }
  110. let iframe = document.getElementById("frameMain_szdoc")
  111. let src = this.reportSrc
  112. iframe.src = src + "?ids=" + _this.id
  113. },
  114. openMessage () {
  115. const h = this.$createElement
  116. this.$notify({
  117. title: '提示',
  118. message: h('i', { style: 'color: teal' }, '点击流域才会生成工作报告')
  119. })
  120. },
  121. // 导出Excel数据
  122. exportExecl () {
  123. v = window.frames["frameMain_szdoc"]
  124. v.contentWindow.report1_saveAsWord()
  125. },
  126. },
  127. watch: {
  128. monthValue (n, o) {
  129. if (n == null) {
  130. this.monthValue = ""
  131. }
  132. }
  133. },
  134. activated () {
  135. let _this = this
  136. let iframe = document.getElementById("frameMain_szdoc")
  137. let src = this.reportSrc
  138. iframe.src = src + "?ids=" + _this.id
  139. iframe.onload = function () {
  140. _this.loading = false
  141. }
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. </style>