instockLog.vue 1.5 KB

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