x-orderManagement.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view style="width: 100%;">
  3. <view class="card_ordermang" v-for="(item,index) in orderList" :key="index" @click="goOrderDetails(item)">
  4. <view class="head_ordermang space_between">
  5. <view class="waybill_title">运单号:<span>{{item.waybillNo}}</span></view>
  6. <span class="card_state" :style="{color:getState(item.status)}">{{orderStatus(item.status)}}</span>
  7. </view>
  8. <view class="card_specification">
  9. <view class="specification_title">
  10. <u-tag :text="item.temperatureInterval" plain size="mini" type="success"
  11. @click="goOrderDetails(item)"></u-tag>
  12. </view>
  13. <view class="specification_title">
  14. <u-tag :text="item.deliveryCondition" plain size="mini" type="primary"
  15. @click="goOrderDetails(item)"></u-tag>
  16. </view>
  17. <view class="specification_title">
  18. <u-tag :text="item.cargoType" plain size="mini" type="warning"
  19. @click="goOrderDetails(item)"></u-tag>
  20. </view>
  21. </view>
  22. <view class="title_ordermang"><span>收货地址:</span>{{item.consigneeAddressDetails}}</view>
  23. <view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
  24. <view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
  25. <view class="btn_printil"
  26. v-if="item.status == 2 && userInfo.userType === 'sys' || item.status == 3 && userInfo.userType === 'sys'"
  27. @click.stop="printBarCode(item)">
  28. <u-button size="small" type="primary" text="打印条码"></u-button>
  29. </view>
  30. <view class="btn_printil" v-if="item.status == 8 && userInfo.userType == 'sys'"
  31. @click.stop="humidityRecording(item)">
  32. <u-button size="small" type="warning" text="打印温湿度记录"></u-button>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'xOrderManagement',
  40. props: {
  41. // 订单列表
  42. orderList: {
  43. type: Array,
  44. default: () => [],
  45. },
  46. userInfo: {
  47. type: Object,
  48. default: () => {},
  49. }
  50. },
  51. data() {
  52. return {}
  53. },
  54. mounted() {
  55. // console.log(this.userInfo, 26)
  56. },
  57. methods: {
  58. // 打印条码
  59. printBarCode(value) {
  60. this.$cache.setCache('commodity', JSON.stringify(value))
  61. uni.navigateTo({
  62. url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=barCode'
  63. });
  64. },
  65. // 打印温湿度记录
  66. humidityRecording(value) {
  67. this.$cache.setCache('commodity', JSON.stringify(value))
  68. uni.navigateTo({
  69. url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=record'
  70. });
  71. },
  72. // 订单详情
  73. goOrderDetails(value) {
  74. this.$cache.setCache('orderDetails', value)
  75. uni.navigateTo({
  76. url: '/pages/order/orderDetails?type=details'
  77. });
  78. },
  79. // 订单状态
  80. orderStatus(value) {
  81. if (this.userInfo.userType == 'sys') {
  82. if (this.userInfo.type == 2) {
  83. // 仓管
  84. if (value == 3) {
  85. return '未入库'
  86. } else if (value == 5) {
  87. return '已入库'
  88. } else {
  89. return '已出库'
  90. }
  91. } else if (this.userInfo.type == 3) {
  92. // 司机
  93. if (value == 2) {
  94. return '未装车'
  95. } else if (value == 4) {
  96. return '已装车'
  97. } else if (value == 6) {
  98. return '已下车'
  99. } else {
  100. return '已签收'
  101. }
  102. }
  103. } else {
  104. if (value == 1 || value == 2 || value == 3) {
  105. return '未发货'
  106. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  107. return '已发货'
  108. } else {
  109. return '已签收'
  110. }
  111. }
  112. },
  113. // 订单文字颜色
  114. getState(value) {
  115. if (this.userInfo.userType == 'sys') {
  116. if (this.userInfo.type == 2) {
  117. // 仓管
  118. if (value == 3) {
  119. return '#ff9900'
  120. } else if (value == 5) {
  121. return '#19be6b'
  122. } else {
  123. return '#606266'
  124. }
  125. } else if (this.userInfo.type == 3) {
  126. // 司机
  127. if (value == 2) {
  128. return '#ff9900'
  129. } else if (value == 4) {
  130. return '#19be6b'
  131. } else if (value == 6) {
  132. return '#19be6b'
  133. } else {
  134. return '#606266'
  135. }
  136. }
  137. } else {
  138. if (value == 1 || value == 2 || value == 3) {
  139. return '#ff9900'
  140. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  141. return '#19be6b'
  142. } else {
  143. return '#606266'
  144. }
  145. }
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. .card_ordermang {
  152. background-color: #fff;
  153. padding: 20rpx;
  154. border-radius: 20rpx;
  155. margin: 20rpx;
  156. }
  157. .head_ordermang {
  158. margin-bottom: 10rpx;
  159. }
  160. .title_ordermang {
  161. margin-top: 10rpx;
  162. font-size: 26rpx;
  163. color: #909399;
  164. span {
  165. font-size: 26rpx;
  166. color: #909399;
  167. margin-right: 10rpx;
  168. }
  169. }
  170. .waybill_title {
  171. font-size: 32rpx;
  172. span {
  173. margin-left: 10rpx;
  174. }
  175. }
  176. .card_state {
  177. color: #606266;
  178. font-size: 32rpx;
  179. }
  180. .card_specification {
  181. display: flex;
  182. align-items: center;
  183. }
  184. .specification_title {
  185. margin-right: 20rpx;
  186. }
  187. .btn_printil {
  188. margin-top: 20rpx;
  189. }
  190. </style>