87e271e538a7a4b9aad119fd9daaff801cbb5531.svn-base 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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-shzh
  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-shzh>
  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 :is="option.value" :ids="ids" type="070"
  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_dxsyc1 from "./report_dxsyc1.vue";
  39. import report_dxsyc2 from "./report_dxsyc2.vue";
  40. import exportTreeListWithCheckBoxShzh from "./exportTreeListWithCheckBox_xry";
  41. export default {
  42. components: {
  43. report_dxsyc1: report_dxsyc1,
  44. report_dxsyc2: report_dxsyc2,
  45. exportTreeListWithCheckBoxShzh: exportTreeListWithCheckBoxShzh,
  46. },
  47. props: [],
  48. data() {
  49. return {
  50. options: [
  51. {
  52. value: "report_dxsyc1",
  53. label: "附表1-检查机井基本情况表"
  54. },
  55. {
  56. value: "report_dxsyc2",
  57. label: "附表2-检查发现问题汇总表"
  58. }
  59. ],
  60. value: "",
  61. currentViewId: "附表1-检查机井基本情况表",
  62. showTable: true,
  63. currentNodeType: "",
  64. ids: [],
  65. pid: "000",
  66. pidNodes: [],
  67. type: "070",
  68. dxdcMainHeight: window.innerHeight - 180,
  69. dxdcAsideHeight: window.innerHeight - 180,
  70. windowHeight: window.innerHeight - 200,
  71. windowWidth: window.innerWidth - 350,
  72. treeWidth: 250,
  73. newYear: ""
  74. };
  75. },
  76. computed: {
  77. persId() {
  78. return localStorage.getItem("userid")
  79. ? localStorage.getItem("userid")
  80. : "1098101939614724096";
  81. }
  82. },
  83. mounted() {
  84. this.treeWidth = this.$refs.elw.$el.clientWidth;
  85. },
  86. watch: {},
  87. methods: {
  88. //树节点选中或取消事件
  89. treeCheckedDataChange(params) {
  90. // 如果是选中状态,把元素id加入到ids里
  91. if (params.newStatus) {
  92. params.newCheckedArray.forEach((element, index) => {
  93. let id = element.id;
  94. if (id != null && id !== undefined && id !== "") {
  95. this.ids.push(id);
  96. }
  97. });
  98. } else {
  99. // 删除取消的元素id
  100. params.changedItem.forEach((element, index) => {
  101. let id = element.id;
  102. let inx = this.ids.indexOf(id);
  103. if (inx > -1) {
  104. delete this.ids[inx];
  105. }
  106. });
  107. }
  108. // 去重
  109. this.ids = Array.from(new Set(this.ids));
  110. console.log("ids:" + this.ids);
  111. },
  112. changeYear(val) {
  113. this.newYear = val;
  114. this.ids = [];
  115. },
  116. }
  117. };
  118. </script>
  119. <style>
  120. </style>