reviewOrderItem.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="review-order-card">
  3. <!-- 订单信息 -->
  4. <view class="order-info">
  5. <view class="info-row">
  6. <text class="label">订单号:</text>
  7. <text class="value">{{ item.orderId }}</text>
  8. </view>
  9. <view class="info-row">
  10. <text class="label">仓库:</text>
  11. <text class="value">{{ item.godownName }}</text>
  12. </view>
  13. <view class="info-row">
  14. <text class="label">不良数量:</text>
  15. <text class="value">{{ item.reviewNum || 0 }}</text>
  16. </view>
  17. <view class="info-row">
  18. <text class="label">是否入库:</text>
  19. <text class="value">{{ stockStatusText }}</text>
  20. <text v-if="item.positionCode" class="position-code">{{ item.positionCode }}</text>
  21. </view>
  22. <view class="info-row">
  23. <text class="label">申请复审时间:</text>
  24. <text class="value">{{ item.applyTime }}</text>
  25. </view>
  26. <view class="info-row">
  27. <text class="label">已用时长:</text>
  28. <TimeClock :initialSeconds="item.waitingTime" />
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { computed } from "vue";
  35. import TimeClock from "./time-clock.vue";
  36. const props = defineProps({
  37. item: {
  38. type: Object,
  39. default: () => { },
  40. },
  41. });
  42. // 库存状态文本
  43. const stockStatusText = computed(() => {
  44. if (props.item.stockStatus === 1) {
  45. return "已入库";
  46. } else if (props.item.stockStatus === 0) {
  47. return "未入库";
  48. }
  49. return "-";
  50. });
  51. // 库存状态颜色
  52. const stockStatusColor = computed(() => {
  53. if (props.item.stockStatus === 1) {
  54. return "#FF4D4F"; // 红色 - 已入库
  55. } else if (props.item.stockStatus === 0) {
  56. return "#333333"; // 黑色 - 未入库
  57. }
  58. return "#999999";
  59. });
  60. // 格式化等待时长(毫秒转为时:分:秒)
  61. const formatWaitingTime = (milliseconds) => {
  62. if (!milliseconds) return "00:00:00";
  63. const totalSeconds = Math.floor(milliseconds / 1000);
  64. const hours = Math.floor(totalSeconds / 3600);
  65. const minutes = Math.floor((totalSeconds % 3600) / 60);
  66. const seconds = totalSeconds % 60;
  67. const pad = (num) => String(num).padStart(2, '0');
  68. return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .review-order-card {
  73. background: #ffffff;
  74. border-radius: 8rpx;
  75. padding: 24rpx;
  76. margin-bottom: 20rpx;
  77. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  78. .order-info {
  79. .info-row {
  80. display: flex;
  81. align-items: center;
  82. margin-bottom: 16rpx;
  83. font-size: 28rpx;
  84. line-height: 40rpx;
  85. &:last-child {
  86. margin-bottom: 0;
  87. }
  88. .label {
  89. color: #333333;
  90. font-weight: 400;
  91. }
  92. .value {
  93. color: #333333;
  94. flex: 1;
  95. &.time-duration {
  96. color: #FF4D4F;
  97. font-weight: 500;
  98. }
  99. }
  100. .position-code {
  101. color: #E87A20FF;
  102. margin-left: 16rpx;
  103. font-weight: 500;
  104. }
  105. }
  106. }
  107. }
  108. </style>