orderDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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=='未装车'&&dataObj.driverContract!='1'"></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=" gray">{{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=" gray">{{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. <view class="content4" v-if='dataObj.orderStatus!="待货主确认"&&dataObj.orderStatus!="未装车"&&dataObj.orderStatus!="待货主确认装车"&&dataObj.orderStatus!="货主驳回装车信息"&&dataObj.orderStatus!="待平台确认装车"&&dataObj.orderStatus!="平台驳回装车信息"&&dataObj.orderStatus!="已终止"'>
  160. <view class="level2-title gray">运费信息(单位:元)</view>
  161. <view class='row-between'>
  162. <view class=" gray">预付运费</view>
  163. <view class="">{{freightInfo.prepaidFreight}}</view>
  164. </view>
  165. <view class='flex flex-end'>
  166. <view class="gray ">{{freightInfo.prepaidFreightDate}}</view>
  167. </view>
  168. <view class='row-between'>
  169. <view class=" gray">运费尾款</view>
  170. <view class="">{{freightInfo.freightBalance?freightInfo.freightBalance:'未支付'}}</view>
  171. </view>
  172. <view class='row-between mx gray'>
  173. 明细:预付{{freightInfo.prepaidFreight}}元,扣款{{freightInfo.deduction}}元,服务费{{freightInfo.serviceCharge}}元,尾款{{freightInfo.freightBalance}}元,合计收款{{freightInfo.totalCollection}}元。
  174. </view>
  175. </view>
  176. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
  177. :closeOnClickOverlay='true' :showCancelButton='true' @confirm="confirmClick" @close="cancelClick"
  178. @cancel="cancelClick" class="modal">
  179. <u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason' class='row'>
  180. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  181. :label="item.name" :name="item.name" @change="radioChange">
  182. </u-radio>
  183. </u-radio-group>
  184. <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
  185. v-if='isShowTerminationReason'>
  186. </u--textarea>
  187. </u-modal>
  188. <u-toast ref="uToast"></u-toast>
  189. </view>
  190. </template>
  191. <script>
  192. export default {
  193. data() {
  194. return {
  195. zcPhoneList:[],
  196. xcPhoneList:[],
  197. carrierInfo:{},
  198. freightInfo:{},
  199. cyinfoStatus: '未装车',
  200. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  201. isShowTerminationReason: false,
  202. dataObj:{},
  203. status1:false,
  204. status2:false,
  205. id: '',
  206. value2: '',
  207. radiolist1: [{
  208. name: '已与货主协商',
  209. disabled: false
  210. },
  211. {
  212. name: '货主原因终止',
  213. disabled: false
  214. },
  215. {
  216. name: '司机个人原因终止',
  217. disabled: false
  218. }, {
  219. name: '其他',
  220. disabled: false
  221. }
  222. ],
  223. radiovalue1: '已与货主协商',
  224. confirmText: '终止',
  225. alertTitle: '确定终止订单?',
  226. alertContent: "",
  227. isShowAlert: false,
  228. }
  229. },
  230. onLoad(options) {
  231. this.id = options.id
  232. },
  233. onShow() {
  234. this.getList()
  235. },
  236. methods: {
  237. lookContract(){
  238. uni.downloadFile({
  239. url: this.dataObj.driverContractUrl,
  240. success: function (res) {
  241. var filePath = res.tempFilePath;
  242. uni.openDocument({
  243. filePath: filePath,
  244. showMenu: true,
  245. success: function (res) {
  246. console.log('打开文档成功');
  247. }
  248. });
  249. }
  250. });
  251. // this.$request.baseRequest('get', '/orderInfo/setPdf', {
  252. // }).then(res => {
  253. // if (res.code == 200) {
  254. // this.contractSrc = res.data
  255. // uni.downloadFile({
  256. // url: res.data,
  257. // success: function (res) {
  258. // var filePath = res.tempFilePath;
  259. // uni.openDocument({
  260. // filePath: filePath,
  261. // showMenu: true,
  262. // success: function (res) {
  263. // console.log('打开文档成功');
  264. // }
  265. // });
  266. // }
  267. // });
  268. // // this.$refs.uToast.show({
  269. // // type: 'success',
  270. // // message: "提交成功",
  271. // // complete() {
  272. // // that.upCallback({
  273. // // size: 10,
  274. // // num: 1
  275. // // })
  276. // // }
  277. // // })
  278. // }
  279. // })
  280. // .catch(res => {
  281. // uni.$u.toast(res.message);
  282. // });
  283. },
  284. signContract() {
  285. // this.lookAlert = true
  286. uni.$u.route('/pages/order/signContract',{obj:encodeURIComponent(JSON.stringify(this.dataObj))}
  287. );
  288. },
  289. // 完结
  290. closed() {
  291. let item = this.dataDetails
  292. let that = this
  293. this.$request.baseRequest('post', '/orderInfo/api/editEnd', {
  294. id: item.id,
  295. }).then(res => {
  296. if (res.code == 200) {
  297. this.$refs.uToast.show({
  298. type: 'success',
  299. message: "提交成功",
  300. complete() {
  301. that.upCallback({
  302. size: 10,
  303. num: 1
  304. })
  305. }
  306. })
  307. }
  308. })
  309. .catch(res => {
  310. uni.$u.toast(res.message);
  311. });
  312. },
  313. confirmLoading() {
  314. uni.$u.route('/pages/order/confirmLoading', {id:this.id});
  315. },
  316. confirmUnLoading() {
  317. let item = this.dataDetails
  318. uni.$u.route('/pages/order/confirmUnloading', item);
  319. },
  320. confirmClick() {
  321. let that = this
  322. if (this.radiovalue1 == '其他' && !this.value2) {
  323. this.$refs.uToast.show({
  324. type: 'error',
  325. message: "请填写终止原因描述!",
  326. })
  327. return
  328. }
  329. let _terminationReason = ''
  330. if (this.radiovalue1 == '已与货主协商') {
  331. _terminationReason = 1
  332. } else if (this.radiovalue1 == '货主原因终止') {
  333. _terminationReason = 2
  334. } else if (this.radiovalue1 == '司机个人原因终止') {
  335. _terminationReason = 3
  336. } else if (this.radiovalue1 == '其他') {
  337. _terminationReason = 4
  338. }
  339. this.$request.baseRequest('post', '/orderInfo/api/end', {
  340. id: this.id,
  341. terminationReason: _terminationReason,
  342. terminationReasonDescription: this.value2,
  343. terminator:1
  344. }).then(res => {
  345. this.isShowAlert = false
  346. // this.mescroll.resetUpScroll()
  347. this.$refs.uToast.show({
  348. type: 'success',
  349. message: "提交成功!",
  350. complete() {
  351. that.getList()
  352. }
  353. })
  354. })
  355. .catch(res => {
  356. uni.$u.toast(res.message);
  357. });
  358. },
  359. cancelClick() {
  360. this.isShowAlert = false
  361. },
  362. stop() {
  363. let item = this.dataObj
  364. // 货主接单
  365. if (item.orderStatusKey == 1) {
  366. this.isShowTerminationReason = false
  367. } else {
  368. this.isShowTerminationReason = true
  369. }
  370. this.id = item.id
  371. this.isShowAlert = true
  372. },
  373. toPhone(){
  374. uni.makePhoneCall({
  375. phoneNumber: this.dataObj.cargoOwnerPhone
  376. });
  377. },
  378. back() {
  379. uni.navigateBack()
  380. },
  381. getList(){
  382. this.$request.baseRequest('get', '/orderInfo/getOrderInfo', {
  383. id: this.id,
  384. }).then(res => {
  385. if(res.code==200){
  386. this.dataObj = res.data
  387. this.carrierInfo = res.data.carrierInfo
  388. this.freightInfo = res.data.freightInfo
  389. this.zcPhoneList = this.carrierInfo.loadingImg.split(',')
  390. // if(res.data.orderStatus!="待货主确认"&&res.data.orderStatus!="未装车"&&res.data.orderStatus!="已终止"){
  391. // this.status1 = true
  392. // }
  393. // if(res.data.orderStatus!="已终止"&&res.data.orderStatus!="平台驳回装车信息"&&res.data.orderStatus!="待平台确认装车"&&res.data.orderStatus!="待货主确认"&&res.data.orderStatus!="未装车"&&res.data.orderStatus!="待货主确认装车"&&res.data.orderStatus!="货主驳回装车信息"){
  394. // this.status2 = true
  395. // }
  396. }
  397. })
  398. },
  399. goConfirmLoading(id) {
  400. uni.$u.route('/pages/order/confirmLoading', {
  401. id: this.id,
  402. });
  403. },
  404. }
  405. }
  406. </script>
  407. <style lang="scss">
  408. .fixed,
  409. .fixed1 {
  410. background: white;
  411. position: fixed;
  412. top: var(--status-bar-height);
  413. z-index: 999;
  414. width: 100%;
  415. }
  416. .fixed {
  417. padding-bottom: 10rpx;
  418. .title {
  419. background: white;
  420. position: relative;
  421. font-size: 36rpx;
  422. color: rgba(0, 0, 0, 0.85);
  423. .search {
  424. position: absolute;
  425. right: 20rpx;
  426. }
  427. .back {
  428. position: absolute;
  429. left: 20rpx;
  430. }
  431. }
  432. }
  433. .fixed1 {
  434. top: 0;
  435. height: var(--status-bar-height);
  436. background: white;
  437. }
  438. .row-between{
  439. margin-bottom: 10rpx;
  440. }
  441. .content1 {
  442. background: white;
  443. margin: calc(var(--status-bar-height) + 80rpx) 20rpx 0 20rpx;
  444. border-radius: 20rpx;
  445. padding: 40rpx 0rpx 0 0;
  446. box-sizing: border-box;
  447. .status {
  448. display: flex;
  449. justify-content: center;
  450. margin-bottom: 40rpx;
  451. font-size: 36rpx;
  452. color: #333333;
  453. font-weight: 700;
  454. }
  455. .btn {
  456. width: 40%;
  457. margin-top: 20rpx;
  458. }
  459. .item2 {
  460. padding-bottom: 40rpx;
  461. }
  462. .item3 {
  463. padding: 20rpx;
  464. background: linear-gradient(180deg, #F7F7F9 0%, #FFFFFF 100%);
  465. border-radius: 0 0 20rpx 20rpx;
  466. .name {
  467. margin-left: 10rpx;
  468. margin-right: 20rpx;
  469. font-size: 32rpx;
  470. font-weight: 500;
  471. color: #333333;
  472. }
  473. .number {
  474. font-size: 26rpx;
  475. color: #878787;
  476. }
  477. .star {
  478. margin-left: 10rpx;
  479. }
  480. .phone {
  481. .bgc {
  482. background: #E5F0FE;
  483. width: 58rpx;
  484. height: 58rpx;
  485. display: flex;
  486. align-items: center;
  487. justify-content: center;
  488. border-radius: 50%;
  489. }
  490. .hz-name {
  491. font-size: 26rpx;
  492. color: #2772FB;
  493. }
  494. }
  495. }
  496. }
  497. .level2-title {
  498. margin: 20rpx 0 20rpx 0;
  499. }
  500. .content2 {
  501. background: white;
  502. margin: 20rpx;
  503. border-radius: 20rpx;
  504. padding: 20rpx;
  505. .change-btn {
  506. width: 86rpx;
  507. height: 86rpx;
  508. position: relative;
  509. top: -20rpx;
  510. }
  511. .item1,
  512. .item2 {
  513. width: 40%;
  514. .text {
  515. text-overflow: ellipsis;
  516. overflow: hidden;
  517. white-space: nowrap;
  518. }
  519. .gray {
  520. text-align: center;
  521. }
  522. }
  523. .item1 .text {
  524. text-align: center;
  525. }
  526. .item2 .text {
  527. text-align: center;
  528. }
  529. .border {
  530. border-bottom: 1px solid #EEEEEE;
  531. padding-bottom: 33rpx;
  532. }
  533. .place {
  534. width: 80%;
  535. text-align: right;
  536. }
  537. }
  538. .content3,
  539. .content4 {
  540. background: white;
  541. margin: 20rpx;
  542. border-radius: 20rpx;
  543. padding: 20rpx;
  544. }
  545. .content4 {
  546. .time{
  547. text-align: right;
  548. }
  549. .mx {
  550. background: #F7F8FA;
  551. padding: 10rpx;
  552. margin: 10rpx 0;
  553. }
  554. }
  555. /deep/.u-modal__content {
  556. flex-direction: column;
  557. }
  558. </style>