DetailList.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <van-popup
  3. v-model:show="props.visibleDetail"
  4. closeable
  5. @close="props.close()"
  6. position="bottom"
  7. :style="{ height: '80%' }">
  8. <view
  9. class="content-wrap"
  10. style="margin-top: 80rpx">
  11. <view class="exe-item">
  12. <Detailtem :data="props.detailData" />
  13. </view>
  14. <view class="exe-item">
  15. <view class="exe-item-detli-top">
  16. <uni-datetime-picker
  17. class="exe-item-detli-time"
  18. type="date"
  19. :model-value="exeDate"
  20. :hide-second="true"
  21. :border="false"
  22. />
  23. <view class="item-right-li priamry"> {{props.detailData.showNum}} </view>
  24. </view>
  25. <van-row class="table-item header">
  26. <van-col span="8">要求执行时间</van-col>
  27. <van-col span="7">执行时间</van-col>
  28. <van-col span="4">执行人</van-col>
  29. <van-col span="5">执行状态</van-col>
  30. </van-row>
  31. <view
  32. v-for="(item, index) in props.detailData.execInfos">
  33. <van-row class="table-item">
  34. <van-col span="8">{{item?.execSttTime}}</van-col>
  35. <van-col span="7">{{item?.execTime}}</van-col>
  36. <van-col span="4">{{item?.execUserName}}</van-col>
  37. <van-col span="5">{{item?.statusDesc}}</van-col>
  38. </van-row>
  39. </view>
  40. </view>
  41. </view>
  42. </van-popup>
  43. </template>
  44. <script setup>
  45. import { ref, watch, onMounted, nextTick } from 'vue';
  46. import Detailtem from './Detailtem.vue';
  47. const exeDate = ref(''); // 执行日期
  48. const props = defineProps({
  49. visibleDetail: {
  50. type: Boolean,
  51. default: false,
  52. },
  53. detailData: {
  54. type: String,
  55. default: '',
  56. },
  57. close: {
  58. type: Function,
  59. default: () => {},
  60. },
  61. });
  62. const formatDateTime = () => {
  63. const date = new Date();
  64. return `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
  65. };
  66. //初始化
  67. const initData = () =>{
  68. let exeDateNow = formatDateTime();
  69. exeDate.value = exeDateNow;
  70. }
  71. watch(
  72. () => props.detailData,
  73. (newVal) => {
  74. // todo根据ID获取详情数据
  75. initData();
  76. },
  77. { immediate: true, deep: true },
  78. );
  79. </script>
  80. <style scoped>
  81. @import url(../common.css);
  82. .table-item {
  83. padding: 20rpx;
  84. border-bottom: 2rpx solid #eee;
  85. font-size: 24rpx;
  86. color: #666;
  87. }
  88. .table-item.header {
  89. color: #333;
  90. }
  91. .table-item:last-child {
  92. border-bottom: none;
  93. }
  94. </style>