orderDetails.vue 18 KB

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