9b51f14a7c283fed34e2f3ed4a3cf51afb7d2b85.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. <exportTreeListWithCheckBoxZjqjg
  10. :pid="pid"
  11. :type="type"
  12. :pidNodes="pidNodes"
  13. :height="dxdcAsideHeight"
  14. :width="treeWidth"
  15. @treeCheckedDataChange="treeCheckedDataChange"
  16. ></exportTreeListWithCheckBoxZjqjg>
  17. </el-card>
  18. </el-col>
  19. <el-tab-pane
  20. :label="option.label"
  21. :name="option.label"
  22. v-for="option in options"
  23. :key="option.value">
  24. <el-col :span="20">
  25. <component v-if="showTable" :is="option.value" :ids="ids" type="042"
  26. :newYear="newYear"></component>
  27. </el-col>
  28. </el-tab-pane>
  29. </el-tabs>
  30. </el-main>
  31. </el-container>
  32. </el-container>
  33. <!-- 添加/编辑人员弹窗 -->
  34. </div>
  35. </template>
  36. <script>
  37. import report_zjry1 from "./report_zjry1.vue";
  38. import report_zjry2 from "./report_zjry2.vue";
  39. import report_zjry3 from "./report_zjry3.vue";
  40. import exportTreeListWithCheckBoxZjqjg from "./exportTreeListWithCheckBox_zjqjg";
  41. export default {
  42. components: {
  43. report_zjry1: report_zjry1,
  44. report_zjry2: report_zjry2,
  45. report_zjry3: report_zjry3,
  46. exportTreeListWithCheckBoxZjqjg: exportTreeListWithCheckBoxZjqjg,
  47. },
  48. props: [],
  49. data() {
  50. return {
  51. options: [
  52. {
  53. value: "report_zjry1",
  54. label: "农村饮用水达标提标行动明查暗访反馈表"
  55. },
  56. {
  57. value: "report_zjry2",
  58. label: "问题明细统计表"
  59. },
  60. {
  61. value: "report_zjry3",
  62. label: "问题数目统计表"
  63. }
  64. ],
  65. value: "",
  66. currentViewId: "农村饮用水达标提标行动明查暗访反馈表",
  67. showTable: true,
  68. currentNodeType: "",
  69. ids: [],
  70. pid: "000",
  71. pidNodes: [],
  72. type: "041",
  73. dxdcMainHeight: window.innerHeight - 180,
  74. dxdcAsideHeight: window.innerHeight - 180,
  75. windowHeight: window.innerHeight - 200,
  76. windowWidth: window.innerWidth - 350,
  77. treeWidth: 250,
  78. newYear: ""
  79. };
  80. },
  81. computed: {
  82. persId() {
  83. return localStorage.getItem("userid")
  84. ? localStorage.getItem("userid")
  85. : "1098101939614724096";
  86. }
  87. },
  88. mounted() {
  89. this.treeWidth = this.$refs.elw.$el.clientWidth;
  90. },
  91. watch: {},
  92. methods: {
  93. //树节点选中或取消事件
  94. treeCheckedDataChange(params) {
  95. // 如果是选中状态,把元素id加入到ids里
  96. if (params.newStatus) {
  97. params.newCheckedArray.forEach((element, index) => {
  98. let id = element.id;
  99. if (id != null && id !== undefined && id !== "") {
  100. this.ids.push(id);
  101. }
  102. });
  103. } else {
  104. // 删除取消的元素id
  105. params.changedItem.forEach((element, index) => {
  106. let id = element.id;
  107. let inx = this.ids.indexOf(id);
  108. if (inx > -1) {
  109. delete this.ids[inx];
  110. }
  111. });
  112. }
  113. // 去重
  114. this.ids = Array.from(new Set(this.ids));
  115. console.log("ids:" + this.ids);
  116. },
  117. }
  118. };
  119. </script>
  120. <style>
  121. </style>