zhsxOther.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <!-- 综合事项记录 -->
  2. <template>
  3. <div class="zhsx-box">
  4. <div class="zhsx-top">
  5. <div>
  6. <el-tabs v-model="activeName" @tab-click="handleClick">
  7. <el-tab-pane
  8. v-for="(item,index) in everySystem"
  9. :key="index"
  10. :label="`${item.label}`"
  11. :name="`${item.type}`"
  12. >
  13. <!-- 综合记录事项 -->
  14. <div v-if="item.type==1">
  15. <zhsx-other-table1 ref="tableZhsx1"></zhsx-other-table1>
  16. </div>
  17. <!-- 第三方检测事项 -->
  18. <div v-if="item.type==2">
  19. <zhsx-other-table2 ref="tableZhsx2"></zhsx-other-table2>
  20. </div>
  21. </el-tab-pane>
  22. </el-tabs>
  23. </div>
  24. <div class="zhsx-img" @click="zhsxLog">
  25. <img src="../../assets/imgs/zy1.png" alt />
  26. </div>
  27. </div>
  28. <zhsx-dialog ref="Dialog" :tableData="tableData"></zhsx-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import moment from "moment";
  33. import { Select } from "meri-design";
  34. // import Select from '@/components/Select/Select.vue'
  35. import ZhsxDialog from "./zhsxDialog";
  36. import zhsxOtherTable1 from "./zhsxOtherTable1";
  37. import zhsxOtherTable2 from "./zhsxOtherTable2";
  38. import { queryZhsxjl } from "@/api/other.js";
  39. export default {
  40. data() {
  41. return {
  42. activeName: "1",
  43. tableData: []
  44. };
  45. },
  46. props: ["everySystem"],
  47. components: { ZhsxDialog, Select, zhsxOtherTable1, zhsxOtherTable2 },
  48. methods: {
  49. zhsxLog() {
  50. let params = {
  51. getParams: {}
  52. };
  53. queryZhsxjl(params).then(res => {
  54. let arr = [];
  55. let newdata = this.compIndex(res.data);
  56. //console.log('综合事项弹框', res)
  57. this.tableData = newdata || [];
  58. // 将tableData中的第三项都设置为相同的数据
  59. this.tableData.map(item => {
  60. arr.push(item.jlsx);
  61. });
  62. arr = [...new Set(arr)];
  63. this.tableData.map(item => {
  64. item.jlsx = arr.join("\n\r");
  65. });
  66. });
  67. this.$refs.Dialog.open();
  68. },
  69. compIndex(ary) {
  70. var res = [];
  71. ary.sort();
  72. var num = 1;
  73. for (var i = 0; i < ary.length; ) {
  74. var count = 0;
  75. for (var j = i; j < ary.length; j++) {
  76. if (ary[i]["jcsx"] == ary[j]["jcsx"]) {
  77. count++;
  78. }
  79. }
  80. res.push([ary[i]["jcsx"], num]);
  81. num = num + 1;
  82. i += count;
  83. }
  84. for (var i = 0; i < ary.length; i++) {
  85. for (var j = 0; j < res.length; j++) {
  86. if (ary[i]["jcsx"] == res[j][0]) {
  87. ary[i]["num"] = res[j][1];
  88. }
  89. }
  90. }
  91. return ary
  92. },
  93. handleClick(tab) {
  94. if (tab.index == "0") {
  95. this.$refs.tableZhsx1[0].getZhjl();
  96. } else if (tab.index == "1") {
  97. this.$refs.tableZhsx2[0].dsfjc();
  98. }
  99. }
  100. },
  101. mounted() {
  102. this.$refs.tableZhsx1[0].getZhjl();
  103. }
  104. };
  105. </script>
  106. <style lang="less" scoped>
  107. .zhsx-box {
  108. height: 100%;
  109. padding: 66px 50px 38px 50px;
  110. .zhsx-top {
  111. position: relative;
  112. .zhsx-img {
  113. position: absolute;
  114. width: 16px;
  115. height: 16px;
  116. left: 260px;
  117. top: 3px;
  118. cursor: pointer;
  119. img {
  120. width: 100%;
  121. height: 100%;
  122. }
  123. }
  124. .tab-top {
  125. display: flex;
  126. align-items: center;
  127. }
  128. }
  129. .zhsx-bottom {
  130. margin-top: 12px;
  131. background: #ffffff;
  132. position: relative;
  133. padding-bottom: 73px;
  134. .footer {
  135. height: 32px;
  136. display: flex;
  137. justify-content: flex-end;
  138. margin-top: 28px;
  139. }
  140. }
  141. }
  142. </style>
  143. <style lang="less">
  144. .zhsx-box {
  145. .el-dialog__header {
  146. padding: 16px 50px;
  147. }
  148. .el-dialog__title {
  149. font-size: 16px;
  150. font-family: PingFangSC-Medium, PingFang SC;
  151. font-weight: 500;
  152. color: rgba(0, 0, 0, 0.85);
  153. line-height: 24px;
  154. }
  155. .el-dialog__body {
  156. padding: 0 24px;
  157. height: 90%;
  158. }
  159. .el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
  160. .el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
  161. .el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
  162. .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  163. padding-left: 16px;
  164. }
  165. .el-tabs--bottom .el-tabs__item.is-bottom:last-child,
  166. .el-tabs--bottom .el-tabs__item.is-top:last-child,
  167. .el-tabs--top .el-tabs__item.is-bottom:last-child,
  168. .el-tabs--top .el-tabs__item.is-top:last-child {
  169. padding-right: 16px;
  170. }
  171. .el-tabs__nav-wrap::after {
  172. height: 0;
  173. }
  174. .el-tabs__item {
  175. padding: 5px 16px;
  176. height: 30px;
  177. line-height: 22px;
  178. font-size: 14px;
  179. font-family: MicrosoftYaHei;
  180. color: rgba(31, 36, 41, 1);
  181. border: 1px solid rgba(195, 199, 203, 1);
  182. background: #fff;
  183. }
  184. /deep/.el-tabs__item:nth-child(2) {
  185. border-radius: 4px 0 0 4px;
  186. }
  187. /deep/.el-tabs__item:last-child {
  188. border-radius: 0 4px 4px 0;
  189. }
  190. .el-tabs,
  191. .el-tabs__content {
  192. height: 94%;
  193. }
  194. .el-tabs__active-bar {
  195. background-color: transparent !important;
  196. }
  197. .is-active {
  198. color: #025baa;
  199. border-color: #025baa;
  200. border-radius: 4px;
  201. }
  202. .el-tabs__header {
  203. margin: 0 0 12px;
  204. }
  205. .el-table td,
  206. .el-table th {
  207. padding: 8px 0;
  208. }
  209. .el-input--suffix .el-input__inner {
  210. padding-right: 20px;
  211. }
  212. @media screen and (max-width: 1366px) {
  213. /deep/ .el-table td {
  214. padding: 3px 0;
  215. }
  216. }
  217. }
  218. </style>