task-item.vue 3.4 KB

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