zhsxDialog.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class='zhsx-log'>
  3. <el-dialog title='综合记录事项' width='70%' :visible.sync='visible'>
  4. <div class='top'></div>
  5. <div class='bottom'>
  6. <p>1.各级政府部门在广场检查中口头及书面提出的工作要求,整改事项</p>
  7. <p>2.广场消防安全培训、消防演习</p>
  8. <p>3.相关政府强制性检测的按时完成情况及检测中提出的问题</p>
  9. <p>4.广场安全质量第三方检测过程中列出的整改事项</p>
  10. <div class='bottom-table'>
  11. <el-table :data='tableData' height='500' style='width:100%;' :span-method='objectSpanMethod' border v-if='tableData.length>0'>
  12. <el-table-column label='序号' type='index' width='50'></el-table-column>
  13. <el-table-column prop='jcsx' label='检测事项' :show-overflow-tooltip='true'></el-table-column>
  14. <el-table-column prop='zgbm' label='主管部门' :show-overflow-tooltip='true'></el-table-column>
  15. <el-table-column prop='jlsx' label='记录事项' :show-overflow-tooltip='true'></el-table-column>
  16. </el-table>
  17. </div>
  18. </div>
  19. </el-dialog>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. props: ['tableData'],
  25. data() {
  26. return {
  27. visible: false
  28. }
  29. },
  30. methods: {
  31. open() {
  32. this.visible = true
  33. },
  34. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  35. if (columnIndex === 2) {
  36. if (rowIndex > 0 && row[column.property] === this.tableData[rowIndex - 1][column.property]) {
  37. return {
  38. rowspan: 0,
  39. colspan: 0
  40. }
  41. } else {
  42. let rows = 1
  43. for (let i = rowIndex; i < this.tableData.length - 1; i++) {
  44. if (row[column.property] === this.tableData[i + 1][column.property]) {
  45. rows++
  46. }
  47. }
  48. return {
  49. rowspan: rows,
  50. colspan: 1
  51. }
  52. }
  53. } else if (columnIndex == 3) {
  54. console.log(row, column)
  55. }
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="less" scoped>
  61. .top {
  62. width: 100%;
  63. height: 1px;
  64. background: rgba(0, 0, 0, 0.06);
  65. margin-bottom: 20px;
  66. }
  67. .bottom {
  68. padding: 0 30px 14px 30px;
  69. p {
  70. font-size: 14px;
  71. font-family: PingFangSC-Regular, PingFang SC;
  72. font-weight: 400;
  73. color: rgba(96, 106, 120, 1);
  74. line-height: 22px;
  75. }
  76. .bottom-table {
  77. margin-top: 12px;
  78. }
  79. }
  80. </style>
  81. <style lang="less">
  82. .zhsx-log {
  83. }
  84. </style>