DetailView.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view>
  3. <view class="tabs-container">
  4. <view class="tabs">
  5. <view class="tab-item" :class="{ active: activeName === 1 }" @click="activeName = 1">基本信息</view>
  6. <view class="tab-item" :class="{ active: activeName === 2 }" @click="activeName = 2">调拨明细</view>
  7. </view>
  8. </view>
  9. <view v-if="activeName === 1">
  10. <CellInfo v-if="type !== 'view'" label="调拨名称" :value="baseInfo.name" />
  11. <CellInfo v-if="type !== 'view'" label="调拨单号" :value="baseInfo.allotCode" />
  12. <CellInfo label="调拨类型" :value="baseInfo.type == 1 ? '库内调拨' : '库外调拨'" />
  13. <CellInfo label="调出库" :value="baseInfo.sourceWarehouse" />
  14. <CellInfo label="调入库" :value="baseInfo.targetWarehouse" />
  15. <!-- <CellInfo label="调拨数量" :value="sum" /> -->
  16. <CellInfo label="创建人" :value="baseInfo.allotName" />
  17. <CellInfo label="创建时间" :value="baseInfo.createTime" />
  18. <CellInfo label="状态" :valueClass="statusClass[baseInfo.status]" :value="type === 'view' ? '草稿' : statusList[baseInfo.status]" />
  19. <!-- <template v-if="type !== 'view'">
  20. <CellInfo label="创建时间" :value="baseInfo.createTime" />
  21. <CellInfo label="提交时间" :value="baseInfo.submissionTime" />
  22. <CellInfo label="审核时间" :value="baseInfo.auditorTime" />
  23. <CellInfo label="审核说明" :value="baseInfo.auditCause" />
  24. </template> -->
  25. </view>
  26. <view class="list" v-if="activeName === 2">
  27. <AssetsCard v-for="(item, index) in list" class="kd-row" type="detail" :key="index" :item="item" />
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import CellInfo from '@/components/CellInfo.vue'
  33. import AssetsCard from './AssetsCard.vue'
  34. export default {
  35. components: { CellInfo, AssetsCard },
  36. props: {
  37. baseInfo: {
  38. type: Object,
  39. default: () => ({})
  40. },
  41. list: {
  42. type: Array,
  43. default: () => []
  44. },
  45. type: {
  46. type: String,
  47. default: ''
  48. }
  49. },
  50. computed: {
  51. sum() {
  52. return this.list.reduce((sum, item) => {
  53. if (item.takeStockPattern) {
  54. sum += +item.amount
  55. } else {
  56. sum += item.detailReqList?.length || 0
  57. }
  58. return sum
  59. }, 0)
  60. }
  61. },
  62. data() {
  63. return {
  64. activeName: 1,
  65. statusList: {
  66. 0: '未提交',
  67. 1: '审核中',
  68. 2: '已完成'
  69. },
  70. statusClass: {
  71. 0: 'text-danger',
  72. 1: 'text-primary',
  73. 2: 'text-primary'
  74. }
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .tabs-container {
  81. height: 80rpx;
  82. }
  83. .tabs {
  84. position: fixed;
  85. width: 100vw;
  86. height: 80rpx;
  87. background-color: #fff;
  88. display: flex;
  89. justify-content: flex-start;
  90. align-items: flex-end;
  91. margin-bottom: 20rpx;
  92. padding-left: 30rpx;
  93. .tab-item {
  94. width: 200rpx;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. padding-top: 10rpx;
  99. &.active {
  100. background: linear-gradient(180deg, rgba(75, 121, 2, 1) 0%, rgba(255, 255, 255, 1) 12%);
  101. border-right: 1rpx solid #ccc;
  102. border-left: 1rpx solid #ccc;
  103. }
  104. }
  105. }
  106. .list {
  107. margin: 20rpx 40rpx;
  108. border: 1rpx solid rgba(204, 204, 204, 1);
  109. }
  110. .kd-row {
  111. font-size: 28rpx;
  112. padding: 14rpx 12rpx 6rpx;
  113. border-bottom: 1rpx solid $page-bg;
  114. .kd-col {
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. color: #aaaaaa;
  119. > text {
  120. flex: 1;
  121. }
  122. .label {
  123. margin-right: 20rpx;
  124. }
  125. &.kd-col {
  126. margin-top: 25rpx;
  127. }
  128. .status {
  129. background-color: $page-bg;
  130. display: inline-block;
  131. padding: 4rpx 10rpx;
  132. border-radius: 18rpx;
  133. }
  134. }
  135. .title {
  136. font-weight: bold;
  137. color: #333333;
  138. }
  139. }
  140. </style>