pickWorkCard.vue 4.0 KB

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