orderInfo.vue 16 KB

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