orderDetails.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <!-- 订单详情 -->
  3. <view>
  4. <u-navbar title="" autoBack placeholder></u-navbar>
  5. <view class="card_order_detail">
  6. <view class="orderNumber">
  7. <view class="card_order_title">
  8. <span>运单号:</span>{{orderList.waybillNo}}
  9. </view>
  10. <span class="card_state"
  11. :style="{color:getState(orderList.status)}">{{orderStatus(orderList.status)}}</span>
  12. </view>
  13. <view class="title_delivery">寄件人:</view>
  14. <x-orderCard :list="senderList"></x-orderCard>
  15. <view class="title_delivery">收件人:</view>
  16. <x-orderCard :list="consigneeList"></x-orderCard>
  17. <view class="card_humiture">
  18. <view class="title_claim">
  19. <span>温度需求:</span>
  20. <view style="width: auto;">
  21. <u-tag :text="orderList.temperatureInterval" plain size="mini" type="success"></u-tag>
  22. </view>
  23. </view>
  24. <view class="title_claim">
  25. <span>配送要求:</span>
  26. <view style="width: auto;">
  27. <u-tag :text="orderList.deliveryCondition" plain size="mini" type="primary"></u-tag>
  28. </view>
  29. </view>
  30. <view class="title_claim">
  31. <span>货物类型:</span>
  32. <view style="width: auto;">
  33. <u-tag :text="orderList.cargoType" plain size="mini" type="warning"></u-tag>
  34. </view>
  35. </view>
  36. <view class="title_claim">
  37. <span>数量:</span>
  38. <view style="width: auto;font-size: 28rpx;">
  39. {{orderList.quantity}}
  40. </view>
  41. </view>
  42. <view class="title_claim"><span>备注:</span>{{orderList.remark}}</view>
  43. </view>
  44. <view class="card_humiture1" v-if="orderList.status == 8">
  45. <view class="order_iamge_item" v-for="(item,index) in srcList" :key="index">
  46. <u-image :showLoading="true" :src="item.url" width="80px" height="80px" radius="2"></u-image>
  47. <view class="order_item_title">{{item.title}}</view>
  48. </view>
  49. </view>
  50. <view v-if="orderList.status != 1">
  51. <view class="line_back" style="margin-top: 40rpx;" @click="logistics">查看物流详情</view>
  52. <view class="line_back" @click="goHumiture">查看温湿度</view>
  53. </view>
  54. <view style="width: 100%;height: 80rpx;"></view>
  55. </view>
  56. <!-- <view class="btn_print" v-if="type == 'details' && orderList.status == 2 || orderList.status == 3">
  57. <u-button type="primary" text="打印条码"></u-button>
  58. </view> -->
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. type: 'details',
  66. senderList: {
  67. name: '',
  68. phone: '',
  69. address: '',
  70. },
  71. consigneeList: {
  72. name: '',
  73. phone: '',
  74. address: '',
  75. },
  76. orderList: {},
  77. srcList: [{
  78. title: '运单签收图片',
  79. url: '',
  80. }, {
  81. title: '随货通行单图片',
  82. url: '',
  83. }, {
  84. title: '冷链交接单图片',
  85. url: '',
  86. }],
  87. userInfo: {},
  88. }
  89. },
  90. onLoad(value) {
  91. var userInfo = this.$cache.getCache('userInfo')
  92. this.userInfo = userInfo
  93. this.type = value.type
  94. },
  95. onShow() {
  96. var orderList = this.$cache.getCache('orderDetails')
  97. this.orderList = orderList
  98. this.senderList.name = orderList.senderAddressName
  99. this.senderList.phone = orderList.senderAddressPhone
  100. this.senderList.address = orderList.senderAddressDetails
  101. this.consigneeList.name = orderList.consigneeAddressName
  102. this.consigneeList.phone = orderList.consigneeAddressPhone
  103. this.consigneeList.address = orderList.consigneeAddressDetails
  104. if (orderList.status == 8) {
  105. const arr = orderList.ReceiptImg.split(',')
  106. this.srcList[0].url = arr[0]
  107. this.srcList[1].url = arr[1]
  108. this.srcList[2].url = arr[2]
  109. }
  110. },
  111. methods: {
  112. // 物流详情
  113. logistics() {
  114. uni.navigateTo({
  115. url: '/pages/order/logisticsDetails'
  116. });
  117. },
  118. // 温湿度记录
  119. goHumiture() {
  120. var orderList = this.$cache.getCache('orderDetails')
  121. uni.navigateTo({
  122. url: '/pages/order/humiture?waybillNo=' + orderList.waybillNo
  123. });
  124. },
  125. // 订单状态
  126. orderStatus(value) {
  127. if (this.userInfo.userType == 'sys') {
  128. if (this.userInfo.type == 2) {
  129. // 仓管
  130. if (value == 3) {
  131. return '未入库'
  132. } else if (value == 9) {
  133. return '待装箱'
  134. } else if (value == 10) {
  135. return '已装箱'
  136. } else if (value == 11) {
  137. return '已出箱'
  138. } else if (value == 5) {
  139. return '已入库'
  140. } else if (value == 7) {
  141. return '已出库'
  142. }
  143. } else if (this.userInfo.type == 3) {
  144. // 司机
  145. if (value == 2) {
  146. return '未装车'
  147. } else if (value == 9) {
  148. return '待装箱'
  149. } else if (value == 10) {
  150. return '已装箱'
  151. } else if (value == 4) {
  152. return '已装车'
  153. } else if (value == 6) {
  154. return '已下车'
  155. } else if (value == 8) {
  156. return '已签收'
  157. }
  158. }
  159. } else {
  160. if (value == 1 || value == 2 || value == 3) {
  161. return '未发货'
  162. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  163. return '已发货'
  164. } else if (value == 8) {
  165. return '已签收'
  166. }
  167. }
  168. },
  169. // 订单文字颜色
  170. getState(value) {
  171. if (this.userInfo.userType == 'sys') {
  172. if (this.userInfo.type == 2) {
  173. // 仓管
  174. if (value == 3) {
  175. return '#ff9900'
  176. } else if (value == 9) {
  177. return '#ff9900'
  178. } else if (value == 10) {
  179. return '#19be6b'
  180. } else if (value == 5) {
  181. return '#19be6b'
  182. } else {
  183. return '#606266'
  184. }
  185. } else if (this.userInfo.type == 3) {
  186. // 司机
  187. if (value == 2) {
  188. return '#ff9900'
  189. } else if (value == 9) {
  190. return '#ff9900'
  191. } else if (value == 10) {
  192. return '#19be6b'
  193. } else if (value == 4) {
  194. return '#19be6b'
  195. } else if (value == 6) {
  196. return '#19be6b'
  197. } else {
  198. return '#606266'
  199. }
  200. }
  201. } else {
  202. if (value == 1 || value == 2 || value == 3) {
  203. return '#ff9900'
  204. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  205. return '#19be6b'
  206. } else {
  207. return '#606266'
  208. }
  209. }
  210. }
  211. }
  212. }
  213. </script>
  214. <style lang="scss" scoped>
  215. .card_order_detail {
  216. margin: 20rpx;
  217. }
  218. .orderNumber {
  219. display: flex;
  220. justify-content: space-between;
  221. align-items: center;
  222. background-color: #fff;
  223. border-radius: 20rpx;
  224. padding: 15rpx;
  225. }
  226. .card_order_title {
  227. span {
  228. font-size: 28rpx;
  229. color: #909399;
  230. margin-right: 10rpx;
  231. }
  232. }
  233. .card_state {
  234. color: #606266;
  235. font-size: 30rpx;
  236. }
  237. .title_delivery {
  238. font-size: 30rpx;
  239. font-weight: 600;
  240. margin: 20rpx 0rpx 10rpx 10rpx;
  241. }
  242. .card_humiture {
  243. margin-top: 30rpx;
  244. border-radius: 20rpx;
  245. padding: 1rpx 20rpx;
  246. background-color: #fff;
  247. }
  248. .card_humiture1 {
  249. display: flex;
  250. justify-content: space-around;
  251. align-items: center;
  252. flex-wrap: wrap;
  253. margin-top: 10rpx;
  254. border-radius: 20rpx;
  255. padding: 20rpx;
  256. background-color: #fff;
  257. }
  258. .order_iamge_item {
  259. display: flex;
  260. flex-direction: column;
  261. align-items: center;
  262. }
  263. .order_item_title {
  264. font-weight: 600;
  265. margin-top: 10rpx;
  266. font-size: 26rpx;
  267. }
  268. .title_claim {
  269. display: flex;
  270. margin: 20rpx 0rpx;
  271. span {
  272. font-size: 28rpx;
  273. color: #909399;
  274. margin-right: 10rpx;
  275. }
  276. }
  277. .line_back {
  278. font-size: 30rpx;
  279. margin: 20rpx 0rpx;
  280. color: #3c9cff;
  281. }
  282. </style>