DetailView.vue 3.3 KB

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