orderDetails.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. uni.navigateTo({
  121. url: '/pages/order/humiture'
  122. });
  123. },
  124. // 订单状态
  125. orderStatus(value) {
  126. if (this.userInfo.userType == 'sys') {
  127. if (this.userInfo.type == 2) {
  128. // 仓管
  129. if (value == 3) {
  130. return '未入库'
  131. } else if (value == 5) {
  132. return '已入库'
  133. } else {
  134. return '已出库'
  135. }
  136. } else if (this.userInfo.type == 3) {
  137. // 司机
  138. if (value == 2) {
  139. return '未装车'
  140. } else if (value == 4) {
  141. return '已装车'
  142. } else if (value == 6) {
  143. return '已下车'
  144. } else {
  145. return '已签收'
  146. }
  147. }
  148. } else {
  149. if (value == 1 || value == 2 || value == 3) {
  150. return '未发货'
  151. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  152. return '已发货'
  153. } else {
  154. return '已签收'
  155. }
  156. }
  157. },
  158. // 订单文字颜色
  159. getState(value) {
  160. if (this.userInfo.userType == 'sys') {
  161. if (this.userInfo.type == 2) {
  162. // 仓管
  163. if (value == 3) {
  164. return '#ff9900'
  165. } else if (value == 5) {
  166. return '#19be6b'
  167. } else {
  168. return '#606266'
  169. }
  170. } else if (this.userInfo.type == 3) {
  171. // 司机
  172. if (value == 2) {
  173. return '#ff9900'
  174. } else if (value == 4) {
  175. return '#19be6b'
  176. } else if (value == 6) {
  177. return '#19be6b'
  178. } else {
  179. return '#606266'
  180. }
  181. }
  182. } else {
  183. if (value == 1 || value == 2 || value == 3) {
  184. return '#ff9900'
  185. } else if (value == 4 || value == 5 || value == 6 || value == 7) {
  186. return '#19be6b'
  187. } else {
  188. return '#606266'
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .card_order_detail {
  197. margin: 20rpx;
  198. }
  199. .orderNumber {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. background-color: #fff;
  204. border-radius: 20rpx;
  205. padding: 15rpx;
  206. }
  207. .card_order_title {
  208. span {
  209. font-size: 28rpx;
  210. color: #909399;
  211. margin-right: 10rpx;
  212. }
  213. }
  214. .card_state {
  215. color: #606266;
  216. font-size: 30rpx;
  217. }
  218. .title_delivery {
  219. font-size: 30rpx;
  220. font-weight: 600;
  221. margin: 20rpx 0rpx 10rpx 10rpx;
  222. }
  223. .card_humiture {
  224. margin-top: 30rpx;
  225. border-radius: 20rpx;
  226. padding: 1rpx 20rpx;
  227. background-color: #fff;
  228. }
  229. .card_humiture1 {
  230. display: flex;
  231. justify-content: space-around;
  232. align-items: center;
  233. flex-wrap: wrap;
  234. margin-top: 10rpx;
  235. border-radius: 20rpx;
  236. padding: 20rpx;
  237. background-color: #fff;
  238. }
  239. .order_iamge_item {
  240. display: flex;
  241. flex-direction: column;
  242. align-items: center;
  243. }
  244. .order_item_title {
  245. font-weight: 600;
  246. margin-top: 10rpx;
  247. font-size: 26rpx;
  248. }
  249. .title_claim {
  250. display: flex;
  251. margin: 20rpx 0rpx;
  252. span {
  253. font-size: 28rpx;
  254. color: #909399;
  255. margin-right: 10rpx;
  256. }
  257. }
  258. .line_back {
  259. font-size: 30rpx;
  260. margin: 20rpx 0rpx;
  261. color: #3c9cff;
  262. }
  263. </style>