index.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  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" v-if="vendorType !== 'buyer'">{{item.buyername}}&nbsp;|&nbsp;{{item.buyentername}}</div>
  18. <div class="pull-left" v-else>{{item.sellername}}</div>
  19. <div class="pull-right">
  20. <template v-if="vendorType === 'buyer'">
  21. <span class="red" v-if="item.status === 505 || item.status === 406 || item.status === 407 || item.status === 403 || item.status === 408">待卖家发货</span>
  22. <span class="red" v-else-if="item.status === 501 || item.status === 502 || item.status === 503 || item.status === 524">待付款</span>
  23. <span class="red" v-else-if="item.status === 404">待收货</span>
  24. <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>
  25. <span class="red" v-else-if="item.status === 504">付款确认中</span>
  26. <span class="red" v-else-if="item.status === 520 || item.status === 405">交易已完成</span>
  27. <span class="red" v-else-if="item.status === 525">卖家请求取消</span>
  28. </template>
  29. <template v-else>
  30. <span class="red" v-if="item.status === 502 || item.status === 406">买家已付款</span>
  31. <!--<span class="red">待发货</span>-->
  32. <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>
  33. <span class="red" v-else-if="item.status === 501 || item.status === 524">待买家付款</span>
  34. <span class="red" v-else-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 503 || item.status === 514">待买家收货</span>
  35. <span class="red" v-else-if="item.status === 405 || item.status === 514 || item.status === 503 || item.status === 506">待商城付款</span>
  36. <span class="red" v-else-if="item.status === 606">交易关闭</span>
  37. <span class="red" v-else-if="item.status === 520">交易完成</span>
  38. <span class="red" v-else-if="item.status === 525">卖家发起取消,待确认</span>
  39. <span class="red" v-else-if="item.status === 504">付款确认中</span>
  40. </template>
  41. </div>
  42. </div>
  43. <div class="list-wrap-content" v-for="(details, index) in item.purchaseDetails" v-if="index < 3">
  44. <div class="list-item clearfix">
  45. <div class="list-wrap-content-brand clearfix pull-left">
  46. <div class="name pull-left">品牌:</div>
  47. <div class="pull-left">{{details.brName || '-'}}</div>
  48. </div>
  49. <div class="pull-right lab">
  50. 自定义标签
  51. </div>
  52. </div>
  53. <div class="list-item clearfix">
  54. <div class="list-wrap-content-brand clearfix pull-left">
  55. <div class="name pull-left">类目:</div>
  56. <div class="pull-left">{{details.kiName || '-'}}</div>
  57. </div>
  58. <div class="pull-right pri">
  59. <span>¥</span>{{details.ensurePrice}}
  60. </div>
  61. </div>
  62. <div class="list-item clearfix">
  63. <div class="list-wrap-content-brand clearfix pull-left">
  64. <div class="name pull-left">型号:</div>
  65. <div class="pull-left">{{details.cmpCode || '-'}}</div>
  66. </div>
  67. <div class="pull-right lab">
  68. <span>x</span>{{details.number}}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="list-all-info clearfix">
  73. <div>共<span>{{item.batchQty}}</span>件商品&nbsp;&nbsp;合计:
  74. <span class="pri"><a class="red">¥</a>{{item.ensurePrice }}</span>
  75. <span class="lab">(含运费:<a class="red">¥</a><a class="red">{{item.fare | priceFiter}}</a>)</span></div>
  76. </div>
  77. <div class="list-btn clearfix">
  78. <template v-if="vendorType === 'buyer'">
  79. <div class="pull-right sendGoods" v-if="item.status === 404" @click="buyerGetGoods(item)">确认收货</div>
  80. <div class="pull-right sendGoods" v-if="!item.installmentId && (item.status === 503 || item.status === 501)" @click="onMind('跳到上传水印地址')">确认付款</div>
  81. <div class="pull-right" @click="lookOrderDetail(item)">订单详情</div>
  82. <div class="pull-right sendGoods" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="item.installmentId && (item.status === 503 || item.status === 504 || item.status === 524 ) && item.installment.status !== 505 && !item.againUpload">立即付款</div>
  83. <div class="pull-right" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="item.installmentId && (item.status === 503 || item.status === 504 || item.status === 524 ) && item.installment.status !== 505 && item.againUpload">重新上传</div>
  84. <div class="pull-right" @click="cancelOrder(item)" v-if="item.status === 503 || item.status === 501 || item.status === 502">取消订单</div>
  85. <div class="pull-right" @click="deleteOrder(item)" 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="_getHoursFromNow(item.paytime) > sellsendGoodsTime - 1">提醒发货</div>
  88. <div @click="lookLogisticsInfo(item)" class="pull-right" v-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 521">查看物流</div>
  89. </template>
  90. <template v-else>
  91. <div class="pull-right sendGoods" v-if="(item.status === 502 || item.status === 406) && !item.uasPurcid" @click="sendGoods(item)">点击发货</div>
  92. <div @click="changelogistics(item)" class="pull-right sendGoods" v-if="item.status === 404 && !item.uasPurcid">修改物流</div>
  93. <div @click="lookOrderDetail(item)" class="pull-right">订单详情</div>
  94. <div @click="deleteOrder(item)" class="pull-right" v-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">
  95. 删除订单</div>
  96. <div @click="lookLogisticsInfo(item)" class="pull-right" v-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 503 || item.status === 514">查看物流</div>
  97. <div @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" class="pull-right" v-if="item.installmentId && ((item.installment.status === 503 && item.Overtime) || item.installment.status === 504) && item.status !== 606 && item.status !== 525">
  98. 取消订单
  99. </div>
  100. <div @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" class="pull-right" v-if="installmentDetailPaid(item) && item.status !== 525 && item.status !== 606">
  101. 确认收款
  102. </div>
  103. </template>
  104. </div>
  105. </li>
  106. </ul>
  107. <div v-if="getOrderList && false"></div>
  108. <!-- 发货弹窗 -->
  109. <div class="mobile-modal" v-if="showSend">
  110. <div class="sendGoods_Alert">
  111. <div class="sendGoods_title">发货信息<span><i class="iconfont icon-guanbi1" @click="showSend = false"></i></span></div>
  112. <div class="sendGoods_buyer">
  113. <div class="sendGoods_buyer_top">
  114. <span class="name">{{sendGoodsInfo.area.name}}</span>
  115. <span class="tel">{{sendGoodsInfo.area.tel}}</span>
  116. </div>
  117. <div class="sendGoods_buyer_bottom">
  118. <img src="/images/order/address_icon.png"/>
  119. <span>{{sendGoodsInfo.area.area}}{{sendGoodsInfo.area.detailAddress}}</span>
  120. </div>
  121. </div>
  122. <div class="sendGoods_list clearfix">
  123. <div class="ti pull-left">配送方式</div>
  124. <div class="pull-right">
  125. {{sendGoodsInfo.sendType === 1301 ? '第三方配送' : (sendGoodsInfo.sendType === 1302 ? '卖家配送': '上门自提')}}
  126. </div>
  127. </div>
  128. <div class="sendGoods_list clearfix" @click="choosePeisong()">
  129. <div class="ti pull-left">配送商</div>
  130. <div class="pull-right">{{peisongShowName ? peisongShowName : '请选择'}}<img src="/images/mobile/user/icon-right.png"/></div>
  131. </div>
  132. <div class="sendGoods_list clearfix">
  133. <div class="ti pull-left">运单号</div>
  134. <div class="pull-right"><input type="number" placeholder="请输入运单号" v-model="sendGoodsInfo.kuaidinumber"/></div>
  135. </div>
  136. <div class="sendGoods_Btn" @click="saveSendGoods()">
  137. 确定
  138. </div>
  139. </div>
  140. </div>
  141. <!-- /end 发货弹窗 -->
  142. <!-- 选择配送商 -->
  143. <div class="mobile-modal" v-if="peisongShow">
  144. <div class="peisong_Alert">
  145. <div class="com-mobile-header" >
  146. <a @click="peisongShow = false"><i class="iconfont icon-fanhui"></i></a>
  147. <p>选择配送商
  148. </p>
  149. </div>
  150. <div class="search-content">
  151. <input type="text" v-model="seekKeyword" placeholder="请输入您要查找的配送商" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
  152. <span @click="searchSeek" >
  153. <i class="iconfont icon-sousuo"></i>
  154. </span>
  155. </div>
  156. <ul>
  157. <li class="clearfix" v-for="(item, index) in peisongList" @click="selectPeisong(index, item)">
  158. <div class="name pull-left">{{item.companyName}}</div>
  159. <div class="pull-right target" :class="peisongChooseIndex === index ? 'active' : ''"></div>
  160. </li>
  161. </ul>
  162. <div @click="savePeisongChoose()" class="sendGoods_Btn">保存</div>
  163. </div>
  164. </div>
  165. <!-- /end 选择配送商 -->
  166. <!-- 删除订单 -->
  167. <!-- 删除提示框 -->
  168. <div class="deleteKuang" v-if="showDeleteAlert">
  169. <div class="kuangContent">
  170. <div class="title">删除信息</div>
  171. <div class="titleinfo">是否删除此订单</div>
  172. <!--<div class="info" v-show="isUploadpro">*存在已上架信息</div>-->
  173. <div class="K_btn">
  174. <div class="cancelBtn" @click="showDeleteAlert = false">取消</div>
  175. <div class="answerBtn" @click="deleteFn()">确定</div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- /end 删除订单 -->
  180. <!-- 取消订单原因弹窗 -->
  181. <div class="mobile-modal" v-if="showBuyerAlert">
  182. <div class="cancelOrder">
  183. <div class="sendGoods_title">取消订单<span><i class="iconfont icon-guanbi1" @click="showBuyerAlert = false"></i></span></div>
  184. <div class="cancelOrder_title">请选择取消订单的原因(必选):</div>
  185. <ul>
  186. <li v-for="(item, index) in cancelList" class="clearfix" @click="ChooseOrderCancel(item, index)">
  187. <div class="target pull-left" :class="index === OrderCancelIndex ? 'active' : ''"></div>
  188. <div class="name pull-left">{{item}}</div>
  189. </li>
  190. </ul>
  191. <div @click="cancenFn()" class="sendGoods_Btn">确定</div>
  192. </div>
  193. </div>
  194. <!-- /end 取消订单原因弹窗 -->
  195. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  196. <pull-up :fixId="'order-wrapper'"
  197. :searchMore="isSearchSearchingMore"
  198. :allPage="allPage"
  199. :page="page"
  200. @pullUpAction="getMoreSearch"></pull-up>
  201. </div>
  202. </template>
  203. <script>
  204. import { EncryptionFilter } from '~utils/tools.js'
  205. import { RemindBox, PullUp } from '~components/mobile/common'
  206. import axios from '~plugins/axios'
  207. export default {
  208. name: 'order',
  209. layout: 'mobile',
  210. middleware: 'authenticated',
  211. fetch({store, route}) {
  212. return route.query.type === 'buyer' ? Promise.all([
  213. store.dispatch('order/getBuyerOrderList', {
  214. count: 5,
  215. page: 1,
  216. isRate: false,
  217. currentPage: 1,
  218. sorting: { creattime: 'DESC' },
  219. status: '503-504-524-525-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606'}
  220. )
  221. ]) : Promise.all([
  222. store.dispatch('order/getSellOrderList', {
  223. count: 5,
  224. page: 1,
  225. sorting: { createtime: 'DESC' },
  226. status: '',
  227. storeType: 'other'}
  228. )
  229. ])
  230. },
  231. data() {
  232. return {
  233. isSearchSearchingMore: false,
  234. page: 1,
  235. collectResult: '',
  236. timeoutCount: 0,
  237. activeType: '', // 选择类型
  238. orderList: [], // 订单列表
  239. $status: '', // 传参状态
  240. showSend: false, // 是否显示发货弹窗
  241. sendGoodsInfo: { // 发货弹窗对象
  242. area: {}
  243. },
  244. peisongShow: false, // 是否显示配送商选择弹窗
  245. seekKeyword: '',
  246. peisongChooseIndex: '', // 配送商选择下标
  247. peisongList: [], // 配送商数组
  248. peisongShowName: '', // 选择完后的配送
  249. showDeleteAlert: false, // 是否显示删除订单
  250. sellsendGoodsTime: '', // 卖家发货时间
  251. showBuyerAlert: false, // 买家取消订单原因
  252. cancelList: ['我不想买了', '信息填写有误,重新购买', '先看看样品再下单', '付款遇到问题(如余额不足、超出限额等)', '买错了', '其他原因'], // 取消订单原因数组
  253. $CancenOrderId: '', // 取消订单id
  254. $Orderreason: '', // 取消订单原因
  255. OrderCancelIndex: '' // 取消订单原因下标
  256. }
  257. },
  258. computed: {
  259. allPage() {
  260. return this.$store.state.order.order.orderList.data.totalPages
  261. },
  262. vendorType() {
  263. return this.$route.query.type
  264. },
  265. getOrderList() {
  266. this.orderList = this._initSetParams(this.$store.state.order.order.orderList.data.content)
  267. return this.$store.state.order.order.orderList
  268. }
  269. },
  270. async asyncData({route}) {
  271. if (route.query.type === 'buyer') {
  272. let { data } = await axios.get(`/trade/tradebasicproperties/get/1054`)
  273. return {
  274. sellsendGoodsTime: parseInt(data.info)
  275. }
  276. }
  277. },
  278. methods: {
  279. getMoreSearch() {
  280. this.page++
  281. this.isSearchSearchingMore = true
  282. let params = {
  283. count: 5,
  284. page: this.page,
  285. sorting: {createtime: 'DESC'},
  286. status: this.$status,
  287. storeType: 'other',
  288. isRate: false,
  289. currentPage: this.page
  290. }
  291. if (this.vendorType === 'buyer') {
  292. params.sorting = { creattime: 'DESC' }
  293. }
  294. let url = this.vendorType !== 'buyer' ? '/trade/purchase/status/createtime' : '/trade/history/goods/list'
  295. this.$http.get(url, {params}).then(res => {
  296. this.isSearchSearchingMore = false
  297. res.data.content = this._initSetParams(res.data.content)
  298. this.orderList = [...this.orderList, ...res.data.content]
  299. })
  300. },
  301. ChangeList(_tp) {
  302. this.activeType = _tp
  303. this.page = 1
  304. if (this.$route.query.type !== 'buyer') {
  305. // 卖家中心
  306. this.sellOrderList(_tp)
  307. } else {
  308. // 买家中心
  309. this.buyerOrderList(_tp)
  310. }
  311. },
  312. // 买家中心订单列表加载数据
  313. buyerOrderList(_tp) {
  314. let status = '503-504-524-525-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606'
  315. if (_tp === 'tobeconfirmed') {
  316. status = '503-504-524-525'
  317. } else if (_tp === 'comfirmed') {
  318. status = '505-406-407-403-408'
  319. } else if (_tp === 'inbound') {
  320. status = '404'
  321. }
  322. this.$status = status
  323. this.$store.dispatch('order/getBuyerOrderList', {
  324. count: 5,
  325. page: 1,
  326. isRate: false,
  327. currentPage: 1,
  328. sorting: { creattime: 'DESC' },
  329. status: status
  330. })
  331. },
  332. // 卖家中心订单列表加载数据
  333. sellOrderList(_tp) {
  334. let status = ''
  335. if (_tp === 'tobeconfirmed') {
  336. status = '501-504-524-525'
  337. } else if (_tp === 'comfirmed') {
  338. status = '502-406'
  339. } else if (_tp === 'inbound') {
  340. status = '404-511'
  341. }
  342. this.peisongShowName = ''
  343. this.sendGoodsInfo.kuaidinumber = ''
  344. this.$status = status
  345. this.$store.dispatch('order/getSellOrderList', {
  346. count: 5,
  347. page: 1,
  348. sorting: {createtime: 'DESC'},
  349. status: status,
  350. storeType: 'other'
  351. })
  352. },
  353. // 是否为分期付款
  354. installmentDetailPaid(item) {
  355. if (!item.installment) return false
  356. let _flag = false
  357. item.installment.installmentDetails.forEach(list => {
  358. if (list.detno === item.installment.currentNo && list.status === 504) {
  359. _flag = true
  360. }
  361. })
  362. return _flag
  363. },
  364. // 发货
  365. sendGoods(item) {
  366. this._id
  367. this.sendGoodstype = 'add'
  368. if (item.inid) {
  369. this._id = EncryptionFilter(item.inid)
  370. this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
  371. this.sendGoodsInfo = res.data[0]
  372. this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
  373. this.showSend = true
  374. })
  375. } else {
  376. this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
  377. this._id = EncryptionFilter(res.inid)
  378. this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
  379. this.sendGoodsInfo = res.data[0]
  380. this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
  381. this.showSend = true
  382. })
  383. }, err => {
  384. this.onMind('转出货单失败' + err.data)
  385. })
  386. }
  387. },
  388. // 选择配送商
  389. choosePeisong() {
  390. if (this.peisongList.length > 0) {
  391. this.peisongShow = true
  392. return
  393. }
  394. this.$http.get('/trade/distributor/selected').then(res => {
  395. this.peisongList = res.data
  396. this.peisongList.splice(0, 0, {
  397. companyName: '请选择配送商'
  398. })
  399. this.peisongShow = true
  400. })
  401. },
  402. // 配送商列表选择
  403. selectPeisong(index, item) {
  404. this.peisongChooseIndex = index
  405. this.peisongChooseItem = item
  406. },
  407. // 确定选择当前配送商
  408. savePeisongChoose() {
  409. this.peisongShow = false
  410. this.peisongShowName = this.peisongChooseItem.companyName === '请选择配送商' ? '' : this.peisongChooseItem.companyName
  411. },
  412. // 发货最终步骤
  413. saveSendGoods() {
  414. // 发货
  415. if (this.sendGoodstype === 'add') {
  416. let patt = new RegExp('^[A-Za-z0-9]+$')
  417. if (this.peisongShowName === '') {
  418. this.onMind('请选择配送商')
  419. } else if (!this.sendGoodsInfo.kuaidinumber) {
  420. this.onMind('请填写物流单号')
  421. } else if (!patt.test(this.sendGoodsInfo.kuaidinumber)) {
  422. this.onMind('请输入正确的物流单号')
  423. } else {
  424. let sendInfo = this.getLogisticsInfo()
  425. this.$http.post(`/trade/inFpu/save?id=${this.sendGoodsInfo.id}`, sendInfo).then(res => {
  426. if (res.data.success) {
  427. this.onMind('发货成功')
  428. setTimeout(() => {
  429. this.ChangeList(this.activeType)
  430. this.showSend = false
  431. this.peisongChooseIndex = 0
  432. this.peisongChooseItem = {companyName: '请选择配送商'}
  433. }, 1500)
  434. }
  435. })
  436. }
  437. } else if (this.sendGoodstype === 'change') {
  438. // 修改物流
  439. let sendInfo = this.getLogisticsInfo('change')
  440. let patt = new RegExp('^[A-Za-z0-9]+$')
  441. if (!this.sendGoodsInfo.lgtId) {
  442. // 如果快递公司 以及 快递编号为空
  443. if (!this.peisongShowName && !this.sendGoodsInfo.kuaidinumber) {
  444. this.showSend = false
  445. return
  446. }
  447. // 如果快递公司为空
  448. if (!this.peisongShowName && this.sendGoodsInfo.kuaidinumber) {
  449. this.onMind('请选择配送商')
  450. return
  451. } else if (!this.sendGoodsInfo.kuaidinumber) {
  452. this.onMind('请填写物流单号')
  453. return
  454. } else if (!patt.test(this.sendGoodsInfo.kuaidinumber)) {
  455. this.onMind('请输入正确的物流单号')
  456. return
  457. }
  458. // 没有物流信息则添加物流信息
  459. this.$http.post(`/trade/logistics/add?inid=${this.sendGoodsInfo.inid}`, sendInfo).then(res => {
  460. if (res.data.success) {
  461. this.onMind('物流信息保存成功')
  462. setTimeout(() => {
  463. this.ChangeList(this.activeType)
  464. this.peisongChooseIndex = 0
  465. this.peisongChooseItem = {companyName: '请选择配送商'}
  466. this.showSend = false
  467. }, 1500)
  468. }
  469. })
  470. } else {
  471. if (this.ChangeInfoObj.number === this.sendGoodsInfo.kuaidinumber && this.peisongShowName === this.ChangeInfoObj.peisongShowName) {
  472. this.showSend = false
  473. return
  474. }
  475. if (this.peisongShowName !== '' || this.sendGoodsInfo.kuaidinumber !== '') {
  476. // 如果用户未做任何信息修改
  477. if (!this.peisongShowName) {
  478. this.onMind('请选择配送商')
  479. return
  480. } else if (!this.sendGoodsInfo.kuaidinumber) {
  481. this.onMind('请填写物流单号')
  482. return
  483. } else if (!patt.test(this.sendGoodsInfo.kuaidinumber)) {
  484. this.onMind('请输入正确的物流单号')
  485. return
  486. }
  487. this.$http.post(`/trade/logistics/${this.sendGoodsInfo.lgtId}?invoiceFuid=${this.sendGoodsInfo.inid}`, sendInfo).then(res => {
  488. if (res.data.success) {
  489. this.onMind('修改物流信息成功')
  490. setTimeout(() => {
  491. this.ChangeList(this.activeType)
  492. this.peisongChooseIndex = 0
  493. this.peisongChooseItem = {companyName: '请选择配送商'}
  494. this.showSend = false
  495. }, 1500)
  496. }
  497. })
  498. } else {
  499. if (this.sendGoodsInfo.sendType !== 1301) {
  500. // 如果清空了物流信息
  501. this.$http.put(`/trade/logistics/clear?inid=${this.sendGoodsInfo.inid}`).then(res => {
  502. if (res.data.success) {
  503. this.onMind('修改物流信息成功')
  504. setTimeout(() => {
  505. this.ChangeList(this.activeType)
  506. this.peisongChooseIndex = 0
  507. this.peisongChooseItem = {companyName: '请选择配送商'}
  508. this.showSend = false
  509. }, 1500)
  510. }
  511. })
  512. }
  513. }
  514. }
  515. }
  516. },
  517. // 买家取消订单
  518. cancelOrder(item) {
  519. this.$CancenOrderId = item.orderid
  520. this.showBuyerAlert = true
  521. },
  522. // 买家取消订单原因选择
  523. ChooseOrderCancel(item, index) {
  524. this.OrderCancelIndex = index
  525. this.$Orderreason = item
  526. },
  527. // 取消订单确认事件
  528. cancenFn() {
  529. if (!this.$Orderreason || this.$Orderreason === '') {
  530. this.onMind('请选择取消订单的原因')
  531. } else {
  532. let reason = {
  533. reason: this.$Orderreason
  534. }
  535. this.$http.put(`/trade/order/simpleinfo/ones/${this.$CancenOrderId}/release`, reason).then(res => {
  536. this.onMind('取消订单成功,等待买家确认')
  537. this.$Orderreason = ''
  538. this.ChangeList(this.activeType)
  539. this.showBuyerAlert = false
  540. })
  541. }
  542. },
  543. // 删除订单弹窗
  544. deleteOrder(item) {
  545. this.sendGoodsInfo = this.baseUtils.deepCopy(item)
  546. this.showDeleteAlert = true
  547. },
  548. // 删除订单确定按钮
  549. deleteFn() {
  550. if (this.$route.query.type !== 'buyer') {
  551. this.$http.post(`/trade/purchase/used/${this.sendGoodsInfo.purchaseid}`).then(res => {
  552. this.ChangeList(this.activeType)
  553. this.showDeleteAlert = false
  554. this.onMind('删除成功')
  555. })
  556. } else {
  557. this.$http.post(`/trade/order/used/${this.sendGoodsInfo.orderid}`).then(res => {
  558. this.ChangeList(this.activeType)
  559. this.showDeleteAlert = false
  560. this.onMind('删除成功')
  561. })
  562. }
  563. },
  564. // 修改物流
  565. changelogistics(item) {
  566. this.sendGoodstype = 'change'
  567. this.peisongShowName = ''
  568. this.sendGoodsInfo.kuaidinumber = ''
  569. let _obj = this.baseUtils.deepCopy(item)
  570. if (!item.lgtId) {
  571. // 如果没有订单编号
  572. this.sendGoodsInfo = _obj
  573. this.sendGoodsInfo.area = JSON.parse(_obj.jsonSdAddress)
  574. this.showSend = true
  575. this.ChangeInfoObj = {
  576. number: '',
  577. peisongShowName: ''
  578. }
  579. } else {
  580. this.$http.get(`/trade/logistics/${_obj.lgtId}`).then(res => {
  581. this.sendGoodsInfo = _obj
  582. this.sendGoodsInfo.area = JSON.parse(_obj.jsonSdAddress)
  583. this.sendGoodsInfo.kuaidinumber = res.data.number
  584. this.peisongShowName = res.data.companyName
  585. this.ChangeInfoObj = {
  586. number: res.data.number,
  587. peisongShowName: res.data.companyName
  588. }
  589. this.showSend = true
  590. })
  591. }
  592. },
  593. // 搜索
  594. searchSeek() {
  595. this.seekKeyword
  596. },
  597. // 获取物流提交信息
  598. getLogisticsInfo(_type) {
  599. let sendInfo = {}
  600. sendInfo.sendType = this.sendGoodsInfo.sendType
  601. sendInfo.jsonSdAddress = this.sendGoodsInfo.jsonSpAddress
  602. sendInfo.logisticsInfo = {}
  603. if (this.peisongShowName) {
  604. sendInfo.logisticsInfo.companyName = this.peisongShowName
  605. }
  606. if (this.sendGoodsInfo.kuaidinumber) {
  607. sendInfo.logisticsInfo.number = this.sendGoodsInfo.kuaidinumber
  608. }
  609. return _type ? sendInfo.logisticsInfo : sendInfo
  610. },
  611. // 查看物流信息
  612. lookLogisticsInfo(item) {
  613. this.$router.push(`/mobile/order/logistics?uuid=${EncryptionFilter(item.purchaseid)}`)
  614. },
  615. // 查看订单详情
  616. lookOrderDetail(item) {},
  617. // 买家确认收货
  618. buyerGetGoods(item) {
  619. this.$http.put(`/trade/order/simpleinfo/ones/${item.id}?_status=ensureaccept`).then(res => {
  620. this.onMind('确认收货成功')
  621. this.ChangeList(this.activeType)
  622. })
  623. },
  624. // 买卖家中心字段同步化
  625. _initSetParams(_obj) {
  626. _obj = this.baseUtils.deepCopy(_obj)
  627. for (let i = 0; i < _obj.length; i++) {
  628. if (!_obj[i].purchaseDetails) {
  629. _obj[i].purchaseDetails = _obj[i].orderDetails
  630. }
  631. }
  632. return _obj
  633. },
  634. // 传入时间,计算距离现在的时间是多少小时了
  635. _getHoursFromNow(time) {
  636. if (!time) {
  637. return 0
  638. }
  639. let newTime = new Date()
  640. let msec = newTime.getTime() - time
  641. let hours = parseInt(parseInt(msec) / (1000 * 60 * 60))
  642. return hours
  643. },
  644. onMind(str) {
  645. this.collectResult = str
  646. this.timeoutCount++
  647. },
  648. blur: function() {
  649. setTimeout(() => {
  650. this.$store.dispatch('mobile/SetInputGetFocus', false)
  651. }, 300)
  652. },
  653. inputGetFocus: function() {
  654. setTimeout(() => {
  655. this.$store.dispatch('mobile/SetInputGetFocus', true)
  656. }, 300)
  657. }
  658. },
  659. filters: {
  660. priceFiter(val) {
  661. if (!val) return '0.00'
  662. return val.toFixed(2)
  663. }
  664. },
  665. components: {
  666. RemindBox,
  667. PullUp
  668. }
  669. }
  670. </script>
  671. <style scoped lang="scss">
  672. @mixin overFlowHidden {
  673. overflow: hidden;
  674. text-overflow: ellipsis;
  675. white-space: nowrap;
  676. }
  677. @mixin lineHeight($value) {
  678. height: $value;
  679. line-height: $value;
  680. }
  681. .order-wrapper {
  682. background: #f1f3f6;
  683. margin: 0.88rem 0 0.98rem 0;
  684. height: calc(100vh - 0.88rem - 0.98rem);
  685. overflow-y: scroll;
  686. padding-bottom: 0.2rem;
  687. .order-nav {
  688. background: #fff;
  689. div {
  690. height: 0.82rem;
  691. line-height: 0.82rem;
  692. display: inline-block;
  693. width: 25%;
  694. text-align: center;
  695. font-size: .28rem;
  696. color: #666;
  697. &.active span{
  698. color: #3f84f6;
  699. border-bottom: 0.03rem solid #3f84f6;
  700. padding-bottom: 0.2rem;
  701. }
  702. }
  703. }
  704. .order-list-wrap {
  705. li {
  706. margin-top: 0.2rem;
  707. }
  708. .list-wrap-title{
  709. padding: 0 0.2rem;
  710. background: #fff;
  711. @include lineHeight(0.88rem);
  712. font-size: 0.28rem;
  713. color: #333;
  714. .pull-left {
  715. width: 5rem;
  716. @include overFlowHidden()
  717. }
  718. .pull-right {
  719. .red {
  720. color: #f21c1c;
  721. }
  722. }
  723. }
  724. .list-wrap-content {
  725. background: #f9f9f8;
  726. padding: 0.3rem 0.2rem;
  727. border-bottom: 1px solid #e4e4e4;
  728. .list-item {
  729. font-size: 0.28rem;
  730. color: #333;
  731. line-height: 0.6rem;
  732. .list-wrap-content-brand {
  733. width: 4.8rem;
  734. @include overFlowHidden();
  735. }
  736. .name {
  737. color: #666;
  738. }
  739. .lab {
  740. color: #999;
  741. font-size: 0.24rem;
  742. span {
  743. font-size: 0.16rem;
  744. }
  745. }
  746. .pri {
  747. font-size: 0.32rem;
  748. color: #f43938;
  749. span {
  750. font-size: 0.24rem;
  751. }
  752. }
  753. }
  754. }
  755. .list-all-info{
  756. text-align: right;
  757. background: #fff;
  758. padding: 0 0.2rem;
  759. @include overFlowHidden();
  760. @include lineHeight(0.66rem);
  761. font-size: 0.26rem;
  762. color: #333;
  763. border-bottom: 1px solid #e4e4e4;
  764. .pri {
  765. font-size: 0.32rem;
  766. color: #f43938;
  767. }
  768. .red {
  769. color: #f43938;
  770. font-size: 0.24rem;
  771. }
  772. .lab {
  773. color: #999;
  774. font-size: 0.24rem;
  775. }
  776. }
  777. .list-btn {
  778. background: #fff;
  779. @include lineHeight(0.8rem);
  780. padding: 0 0.2rem;
  781. div {
  782. display: inline-block;
  783. width: 1.5rem;
  784. @include lineHeight(0.56rem);
  785. border: 0.01rem solid #333;
  786. font-size: 0.26rem;
  787. color: #333;
  788. text-align: center;
  789. margin-top: 0.11rem;
  790. margin-left: 0.2rem;
  791. border-radius: 3px;
  792. &.sendGoods {
  793. color: #f43938;
  794. border: 0.01rem solid #f43938;
  795. }
  796. }
  797. }
  798. }
  799. .sendGoods_Alert {
  800. background: #fff;
  801. position: absolute;
  802. bottom: 0;
  803. left: 0;
  804. width: 100%;
  805. border-top-left-radius: 5px;
  806. border-top-right-radius: 5px;
  807. overflow: hidden;
  808. .sendGoods_title {
  809. color: #333;
  810. font-size: 0.42rem;
  811. text-align: center;
  812. line-height: 1rem;
  813. font-weight: 600;
  814. position: relative;
  815. i {
  816. position: absolute;
  817. font-size: 16px;
  818. right: 0.2rem;
  819. }
  820. }
  821. .sendGoods_buyer {
  822. padding: 0.3rem 0.2rem;
  823. border-bottom: 1px solid #d9d9d9;
  824. border-top: 1px solid #d9d9d9;
  825. .sendGoods_buyer_top {
  826. color: #333;
  827. font-size: 0.3rem;
  828. font-weight: bold;
  829. .name {
  830. margin-right: 0.3rem;
  831. margin-left: 0.32rem;
  832. }
  833. }
  834. .sendGoods_buyer_bottom {
  835. color: #333;
  836. font-size: 0.26rem;
  837. margin-top: 0.2rem;
  838. img {
  839. width: 0.22rem;
  840. height: 0.29rem;
  841. margin-right: 0.1rem;
  842. margin-top: -0.1rem;
  843. }
  844. }
  845. }
  846. .sendGoods_list {
  847. padding: 0 0.2rem;
  848. @include lineHeight(0.8rem);
  849. border-bottom: 1px solid #d9d9d9;
  850. font-size: 0.32rem;
  851. color: #333;
  852. .ti {
  853. font-weight: bold;
  854. }
  855. .pull-right {
  856. font-size: 0.28rem;
  857. color: #999;
  858. img {
  859. width: 0.14rem;
  860. height: 0.24rem;
  861. vertical-align: middle;
  862. margin-top: -0.02rem;
  863. margin-left: 0.1rem;
  864. }
  865. }
  866. input {
  867. width: 4rem;
  868. text-align: right;
  869. color: #333;
  870. }
  871. }
  872. .sendGoods_Btn {
  873. @include lineHeight(1rem);
  874. text-align: center;
  875. color: #fff;
  876. font-size: 0.36rem;
  877. background: #3f84f6;
  878. }
  879. }
  880. .search-content {
  881. margin-top: 0.88rem;
  882. margin-bottom: 0.2rem;
  883. text-align: center;
  884. padding: .25rem 0 0 0;
  885. input {
  886. border: 1px solid #376ff3;
  887. }
  888. span {
  889. height: .46rem;
  890. line-height: .46rem;
  891. }
  892. }
  893. .peisong_Alert {
  894. background: #f1f3f6;
  895. position: fixed;
  896. bottom: 0;
  897. left: 0;
  898. right: 0;
  899. top: 0;
  900. z-index: 11111;
  901. ul {
  902. height: calc(100vh - 1.2rem - 1.7rem);
  903. overflow-y: scroll;
  904. li {
  905. line-height: 1rem;
  906. background: #fff;
  907. padding: 0 0.2rem;
  908. font-size: 0.28rem;
  909. color: #333;
  910. border-bottom: 1px solid #e0e1e2;
  911. div.name {
  912. @include overFlowHidden();
  913. }
  914. div.target {
  915. width: 0.36rem;
  916. height: 0.36rem;
  917. border-radius: 50%;
  918. overflow: hidden;
  919. border: 1px solid #a4a4a4;
  920. margin-top: 0.3rem;
  921. &.active {
  922. background-image: url('/images/order/getChoose_icon.png');
  923. background-size: 100% 100%;
  924. border: 0px;
  925. }
  926. }
  927. }
  928. }
  929. .sendGoods_Btn {
  930. @include lineHeight(1rem);
  931. text-align: center;
  932. color: #fff;
  933. font-size: 0.36rem;
  934. background: #3f84f6;
  935. }
  936. }
  937. .deleteKuang {
  938. position: fixed;
  939. background: rgba(0,0,0,0.5);
  940. top: 0;
  941. left: 0;
  942. right: 0;
  943. bottom: 0;
  944. z-index: 9999;
  945. .kuangContent {
  946. border-radius: 5px;
  947. background: #fff;
  948. width: 5rem;
  949. position: absolute;
  950. left: 50%;
  951. top: 50%;
  952. transform: translate3d(-50%, -50%, 0);
  953. overflow: hidden;
  954. .titleinfo {
  955. font-size: .3rem;
  956. color: #666;
  957. text-align: center;
  958. margin-top: 0.5rem;
  959. margin-bottom: 0.1rem;
  960. }
  961. .title {
  962. background: #5078cb;
  963. height: .7rem;
  964. line-height: .7rem;
  965. font-size: .3rem;
  966. color: #fff;
  967. text-align: center;
  968. }
  969. .info {
  970. color: #f00;
  971. text-align: center;
  972. }
  973. .K_btn {
  974. margin-top: 0.4rem;
  975. line-height: 0.7rem;
  976. height: 0.7rem;
  977. &::after{
  978. clear: both;
  979. display: block;
  980. content: ' ';
  981. visibility: hidden;
  982. zoom: 1;
  983. }
  984. div {
  985. float: left;
  986. width: 50%;
  987. font-size: 0.3rem;
  988. text-align: center;
  989. &.cancelBtn {
  990. background: #b4b5b9;
  991. color: #333;
  992. }
  993. &.answerBtn {
  994. background: #5078cb;
  995. color: #fff;
  996. }
  997. }
  998. }
  999. }
  1000. i {
  1001. font-size: .6rem;
  1002. position: absolute;
  1003. right: -0.3rem;
  1004. top: -0.35rem;
  1005. color: #fff;
  1006. &::after{
  1007. position: absolute;
  1008. top: -0.1rem;
  1009. left: -0.1rem;
  1010. right: -0.1rem;
  1011. bottom: -0.1rem;
  1012. content: ' '
  1013. }
  1014. }
  1015. .title {
  1016. background: #3f84f6;
  1017. height: 0.7rem;
  1018. line-height: 0.7rem;
  1019. color: #fff;
  1020. text-align: center;
  1021. font-size: 0.3rem;
  1022. position: relative;
  1023. }
  1024. .Kuang {
  1025. max-height: 10rem;
  1026. width: 6.7rem;
  1027. position: absolute;
  1028. left: 50%;
  1029. top: 50%;
  1030. transform: translate3d(-50%, -50%, 0);
  1031. background: #ececec;
  1032. border-radius: 5px;
  1033. }
  1034. .content {
  1035. overflow-y: scroll;
  1036. max-height: 9.3rem;
  1037. .infob {
  1038. background: #e3edfd;
  1039. padding: 0.2rem;
  1040. .info {
  1041. color: #333;
  1042. font-size: 0.3rem;
  1043. overflow: hidden;
  1044. text-overflow: ellipsis;
  1045. white-space: nowrap;
  1046. margin-bottom: 0.18rem;
  1047. .name {
  1048. color: #666;
  1049. }
  1050. div {
  1051. display: inline-block;
  1052. }
  1053. }
  1054. }
  1055. .content_sq {
  1056. width: 6.4rem;
  1057. margin: 0.1rem auto;
  1058. background: #fff;
  1059. padding: 0.2rem 0rem;
  1060. .list {
  1061. margin-bottom: 0.18rem;
  1062. }
  1063. .fl {
  1064. width: 3.2rem;
  1065. }
  1066. .table {
  1067. width: 4.2rem;
  1068. margin-top: -0.1rem;
  1069. }
  1070. .labelinfo {
  1071. background-image: url('/images/mobile/@2x/labelTop.png');
  1072. background-repeat: no-repeat;
  1073. width: 6.29rem;
  1074. height: 0.64rem;
  1075. line-height: 0.64rem;
  1076. background-size: 100%;
  1077. margin-top: 0rem;
  1078. margin-right: 0rem;
  1079. background-color: rgba(0, 0, 0, 0);
  1080. color: #666;
  1081. }
  1082. }
  1083. }
  1084. }
  1085. .cancelOrder {
  1086. background: #fff;
  1087. position: absolute;
  1088. bottom: 0;
  1089. left: 0;
  1090. width: 100%;
  1091. border-top-left-radius: 5px;
  1092. border-top-right-radius: 5px;
  1093. overflow: hidden;
  1094. .sendGoods_title {
  1095. color: #333;
  1096. font-size: 0.42rem;
  1097. text-align: center;
  1098. line-height: 1rem;
  1099. font-weight: 600;
  1100. position: relative;
  1101. i {
  1102. position: absolute;
  1103. font-size: 16px;
  1104. right: 0.2rem;
  1105. }
  1106. }
  1107. .cancelOrder_title {
  1108. font-size: 0.36rem;
  1109. color: #333;
  1110. border-bottom: 1px solid #d9d9d9;
  1111. font-weight: bold;
  1112. padding: 0 0.2rem;
  1113. line-height: 0.6rem;
  1114. }
  1115. ul {
  1116. li {
  1117. line-height: 1rem;
  1118. background: #fff;
  1119. padding: 0 0.2rem;
  1120. font-size: 0.32rem;
  1121. color: #333;
  1122. border-bottom: 1px solid #d9d9d9;
  1123. div.name {
  1124. @include overFlowHidden();
  1125. }
  1126. div.target {
  1127. margin-right: 0.2rem;
  1128. width: 0.36rem;
  1129. height: 0.36rem;
  1130. border-radius: 50%;
  1131. overflow: hidden;
  1132. border: 1px solid #a4a4a4;
  1133. margin-top: 0.3rem;
  1134. &.active {
  1135. background-image: url('/images/order/getChoose_icon.png');
  1136. background-size: 100% 100%;
  1137. border: 0px;
  1138. }
  1139. }
  1140. }
  1141. }
  1142. .sendGoods_Btn {
  1143. @include lineHeight(1rem);
  1144. text-align: center;
  1145. color: #fff;
  1146. font-size: 0.36rem;
  1147. background: #3f84f6;
  1148. }
  1149. }
  1150. }
  1151. </style>