task-item.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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-greed" 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 class="btn btn-1" v-if="item.status == 1 || item.status == 4" @click="toStorage">去入库</view>
  43. <view class="btn btn-2" v-else @click="toDetail">详情</view>
  44. </view>
  45. <view v-else>
  46. <view class="btn btn-1" v-if="item.status == 1 || item.status == 4" @click="toStorage">去出库</view>
  47. <view class="btn btn-2" v-else @click="toDetail">详情</view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default{
  54. props:{
  55. item:{
  56. type:Object,
  57. default:()=>{}
  58. },
  59. type: {
  60. type:String,
  61. default:''
  62. }
  63. },
  64. data() {
  65. return{
  66. }
  67. },
  68. methods:{
  69. toStorage() {
  70. this.$emit('toStorage',this.item)
  71. },
  72. toDetail() {
  73. this.$emit('toDetail',this.item)
  74. },
  75. detailClick() {
  76. if(this.item.status == 1 || this.item.status == 4) {
  77. this.toStorage()
  78. }else {
  79. this.toDetail()
  80. }
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .task-item {
  87. width: 100%;
  88. background-color: #fff;
  89. border-radius: 16rpx;
  90. padding: 24rpx 24rpx 0;
  91. margin-bottom: 24rpx;
  92. .task-head {
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. .sn-box {
  97. color: #333;
  98. font-family: "PingFang SC";
  99. font-size: 28rpx;
  100. font-weight: 500;
  101. }
  102. .tips {
  103. font-family: "PingFang SC";
  104. font-size: 22rpx;
  105. font-weight: 400;
  106. width: 120rpx;
  107. height: 44rpx;
  108. border-radius: 8rpx;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. }
  113. .tips-red {
  114. color: #FF3B1D;
  115. background: rgba(255, 59, 29, 0.20);
  116. }
  117. .tips-greed {
  118. color: #00B97B;
  119. background: rgba(0, 185, 123, 0.20);
  120. }
  121. .tips-yellow {
  122. color: #F57701;
  123. background: rgba(245, 151, 1, 0.20);
  124. }
  125. }
  126. .task-line {
  127. display: flex;
  128. align-items: center;
  129. color: #666;
  130. font-family: "PingFang SC";
  131. font-size: 28rpx;
  132. font-weight: 400;
  133. margin-top: 16rpx;
  134. }
  135. .task-line2 {
  136. width: 50%;
  137. display: flex;
  138. align-items: center;
  139. .task-num {
  140. color: #0256FF;;
  141. }
  142. }
  143. .task-bottom {
  144. border-top: 1px solid #F0F0F0;
  145. margin-top: 32rpx;
  146. height: 104rpx;
  147. display: flex;
  148. align-items: center;
  149. justify-content: flex-end;
  150. .btn {
  151. width: 144rpx;
  152. height: 56rpx;
  153. border-radius: 8rpx;
  154. font-size: 28rpx;
  155. display: flex;
  156. align-items: center;
  157. justify-content: center;
  158. font-family: "PingFang SC";
  159. }
  160. .btn-1 {
  161. background: #0256FF;
  162. color: #FFF;
  163. }
  164. .btn-2 {
  165. border: 1px solid #0256FF;
  166. background: rgba(2, 86, 255, 0.20);
  167. color: #0256FF;
  168. }
  169. }
  170. }
  171. </style>