orderDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <!-- 订单详情-->
  2. <template>
  3. <view class="content">
  4. <view class="fixed1"></view>
  5. <view class="fixed">
  6. <view class='title flex flex-center'>
  7. <u-icon class="back" name="arrow-left" color="" size="20" @click="back"></u-icon>
  8. <view class="nav-title">订单</view>
  9. <u-icon class="search" name="server-fill" color="" size="28" @click="$helper.contactCustomerService"></u-icon>
  10. </view>
  11. </view>
  12. <view class="content1">
  13. <view class="item1">
  14. <view class="status">{{dataObj.orderStatus}}</view>
  15. </view>
  16. <!-- flex flex-space-between -->
  17. <view class="item2">
  18. <u-button class="btn" text="查看合同" @click="lookContract" v-if="dataObj.driverContract=='1'"></u-button>
  19. <!-- <u-button class="btn" text="签订合同" @click="signContract" v-if="dataObj.cargoOwnerStatus=='未装车'&&dataObj.driverContract!='1'"></u-button> -->
  20. <u-button class="btn" text="终止" @click="stop" v-if="dataObj.orderStatus=='待货主确认'||dataObj.orderStatus=='未装车'"></u-button>
  21. <u-button class="btn" text="联系客服" @click="$helper.contactCustomerService"></u-button>
  22. <u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'"></u-button>
  23. <!-- <u-button class="btn" text="确认装车" @click="confirmLoading"></u-button> -->
  24. <u-button class="btn" text="修改装车信息" @click="confirmLoading" v-if="dataObj.orderStatus=='货主驳回装车信息'||dataObj.orderStatus=='平台驳回装车信息'"></u-button>
  25. <u-button class="btn" text="确认卸车" @click="confirmUnLoading" v-if="dataObj.orderStatus=='运输中'"></u-button>
  26. <u-button class="btn" text="修改卸车信息" @click="confirmUnLoading" v-if="dataObj.orderStatus=='货主驳回卸车信息'||dataObj.orderStatus=='平台驳回卸车信息'"></u-button>
  27. <u-button class="btn" text="完结" @click="closed" v-if="dataObj.orderStatus=='结算中'"></u-button>
  28. </view>
  29. <view class="item3 flex flex-space-between align-center">
  30. <view class="left flex align-center">
  31. <u--image :showLoading="true" :src="src" width="44px" height="44px" @click="" shape='circle'>
  32. </u--image>
  33. <view class="name">{{dataObj.cargoOwner}}</view>
  34. <view class="flex align-center">
  35. <!-- <view class="number">4.98</view> -->
  36. <!-- <u-icon class="star" name="star-fill" color="#FEC823" size="20" @click="back"></u-icon> -->
  37. </view>
  38. </view>
  39. <view class="right flex s-row align-center phone">
  40. <view class="bgc">
  41. <u-icon class="phone" name="phone-fill" color="#2772FB" size="20" @click="toPhone"></u-icon>
  42. </view>
  43. <view class="hz-name">联系货主</view>
  44. </view>
  45. </view>
  46. <!-- <view class='row-between'>
  47. <view class="">货主</view>
  48. <view>张三</view>
  49. </view>
  50. <view class='row-between'>
  51. <view class="">货主单位</view>
  52. <view>黑龙江中天昊元贸易有限公司</view>
  53. </view>
  54. <view class='row-between'>
  55. <view class="">卸货地</view>
  56. <view>黑龙江省齐齐哈尔市梅里斯达斡尔族区杜尔门沁达斡尔乡53农场</view>
  57. </view>
  58. <view class='row-between'>
  59. <view class="">货名</view>
  60. <view>玉米</view>
  61. </view>
  62. <view class='row-between'>
  63. <view class="">距离</view>
  64. <view>约15公里</view>
  65. </view>
  66. <view class='row-between'>
  67. <view class="">货运费</view>
  68. <view>100元/吨</view>
  69. </view> -->
  70. </view>
  71. <view class="content2">
  72. <view class="flex flex-space-between border">
  73. <view class="flex s-row item1">
  74. <view class="fontsize-46 fontweight-500 text">{{dataObj.sendCity}}</view>
  75. <view class="fontsize-28 gray">发货地</view>
  76. </view>
  77. <image class="change-btn" src="@/static/images/common/jt.png" mode='widthFix'></image>
  78. <view class="flex s-row item2">
  79. <view class="fontsize-46 fontweight-500 text" @click="">{{dataObj.unloadCity}}</view>
  80. <view class="fontsize-28 gray text-align-right">卸货地</view>
  81. </view>
  82. </view>
  83. <view class="level2-title">基本信息</view>
  84. <view class='row-between'>
  85. <view class=" gray">订单编号</view>
  86. <view class="">{{dataObj.orderNo}}</view>
  87. </view>
  88. <!-- <view class='row-between'>
  89. <view class=" gray">货主</view>
  90. <view class="">{{dataObj.cargoOwner}}</view>
  91. </view> -->
  92. <view class='row-between'>
  93. <view class=" gray">货主单位</view>
  94. <view class="">{{dataObj.compName?dataObj.compName:'个人货主'}}</view>
  95. </view>
  96. <view class='row-between'>
  97. <view class=" gray">发货地</view>
  98. <view class=" place">{{dataObj.sendPrivate}}{{dataObj.sendCity}}{{dataObj.sendArea}}{{dataObj.sendDetailedAddress}}</view>
  99. </view>
  100. <view class='row-between'>
  101. <view class=" gray">卸货地</view>
  102. <view class=" place">{{dataObj.unloadPrivate}}{{dataObj.unloadCity}}{{dataObj.unloadArea}}{{dataObj.unloadDetailedAddress}}</view>
  103. </view>
  104. <view class='row-between'>
  105. <view class=" gray">货名</view>
  106. <view class="">{{dataObj.goodsName}}</view>
  107. </view>
  108. <view class='row-between'>
  109. <view class=" gray">距离</view>
  110. <view class="">约{{dataObj.distance}}公里</view>
  111. </view>
  112. <!-- <view class='row-between'>
  113. <view class=" gray">运费</view>
  114. <view class="">{{dataObj.freight}}{{dataObj.illingMethod==0?'元/吨':'元/车'}}</view>
  115. </view> -->
  116. </view>
  117. <view class="content3" v-if='dataObj.orderStatus!="待货主确认"&&dataObj.orderStatus!="未装车"&&dataObj.orderStatus!="已终止"'>
  118. <view class="level2-title">承运信息</view>
  119. <view class='row-between'>
  120. <view class=" gray">合同编号</view>
  121. <view class="">{{carrierInfo.contractNo}}</view>
  122. </view>
  123. <view class='row-between'>
  124. <view class=" gray">车牌号</view>
  125. <view class="">{{carrierInfo.carNo}}</view>
  126. </view>
  127. <view class='row-between'>
  128. <view class=" gray">运费</view>
  129. <view class="">{{carrierInfo.estimatedFreight}}元</view>
  130. </view>
  131. <view class='row-between'>
  132. <view class=" gray">装车时间</view>
  133. <view class="">{{carrierInfo.loadingDate}}</view>
  134. </view>
  135. <view class='row-between'>
  136. <view class=" gray">装车照片</view>
  137. <view class="flex">
  138. <u--image :showLoading="true" :src='item' width="40px" height="40px" v-for="(item,index) in zcPhoneList"></u--image>
  139. </view>
  140. </view>
  141. <view v-if='dataObj.orderStatus!="待货主确认"&&dataObj.orderStatus!="未装车"&&dataObj.orderStatus!="待货主确认装车"&&dataObj.orderStatus!="货主驳回装车信息"&&dataObj.orderStatus!="待平台确认装车"&&dataObj.orderStatus!="平台驳回装车信息"&&dataObj.orderStatus!="运输中"&&dataObj.orderStatus!="已终止"'>
  142. <view class='row-between'>
  143. <view class=" gray">合计应付运费</view>
  144. <view class="">{{carrierInfo.totalFreight}}元</view>
  145. </view>
  146. <view class='row-between'>
  147. <view class=" gray">卸车时间</view>
  148. <view class="">{{carrierInfo.loadingDate}}</view>
  149. </view>
  150. <view class='row-between'>
  151. <view class=" gray">卸车照片</view>
  152. <view class="flex">
  153. <u--image :showLoading="true" :src='item' width="40px" height="40px" v-for="(item,index) in xcPhoneList"></u--image>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <!-- v-if="status2 -->
  159. <!-- dataObj.orderStatus!="待货主确认"&&dataObj.orderStatus!="未装车"&&dataObj.orderStatus!="待货主确认装车"&&dataObj.orderStatus!="货主驳回装车信息"&&dataObj.orderStatus!="待平台确认装车"&&dataObj.orderStatus!="平台驳回装车信息"&&dataObj.orderStatus!="已终止" -->
  160. <view class="content4" v-if='status2'>
  161. <view class="level2-title gray">运费信息(单位:元)</view>
  162. <view class='row-between'>
  163. <view class=" gray">预付运费</view>
  164. <view class="">{{freightInfo.prepaidFreight}}</view>
  165. </view>
  166. <view class='flex flex-end'>
  167. <view class="">{{freightInfo.prepaidFreightDate}}</view>
  168. </view>
  169. <view class='row-between'>
  170. <view class=" gray">运费尾款</view>
  171. <view class="">{{freightInfo.freightBalance?freightInfo.freightBalance:'未支付'}}</view>
  172. </view>
  173. <view class='row-between mx ' v-if="freightInfo.freightBalance">
  174. 明细:预付{{freightInfo.prepaidFreight}}元,服务费{{freightInfo.driverServiceCharge}}元,尾款{{freightInfo.freightBalance}}元,合计收款{{freightInfo.totalCollection}}元。
  175. </view>
  176. </view>
  177. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
  178. :closeOnClickOverlay='true' :showCancelButton='true' @confirm="confirmClick" @close="cancelClick"
  179. @cancel="cancelClick" class="modal">
  180. <u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason' class='row'>
  181. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  182. :label="item.name" :name="item.name" @change="radioChange">
  183. </u-radio>
  184. </u-radio-group>
  185. <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
  186. v-if='isShowTerminationReason'>
  187. </u--textarea>
  188. </u-modal>
  189. <u-toast ref="uToast"></u-toast>
  190. </view>
  191. </template>
  192. <script>
  193. export default {
  194. data() {
  195. return {
  196. zcPhoneList:[],
  197. xcPhoneList:[],
  198. carrierInfo:{},
  199. freightInfo:{},
  200. cyinfoStatus: '未装车',
  201. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  202. isShowTerminationReason: false,
  203. dataObj:{},
  204. status1:false,
  205. status2:false,
  206. id: '',
  207. value2: '',
  208. radiolist1: [{
  209. name: '已与货主协商',
  210. disabled: false
  211. },
  212. {
  213. name: '货主原因终止',
  214. disabled: false
  215. },
  216. {
  217. name: '司机个人原因终止',
  218. disabled: false
  219. }, {
  220. name: '其他',
  221. disabled: false
  222. }
  223. ],
  224. radiovalue1: '已与货主协商',
  225. confirmText: '终止',
  226. alertTitle: '确定终止订单?',
  227. alertContent: "",
  228. isShowAlert: false,
  229. }
  230. },
  231. onLoad(options) {
  232. this.id = options.id
  233. },
  234. onShow() {
  235. this.getList()
  236. },
  237. methods: {
  238. lookContract(){
  239. uni.downloadFile({
  240. url: this.dataObj.driverContractUrl,
  241. success: function (res) {
  242. var filePath = res.tempFilePath;
  243. uni.openDocument({
  244. filePath: filePath,
  245. showMenu: true,
  246. success: function (res) {
  247. console.log('打开文档成功');
  248. }
  249. });
  250. }
  251. });
  252. // this.$request.baseRequest('get', '/orderInfo/setPdf', {
  253. // }).then(res => {
  254. // if (res.code == 200) {
  255. // this.contractSrc = res.data
  256. // uni.downloadFile({
  257. // url: res.data,
  258. // success: function (res) {
  259. // var filePath = res.tempFilePath;
  260. // uni.openDocument({
  261. // filePath: filePath,
  262. // showMenu: true,
  263. // success: function (res) {
  264. // console.log('打开文档成功');
  265. // }
  266. // });
  267. // }
  268. // });
  269. // // this.$refs.uToast.show({
  270. // // type: 'success',
  271. // // message: "提交成功",
  272. // // complete() {
  273. // // that.upCallback({
  274. // // size: 10,
  275. // // num: 1
  276. // // })
  277. // // }
  278. // // })
  279. // }
  280. // })
  281. // .catch(res => {
  282. // uni.$u.toast(res.message);
  283. // });
  284. },
  285. signContract() {
  286. // this.lookAlert = true
  287. uni.$u.route('/pages/order/signContract',{obj:encodeURIComponent(JSON.stringify(this.dataObj))}
  288. );
  289. },
  290. // 完结
  291. closed() {
  292. let item = this.dataDetails
  293. let that = this
  294. this.$request.baseRequest('post', '/orderInfo/api/editEnd', {
  295. id: item.id,
  296. }).then(res => {
  297. if (res.code == 200) {
  298. this.$refs.uToast.show({
  299. type: 'success',
  300. message: "提交成功",
  301. complete() {
  302. that.upCallback({
  303. size: 10,
  304. num: 1
  305. })
  306. }
  307. })
  308. }
  309. })
  310. .catch(res => {
  311. uni.$u.toast(res.message);
  312. });
  313. },
  314. confirmLoading() {
  315. uni.$u.route('/pages/order/confirmLoading', {
  316. obj: JSON.stringify({id:this.id,carrierId:this.dataObj.hyCarrierInfo.id}),
  317. });
  318. // uni.$u.route('/pages/order/confirmLoading', {id:this.id});
  319. },
  320. confirmUnLoading() {
  321. let item = this.dataDetails
  322. uni.$u.route('/pages/order/confirmUnloading', item);
  323. },
  324. confirmClick() {
  325. let that = this
  326. if (this.radiovalue1 == '其他' && !this.value2) {
  327. this.$refs.uToast.show({
  328. type: 'error',
  329. message: "请填写终止原因描述!",
  330. })
  331. return
  332. }
  333. let _terminationReason = ''
  334. if (this.radiovalue1 == '已与货主协商') {
  335. _terminationReason = 1
  336. } else if (this.radiovalue1 == '货主原因终止') {
  337. _terminationReason = 2
  338. } else if (this.radiovalue1 == '司机个人原因终止') {
  339. _terminationReason = 3
  340. } else if (this.radiovalue1 == '其他') {
  341. _terminationReason = 4
  342. }
  343. this.$request.baseRequest('post', '/orderInfo/api/end', {
  344. id: this.id,
  345. terminationReason: _terminationReason,
  346. terminationReasonDescription: this.value2,
  347. terminator:1
  348. }).then(res => {
  349. this.isShowAlert = false
  350. // this.mescroll.resetUpScroll()
  351. this.$refs.uToast.show({
  352. type: 'success',
  353. message: "提交成功!",
  354. complete() {
  355. that.getList()
  356. }
  357. })
  358. })
  359. .catch(res => {
  360. uni.$u.toast(res.message);
  361. });
  362. },
  363. cancelClick() {
  364. this.isShowAlert = false
  365. },
  366. stop() {
  367. let item = this.dataObj
  368. // 货主接单
  369. if (item.orderStatusKey == 1) {
  370. this.isShowTerminationReason = false
  371. } else {
  372. this.isShowTerminationReason = true
  373. }
  374. this.id = item.id
  375. this.isShowAlert = true
  376. },
  377. toPhone(){
  378. uni.makePhoneCall({
  379. phoneNumber: this.dataObj.cargoOwnerPhone
  380. });
  381. },
  382. back() {
  383. uni.navigateBack()
  384. },
  385. getList(){
  386. this.$request.baseRequest('get', '/orderInfo/getOrderInfo', {
  387. id: this.id,
  388. }).then(res => {
  389. if(res.code==200){
  390. this.dataObj = res.data
  391. this.carrierInfo = res.data.hyCarrierInfo
  392. this.freightInfo = res.data.freightInfo
  393. if(this.carrierInfo.loadingImg&&this.carrierInfo.loadingImg.length>0){
  394. this.zcPhoneList = this.carrierInfo.loadingImg.split(',')
  395. }
  396. // if(res.data.orderStatus!="待货主确认"&&res.data.orderStatus!="未装车"&&res.data.orderStatus!="已终止"){
  397. // this.status1 = true
  398. // }
  399. // 运费信息
  400. if (res.data.cargoOwnerStatus != "待接单" && res.data.cargoOwnerStatus != "未装车" && res.data
  401. .cargoOwnerStatus != "待确认装车" && res.data.cargoOwnerStatus != "已驳回装车信息" && res.data
  402. .cargoOwnerStatus != "待平台确认装车" && res.data.cargoOwnerStatus != "平台驳回装车信息" && res.data.cargoOwnerStatus != "待结算" && res.data
  403. .cargoOwnerStatus != "已终止") {
  404. this.status2 = true
  405. }
  406. }
  407. })
  408. },
  409. goConfirmLoading(id) {
  410. uni.$u.route('/pages/order/confirmLoading', {
  411. obj: JSON.stringify({id:this.id}),
  412. });
  413. },
  414. }
  415. }
  416. </script>
  417. <style lang="scss">
  418. .fixed,
  419. .fixed1 {
  420. background: white;
  421. position: fixed;
  422. top: var(--status-bar-height);
  423. z-index: 999;
  424. width: 100%;
  425. }
  426. .fixed {
  427. padding-bottom: 10rpx;
  428. .title {
  429. background: white;
  430. position: relative;
  431. font-size: 36rpx;
  432. color: rgba(0, 0, 0, 0.85);
  433. .search {
  434. position: absolute;
  435. right: 20rpx;
  436. }
  437. .back {
  438. position: absolute;
  439. left: 20rpx;
  440. }
  441. }
  442. }
  443. .fixed1 {
  444. top: 0;
  445. height: var(--status-bar-height);
  446. background: white;
  447. }
  448. .row-between{
  449. margin-bottom: 10rpx;
  450. }
  451. .content1 {
  452. background: white;
  453. margin: calc(var(--status-bar-height) + 80rpx) 20rpx 0 20rpx;
  454. border-radius: 20rpx;
  455. padding: 40rpx 0rpx 0 0;
  456. box-sizing: border-box;
  457. .status {
  458. display: flex;
  459. justify-content: center;
  460. margin-bottom: 40rpx;
  461. font-size: 36rpx;
  462. color: #333333;
  463. font-weight: 700;
  464. }
  465. .btn {
  466. width: 40%;
  467. margin-top: 20rpx;
  468. }
  469. .item2 {
  470. padding-bottom: 40rpx;
  471. }
  472. .item3 {
  473. padding: 20rpx;
  474. background: linear-gradient(180deg, #F7F7F9 0%, #FFFFFF 100%);
  475. border-radius: 0 0 20rpx 20rpx;
  476. .name {
  477. margin-left: 10rpx;
  478. margin-right: 20rpx;
  479. font-size: 32rpx;
  480. font-weight: 500;
  481. color: #333333;
  482. }
  483. .number {
  484. font-size: 26rpx;
  485. color: #878787;
  486. }
  487. .star {
  488. margin-left: 10rpx;
  489. }
  490. .phone {
  491. .bgc {
  492. background: #E5F0FE;
  493. width: 58rpx;
  494. height: 58rpx;
  495. display: flex;
  496. align-items: center;
  497. justify-content: center;
  498. border-radius: 50%;
  499. }
  500. .hz-name {
  501. font-size: 26rpx;
  502. color: #2772FB;
  503. }
  504. }
  505. }
  506. }
  507. .level2-title {
  508. margin: 20rpx 0 20rpx 0;
  509. }
  510. .content2 {
  511. background: white;
  512. margin: 20rpx;
  513. border-radius: 20rpx;
  514. padding: 20rpx;
  515. .change-btn {
  516. width: 86rpx;
  517. height: 86rpx;
  518. position: relative;
  519. top: -20rpx;
  520. }
  521. .item1,
  522. .item2 {
  523. width: 40%;
  524. .text {
  525. text-overflow: ellipsis;
  526. overflow: hidden;
  527. white-space: nowrap;
  528. }
  529. .gray {
  530. text-align: center;
  531. }
  532. }
  533. .item1 .text {
  534. text-align: center;
  535. }
  536. .item2 .text {
  537. text-align: center;
  538. }
  539. .border {
  540. border-bottom: 1px solid #EEEEEE;
  541. padding-bottom: 33rpx;
  542. }
  543. .place {
  544. width: 80%;
  545. text-align: right;
  546. }
  547. }
  548. .content3,
  549. .content4 {
  550. background: white;
  551. margin: 20rpx;
  552. border-radius: 20rpx;
  553. padding: 20rpx;
  554. }
  555. .content4 {
  556. .time{
  557. text-align: right;
  558. }
  559. .mx {
  560. background: #F7F8FA;
  561. padding: 10rpx;
  562. margin: 10rpx 0;
  563. }
  564. }
  565. /deep/.u-modal__content {
  566. flex-direction: column;
  567. }
  568. </style>