orderDetails.vue 16 KB

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