6f63fb574d83f512304e85c3df98164cb25714a7.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-container>
  5. <el-main id="dxdcListMain" style="padding:5px 20px;">
  6. <el-tabs v-model="currentViewId" type="card">
  7. <el-col :span="4" ref="elw">
  8. <el-card :body-style="{'padding':'0'}">
  9. <export-tree-list-with-check-box-nyaqhtk
  10. :pid="pid"
  11. :type="type"
  12. :pidNodes="pidNodes"
  13. :height="dxdcAsideHeight"
  14. :width="treeWidth"
  15. @treeCheckedDataChange="treeCheckedDataChange"
  16. @changeYear="changeYear"
  17. ></export-tree-list-with-check-box-nyaqhtk>
  18. </el-card>
  19. </el-col>
  20. <el-tab-pane
  21. :label="option.label"
  22. :name="option.label"
  23. v-for="option in options"
  24. :key="option.value">
  25. <el-col :span="20">
  26. <component v-if="showTable" :is="option.value" :ids="ids" type="037"
  27. :newYear="newYear"></component>
  28. </el-col>
  29. </el-tab-pane>
  30. </el-tabs>
  31. </el-main>
  32. </el-container>
  33. </el-container>
  34. <!-- 添加/编辑人员弹窗 -->
  35. </div>
  36. </template>
  37. <script>
  38. import report_dcry from "./nyaqhtk/report_dcry.vue";
  39. import report_pkhaf from "./nyaqhtk/report_pkhaf.vue";
  40. import report_gsgcaf from "./nyaqhtk/report_gsgcaf.vue";
  41. import report_pkhwtqd from "./nyaqhtk/report_pkhwtqd.vue";
  42. import report_gsgcwtqd from "./nyaqhtk/report_gsgcwtqd.vue";
  43. import exportTreeListWithCheckBoxNyaqhtk from "./exportTreeListWithCheckBox_xry";
  44. export default {
  45. components: {
  46. report_dcry,
  47. report_pkhaf,
  48. report_gsgcaf,
  49. report_pkhwtqd,
  50. report_gsgcwtqd,
  51. exportTreeListWithCheckBoxNyaqhtk: exportTreeListWithCheckBoxNyaqhtk,
  52. },
  53. props: [],
  54. data() {
  55. return {
  56. options: [
  57. {
  58. value: "report_dcry",
  59. label: "附件1 督查人员情况表"
  60. },
  61. {
  62. value: "report_pkhaf",
  63. label: "附件2 贫困户暗访情况表"
  64. },
  65. {
  66. value: "report_gsgcaf",
  67. label: "附件3 农村供水工程暗访情况表"
  68. },
  69. {
  70. value: "report_pkhwtqd",
  71. label: "附件4 贫困户问题清单表"
  72. },
  73. {
  74. value: "report_gsgcwtqd",
  75. label: "附件5 农村供水工程问题清单"
  76. }
  77. ],
  78. value: "",
  79. currentViewId: "附件1 督查人员情况表",
  80. showTable: true,
  81. currentNodeType: "",
  82. ids: [],
  83. pid: "000",
  84. pidNodes: [],
  85. type: "037",
  86. dxdcMainHeight: window.innerHeight - 180,
  87. dxdcAsideHeight: window.innerHeight - 180,
  88. windowHeight: window.innerHeight - 200,
  89. windowWidth: window.innerWidth - 350,
  90. treeWidth: 250,
  91. newYear: ""
  92. };
  93. },
  94. computed: {
  95. persId() {
  96. return localStorage.getItem("userid")
  97. ? localStorage.getItem("userid")
  98. : "1098101939614724096";
  99. }
  100. },
  101. mounted() {
  102. this.treeWidth = this.$refs.elw.$el.clientWidth;
  103. },
  104. watch: {},
  105. methods: {
  106. //树节点选中或取消事件
  107. treeCheckedDataChange(params) {
  108. // 如果是选中状态,把元素id加入到ids里
  109. if (params.newStatus) {
  110. params.newCheckedArray.forEach((element, index) => {
  111. let id = element.id;
  112. if (id != null && id !== undefined && id !== "") {
  113. this.ids.push(id);
  114. }
  115. });
  116. } else {
  117. // 删除取消的元素id
  118. params.changedItem.forEach((element, index) => {
  119. let id = element.id;
  120. let inx = this.ids.indexOf(id);
  121. if (inx > -1) {
  122. delete this.ids[inx];
  123. }
  124. });
  125. }
  126. // 去重
  127. this.ids = Array.from(new Set(this.ids));
  128. console.log("ids:" + this.ids);
  129. },
  130. changeYear(val) {
  131. this.newYear = val;
  132. this.ids = [];
  133. },
  134. }
  135. };
  136. </script>
  137. <style>
  138. </style>