DetailView.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view>
  3. <view class="tabs-container">
  4. <u-subsection :list="tabList" :current="activeName" @change="changeTab"
  5. active-color="#157a2c"></u-subsection>
  6. </view>
  7. <view v-if="activeName == 0" class="kd-baseInfo">
  8. <view class="kd-cell" v-if="type !== 'view'">
  9. <text class="kd-label">调拨名称</text>
  10. {{ baseInfo.name }}
  11. </view>
  12. <view class="kd-cell" v-if="type !== 'view'">
  13. <text class="kd-label">调拨单号</text>
  14. {{ baseInfo.allotCode }}
  15. </view>
  16. <view class="kd-cell">
  17. <text class="kd-label">调拨类型</text>
  18. {{ baseInfo.type == 1 ? '库内调拨' : '库外调拨' }}
  19. </view>
  20. <view class="kd-cell">
  21. <text class="kd-label">调出库</text>
  22. {{baseInfo.sourceWarehouse }}
  23. </view>
  24. <view class="kd-cell">
  25. <text class="kd-label">调入库</text>
  26. {{ baseInfo.targetWarehouse}}
  27. </view>
  28. <view class="kd-cell">
  29. <text class="kd-label">列表维度</text>
  30. {{ getDimensionLabel(baseInfo.inventoryDimension)}}
  31. </view>
  32. <view class="kd-cell">
  33. <text class="kd-label">创建人</text>
  34. {{ baseInfo.allotName }}
  35. </view>
  36. <view class="kd-cell">
  37. <text class="kd-label">创建时间</text>
  38. {{ baseInfo.createTime }}
  39. </view>
  40. <view class="kd-cell">
  41. <text class="kd-label">状态</text>
  42. <view :class="statusClass[baseInfo.status]">{{ type === 'view' ? '草稿' : statusList[baseInfo.status] }}
  43. </view>
  44. </view>
  45. <!-- <template v-if="type !== 'view'">
  46. <CellInfo label="创建时间" :value="baseInfo.createTime" />
  47. <CellInfo label="提交时间" :value="baseInfo.submissionTime" />
  48. <CellInfo label="审核时间" :value="baseInfo.auditorTime" />
  49. <CellInfo label="审核说明" :value="baseInfo.auditCause" />
  50. </template> -->
  51. </view>
  52. <view class="list" v-if="activeName === 1">
  53. <AssetsCard v-for="(item, index) in list" class="kd-row" type="detail" :key="index" :item="item"
  54. :index="index+Number(1)" :dimension="baseInfo.inventoryDimension" />
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import CellInfo from '@/components/CellInfo.vue'
  60. import AssetsCard from './AssetsCard.vue'
  61. import { dimensionType } from '@/enum/dict.js'
  62. export default {
  63. components: {
  64. CellInfo,
  65. AssetsCard
  66. },
  67. props: {
  68. baseInfo: {
  69. type: Object,
  70. default: () => ({})
  71. },
  72. list: {
  73. type: Array,
  74. default: () => []
  75. },
  76. type: {
  77. type: String,
  78. default: ''
  79. }
  80. },
  81. computed: {
  82. sum() {
  83. return this.list.reduce((sum, item) => {
  84. if (item.takeStockPattern) {
  85. sum += +item.amount
  86. } else {
  87. sum += item.detailReqList?.length || 0
  88. }
  89. return sum
  90. }, 0)
  91. }
  92. },
  93. data() {
  94. return {
  95. tabList: ['基本信息', '调拨明细'],
  96. activeName: 0,
  97. statusList: {
  98. 0: '未提交',
  99. 1: '审核中',
  100. 2: '已完成'
  101. },
  102. statusClass: {
  103. 0: 'text-danger',
  104. 1: 'text-primary',
  105. 2: 'text-primary'
  106. },
  107. dimensionType
  108. }
  109. },
  110. methods: {
  111. changeTab(val) {
  112. this.activeName = val
  113. },
  114. getDimensionLabel(dimension) {
  115. const item = this.dimensionType.find(item => item.value == dimension)
  116. return item?.text || ''
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .tabs-container {
  123. height: 80rpx;
  124. }
  125. /deep/.u-subsection__item__text {
  126. font-size: 28rpx !important;
  127. }
  128. /deep/.u-cell__body {
  129. // {
  130. // font-size: 26rpx !important;
  131. // }
  132. // padding: 12rpx 12rpx;
  133. .u-cell__title-text,
  134. .input-value,
  135. .uni-input-wrapper {
  136. font-size: 26rpx !important;
  137. }
  138. }
  139. .kd-baseInfo {
  140. padding: 0 32rpx;
  141. font-size: 28rpx;
  142. }
  143. .kd-cell {
  144. min-height: 90rpx;
  145. border-bottom: 1px dashed #dadada;
  146. display: flex;
  147. align-items: center;
  148. .kd-label {
  149. display: inline-block;
  150. width: 6em;
  151. font-weight: bold;
  152. }
  153. .kd-content {
  154. flex: 1;
  155. word-break: break-all;
  156. }
  157. }
  158. .list {
  159. // margin: 20rpx 40rpx;
  160. // border: 1rpx solid rgba(204, 204, 204, 1);
  161. }
  162. .kd-row {
  163. font-size: 28rpx;
  164. padding: 14rpx 12rpx 6rpx;
  165. border-bottom: 1rpx solid $page-bg;
  166. .kd-col {
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. color: #aaaaaa;
  171. >text {
  172. flex: 1;
  173. }
  174. .label {
  175. margin-right: 20rpx;
  176. }
  177. &.kd-col {
  178. margin-top: 25rpx;
  179. }
  180. .status {
  181. background-color: $page-bg;
  182. display: inline-block;
  183. padding: 4rpx 10rpx;
  184. border-radius: 18rpx;
  185. }
  186. }
  187. .title {
  188. font-weight: bold;
  189. color: #333333;
  190. }
  191. }
  192. </style>