DetailView.vue 4.0 KB

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