waybillNoLog.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="history">
  3. <view class="item" v-for="(item, i) in waybillNoHistory" :key="i">
  4. <view>
  5. <view>
  6. <text class="type">库位</text>
  7. <text class="code" :style="{ color: item.status ? 'green' : '#666' }">{{ item.space }}</text>
  8. </view>
  9. <view>
  10. <text class="type">单号</text>
  11. <text class="code" :style="{ color: item.status ? 'green' : '#666' }">{{ item.code }}</text>
  12. </view>
  13. <view class="space-time">
  14. <text>
  15. {{ item.createTime }}
  16. </text>
  17. </view>
  18. </view>
  19. <view>
  20. <uni-icons v-if="item.status" type="checkmarkempty" class="status" size="16"
  21. color="green"></uni-icons>
  22. <text class="status fail" v-else>F</text>
  23. </view>
  24. </view>
  25. <view v-if="waybillNoHistory.length === 0" class="is-empty">暂无历史</view>
  26. </view>
  27. </template>
  28. <script setup lang="ts">
  29. import { reactive, ref } from 'vue';
  30. import { onLoad } from '@dcloudio/uni-app';
  31. const waybillNoHistory = ref([]);
  32. const getHistory = async () => {
  33. waybillNoHistory.value = await uni.getStorageSync('waybillNoHistory');
  34. };
  35. onLoad(async () => {
  36. await getHistory();
  37. });
  38. </script>
  39. <style lang="scss" scoped>
  40. .history {
  41. display: flex;
  42. width: 100%;
  43. flex-direction: column;
  44. justify-items: start;
  45. .title {
  46. padding: 20rpx;
  47. font-size: 24rpx;
  48. font-weight: 600;
  49. }
  50. .type {
  51. padding-right: 20rpx;
  52. font-size: 24rpx;
  53. }
  54. .code {
  55. font-weight: 600;
  56. }
  57. .item {
  58. padding: 20rpx;
  59. font-size: 20rpx;
  60. color: #666;
  61. display: flex;
  62. flex-direction: row;
  63. .status {
  64. padding-left: 20rpx;
  65. }
  66. .fail {
  67. font-weight: 600;
  68. color: #f00;
  69. }
  70. }
  71. .is-empty {
  72. text-align: center;
  73. margin: 40px 0;
  74. color: #999;
  75. }
  76. }
  77. </style>