cf61a3b059846182c671a36babf8f2e3fcc797dd.svn-base 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-container>
  5. <el-main id="dxdcListMain" style="padding:5px 20px;">
  6. <el-tabs @tab-click="clickTab" v-model="currentViewId" type="card">
  7. <el-col :span="4" ref="elw">
  8. <el-card :body-style="{'padding':'0'}">
  9. <exportTreeList
  10. :pid="pid"
  11. :type="type"
  12. :pidNodes="pidNodes"
  13. :height="dxdcAsideHeight"
  14. :width="treeWidth"
  15. :showCheckbox="showCheckbox"
  16. @provTreeSelectChange="provTreeSelectChange"
  17. @treeCheckedDataChange="treeCheckedDataChange"
  18. />
  19. </el-card>
  20. </el-col>
  21. <el-col v-show="showObjData" :span="4" ref="elw">
  22. <el-card :body-style="{'padding':'0'}">
  23. <el-tree :data="objData" :props="defaultProps" :expand-on-click-node="false"
  24. @node-click="objDataSelectChangeHandler">
  25. <span class="custom-tree-node" slot-scope="{ node, data }">
  26. <span :title="node.label">{{ node.label }}</span>
  27. </span>
  28. </el-tree>
  29. </el-card>
  30. </el-col>
  31. <el-tab-pane label="河道外-取水许可管理对象核实" name="first" :key="'first'">
  32. <el-col :span="reportWidth">
  33. <report_wtgt2 v-if="showTable" :ids="ids" :type="type" ref="first" :newYear="newYear"/>
  34. </el-col>
  35. </el-tab-pane>
  36. <el-tab-pane label="河道外-取水许可管理对象核实问题汇总表" name="second" :key="'second'">
  37. <el-col :span="reportWidth">
  38. <report_wtgt1 v-if="showTable" :ids="ids" :type="type" ref="second" :newYear="newYear"/>
  39. </el-col>
  40. </el-tab-pane>
  41. </el-tabs>
  42. </el-main>
  43. </el-container>
  44. </el-container>
  45. </div>
  46. </template>
  47. <script>
  48. import report_wtgt1 from "./report_wtgt1.vue";
  49. import report_wtgt2 from "./report_wtgt2.vue";
  50. import exportTreeList from "./exportTreeList";
  51. import request from "@util/gw_ajax_request";
  52. export default {
  53. components: {
  54. report_wtgt2: report_wtgt2,
  55. report_wtgt1: report_wtgt1,
  56. exportTreeList: exportTreeList,
  57. },
  58. props: [],
  59. data() {
  60. return {
  61. options: [
  62. {
  63. value: "report_wtgt2",
  64. label: "取水许可管理对象核实-河道外"
  65. },
  66. {
  67. value: "report_wtgt1",
  68. label: ""
  69. }
  70. ],
  71. value: "",
  72. currentViewId: "first",
  73. showTable: true,
  74. currentNodeType: "",
  75. ids: [],
  76. pid: "000",
  77. pidNodes: [],
  78. type: "055",
  79. objData: [],
  80. dxdcMainHeight: window.innerHeight - 180,
  81. dxdcAsideHeight: window.innerHeight - 180,
  82. windowHeight: window.innerHeight - 200,
  83. windowWidth: window.innerWidth - 350,
  84. treeWidth: 250,
  85. reportWidth: 16,
  86. showCheckbox: false,
  87. showObjData: true,
  88. newYear: "",
  89. defaultProps: {
  90. children: "children",
  91. label: "depName",
  92. }
  93. };
  94. },
  95. computed: {
  96. persId() {
  97. return localStorage.getItem("userid")
  98. ? localStorage.getItem("userid")
  99. : "1098101939614724096";
  100. }
  101. },
  102. mounted() {
  103. this.treeWidth = this.$refs.elw.$el.clientWidth;
  104. },
  105. watch: {},
  106. methods: {
  107. //树节点选中或取消事件
  108. treeCheckedDataChange(params) {
  109. // 如果是选中状态,把元素id加入到ids里
  110. if (params.newStatus) {
  111. params.newCheckedArray.forEach((element, index) => {
  112. let id = element.id;
  113. if (id != null && id !== undefined && id !== "") {
  114. this.ids.push(id);
  115. }
  116. });
  117. } else {
  118. // 删除取消的元素id
  119. params.changedItem.forEach((element, index) => {
  120. let id = element.id;
  121. let inx = this.ids.indexOf(id);
  122. if (inx > -1) {
  123. delete this.ids[inx];
  124. }
  125. });
  126. }
  127. // 去重
  128. this.ids = Array.from(new Set(this.ids));
  129. console.log("ids:" + this.ids);
  130. },
  131. // 树节点点击事件
  132. provTreeSelectChange(data) {
  133. this.id = data.id;
  134. request.post(`/bis/insp/wtgt/findPage`, {pageNum: 1, pageSize: 100, groupId: this.id}).then((response) => {
  135. if (response.data !== null) {
  136. this.objData = response.data.list;
  137. }
  138. });
  139. },
  140. // 对象点击
  141. objDataSelectChangeHandler(data) {
  142. this.ids = data.id;
  143. this.$refs.first.searchExecl(this.ids);
  144. },
  145. // 切换TAB
  146. clickTab(e) {
  147. if (e.$el.id === 'pane-second') {
  148. this.reportWidth = 20;
  149. this.showCheckbox = true;
  150. this.showObjData = false;
  151. } else {
  152. this.reportWidth = 16;
  153. this.showCheckbox = false;
  154. this.showObjData = true;
  155. }
  156. },
  157. // changeYear(val) {
  158. // this.newYear = val;
  159. // this.ids = [];
  160. // },
  161. }
  162. };
  163. </script>
  164. <style>
  165. </style>