x-orderManagement.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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="space_between">
  9. <view class="card_specification">
  10. <view class="specification_title">
  11. <u-tag :text="item.temperatureInterval" plain size="mini" type="success"
  12. @click="goOrderDetails(item)"></u-tag>
  13. </view>
  14. <view class="specification_title">
  15. <u-tag :text="item.deliveryCondition" plain size="mini" type="primary"
  16. @click="goOrderDetails(item)"></u-tag>
  17. </view>
  18. <view class="specification_title">
  19. <u-tag :text="item.cargoType" plain size="mini" type="warning"
  20. @click="goOrderDetails(item)"></u-tag>
  21. </view>
  22. </view>
  23. <view style="font-size: 28rpx;">x{{item.quantity}}</view>
  24. </view>
  25. <view class="title_ordermang"><span>收货地址:</span>{{item.consigneeAddressDetails}}</view>
  26. <view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
  27. <view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
  28. <view style="display: flex;">
  29. <view class="btn_printil markd10" v-if="item.status == 1 || item.status == 2 || item.status == 3"
  30. @click.stop="modifyOrder(item)">
  31. <u-button size="small" type="warning" text="修改订单"></u-button>
  32. </view>
  33. <view class="btn_printil markd10" v-if="printbarCode(item.status)" @click.stop="printBarCode(item)">
  34. <u-button size="small" type="primary" text="打印条码"></u-button>
  35. </view>
  36. </view>
  37. <view style="display: flex;">
  38. <view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
  39. @click.stop="sendmail(item)">
  40. <u-button size="small" type="primary" text="发送邮件"></u-button>
  41. </view>
  42. <view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
  43. @click.stop="humidityRecording(item)">
  44. <u-button size="small" type="success" text="打印温湿度记录"></u-button>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. name: 'xOrderManagement',
  53. props: {
  54. // 订单列表
  55. orderList: {
  56. type: Array,
  57. default: () => [],
  58. },
  59. userInfo: {
  60. type: Object,
  61. default: () => {},
  62. }
  63. },
  64. data() {
  65. return {}
  66. },
  67. mounted() {
  68. // console.log(this.userInfo, 26)
  69. },
  70. methods: {
  71. // 打印条码
  72. printBarCode(value) {
  73. this.$cache.setCache('commodity', JSON.stringify(value))
  74. uni.navigateTo({
  75. url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=barCode'
  76. });
  77. },
  78. // 打印温湿度记录
  79. humidityRecording(value) {
  80. this.$cache.setCache('commodity', JSON.stringify(value))
  81. uni.navigateTo({
  82. url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=record'
  83. });
  84. },
  85. // 发送邮件
  86. sendmail(value) {
  87. this.$emit('sendmail', value)
  88. },
  89. // 修改订单
  90. modifyOrder(value) {
  91. this.$cache.setCache('orderDetails', value)
  92. uni.redirectTo({
  93. url: '/pages/order/addWaybill?title=修改订单&type=2'
  94. });
  95. },
  96. // 订单详情
  97. goOrderDetails(value) {
  98. this.$cache.setCache('orderDetails', value)
  99. uni.navigateTo({
  100. url: '/pages/order/orderDetails?type=details'
  101. });
  102. },
  103. // 订单状态
  104. orderStatus(value) {
  105. if (this.userInfo.userType == 'sys') {
  106. if (this.userInfo.type == 2) {
  107. // 仓管
  108. if (value == 3) {
  109. return '未入库'
  110. } else if (value == 5) {
  111. return '已入库'
  112. } else if (value == 9) {
  113. return '待装箱'
  114. } else if (value == 10) {
  115. return '已装箱'
  116. } else {
  117. return '已出库'
  118. }
  119. } else if (this.userInfo.type == 3) {
  120. // 司机
  121. if (value == 2) {
  122. return '未装车'
  123. } else if (value == 9) {
  124. return '待装箱'
  125. } else if (value == 10) {
  126. return '已装箱'
  127. } else if (value == 4) {
  128. return '已装车'
  129. } else if (value == 6) {
  130. return '已下车'
  131. } else {
  132. return '已签收'
  133. }
  134. }
  135. } else {
  136. if (value == 1 || value == 2 || value == 3) {
  137. return '未发货'
  138. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  139. return '已发货'
  140. } else {
  141. return '已签收'
  142. }
  143. }
  144. },
  145. // 订单文字颜色
  146. getState(value) {
  147. if (this.userInfo.userType == 'sys') {
  148. if (this.userInfo.type == 2) {
  149. // 仓管
  150. if (value == 3) {
  151. return '#ff9900'
  152. } else if (value == 9) {
  153. return '#ff9900'
  154. } else if (value == 10) {
  155. return '#19be6b'
  156. } else if (value == 5) {
  157. return '#19be6b'
  158. } else {
  159. return '#606266'
  160. }
  161. } else if (this.userInfo.type == 3) {
  162. // 司机
  163. if (value == 2) {
  164. return '#ff9900'
  165. } else if (value == 9) {
  166. return '#ff9900'
  167. } else if (value == 10) {
  168. return '#19be6b'
  169. } else if (value == 4) {
  170. return '#19be6b'
  171. } else if (value == 6) {
  172. return '#19be6b'
  173. } else {
  174. return '#606266'
  175. }
  176. }
  177. } else {
  178. if (value == 1 || value == 2 || value == 3) {
  179. return '#ff9900'
  180. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  181. return '#19be6b'
  182. } else {
  183. return '#606266'
  184. }
  185. }
  186. },
  187. // 打印运单
  188. printbarCode(type) {
  189. if (this.userInfo.userType === 'sys' && [2, 3, 9].includes(type)) {
  190. return true
  191. } else {
  192. return false
  193. }
  194. }
  195. }
  196. }
  197. </script>
  198. <style lang="scss">
  199. .card_ordermang {
  200. background-color: #fff;
  201. padding: 20rpx;
  202. border-radius: 20rpx;
  203. margin: 20rpx;
  204. }
  205. .head_ordermang {
  206. margin-bottom: 10rpx;
  207. }
  208. .title_ordermang {
  209. margin-top: 10rpx;
  210. font-size: 26rpx;
  211. color: #909399;
  212. span {
  213. font-size: 26rpx;
  214. color: #909399;
  215. margin-right: 10rpx;
  216. }
  217. }
  218. .waybill_title {
  219. font-size: 32rpx;
  220. span {
  221. margin-left: 10rpx;
  222. }
  223. }
  224. .card_state {
  225. color: #606266;
  226. font-size: 32rpx;
  227. }
  228. .card_specification {
  229. display: flex;
  230. align-items: center;
  231. }
  232. .specification_title {
  233. margin-right: 20rpx;
  234. }
  235. .btn_printil {
  236. flex: 1;
  237. margin-top: 10px;
  238. }
  239. .markd10:nth-child(1) {
  240. margin: 10px 10rpx 0px 0rpx;
  241. }
  242. .markd10:nth-child(2) {
  243. margin: 10px 0rpx 0px 10rpx;
  244. }
  245. </style>