mixedOrderInfo.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <view class="order-infos">
  3. <!-- #ifdef MP-WEIXIN -->
  4. <view class="topbar"
  5. :style="rect?'height:'+rect.height+'px;line-height:'+rect.height+'px;margin-top:'+rect.top+'px':''">
  6. <!-- #endif -->
  7. <!-- #ifndef MP-WEIXIN -->
  8. <view class="topbar" :style="statusBarHeight?'margin-top:'+statusBarHeight+'px':''">
  9. <!-- #endif -->
  10. <view class="back-icon" :style="rect?'padding:'+(rect.height-24)+'rpx 20rpx':''">
  11. <u-icon name="arrow-left" size="24" color="#ffffff" @click="pageBack"></u-icon>
  12. </view>
  13. 混装详情
  14. </view>
  15. <view class="after">
  16. <view class="order-info-card">
  17. <view class="order-card">
  18. <view class="order-info-title">
  19. <image class="img" src="../../subpages/static/czzn-img/order/orderInfo-tenant.png"
  20. mode="scaleToFill" />
  21. <view class="mid">
  22. <view class="info">
  23. <span class="label">
  24. {{$t('spare.orderCode')}}
  25. </span>
  26. <span class="type" v-if="orderInfo.orderType == '1'">{{ $t('order.temp') }}</span>
  27. <span class="type" v-if="orderInfo.orderType == '2'">{{ $t('order.fixed') }}</span>
  28. <!-- <view class="order-type" v-if="orderInfo.isMain==2">
  29. <u-tag :text="$t('order.mixed')" type="success"></u-tag>
  30. </view> -->
  31. </view>
  32. <text class="code">{{ orderInfo.code || '' }}</text>
  33. </view>
  34. <view class="orderStatus-info" v-if="orderInfo.orderType != '4'">
  35. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 0"
  36. src="/subpages/static/czzn-img/state/not-factory.png"></u--image>
  37. <u--image width="100rpx" height="88rpx"
  38. v-if="orderInfo.orderStatus == 1 && orderInfo.weighingStatus == 0"
  39. src="/subpages/static/czzn-img/state/in-factory.png"></u--image>
  40. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 2"
  41. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  42. <u--image width="100rpx" height="88rpx"
  43. v-if="orderInfo.orderStatus == 1 && orderInfo.weighingStatus != 0"
  44. src="/subpages/static/czzn-img/state/weighed.png"></u--image>
  45. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 4"
  46. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  47. </view>
  48. <!-- <span class="type" v-if="orderInfo.orderType == '1'">{{ $t('order.temp') }}</span>
  49. <span class="type" v-if="orderInfo.orderType == '2'">{{ $t('order.fixed') }}</span> -->
  50. <view class="orderStatus-info" v-if="orderInfo.orderType == '4'">
  51. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 0"
  52. src="/subpages/static/czzn-img/state/no-take-order.png"></u--image>
  53. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 1"
  54. src="/subpages/static/czzn-img/state/start-take-order.png"></u--image>
  55. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 2"
  56. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  57. <u--image width="100rpx" height="88rpx"
  58. v-if="orderInfo.enabledMarkType == 1 || orderInfo.orderStatus == 4"
  59. src="/subpages/static//czzn-img/state/cancellation.png"></u--image>
  60. </view>
  61. </view>
  62. <view class="order-card-info">
  63. <p class="cell">
  64. <text class="label">{{ $t('order.orderDate') }}</text>
  65. <text class="info">{{ orderInfo.setDate || '' }}</text>
  66. </p>
  67. <p class="cell">
  68. <text class="label">{{ $t('order.vehicleType') }}</text>
  69. <text class="info"
  70. v-if="orderInfo.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  71. <text class="info"
  72. v-if="orderInfo.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  73. <text class="info"
  74. v-if="orderInfo.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  75. <text class="info"
  76. v-if="orderInfo.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  77. </p>
  78. <p class="cell">
  79. <text class="label">{{ $t('order.companyName') }}</text>
  80. <text class="info">{{ orderInfo.companyName || '' }}</text>
  81. </p>
  82. <p class="cell">
  83. <text class="label">{{ $t('order.driver') }}</text>
  84. <text class="info">{{ orderInfo.driver || '' }}</text>
  85. </p>
  86. <p class="cell">
  87. <text class="label">{{ $t('order.vehicle') }}</text>
  88. <text class="info">{{ orderInfo.vehicle || '' }}</text>
  89. </p>
  90. <template
  91. v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 1">
  92. <p class="cell">
  93. <text class="label">{{ $t('order.tareWeight') }}</text>
  94. <text class="info">{{ orderInfo.tareWeight || '0' }}</text>
  95. </p>
  96. </template>
  97. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 1">
  98. <p class="cell">
  99. <text class="label">{{ $t('order.inTime') }}</text>
  100. <text class="info">{{ orderInfo.inTime || '' }}</text>
  101. </p>
  102. </template>
  103. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 2">
  104. <p class="cell">
  105. <text class="label">{{ $t('order.outTime') }}</text>
  106. <text class="info">{{ orderInfo.outTime || '' }}</text>
  107. </p>
  108. </template>
  109. <template v-if="orderInfo.orderStatus == 2">
  110. <p class="cell">
  111. <text class="label">{{ $t('order.outDate') }}</text>
  112. <text class="info">{{ orderInfo.outDoorTime || '' }}</text>
  113. </p>
  114. </template>
  115. <template v-if="orderInfo.orderStatus == 2">
  116. <p class="cell" v-if="orderInfo.vehicleType=='101'||orderInfo.vehicleType=='102'">
  117. <text class="label"
  118. v-if="orderInfo.vehicleType=='101'">{{ $t('order.isBack') }}</text>
  119. <text class="label"
  120. v-if="orderInfo.vehicleType=='102'">{{ $t('order.isReturn') }}</text>
  121. <text class="info"
  122. :style="orderInfo.backFlag&&orderInfo.backFlag=='1'?'color:#3275F5;font-weight:bold':''">{{ orderInfo.backFlag&&orderInfo.backFlag=='1'?$t('driver.yes'):$t('driver.no') }}</text>
  123. </p>
  124. </template>
  125. <template>
  126. <p class="cell">
  127. <text class="label">{{ $t('order.endDate') }}</text>
  128. <text class="info">{{ orderInfo.orderValidDate || '永久' }}</text>
  129. </p>
  130. </template>
  131. </view>
  132. </view>
  133. <u-divider :text="$t('order.mixedMaterial')" textColor="#2979ff" lineColor="#2979ff"></u-divider>
  134. <view class="order-card" style="border-bottom: 4rpx dashed #ccc;" v-for="(item, index) in orderHaxMixedList" :key="index">
  135. <!--<view class="order-info-title">
  136. <image class="img" src="../../subpages/static/czzn-img/order/orderInfo-tenant.png"
  137. mode="scaleToFill" />
  138. <view class="mid">
  139. <view class="info">
  140. <span class="label">
  141. {{$t('spare.orderCode')}}
  142. </span>
  143. <span class="type" v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  144. <span class="type" v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span>
  145. <view class="order-type">
  146. <u-tag :text="$t('order.suppOrder')" type="error"></u-tag>
  147. </view>
  148. </view>
  149. <text class="code">{{ item.code || '' }}</text>
  150. </view>
  151. <view class="orderStatus-info" v-if="item.orderType != '4'">
  152. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 0"
  153. src="/subpages/static/czzn-img/state/not-factory.png"></u--image>
  154. <u--image width="100rpx" height="88rpx"
  155. v-if="item.orderStatus == 1 && item.weighingStatus == 0"
  156. src="/subpages/static/czzn-img/state/in-factory.png"></u--image>
  157. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 2"
  158. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  159. <u--image width="100rpx" height="88rpx"
  160. v-if="item.orderStatus == 1 && item.weighingStatus != 0"
  161. src="/subpages/static/czzn-img/state/weighed.png"></u--image>
  162. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 4"
  163. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  164. </view>
  165. </view>-->
  166. <view class="order-card-info">
  167. <!-- <p class="cell">
  168. <text class="label">{{ $t('order.orderDate') }}</text>
  169. <text class="info">{{ item.setDate || '' }}</text>
  170. </p> -->
  171. <!-- <p class="cell">
  172. <text class="label">{{ $t('order.vehicleType') }}</text>
  173. <text class="info" v-if="item.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  174. <text class="info"
  175. v-if="item.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  176. <text class="info"
  177. v-if="item.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  178. <text class="info"
  179. v-if="item.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  180. </p> -->
  181. <view class="cell">
  182. <text class="label">{{ $t('order.companyName') }}</text>
  183. <text class="info">{{ item.companyName || '' }}</text>
  184. </view>
  185. <view class="cell">
  186. <text class="label">{{ $t('order.materialName') }}</text>
  187. <text
  188. class="info">{{ item.materialName || '' }}[{{ item.orderNumber || '0' }}{{$t('customer_meter.unitT') }}]</text>
  189. </view>
  190. <view class="cell" v-if="userType=='4'">
  191. <p class="info" v-if="!item.queueId && item.weighingStatus=='1'">
  192. <button type='primary' shape="circle" color='#CCCCCC' size="small"
  193. @click="onAddQueueClick(item)">
  194. {{ $t('mine.load')+$t('mine.queue') }}
  195. </button>
  196. </p>
  197. </view>
  198. <!-- <p class="cell">
  199. <text class="label">{{ $t('order.orderNumber') }}</text>
  200. <text class="info">{{ item.orderNumber || '0' }}{{$t('customer_meter.unitT') }}</text>
  201. </p> -->
  202. <!-- <p class="cell">
  203. <text class="label">{{ $t('order.driver') }}</text>
  204. <text class="info">{{ item.driver || '' }}</text>
  205. </p>
  206. <p class="cell">
  207. <text class="label">{{ $t('order.vehicle') }}</text>
  208. <text class="info">{{ item.vehicle || '' }}</text>
  209. </p>
  210. <template v-if="item.orderStatus != 0 && item.weighingStatus != 0">
  211. <p class="cell">
  212. <text class="label">{{ $t('order.tareWeight') }}</text>
  213. <text class="info">{{ item.tareWeight || '0' }}</text>
  214. </p>
  215. <p class="cell">
  216. <text class="label">{{ $t('order.grossWeight') }}</text>
  217. <text class="info">{{ item.grossWeight || '0' }}</text>
  218. </p>
  219. </template>
  220. <template>
  221. <p class="cell">
  222. <text class="label">{{ $t('order.netWeight') }}</text>
  223. <text class="info">{{ item.netWeight || '0' }}</text>
  224. </p>
  225. </template>
  226. <template v-if="item.orderStatus != 0 && item.weighingStatus == 1">
  227. <p class="cell">
  228. <text class="label">{{ $t('order.inTime') }}</text>
  229. <text class="info">{{ item.inTime || '' }}</text>
  230. </p>
  231. </template>
  232. <template v-if="item.orderStatus != 0 && item.weighingStatus == 2">
  233. <p class="cell">
  234. <text class="label">{{ $t('order.outTime') }}</text>
  235. <text class="info">{{ item.outTime || '' }}</text>
  236. </p>
  237. </template>
  238. <template v-if="item.orderStatus == 2">
  239. <p class="cell">
  240. <text class="label">{{ $t('order.outDate') }}</text>
  241. <text class="info">{{ item.outDoorTime || '' }}</text>
  242. </p>
  243. </template> -->
  244. </view>
  245. </view>
  246. </view>
  247. </view>
  248. <u-toast ref="loadingToast"></u-toast>
  249. </view>
  250. </template>
  251. <script>
  252. import {
  253. getOrderInfo,
  254. getOrderMixedInfo,
  255. createQueue,
  256. } from '../../api/order'
  257. export default {
  258. data() {
  259. return {
  260. orderInfo: {},
  261. orderHaxMixedList: [],
  262. rect: undefined,
  263. statusBarHeight: null,
  264. options: {},
  265. userType:"0",
  266. }
  267. },
  268. onLoad(options) {
  269. this.options = options;
  270. //3:客商,4:司机
  271. this.userType = this.options.userType
  272. this.bindOrderInfo()
  273. let sysInfo = uni.getSystemInfoSync(); //状态栏的高度
  274. this.statusBarHeight = sysInfo.statusBarHeight;
  275. // #ifdef MP-WEIXIN
  276. this.rect = wx.getMenuButtonBoundingClientRect();
  277. // #endif
  278. console.log(this.rect, this.statusBarHeight);
  279. },
  280. methods: {
  281. bindOrderInfo() {
  282. getOrderInfo(this.options).then(res => {
  283. if (res.statusCode == 200) {
  284. this.orderInfo = res.data.data
  285. console.log("当前订单信息、", this.orderInfo);
  286. this.bindMixedOrderInfo();
  287. }
  288. })
  289. },
  290. bindMixedOrderInfo() {
  291. getOrderMixedInfo(this.options).then(res => {
  292. if (res.statusCode == 200) {
  293. this.orderHaxMixedList = res.data.data
  294. console.log("获取到已拼车订单信息、", this.orderHaxMixedList);
  295. }
  296. })
  297. },
  298. pageBack() {
  299. uni.navigateBack({
  300. delta: 1
  301. })
  302. },
  303. //订单作废
  304. onAddQueueClick(item) {
  305. let that = this
  306. uni.showModal({
  307. content: that.$t('driver.startLoad'),
  308. showCancell: true,
  309. success: function(res) {
  310. if (res.confirm) {
  311. let data = {
  312. orderId: item.id
  313. };
  314. that.$refs.loadingToast.show({
  315. type: "loading",
  316. message: that.$t('base.common.loading'),
  317. duration: "1000000"
  318. })
  319. createQueue(data).then(res => {
  320. that.$refs.loadingToast.hide()
  321. if (res.statusCode == 200) {
  322. uni.showToast({
  323. title: that.$t('mine.operateOk'),
  324. icon: 'none',
  325. duration: 2000
  326. })
  327. that.getOrderInfo()
  328. }
  329. }).catch(res => {
  330. debugger
  331. that.$refs.loadingToast.hide()
  332. })
  333. } else if (res.cancell) {
  334. that.$refs.loadingToast.hide()
  335. console.log('用户点击取消');
  336. }
  337. }
  338. });
  339. },
  340. }
  341. }
  342. </script>
  343. <style>
  344. /* #ifndef APP-NVUE */
  345. view {
  346. display: flex;
  347. box-sizing: border-box;
  348. flex-direction: column;
  349. }
  350. page {
  351. box-sizing: border-box;
  352. /* padding: 40rpx 40rpx 80rpx; */
  353. height: 100%;
  354. background: url('../../subpages/static/czzn-img/order/orderInfo-bg.jpg') no-repeat;
  355. background-size: 750rpx auto;
  356. background-color: #f5f7fa;
  357. }
  358. /* #endif*/
  359. </style>
  360. <style lang="scss" scoped>
  361. @import '../../common/css/public.scss';
  362. </style>