orderDetails.vue 17 KB

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