DetailView.vue 3.9 KB

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