task-item.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="task-item">
  3. <view @click="detailClick">
  4. <view class="task-head">
  5. <view class="sn-box">单据编号:{{ item.number }}</view>
  6. <view v-if="type == 'caigou'">
  7. <view class="tips tips-red" v-if="item.status == 1">待入库</view>
  8. <view class="tips tips-greed" v-if="item.status == 2">已入库</view>
  9. <view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
  10. </view>
  11. <view v-else>
  12. <view class="tips tips-red" v-if="item.status == 1">待拣货</view>
  13. <view class="tips tips-greed" v-if="item.status == 2">已拣货</view>
  14. <view class="tips tips-yellow" v-if="item.status == 4">拣货中</view>
  15. </view>
  16. </view>
  17. <view class="task-line" v-if="type == 'caigou'">
  18. <view>供应商:</view>
  19. <view>{{ item.supplierName }}</view>
  20. </view>
  21. <view class="task-line" v-else>
  22. <view>客户名称:</view>
  23. <view>{{ item.supplierName }}</view>
  24. </view>
  25. <view class="task-line">
  26. <view>单据日期:</view>
  27. <view>{{ item.operTime }}</view>
  28. </view>
  29. <view class="task-line">
  30. <view class="task-line2">
  31. <view>货物总数:</view>
  32. <view class="task-num">{{ item.goodsQuantity }}件</view>
  33. </view>
  34. <view class="task-line2">
  35. <view>货物种类:</view>
  36. <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="task-bottom">
  41. <view v-if="type == 'caigou'">
  42. <view
  43. class="btn btn-1"
  44. v-if="item.status == 1 || item.status == 4"
  45. @click="toStorage"
  46. >去入库</view
  47. >
  48. <view class="btn btn-2" v-else @click="toDetail">详情</view>
  49. </view>
  50. <view v-else>
  51. <view
  52. class="btn btn-1"
  53. v-if="item.status == 1 || item.status == 4"
  54. @click="toStorage"
  55. >去出库</view
  56. >
  57. <view class="btn btn-2" v-else @click="toDetail">详情</view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. props: {
  65. item: {
  66. type: Object,
  67. default: () => {},
  68. },
  69. type: {
  70. type: String,
  71. default: "",
  72. },
  73. },
  74. data() {
  75. return {};
  76. },
  77. methods: {
  78. toStorage() {
  79. this.$emit("toStorage", this.item);
  80. },
  81. toDetail() {
  82. this.$emit("toDetail", this.item);
  83. },
  84. detailClick() {
  85. if (this.item.status == 1 || this.item.status == 4) {
  86. this.toStorage();
  87. } else {
  88. this.toDetail();
  89. }
  90. },
  91. },
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. .task-item {
  96. width: 100%;
  97. background-color: #fff;
  98. border-radius: 16rpx;
  99. padding: 24rpx 24rpx 0;
  100. margin-bottom: 24rpx;
  101. .task-head {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. .sn-box {
  106. color: #333;
  107. font-family: "PingFang SC";
  108. font-size: 28rpx;
  109. font-weight: 500;
  110. }
  111. .tips {
  112. font-family: "PingFang SC";
  113. font-size: 22rpx;
  114. font-weight: 400;
  115. width: 120rpx;
  116. height: 44rpx;
  117. border-radius: 8rpx;
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. }
  122. .tips-red {
  123. color: #ff3b1d;
  124. background: rgba(255, 59, 29, 0.2);
  125. }
  126. .tips-greed {
  127. color: #00b97b;
  128. background: rgba(0, 185, 123, 0.2);
  129. }
  130. .tips-yellow {
  131. color: #f57701;
  132. background: rgba(245, 151, 1, 0.2);
  133. }
  134. }
  135. .task-line {
  136. display: flex;
  137. align-items: center;
  138. color: #666;
  139. font-family: "PingFang SC";
  140. font-size: 28rpx;
  141. font-weight: 400;
  142. margin-top: 16rpx;
  143. }
  144. .task-line2 {
  145. width: 50%;
  146. display: flex;
  147. align-items: center;
  148. .task-num {
  149. color: #0256ff;
  150. }
  151. }
  152. .task-bottom {
  153. border-top: 1px solid #f0f0f0;
  154. margin-top: 32rpx;
  155. height: 104rpx;
  156. display: flex;
  157. align-items: center;
  158. justify-content: flex-end;
  159. .btn {
  160. width: 144rpx;
  161. height: 56rpx;
  162. border-radius: 8rpx;
  163. font-size: 28rpx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. font-family: "PingFang SC";
  168. }
  169. .btn-1 {
  170. background: #0256ff;
  171. color: #fff;
  172. }
  173. .btn-2 {
  174. border: 1px solid #0256ff;
  175. background: rgba(2, 86, 255, 0.2);
  176. color: #0256ff;
  177. }
  178. }
  179. }
  180. </style>