task-item.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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>
  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>
  12. <view class="task-line">
  13. <view>客户名称:</view>
  14. <view>{{ item.supplierName }}</view>
  15. </view>
  16. <view class="task-line">
  17. <view>单据日期:</view>
  18. <view>{{ item.createTime }}</view>
  19. </view>
  20. <view class="task-line">
  21. <view class="task-line2">
  22. <view>类别:</view>
  23. <view>采购入库</view>
  24. </view>
  25. <view class="task-line2">
  26. <view>入库人:</view>
  27. <view>张三</view>
  28. </view>
  29. <!-- <view class="task-line2">
  30. <view>出库人:</view>
  31. <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
  32. </view> -->
  33. </view>
  34. <view class="task-line">
  35. <view class="task-line2">
  36. <view>货物总数:</view>
  37. <view class="task-num">{{ item.goodsQuantity }}件</view>
  38. </view>
  39. <view class="task-line2">
  40. <view>货物种类:</view>
  41. <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="action-box">
  46. <view class="task-line" style="font-size: 24rpx; margin: 0">
  47. <view>入库时间:</view>
  48. <view>2021-11-21 00:00:03</view>
  49. </view>
  50. <view class="task-bottom">
  51. <view
  52. class="btn btn-1"
  53. v-if="item.status == 1 || item.status == 4"
  54. @click="toAudit"
  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. toAudit() {
  79. this.$emit("toAudit", 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.toAudit();
  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. .action-box {
  153. margin-top: 32rpx;
  154. display: flex;
  155. align-items: center;
  156. justify-content: space-between;
  157. }
  158. .task-bottom {
  159. border-top: 1px solid #f0f0f0;
  160. height: 104rpx;
  161. display: flex;
  162. align-items: center;
  163. justify-content: flex-end;
  164. .btn {
  165. width: 144rpx;
  166. height: 56rpx;
  167. border-radius: 8rpx;
  168. font-size: 28rpx;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. font-family: "PingFang SC";
  173. }
  174. .btn-1 {
  175. background: #0256ff;
  176. color: #fff;
  177. }
  178. .btn-2 {
  179. border: 1px solid #0256ff;
  180. background: rgba(2, 86, 255, 0.2);
  181. color: #0256ff;
  182. }
  183. }
  184. }
  185. </style>