e08d52f117d11afedf260c2ef0b2feeeac1ee590.svn-base 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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'}" style="height:100%;">
  5. <el-tree
  6. class="el-treeWhite"
  7. :data="treeData"
  8. :props="treeProps"
  9. @node-click="nodeClick"
  10. node-key="id"
  11. style="max-height:100%;overflow:auto;"
  12. ></el-tree>
  13. </el-card>
  14. </el-col>
  15. <el-col :span="rightCol" style="height:100%;">
  16. <!-- <el-card :body-style="{'padding-top':'10px'}">-->
  17. <!-- <el-radio-group v-model="radioTable">-->
  18. <!-- <el-radio :label="1">监督复核情况报告</el-radio>-->
  19. <!-- </el-radio-group>-->
  20. <!-- <div class="block">-->
  21. <!-- <span class="demonstration">选择时间</span>-->
  22. <!-- &lt;!&ndash; <el-date-picker&ndash;&gt;-->
  23. <!-- &lt;!&ndash; v-model="dateValue"&ndash;&gt;-->
  24. <!-- &lt;!&ndash; type="month"&ndash;&gt;-->
  25. <!-- &lt;!&ndash; value-format="yyyy-MM"&ndash;&gt;-->
  26. <!-- &lt;!&ndash; placeholder="选择月">&ndash;&gt;-->
  27. <!-- &lt;!&ndash; </el-date-picker>&ndash;&gt;-->
  28. <!-- <el-date-picker-->
  29. <!-- v-model="date"-->
  30. <!-- type="daterange"-->
  31. <!-- format="yyyy-MM-dd"-->
  32. <!-- range-separator="至"-->
  33. <!-- start-placeholder="开始日期"-->
  34. <!-- end-placeholder="结束日期">-->
  35. <!-- </el-date-picker>-->
  36. <!-- &lt;!&ndash; <el-button type="primary" icon="el-icon-download"&ndash;&gt;-->
  37. <!-- &lt;!&ndash; style="float: right;margin:0 5px"&ndash;&gt;-->
  38. <!-- &lt;!&ndash; @click="exportExecl">导出&ndash;&gt;-->
  39. <!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
  40. <!-- <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询-->
  41. <!-- </el-button>-->
  42. <!-- </div>-->
  43. <!-- </el-card>-->
  44. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}" style="height:100%;">
  45. <div
  46. style="width: 100%;height: 100%;display:flex;flex-direction:row;justify-content:center;align-items:center;"
  47. v-loading="loading"
  48. >
  49. <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
  50. <p
  51. v-if="firstToShow"
  52. style="font-weight: bolder;color: #868686;font-size: larger;"
  53. >请点击左侧小组</p>
  54. <iframe
  55. v-show="!firstToShow"
  56. ref="myIframe"
  57. id="frameMain_sk7"
  58. src
  59. frameborder="0"
  60. width="100%"
  61. height="100%"
  62. style="overflow: auto"
  63. ></iframe>
  64. </div>
  65. </el-card>
  66. </el-col>
  67. </el-row>
  68. </template>
  69. <script>
  70. import {dateFormat} from '../../utils/gw_date.js'
  71. import request from '../../utils/gw_ajax_request.js';
  72. export default {
  73. data() {
  74. return {
  75. firstToShow: true,
  76. id: '',
  77. pid: '000',
  78. pidNodes: [],
  79. ptypes: '053,054,055,056,057',
  80. level: '1',
  81. dxdcMainHeight: window.innerHeight,
  82. dxdcAsideHeight: window.innerHeight - 90,
  83. windowHeight: window.innerHeight - 160,
  84. windowWidth: window.innerWidth - 250,
  85. reportSrc: '/pageofficePath/dc/pageoffice/report/show',
  86. // type: 'renyin',
  87. radioTable: 1,
  88. loading: false,
  89. leftCol: 4,
  90. rightCol: 20,
  91. excelName: '监督复核情况报告',
  92. dateValue: "",
  93. date: "",
  94. treeData: [],
  95. code: '45',
  96. tableDefaultExpandedKeys: ['001', '002', '003', '006'],
  97. treeProps: {
  98. label: "pnm",
  99. children: "childrens",
  100. disabled: false,
  101. expandOnClickNode: false,
  102. first: true,
  103. },
  104. checkedData: [],
  105. changedData: [],
  106. yearList: [],
  107. }
  108. },
  109. mounted() {
  110. this.getLeftTreeData();
  111. },
  112. computed: {
  113. userId: function () {
  114. return localStorage.getItem("userid")
  115. ? localStorage.getItem("userid")
  116. : "1098101939614724096"
  117. }
  118. },
  119. methods: {
  120. // 节点点击事件
  121. nodeClick: function (data, node) {
  122. const ids = data.code.split(",");
  123. if (ids !== ''){
  124. if (ids[0].length !== 12){
  125. return;
  126. }
  127. }
  128. this.id = data.code;
  129. this.searchExecl();
  130. },
  131. //根据用户id获取左侧树
  132. getLeftTreeData() {
  133. var _self = this;
  134. request.get('/dc/insp/all/listByName?ptypes=' + this.ptypes).then((res) => {
  135. let data = res.data;
  136. if (data != null && data.length > 0) {
  137. _self.treeData = data;
  138. }
  139. // 获取第一个节点给子页面带过去
  140. this.getFirstNode(data);
  141. })
  142. },
  143. getFirstNode(data) {
  144. let node = '';
  145. if (data != null && data != '') {
  146. if (data[0].id.length == 6) {
  147. node = data[0].id;
  148. } else if (data[0].id.length == 3) {
  149. node = data[0].childrens[0].id;
  150. }
  151. }
  152. },
  153. // 获取Excel数据
  154. searchExecl() {
  155. let _this = this;
  156. if (_this.id === '') {
  157. this.firstToShow = true
  158. return
  159. }
  160. let iframe = document.getElementById("frameMain_sk7")
  161. iframe.src = _this.reportSrc + "?dateValue=" + _this.dateValue + "&ids=" + _this.id + "&type=wrws";
  162. iframe.onload = function () {
  163. _this.firstToShow = false
  164. }
  165. },
  166. openMessage() {
  167. const h = this.$createElementnpm
  168. this.$notify({
  169. title: '提示',
  170. message: h('i', {style: 'color: teal'}, '点击查询才会生成工作报告')
  171. })
  172. },
  173. // 导出Excel数据
  174. exportExecl() {
  175. v = window.frames["frameMain_sk7"];
  176. v.contentWindow.report1_saveAsWord()
  177. },
  178. },
  179. watch: {
  180. date(n, o) {
  181. this.dateValue = "";
  182. if (n !== null) {
  183. for (const v in n) {
  184. let date = dateFormat(n[v], 'yyyy-MM-dd');
  185. this.dateValue = this.dateValue + date + ',';
  186. }
  187. this.dateValue = this.dateValue.substring(0, this.dateValue.length - 1);
  188. }
  189. }
  190. }
  191. }
  192. </script>
  193. <style scoped>
  194. </style>