instockLog.vue 1.4 KB

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