orderInfo.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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.mainOrder')" 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. <view class="cell">
  83. <text class="label">{{ $t('order.materialName') }}</text>
  84. <text class="info">{{ orderInfo.materialName || '' }}</text>
  85. </view>
  86. <view class="cell">
  87. <text class="label">{{ $t('order.orderNumber') }}</text>
  88. <!-- <text class="info">{{ orderInfo.orderNumber || '0' }}{{orderInfo.orderType ==
  89. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT') }}</text> -->
  90. <text class="info" :style="'font-size: 9pt;font-weight: bold;'+(orderInfo.companyClientType=='109'?'color: green;':'color: red;')">
  91. {{ orderInfo.orderNumber || '0' }}{{ orderInfo.materialKind=='101' && orderInfo.companyClientType=='109'?$t('customer_meter.unitB') :(orderInfo.orderType ==
  92. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT')) }}</text>
  93. </view>
  94. <p class="cell">
  95. <text class="label">{{ $t('order.transporter') }}</text>
  96. <text class="info">{{ orderInfo.transporterName || '' }}</text>
  97. </p>
  98. <p class="cell">
  99. <text class="label">{{ $t('order.driver') }}</text>
  100. <text class="info">{{ orderInfo.driver || '' }}</text>
  101. </p>
  102. <p class="cell">
  103. <text class="label">{{ $t('order.vehicle') }}</text>
  104. <text class="info">{{ orderInfo.vehicle || '' }}</text>
  105. </p>
  106. <p class="cell">
  107. <text class="label">{{ $t('order.phone') }}</text>
  108. <text class="info">{{ orderInfo.phone || '' }}</text>
  109. </p>
  110. <template
  111. v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101'">
  112. <p class="cell">
  113. <text class="label">{{ $t('order.tareWeight') }}</text>
  114. <text class="info">{{ orderInfo.tareWeight || '0' }}</text>
  115. </p>
  116. <p class="cell">
  117. <text class="label">{{ $t('order.grossWeight') }}</text>
  118. <text class="info">{{ orderInfo.grossWeight || '0' }}</text>
  119. </p>
  120. </template>
  121. <template
  122. v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101'">
  123. <p class="cell">
  124. <text class="label">{{ $t('order.netWeight') }}</text>
  125. <text class="info">{{ orderInfo.netWeight || '0' }}</text>
  126. </p>
  127. </template>
  128. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 1">
  129. <p class="cell">
  130. <text class="label">{{ $t('order.inTime') }}</text>
  131. <text class="info">{{ orderInfo.inTime || '' }}</text>
  132. </p>
  133. </template>
  134. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 2">
  135. <p class="cell">
  136. <text class="label">{{ $t('order.outTime') }}</text>
  137. <text class="info">{{ orderInfo.outTime || '' }}</text>
  138. </p>
  139. </template>
  140. <template v-if="orderInfo.orderStatus == 2">
  141. <p class="cell">
  142. <text class="label">{{ $t('order.outDate') }}</text>
  143. <text class="info">{{ orderInfo.outDoorTime || '' }}</text>
  144. </p>
  145. </template>
  146. <template v-if="orderInfo.orderStatus == 2">
  147. <p class="cell" v-if="orderInfo.vehicleType=='101'||orderInfo.vehicleType=='102'">
  148. <text class="label" v-if="orderInfo.vehicleType=='101'">{{ $t('order.isBack') }}</text>
  149. <text class="label" v-if="orderInfo.vehicleType=='102'">{{ $t('order.isReturn') }}</text>
  150. <text class="info" :style="orderInfo.backFlag&&orderInfo.backFlag=='1'?'color:#3275F5;font-weight:bold':''">{{ orderInfo.backFlag&&orderInfo.backFlag=='1'?$t('driver.yes'):$t('driver.no') }}</text>
  151. </p>
  152. </template>
  153. <template>
  154. <p class="cell">
  155. <text class="label">{{ $t('order.endDate') }}</text>
  156. <text class="info">{{ orderInfo.orderValidDate || '永久' }}</text>
  157. </p>
  158. </template>
  159. <view class="btn" v-if="orderInfo.orderStatus!=4">
  160. <button class="oper-btn" type='primary' shape="circle" color='#4680F9' size="small"
  161. @click="onElectronicClick(orderInfo)">
  162. {{ $t('mine.electronic') }}
  163. </button>
  164. </view>
  165. </view>
  166. </view>
  167. <view class="order-card" v-for="(item, index) in orderHaxMixedList" :key="index">
  168. <view class="order-info-title">
  169. <image class="img" src="../../subpages/static/czzn-img/order/orderInfo-tenant.png"
  170. mode="scaleToFill" />
  171. <view class="mid">
  172. <view class="info">
  173. <span class="label">
  174. {{$t('spare.orderCode')}}
  175. </span>
  176. <span class="type" v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  177. <span class="type" v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span>
  178. <view class="order-type">
  179. <u-tag :text="$t('spare.suppOrder')" type="error"></u-tag>
  180. </view>
  181. </view>
  182. <text class="code">{{ item.code || '' }}</text>
  183. </view>
  184. <view class="orderStatus-info" v-if="item.orderType != '4'">
  185. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 0"
  186. src="/subpages/static/czzn-img/state/not-factory.png"></u--image>
  187. <u--image width="100rpx" height="88rpx"
  188. v-if="item.orderStatus == 1 && item.weighingStatus == 0"
  189. src="/subpages/static/czzn-img/state/in-factory.png"></u--image>
  190. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 2"
  191. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  192. <u--image width="100rpx" height="88rpx"
  193. v-if="item.orderStatus == 1 && item.weighingStatus != 0"
  194. src="/subpages/static/czzn-img/state/weighed.png"></u--image>
  195. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 4"
  196. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  197. </view>
  198. <view class="orderStatus-info" v-if="item.orderType == '4'">
  199. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 0"
  200. src="/subpages/static/czzn-img/state/no-take-order.png"></u--image>
  201. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 1"
  202. src="/subpages/static/czzn-img/state/start-take-order.png"></u--image>
  203. <u--image width="100rpx" height="88rpx" v-if="item.orderStatus == 2"
  204. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  205. <u--image width="100rpx" height="88rpx"
  206. v-if="item.enabledMarkType == 1 || item.orderStatus == 4"
  207. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  208. </view>
  209. </view>
  210. <view class="order-card-info">
  211. <p class="cell">
  212. <text class="label">{{ $t('order.orderDate') }}</text>
  213. <text class="info">{{ item.setDate || '' }}</text>
  214. </p>
  215. <p class="cell">
  216. <text class="label">{{ $t('order.vehicleType') }}</text>
  217. <text class="info" v-if="item.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  218. <text class="info"
  219. v-if="item.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  220. <text class="info"
  221. v-if="item.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  222. <text class="info"
  223. v-if="item.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  224. <!-- <span class="tag tag-ls" v-if="item.orderType == '1'">{{ $t('order.temp') }}</span>
  225. <span class="tag tag-gd" v-if="item.orderType == '2'">{{ $t('order.fixed') }}</span> -->
  226. </p>
  227. <p class="cell">
  228. <text class="label">{{ $t('order.companyName') }}</text>
  229. <text class="info">{{ item.companyName || '' }}</text>
  230. </p>
  231. <p class="cell">
  232. <text class="label">{{ $t('order.materialName') }}</text>
  233. <text class="info">{{ item.materialName || '' }}</text>
  234. </p>
  235. <p class="cell">
  236. <text class="label">{{ $t('order.orderNumber') }}</text>
  237. <text class="info">{{ item.orderNumber || '0' }}{{ item.orderType ==
  238. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT') }}</text>
  239. </p>
  240. <p class="cell">
  241. <text class="label">{{ $t('order.driver') }}</text>
  242. <text class="info">{{ item.driver || '' }}</text>
  243. </p>
  244. <p class="cell">
  245. <text class="label">{{ $t('order.vehicle') }}</text>
  246. <text class="info">{{ item.vehicle || '' }}</text>
  247. </p>
  248. <template v-if="item.orderStatus != 0 && item.weighingStatus != 0">
  249. <p class="cell">
  250. <text class="label">{{ $t('order.tareWeight') }}</text>
  251. <text class="info">{{ item.tareWeight || '0' }}</text>
  252. </p>
  253. <p class="cell">
  254. <text class="label">{{ $t('order.grossWeight') }}</text>
  255. <text class="info">{{ item.grossWeight || '0' }}</text>
  256. </p>
  257. </template>
  258. <template>
  259. <p class="cell">
  260. <text class="label">{{ $t('order.netWeight') }}</text>
  261. <text class="info">{{ item.netWeight || '0' }}</text>
  262. </p>
  263. </template>
  264. <template v-if="item.orderStatus != 0 && item.weighingStatus == 1">
  265. <p class="cell">
  266. <text class="label">{{ $t('order.inTime') }}</text>
  267. <text class="info">{{ item.inTime || '' }}</text>
  268. </p>
  269. </template>
  270. <template v-if="item.orderStatus != 0 && item.weighingStatus == 2">
  271. <p class="cell">
  272. <text class="label">{{ $t('order.outTime') }}</text>
  273. <text class="info">{{ item.outTime || '' }}</text>
  274. </p>
  275. </template>
  276. <template v-if="item.orderStatus == 2">
  277. <p class="cell">
  278. <text class="label">{{ $t('order.outDate') }}</text>
  279. <text class="info">{{ item.outDoorTime || '' }}</text>
  280. </p>
  281. </template>
  282. </view>
  283. </view>
  284. </view>
  285. </view>
  286. </view>
  287. </template>
  288. <script>
  289. import {
  290. getOrderInfo,
  291. getOrderMixedInfo,
  292. getElectronicInfo
  293. } from '../../api/order'
  294. export default {
  295. data() {
  296. return {
  297. orderInfo: {},
  298. orderHaxMixedList: [],
  299. rect: undefined,
  300. statusBarHeight: null,
  301. }
  302. },
  303. onLoad(options) {
  304. this.bindOrderInfo(options)
  305. let sysInfo = uni.getSystemInfoSync(); //状态栏的高度
  306. this.statusBarHeight = sysInfo.statusBarHeight;
  307. // #ifdef MP-WEIXIN
  308. this.rect = wx.getMenuButtonBoundingClientRect();
  309. // #endif
  310. console.log(this.rect, this.statusBarHeight);
  311. },
  312. methods: {
  313. bindOrderInfo(data) {
  314. getOrderInfo(data).then(res => {
  315. if (res.statusCode == 200) {
  316. this.orderInfo = res.data.data
  317. console.log("当前订单信息、", this.orderInfo);
  318. this.bindMixedOrderInfo(data);
  319. }
  320. })
  321. },
  322. bindMixedOrderInfo(data) {
  323. getOrderMixedInfo(data).then(res => {
  324. if (res.statusCode == 200) {
  325. this.orderHaxMixedList = res.data.data
  326. console.log("获取到已拼车订单信息、", this.orderHaxMixedList);
  327. }
  328. })
  329. },
  330. pageBack() {
  331. uni.navigateBack({
  332. delta: 1
  333. })
  334. },
  335. onElectronicClick(item){
  336. console.log(item,'----item-----------');
  337. let data={
  338. type:'weight',
  339. orderId:item.id
  340. }
  341. getElectronicInfo(data).then(res => {
  342. console.log(res,'------data--------');
  343. if (res.data.code == 0) {
  344. uni.downloadFile({
  345. url:res.data.data.replace('http://localhost:9000/','http://5.63.101.254:3689/admin/sys-file/getPDFFile/'),
  346. success: function (res) {
  347. console.log('downloadFile', res);
  348. const filePath =res.tempFilePath;
  349. uni.openDocument({
  350. filePath: filePath,
  351. fileType: 'pdf',
  352. showMenu: true,
  353. success: function (res) {
  354. console.log(res);
  355. console.log('打开文档成功')
  356. uni.hideLoading()
  357. },
  358. fail: function (res) {
  359. console.log(res)
  360. console.log('打开失败')
  361. },
  362. })
  363. }
  364. })
  365. } else {
  366. uni.showToast({
  367. title: '生成PDF文件出错 ' + res.msg,
  368. icon: 'none'
  369. })
  370. }
  371. })
  372. }
  373. }
  374. }
  375. </script>
  376. <style>
  377. /* #ifndef APP-NVUE */
  378. view {
  379. display: flex;
  380. box-sizing: border-box;
  381. flex-direction: column;
  382. }
  383. page {
  384. box-sizing: border-box;
  385. /* padding: 40rpx 40rpx 80rpx; */
  386. height: 100%;
  387. background: url('../../subpages/static/czzn-img/order/orderInfo-bg.jpg') no-repeat;
  388. background-size: 750rpx auto;
  389. background-color: #f5f7fa;
  390. }
  391. .cell .info {
  392. display: block; /* 确保 text 使用块级显示,有助于控制布局 */
  393. white-space: normal; /* 允许文本自然换行 */
  394. word-break: break-word; /* 在长单词或 URL 地址内部进行断行 */
  395. overflow-wrap: break-word; /* 当整个单词不能在一行显示时将其断开 */
  396. }
  397. /* #endif*/
  398. </style>
  399. <style lang="scss" scoped>
  400. @import '../../common/css/public.scss';
  401. </style>