orderDetails.vue 15 KB

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