index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <div class="order-wrapper" id="order-wrapper">
  3. <div class="com-mobile-header">
  4. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  5. <p>订单管理
  6. </p>
  7. </div>
  8. <div class="order-nav">
  9. <div :class="activeType === '' ? 'active': ''" @click="ChangeList('')"><span>全部</span></div>
  10. <div :class="activeType === 'tobeconfirmed' ? 'active' : ''" @click="ChangeList('tobeconfirmed')"><span>待付款</span></div>
  11. <div :class="activeType === 'comfirmed' ? 'active' : ''" @click="ChangeList('comfirmed')"><span>待发货</span></div>
  12. <div :class="activeType === 'inbound' ? 'active' : ''" @click="ChangeList('inbound')"><span>待收货</span></div>
  13. </div>
  14. <ul class="order-list-wrap">
  15. <li class="clearfix" v-for="item in orderList">
  16. <div class="list-wrap-title clearfix">
  17. <div class="pull-left">{{item.buyername}}&nbsp;|&nbsp;{{item.buyentername}}</div>
  18. <div class="pull-right">
  19. <template v-if="vendorType === 'buyer'">
  20. <span class="red">待卖家发货</span>
  21. <!--<span class="red">待付款</span>-->
  22. <!--<span class="red">待收货</span>-->
  23. <!--<span class="red">交易关闭</span>-->
  24. </template>
  25. <template v-else>
  26. <span class="red" v-if="item.status === 502 || item.status === 406">买家已付款</span>
  27. <!--<span class="red">待发货</span>-->
  28. <span class="red" v-else-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">订单已取消</span>
  29. <span class="red" v-else-if="item.status === 501 || item.status === 524">待买家付款</span>
  30. <span class="red" v-else-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 503 || item.status === 514">待买家收货</span>
  31. <span class="red" v-else-if="item.status === 405 || item.status === 514 || item.status === 503 || item.status === 506">待商城付款</span>
  32. <span class="red" v-else-if="item.status === 606">交易关闭</span>
  33. <span class="red" v-else-if="item.status === 520">交易完成</span>
  34. <span class="red" v-else-if="item.status === 525">卖家发起取消,待确认</span>
  35. <span class="red" v-else-if="item.status === 504">付款确认中</span>
  36. </template>
  37. </div>
  38. </div>
  39. <div class="list-wrap-content" v-for="details in item.purchaseDetails">
  40. <div class="list-item clearfix">
  41. <div class="list-wrap-content-brand clearfix pull-left">
  42. <div class="name pull-left">品牌:</div>
  43. <div class="pull-left">{{details.brName || '-'}}</div>
  44. </div>
  45. <div class="pull-right lab">
  46. 自定义标签
  47. </div>
  48. </div>
  49. <div class="list-item clearfix">
  50. <div class="list-wrap-content-brand clearfix pull-left">
  51. <div class="name pull-left">类目:</div>
  52. <div class="pull-left">{{details.kiName || '-'}}</div>
  53. </div>
  54. <div class="pull-right pri">
  55. <span>¥</span>{{details.ensurePrice}}
  56. </div>
  57. </div>
  58. <div class="list-item clearfix">
  59. <div class="list-wrap-content-brand clearfix pull-left">
  60. <div class="name pull-left">型号:</div>
  61. <div class="pull-left">{{details.cmpCode || '-'}}</div>
  62. </div>
  63. <div class="pull-right lab">
  64. <span>x</span>{{details.number}}
  65. </div>
  66. </div>
  67. </div>
  68. <div class="list-all-info clearfix">
  69. <div>共<span>{{item.batchQty}}</span>件商品&nbsp;&nbsp;合计:
  70. <span class="pri"><a class="red">¥</a>{{item.ensurePrice }}</span>
  71. <span class="lab">(含运费:<a class="red">¥</a><a class="red">{{item.fare || '0.00'}}</a>)</span></div>
  72. </div>
  73. <div class="list-btn clearfix">
  74. <template v-if="vendorType === 'buyer'">
  75. <div class="pull-right sendGoods">确认收货</div>
  76. <!--<div class="pull-right sendGoods">确认付款</div>-->
  77. <!--<div class="pull-right">订单详情</div>-->
  78. <!--<div class="pull-right">取消订单</div>-->
  79. <!--<div class="pull-right">删除订单</div>-->
  80. </template>
  81. <template v-else>
  82. <div class="pull-right sendGoods" v-if="(item.status === 502 || item.status === 406) && !item.uasPurcid" @click="sendGoods(item)">点击发货</div>
  83. <div class="pull-right sendGoods" v-if="item.status === 404 && !item.uasPurcid">修改物流</div>
  84. <div class="pull-right">订单详情</div>
  85. <div class="pull-right" v-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">
  86. 删除订单</div>
  87. <div class="pull-right" v-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 503 || item.status === 514">查看物流</div>
  88. <div class="pull-right" v-if="item.installmentId && ((item.installment.status === 503 && item.Overtime) || item.installment.status === 504) && item.status !== 606 && item.status !== 525">
  89. 取消订单
  90. </div>
  91. <div @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" class="pull-right" v-if="installmentDetailPaid(item) && item.status !== 525 && item.status !== 606">
  92. 确认收款
  93. </div>
  94. </template>
  95. </div>
  96. </li>
  97. </ul>
  98. <div v-if="getOrderList && false"></div>
  99. <!-- 发货弹窗 -->
  100. <div class="mobile-modal" v-show="showSend">
  101. <div class="sendGoods_Alert">
  102. <div class="sendGoods_title">发货信息<span><i class="iconfont icon-guanbi1" @click="showSend = false"></i></span></div>
  103. <div class="sendGoods_buyer">
  104. <div class="sendGoods_buyer_top">
  105. <span class="name">{{sendGoodsInfo.area.name}}</span>
  106. <span class="tel">{{sendGoodsInfo.area.tel}}</span>
  107. </div>
  108. <div class="sendGoods_buyer_bottom">
  109. <img src="/images/order/address_icon.png"/>
  110. <span>{{sendGoodsInfo.area.area}}{{sendGoodsInfo.area.detailAddress}}</span>
  111. </div>
  112. </div>
  113. <div class="sendGoods_list clearfix">
  114. <div class="ti pull-left">配送方式</div>
  115. <div class="pull-right">
  116. {{sendGoodsInfo.sendType === 1301 ? '第三方配送' : (sendGoodsInfo.sendType === 1302 ? '卖家配送': '上门自提')}}
  117. </div>
  118. </div>
  119. <div class="sendGoods_list clearfix">
  120. <div class="ti pull-left">配送商</div>
  121. <div class="pull-right">请选择<img src="/images/mobile/user/icon-right.png"/></div>
  122. </div>
  123. <div class="sendGoods_list clearfix">
  124. <div class="ti pull-left">运单号</div>
  125. <div class="pull-right"><input type="number" placeholder="请输入运单号"/></div>
  126. </div>
  127. <div class="sendGoods_Btn">
  128. 确定
  129. </div>
  130. </div>
  131. </div>
  132. <!-- /end 发货弹窗 -->
  133. <!-- 选择配送商 -->
  134. <div class="mobile-modal" v-show="peisongShow">
  135. <div class="peisong_Alert">
  136. <div class="com-mobile-header">
  137. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  138. <p>选择配送商
  139. </p>
  140. </div>
  141. <div class="search-content">
  142. <input type="text" v-model="seekKeyword" placeholder="请输入您要查找的配送商" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
  143. <span @click="searchSeek" >
  144. <i class="iconfont icon-sousuo"></i>
  145. </span>
  146. </div>
  147. <ul>
  148. <li class="clearfix">
  149. <div class="name pull-left">11111</div>
  150. <div class="pull-right target" :class="peisonChooseItem === 0 ? 'active' : ''"></div>
  151. </li>
  152. </ul>
  153. </div>
  154. </div>
  155. <!-- /end 选择配送商 -->
  156. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  157. <pull-up :fixId="'order-wrapper'"
  158. :searchMore="isSearchSearchingMore"
  159. :allPage="allPage"
  160. :page="page"
  161. @pullUpAction="getMoreSearch"></pull-up>
  162. </div>
  163. </template>
  164. <script>
  165. import { EncryptionFilter } from '~utils/tools.js'
  166. import { RemindBox, PullUp } from '~components/mobile/common'
  167. export default {
  168. name: 'order',
  169. layout: 'mobile',
  170. middleware: 'authenticated',
  171. fetch({store, route}) {
  172. return route.query.type === 'buyer' ? Promise.all([
  173. ]) : Promise.all([
  174. store.dispatch('order/getSellOrderList', {
  175. count: 5,
  176. page: 1,
  177. sorting: { createtime: 'DESC' },
  178. status: '',
  179. storeType: 'other'}
  180. )
  181. ])
  182. },
  183. data() {
  184. return {
  185. isSearchSearchingMore: false,
  186. page: 1,
  187. collectResult: '',
  188. timeoutCount: 0,
  189. activeType: '',
  190. orderList: [],
  191. $status: '',
  192. showSend: false,
  193. sendGoodsInfo: {
  194. area: {}
  195. },
  196. peisongShow: true,
  197. seekKeyword: '',
  198. peisonChooseItem: 0
  199. }
  200. },
  201. computed: {
  202. allPage() {
  203. return this.$store.state.order.order.orderList.data.totalPages
  204. },
  205. vendorType() {
  206. return this.$route.query.type
  207. },
  208. getOrderList() {
  209. this.orderList = this.$store.state.order.order.orderList.data.content
  210. return this.$store.state.order.order.orderList
  211. }
  212. },
  213. methods: {
  214. getMoreSearch() {
  215. this.page++
  216. this.isSearchSearchingMore = true
  217. let params = {
  218. count: 5,
  219. page: this.page,
  220. sorting: { createtime: 'DESC' },
  221. status: this.$status,
  222. storeType: 'other'
  223. }
  224. this.$http.get('/trade/purchase/status/createtime', {params}).then(res => {
  225. this.isSearchSearchingMore = false
  226. this.orderList = [...this.orderList, ...res.data.content]
  227. })
  228. },
  229. ChangeList(_tp) {
  230. this.activeType = _tp
  231. this.page = 1
  232. let status = ''
  233. if (_tp === 'tobeconfirmed') {
  234. status = '501-504-524-525'
  235. } else if (_tp === 'comfirmed') {
  236. status = '502-406'
  237. } else if (_tp === 'inbound') {
  238. status = '404-511'
  239. }
  240. this.$status = status
  241. this.$store.dispatch('order/getSellOrderList', {
  242. count: 5,
  243. page: 1,
  244. sorting: { createtime: 'DESC' },
  245. status: status,
  246. storeType: 'other'})
  247. },
  248. // 是否为分期付款
  249. installmentDetailPaid(item) {
  250. if (!item.installment) return false
  251. let _flag = false
  252. item.installment.installmentDetails.forEach(list => {
  253. if (list.detno === item.installment.currentNo && list.status === 504) {
  254. _flag = true
  255. }
  256. })
  257. return _flag
  258. },
  259. // 发货
  260. sendGoods(item) {
  261. let _id
  262. if (item.inid) {
  263. _id = EncryptionFilter(item.inid)
  264. this.$http.get(`/trade/inFpu/tobeshipped/${_id}`).then(res => {
  265. this.sendGoodsInfo = res.data[0]
  266. this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
  267. this.showSend = true
  268. })
  269. } else {
  270. this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
  271. _id = EncryptionFilter(res.inid)
  272. this.$http.get(`/trade/inFpu/tobeshipped/${_id}`).then(res => {
  273. this.sendGoodsInfo = res.data[0]
  274. this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
  275. this.showSend = true
  276. })
  277. }, err => {
  278. this.onMind('转出货单失败' + err.data)
  279. })
  280. }
  281. },
  282. onMind(str) {
  283. this.collectResult = str
  284. this.timeoutCount++
  285. },
  286. // 搜索
  287. searchSeek() {
  288. this.seekKeyword
  289. },
  290. blur: function() {
  291. setTimeout(() => {
  292. this.$store.dispatch('mobile/SetInputGetFocus', false)
  293. }, 300)
  294. },
  295. inputGetFocus: function() {
  296. setTimeout(() => {
  297. this.$store.dispatch('mobile/SetInputGetFocus', true)
  298. }, 300)
  299. }
  300. },
  301. components: {
  302. RemindBox,
  303. PullUp
  304. }
  305. }
  306. </script>
  307. <style scoped lang="scss">
  308. @mixin overFlowHidden {
  309. overflow: hidden;
  310. text-overflow: ellipsis;
  311. white-space: nowrap;
  312. }
  313. @mixin lineHeight($value) {
  314. height: $value;
  315. line-height: $value;
  316. }
  317. .order-wrapper {
  318. background: #f1f3f6;
  319. margin: 0.88rem 0 0.98rem 0;
  320. height: calc(100vh - 0.88rem - 0.98rem);
  321. overflow-y: scroll;
  322. padding-bottom: 0.2rem;
  323. .order-nav {
  324. background: #fff;
  325. div {
  326. height: 0.82rem;
  327. line-height: 0.82rem;
  328. display: inline-block;
  329. width: 25%;
  330. text-align: center;
  331. font-size: .28rem;
  332. color: #666;
  333. &.active span{
  334. color: #3f84f6;
  335. border-bottom: 0.03rem solid #3f84f6;
  336. padding-bottom: 0.2rem;
  337. }
  338. }
  339. }
  340. .order-list-wrap {
  341. li {
  342. margin-top: 0.2rem;
  343. }
  344. .list-wrap-title{
  345. padding: 0 0.2rem;
  346. background: #fff;
  347. @include lineHeight(0.88rem);
  348. font-size: 0.28rem;
  349. color: #333;
  350. .pull-left {
  351. width: 5rem;
  352. @include overFlowHidden()
  353. }
  354. .pull-right {
  355. .red {
  356. color: #f21c1c;
  357. }
  358. }
  359. }
  360. .list-wrap-content {
  361. background: #f9f9f8;
  362. padding: 0.3rem 0.2rem;
  363. border-bottom: 1px solid #e4e4e4;
  364. .list-item {
  365. font-size: 0.28rem;
  366. color: #333;
  367. line-height: 0.6rem;
  368. .list-wrap-content-brand {
  369. width: 4.8rem;
  370. @include overFlowHidden();
  371. }
  372. .name {
  373. color: #666;
  374. }
  375. .lab {
  376. color: #999;
  377. font-size: 0.24rem;
  378. span {
  379. font-size: 0.16rem;
  380. }
  381. }
  382. .pri {
  383. font-size: 0.32rem;
  384. color: #f43938;
  385. span {
  386. font-size: 0.24rem;
  387. }
  388. }
  389. }
  390. }
  391. .list-all-info{
  392. text-align: right;
  393. background: #fff;
  394. padding: 0 0.2rem;
  395. @include overFlowHidden();
  396. @include lineHeight(0.66rem);
  397. font-size: 0.26rem;
  398. color: #333;
  399. border-bottom: 1px solid #e4e4e4;
  400. .pri {
  401. font-size: 0.32rem;
  402. color: #f43938;
  403. }
  404. .red {
  405. color: #f43938;
  406. font-size: 0.24rem;
  407. }
  408. .lab {
  409. color: #999;
  410. font-size: 0.24rem;
  411. }
  412. }
  413. .list-btn {
  414. background: #fff;
  415. @include lineHeight(0.8rem);
  416. padding: 0 0.2rem;
  417. div {
  418. display: inline-block;
  419. width: 1.5rem;
  420. @include lineHeight(0.56rem);
  421. border: 0.01rem solid #333;
  422. font-size: 0.26rem;
  423. color: #333;
  424. text-align: center;
  425. margin-top: 0.11rem;
  426. margin-left: 0.2rem;
  427. border-radius: 3px;
  428. &.sendGoods {
  429. color: #f43938;
  430. border: 0.01rem solid #f43938;
  431. }
  432. }
  433. }
  434. }
  435. .sendGoods_Alert {
  436. background: #fff;
  437. position: absolute;
  438. bottom: 0;
  439. left: 0;
  440. width: 100%;
  441. border-top-left-radius: 5px;
  442. border-top-right-radius: 5px;
  443. overflow: hidden;
  444. .sendGoods_title {
  445. color: #333;
  446. font-size: 0.42rem;
  447. text-align: center;
  448. line-height: 1rem;
  449. font-weight: 600;
  450. position: relative;
  451. i {
  452. position: absolute;
  453. font-size: 16px;
  454. right: 0.2rem;
  455. }
  456. }
  457. .sendGoods_buyer {
  458. padding: 0.3rem 0.2rem;
  459. border-bottom: 1px solid #d9d9d9;
  460. border-top: 1px solid #d9d9d9;
  461. .sendGoods_buyer_top {
  462. color: #333;
  463. font-size: 0.3rem;
  464. font-weight: bold;
  465. .name {
  466. margin-right: 0.3rem;
  467. margin-left: 0.32rem;
  468. }
  469. }
  470. .sendGoods_buyer_bottom {
  471. color: #333;
  472. font-size: 0.26rem;
  473. margin-top: 0.2rem;
  474. img {
  475. width: 0.22rem;
  476. height: 0.29rem;
  477. margin-right: 0.1rem;
  478. margin-top: -0.1rem;
  479. }
  480. }
  481. }
  482. .sendGoods_list {
  483. padding: 0 0.2rem;
  484. @include lineHeight(0.8rem);
  485. border-bottom: 1px solid #d9d9d9;
  486. font-size: 0.32rem;
  487. color: #333;
  488. .ti {
  489. font-weight: bold;
  490. }
  491. .pull-right {
  492. font-size: 0.28rem;
  493. color: #999;
  494. img {
  495. width: 0.14rem;
  496. height: 0.24rem;
  497. vertical-align: middle;
  498. margin-top: -0.02rem;
  499. margin-left: 0.1rem;
  500. }
  501. }
  502. input {
  503. width: 4rem;
  504. text-align: right;
  505. color: #333;
  506. }
  507. }
  508. .sendGoods_Btn {
  509. @include lineHeight(1rem);
  510. text-align: center;
  511. color: #fff;
  512. font-size: 0.36rem;
  513. background: #3f84f6;
  514. }
  515. }
  516. .search-content {
  517. margin-top: 0.88rem;
  518. margin-bottom: 0.2rem;
  519. text-align: center;
  520. padding: .25rem 0 0 0;
  521. input {
  522. border: 1px solid #376ff3;
  523. }
  524. span {
  525. height: .46rem;
  526. line-height: .46rem;
  527. }
  528. }
  529. .peisong_Alert {
  530. background: #f1f3f6;
  531. position: fixed;
  532. bottom: 0;
  533. left: 0;
  534. right: 0;
  535. top: 0;
  536. z-index: 11111;
  537. ul {
  538. li {
  539. line-height: 1rem;
  540. background: #fff;
  541. padding: 0 0.2rem;
  542. font-size: 0.28rem;
  543. color: #333;
  544. border-bottom: 1px solid #e0e1e2;
  545. div.target {
  546. width: 0.36rem;
  547. height: 0.36rem;
  548. border-radius: 50%;
  549. overflow: hidden;
  550. border: 1px solid #a4a4a4;
  551. margin-top: 0.3rem;
  552. &.active {
  553. background-image: url('/images/order/getChoose_icon.png');
  554. background-size: 100% 100%;
  555. }
  556. }
  557. }
  558. }
  559. }
  560. }
  561. </style>