patrolRecords.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!-- 巡检记录 -->
  2. <template>
  3. <view class="records">
  4. <view class="records-search">
  5. <view class="int">
  6. <u--input placeholder="开始日期" border="surround" v-model="form.startDate" :readonly="true"
  7. prefixIcon="clock" @focus="startDateShow = true">
  8. </u--input>
  9. <u-calendar :show="startDateShow" @confirm="startDateConfirm" @close="startDateShow = false">
  10. </u-calendar>
  11. </view>
  12. <text>至</text>
  13. <view class="int">
  14. <u--input placeholder="结束日期" border="surround" v-model="form.endDate" :readonly="true"
  15. prefixIcon="clock" @focus="endDateShow = true"></u--input>
  16. <u-calendar :show="endDateShow" @confirm="endDateConfirm" @close="endDateShow = false"></u-calendar>
  17. </view>
  18. </view>
  19. <view class="records-table">
  20. <t-table>
  21. <t-tr style="width: 1270rpx; background-color: #e6e6e6;">
  22. <t-th v-for="(item, index) in table.header" :key="index" style="width: 140rpx;height: 100rpx;">
  23. {{ item }}
  24. </t-th>
  25. </t-tr>
  26. <t-tr style="width: 1270rpx;background-color: #fff;height: 100rpx;" v-for="(item, index) in table.list"
  27. :key="index" :class="{'last-child': index === table.list.length - 1}">
  28. <t-td style="width: 140rpx;">{{ item.user }}</t-td>
  29. <t-td style="width: 140rpx;">{{ item.road }}</t-td>
  30. <t-td style="width: 140rpx;">{{ item.device }}</t-td>
  31. <t-td style="width: 140rpx;">{{ item.situation }}</t-td>
  32. <t-td style="width: 140rpx; color: #008CFF;">评价</t-td>
  33. </t-tr>
  34. </t-table>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import tTable from '@/components/t-table/t-table.vue';
  40. import tTh from '@/components/t-table/t-th.vue';
  41. import tTr from '@/components/t-table/t-tr.vue';
  42. import tTd from '@/components/t-table/t-td.vue';
  43. export default {
  44. components: {
  45. tTable,
  46. tTh,
  47. tTr,
  48. tTd
  49. },
  50. data() {
  51. return {
  52. form: {
  53. startDate: '',
  54. endDate: ''
  55. },
  56. startDateShow: false,
  57. endDateShow: false,
  58. table: {
  59. header: ['巡检人', '巡检路段', '巡检设备', '巡检情况', '详情'],
  60. list: [{
  61. user: '张刚',
  62. road: '丰林路',
  63. device: '日常任务',
  64. situation: 'FL001、FL002未巡检'
  65. }, {
  66. user: '张倩',
  67. road: '丰林路',
  68. device: '日常任务',
  69. situation: 'FL001、FL002未巡检'
  70. },
  71. {
  72. user: '运维人员',
  73. road: '丰林路',
  74. device: '日常任务',
  75. situation: 'FL001、FL002未巡检'
  76. },
  77. {
  78. user: '李明',
  79. road: '丰林路',
  80. device: '日常任务',
  81. situation: 'FL001、FL002未巡检'
  82. },
  83. {
  84. user: '陈静',
  85. road: '丰林路',
  86. device: '日常任务',
  87. situation: 'FL001、FL002未巡检'
  88. },
  89. {
  90. user: '孟大顺',
  91. road: '丰林路',
  92. device: '日常任务',
  93. situation: 'FL001、FL002未巡检'
  94. },
  95. {
  96. user: '张强',
  97. road: '丰林路',
  98. device: '日常任务',
  99. situation: 'FL001、FL002未巡检'
  100. }
  101. ]
  102. }
  103. }
  104. },
  105. methods: {
  106. startDateConfirm(val) {
  107. console.log(val)
  108. this.form.startDate = val[0]
  109. this.startDateShow = false
  110. },
  111. endDateConfirm(val) {
  112. console.log(val)
  113. this.form.endDate = val[0]
  114. this.endDateShow = false
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .records {
  121. padding: 14rpx;
  122. &-search {
  123. display: flex;
  124. align-items: center;
  125. .int {
  126. width: 260rpx;
  127. }
  128. text {
  129. padding: 0 10rpx;
  130. }
  131. }
  132. &-table {
  133. margin-top: 40rpx;
  134. }
  135. }
  136. </style>