pickWorkCard.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="card-wrapper">
  3. <checkbox-group
  4. v-for="(item, index) in list"
  5. :key="index"
  6. @change="(e) => selectVal(e, item, index)"
  7. >
  8. <label class="card" @click="openDetails(item.status, item)">
  9. <view class="card-header">
  10. <view class="index">{{ index + 1 }}</view>
  11. <view class="order">{{ item.code }}</view>
  12. <view class="status-tag" :class="'status-' + item.status">
  13. {{ statusText[item.status] }}
  14. </view>
  15. </view>
  16. <view class="row">
  17. <text class="label">领料单编号:</text>
  18. <text class="value ellipsis">{{ item.code }}</text>
  19. </view>
  20. <view class="row two-col">
  21. <view class="col">
  22. <text class="label">领料人:</text>
  23. <text class="value theme ellipsis">{{ item.executorName }}</text>
  24. </view>
  25. <view class="col">
  26. <text class="label">审核人:</text>
  27. <text class="value ellipsis">{{ item.joinReviewerName }}</text>
  28. </view>
  29. </view>
  30. <view class="row">
  31. <text class="label">领料仓库:</text>
  32. <text class="value ellipsis">{{ item.joinWarehouseName }}</text>
  33. </view>
  34. <view class="row">
  35. <text class="label">类型:</text>
  36. <text class="value theme">{{ typeMap[item.type] }}</text>
  37. </view>
  38. <view class="row">
  39. <text class="label">领料时间:</text>
  40. <text class="value ellipsis">{{ item.createTime }}</text>
  41. </view>
  42. </label>
  43. </checkbox-group>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. props: {
  49. list: {
  50. type: Array,
  51. default: () => [],
  52. },
  53. },
  54. data() {
  55. return {
  56. statusText: {
  57. 0: "未领料",
  58. 1: "领料中",
  59. 2: "已出库",
  60. },
  61. typeMap: {
  62. 1: "自建领料",
  63. 2: "工单领料",
  64. 3: "委外领料",
  65. },
  66. };
  67. },
  68. methods: {
  69. selectVal(e, val, index) {
  70. this.list[index].checked = !this.list[index].checked;
  71. },
  72. openDetails(pickStatus, item) {
  73. if (pickStatus == 1 || pickStatus == 2) {
  74. let url =
  75. "/pages/pda/selfBuiltPickOrder/components/selfBuiltPickOrderDetail";
  76. url += `?item=${JSON.stringify(item)}&status=${pickStatus}`;
  77. uni.navigateTo({ url });
  78. }
  79. },
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .card-wrapper {
  85. padding: 20rpx;
  86. }
  87. .card {
  88. background: #fff;
  89. padding: 24rpx;
  90. border-radius: 16rpx;
  91. margin-bottom: 24rpx;
  92. box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.06);
  93. display: block;
  94. transition: 0.1s;
  95. }
  96. .card:active {
  97. transform: scale(0.98);
  98. opacity: 0.9;
  99. }
  100. /* 顶部标题区 */
  101. .card-header {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. margin-bottom: 14rpx;
  106. .index {
  107. width: 40rpx;
  108. height: 40rpx;
  109. line-height: 40rpx;
  110. border-radius: 50%;
  111. background: $theme-color;
  112. color: #fff;
  113. text-align: center;
  114. font-size: 22rpx;
  115. margin-right: 16rpx;
  116. }
  117. .order {
  118. flex: 1;
  119. font-size: 30rpx;
  120. font-weight: 600;
  121. color: #333;
  122. margin-left: 10rpx;
  123. }
  124. .status-tag {
  125. font-size: 24rpx;
  126. padding: 4rpx 14rpx;
  127. border-radius: 8rpx;
  128. color: #fff;
  129. }
  130. .status-0 {
  131. background: #bfbfbf;
  132. }
  133. .status-1 {
  134. background: #ffa929;
  135. }
  136. .status-2 {
  137. background: #30c26e;
  138. }
  139. }
  140. /* 信息行 */
  141. .row {
  142. font-size: 26rpx;
  143. margin-top: 12rpx;
  144. display: flex;
  145. .label {
  146. color: #999;
  147. width: 160rpx;
  148. }
  149. .value {
  150. color: #333;
  151. flex: 1;
  152. }
  153. .theme {
  154. color: $theme-color;
  155. }
  156. }
  157. /* 两列布局 */
  158. .two-col {
  159. display: flex;
  160. justify-content: space-between;
  161. .col {
  162. width: 48%;
  163. }
  164. }
  165. /* 长文本省略 */
  166. .ellipsis {
  167. white-space: nowrap;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. }
  171. </style>