task-item.vue 4.9 KB

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