index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <template>
  2. <view class="pos-order-list" ref="container">
  3. <!-- #ifdef MP || APP-PLUS -->
  4. <NavBar titleText="订单管理" bagColor="#f5f5f5" :iconColor="iconColor" :textColor="iconColor"
  5. :isScrolling="isScrolling" showBack></NavBar>
  6. <!-- #endif -->
  7. <view class="searchCon acea-row">
  8. <view class="search acea-row row-middle">
  9. <text class="iconfont icon-ic_search"></text>
  10. <input class="inputs" placeholder='请输入订单号' placeholder-style="font-size:28rpx" placeholder-class='placeholder' confirm-type='search'
  11. name="search" v-model="searchListData.orderNo" @confirm="searchSubmit"></input>
  12. </view>
  13. <view class="btn" @click="filterShow = true">
  14. <text class="iconfont icon-a-icon_filter1x"></text>
  15. </view>
  16. </view>
  17. <view :style="{ height: navHeight + 'px' }" v-if="isFixed"></view>
  18. <!-- #ifdef MP -->
  19. <view class="nav acea-row row-around row-middle" :style="{
  20. top:getHeight.barTop+getHeight.barHeight+'px'
  21. }" id="nav">
  22. <!-- #endif -->
  23. <!-- #ifndef MP -->
  24. <view class="nav acea-row row-around row-middle" id="nav">
  25. <!-- #endif -->
  26. <scroll-view scroll-x="true" class="scroll_view">
  27. <view class="item" :class="state == 'all' ? 'on' : ''" @click="changeStatus('all')">
  28. 全部({{headerArr['all']!=undefined?headerArr['all']:0}})
  29. <image src="../static/adorn.png" v-if="state == 'all'"></image>
  30. </view>
  31. <view class="item" :class="state == 'notShipped' ? 'on' : ''" @click="changeStatus('notShipped')">
  32. 待接单({{headerArr['notShipped']!=undefined?headerArr['notShipped']:0}})
  33. <image src="../static/adorn.png" v-if="state == 'notShipped'"></image>
  34. </view>
  35. <view class="item" :class="state == 'spike' ? 'on' : ''" @click="changeStatus('spike')">
  36. 待取货({{headerArr['spike']!=undefined?headerArr['spike']:0}})
  37. <image src="../static/adorn.png" v-if="state == 'spike'"></image>
  38. </view>
  39. <view class="item" :class="state == 'awaitVerification' ? 'on' : ''"
  40. @click="changeStatus('awaitVerification')">
  41. 配送中({{headerArr['verification']!=undefined?headerArr['verification']:0}})
  42. <image src="../static/adorn.png" v-if="state == 'awaitVerification'"></image>
  43. </view>
  44. <view class="item" :class="state == 'receiving' ? 'on' : ''" @click="changeStatus('receiving')">
  45. 已完成({{headerArr['receiving']!=undefined?headerArr['receiving']:0}})
  46. <image src="../static/adorn.png" v-if="state == 'receiving'"></image>
  47. </view>
  48. <!--view class="item" :class="state == 'complete' ? 'on' : ''" @click="changeStatus('complete')">
  49. 已完成({{headerArr['complete']!=undefined?headerArr['complete']:0}})
  50. <image src="../static/adorn.png" v-if="state == 'complete'"></image>
  51. </view>
  52. <view class="item" :class="state == 'refunded' ? 'on' : ''" @click="changeStatus('refunded')">
  53. 已退款({{headerArr['refunded']!=undefined?headerArr['refunded']:0}})
  54. <image src="../static/adorn.png" v-if="state == 'refunded'"></image>
  55. </view>
  56. <view class="item" :class="state == 'deleted' ? 'on' : ''" @click="changeStatus('deleted')">
  57. 已删除({{headerArr['deleted']!=undefined?headerArr['deleted']:0}})
  58. <image src="../static/adorn.png" v-if="state == 'deleted'"></image>
  59. </view-->
  60. </scroll-view>
  61. </view>
  62. <view class="list" v-if="list.length">
  63. <view class="item" v-for="(item, index) in list" :key="index">
  64. <view class="order-num acea-row row-between-wrapper" @click="toDetail(item)">
  65. <view>
  66. <view class="title">
  67. <view class="type">{{orderType[item.type]}}</view>{{item.orderNo}}
  68. </view>
  69. </view>
  70. <view class="state">
  71. {{orderStatus[item.status]}}
  72. </view>
  73. </view>
  74. <view class="pos-order-goods">
  75. <view class="goods acea-row" @click="toDetail(item)">
  76. <!-- <scroll-view class="picTxt scroll-view" scroll-x="true"
  77. v-if="item.infoResponseList.length > 1">
  78. <view class="pictrue" v-for="(val, key) in item.infoResponseList" :key="key">
  79. <image :src="val.image" />
  80. </view>
  81. </scroll-view> -->
  82. <view class="picTxt">
  83. <view class="acea-row" v-for="(val, key) in item.infoResponseList" :key="key">
  84. <view class="order-content">
  85. <view class="bold-size flex-y-center" style="padding: 10rpx 0;">
  86. <view class="icon-info"></view>
  87. <text>配送详情</text>
  88. </view>
  89. <view style="padding-bottom: 10rpx;position: relative;" id="myLineRef">
  90. <view class="line"></view>
  91. <view class="box-item">
  92. <view class="bold-size">
  93. <text class="order-icon">取</text>大粽子杂货店
  94. </view>
  95. </view>
  96. <text class="onBold-size"><text class="order-icon" style="opacity: 0">取</text>长沙岳麓区西中心</text>
  97. </view>
  98. <view>
  99. <view class="box-item">
  100. <view class="bold-size">
  101. <text class="order-icon">送</text>张先生
  102. </view>
  103. </view>
  104. <text class="onBold-size"><text class="order-icon" style="opacity: 0">送</text>枫林三路喜地大厦</text>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="money">
  110. 配送费 <baseMoney :money="item.payPrice" symbolSize="20" integerSize="32" decimalSize="20">
  111. </baseMoney>
  112. <!-- <view class="num">共{{ item.totalNum }}件</view> -->
  113. <view class="num">距离{{ item.totalNum }}km</view>
  114. <view class="map" @click="goMap(item)">
  115. <text class="iconfont icon-chakanditu"></text>
  116. <view class="map_text">查看地图</view>
  117. </view>
  118. <!-- <view class="num">距离4.5km</view> -->
  119. </view>
  120. </view>
  121. </view>
  122. <view class="operation acea-row row-between-wrapper">
  123. <view class="more">
  124. </view>
  125. <view class="acea-row row-middle">
  126. <view class="bnt on acea-row row-center-wrapper">联系客户</view>
  127. <view class="bnt primary"
  128. @click="goDelivery(item)">接单
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <emptyPage v-else title="暂无订单~" :imgSrc="urlDomain+'crmebimage/presets/noShopper.png'"></emptyPage>
  135. <Loading :loaded="loaded" :loading="loading"></Loading>
  136. <PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund"
  137. v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)"
  138. v-on:savePrice="savePrice" :status="status"></PriceChange>
  139. <view class="mask" v-if="filterShow" @click="filterShow=!filterShow"></view>
  140. <!-- #ifdef H5 -->
  141. <view class="filter-popup" :class="{ on: filterShow }">
  142. <!-- #endif -->
  143. <!-- #ifndef H5 -->
  144. <view class="filter-popup" :class="{ on: filterShow }" :style="{
  145. top:getHeight.barTop+getHeight.barHeight+'px'}">
  146. <!-- #endif -->
  147. <view class="search-box">
  148. <view class="search acea-row row-middle">
  149. <text class="iconfont icon-ic_search"></text>
  150. <input class="input" placeholder='请输入要查询的订单' placeholder-style="font-size:28rpx" placeholder-class='placeholder'
  151. confirm-type='search' name="search" v-model="searchListData.orderNo"
  152. @confirm="searchSubmit"></input>
  153. </view>
  154. </view>
  155. <view class="content">
  156. <view class="item">
  157. <view class="title">按下单时间</view>
  158. <view class="acea-row list">
  159. <view class="cell" v-for="(item, index) in dateList" :key="index"
  160. :class="{ on: item.val == dateSelected }" @click="dateChange(item.val)">{{ item.label }}
  161. </view>
  162. </view>
  163. </view>
  164. <view class="item">
  165. <view class="title">按订单类型</view>
  166. <view class="acea-row list">
  167. <view class="cell" v-for="(item, index) in payList" :key="index"
  168. :class="{ on: item.val === searchListData.type }" @click="payChange(item.val)">
  169. {{ item.label }}
  170. </view>
  171. </view>
  172. </view>
  173. <view class="bottom">
  174. <view class="no_view" @click="resetBtn">重置</view>
  175. <view class="yes_view" @click="submitBtn">确定</view>
  176. </view>
  177. </view>
  178. </view>
  179. <view v-if="confirmShow" class="mask"></view>
  180. <view v-if="confirmShow" class="confirm-popup">
  181. <view class="title">确认付款</view>
  182. <view class="info">确认该订单用户已付款</view>
  183. <view class="acea-row btn-box">
  184. <view class="btn" @click="confirmShow = false">取消</view>
  185. <view class="btn primary" @click="offlinePay">确认</view>
  186. </view>
  187. </view>
  188. <view class="footerH"></view>
  189. <footerPage></footerPage>
  190. </view>
  191. </template>
  192. <script>
  193. // import UniDatetime from '../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
  194. import Loading from '../components/Loading/index'
  195. import PriceChange from '../components/PriceChange/index.vue'
  196. import footerPage from '../components/footerPage/index.vue'
  197. import countDown from '@/components/countDown/index.vue'
  198. import emptyPage from '@/components/emptyPage.vue'
  199. import baseMoney from '../components/BaseMoney.vue'
  200. // #ifdef MP || APP-PLUS
  201. import NavBar from '../components/NavBar.vue';
  202. // #endif
  203. import {
  204. isMoney
  205. } from '@/utils/validate.js';
  206. import {
  207. HTTP_REQUEST_URL
  208. } from '@/config/app';
  209. import {
  210. employeeOrderList,
  211. employeeOrderMark,
  212. orderStatusNum,
  213. employeeOrderInfo,
  214. orderGetVerfication
  215. } from '@/api/work.js';
  216. export default {
  217. name: "AdminOrderList",
  218. components: {
  219. Loading,
  220. PriceChange,
  221. footerPage,
  222. countDown,
  223. emptyPage,
  224. baseMoney,
  225. // #ifdef MP || APP-PLUS
  226. NavBar,
  227. // #endif
  228. },
  229. data() {
  230. return {
  231. urlDomain: this.$Cache.get("imgHost"),
  232. datetimerange: [],
  233. orderType: ['普通','秒杀','拼团'],
  234. orderStatus: ['待支付', '待发货', '部分发货', '待核销', '待收货', '已收货', '已完成', '已取消'],
  235. getHeight: this.$util.getWXStatusHeight(),
  236. iconColor: '#333333',
  237. isScrolling: false,
  238. top: 0,
  239. navHeight: 0,
  240. isFixed: false,
  241. filterShow: false,
  242. current: "",
  243. change: false,
  244. types: 0,
  245. list: [],
  246. loaded: false,
  247. loading: false,
  248. orderInfo: {},
  249. status: "",
  250. state: 'all',
  251. isRefund: 0, //1是仅退款;0是退货退款
  252. imgHost: HTTP_REQUEST_URL,
  253. dateSelected: '1',
  254. dateList: [{
  255. label: '全部',
  256. val: '1',
  257. },
  258. {
  259. label: '近1个月',
  260. val: '2',
  261. },
  262. {
  263. label: '近3个月',
  264. val: '3',
  265. },
  266. {
  267. label: '近6个月',
  268. val: '4',
  269. },
  270. ],
  271. payList: [
  272. {
  273. label: '全部订单',
  274. val: '',
  275. },
  276. {
  277. label: '普通订单',
  278. val: 0,
  279. },
  280. {
  281. label: '秒杀订单',
  282. val: 1,
  283. },
  284. {
  285. label: '拼团订单',
  286. val: 2,
  287. }
  288. ],
  289. confirmOrder: {},
  290. confirmShow: false,
  291. searchListData: {
  292. dateLimit: '',
  293. limit: 10,
  294. merId: '',
  295. orderNo: '',
  296. page: 1,
  297. status: 'all',
  298. type: '',
  299. },
  300. headerArr: {},
  301. totalPage: '',
  302. };
  303. },
  304. onLoad(options) {
  305. this.state = options.type ? options.type : 'all';
  306. this.searchListData.status = options.type ? options.type : 'all';
  307. },
  308. // created() {
  309. // this.getInitList()
  310. // this.statusHeader()
  311. // },
  312. onShow() {
  313. this.searchListData.page=1
  314. this.getInitList()
  315. this.statusHeader()
  316. },
  317. methods: {
  318. //订单表头数量
  319. statusHeader() {
  320. orderStatusNum(this.searchListData).then(res => {
  321. this.headerArr = res.data
  322. })
  323. },
  324. // 订单搜索
  325. searchSubmit() {
  326. this.searchListData.page=1
  327. this.getInitList()
  328. this.statusHeader()
  329. },
  330. //订单列表
  331. getInitList(type) {
  332. employeeOrderList(this.searchListData).then(res => {
  333. //下拉触底
  334. if (type == 'bottom') {
  335. this.list = this.list.concat(res.data.list)
  336. } else {
  337. this.list = res.data.list
  338. }
  339. this.totalPage = res.data.totalPage
  340. }).catch(err=>{
  341. this.$util.Tips({
  342. title: err
  343. })
  344. })
  345. },
  346. toDetail(item) {
  347. if(item.groupBuyRecordStatus===0){
  348. return this.$util.Tips({
  349. title: '拼团中无法查看详情'
  350. })
  351. }else{
  352. uni.navigateTo({
  353. url: `/pages/admin/order/detail?orderNo=${item.orderNo}`
  354. })
  355. }
  356. },
  357. //发送货
  358. goDelivery(item) {
  359. if (item.refundStatus == 1) return this.$util.Tips({
  360. title: '请处理售后,再操作',
  361. });
  362. uni.navigateTo({
  363. url: `/pages/admin/order/send?orderNo=${item.orderNo}`
  364. })
  365. },
  366. // 商品操作
  367. modify: function(item, status, type) {
  368. this.change = true;
  369. this.status = status.toString();
  370. this.orderInfo = item;
  371. if (status == 2) {
  372. this.isRefund = type
  373. }
  374. },
  375. //核销
  376. verify(item) {
  377. employeeOrderInfo(item.orderNo).then(res => {
  378. let verifyCode=res.data.verifyCode
  379. orderGetVerfication({
  380. verifyCode: res.data.verifyCode
  381. }).then(res => {
  382. if (res.code == 200) {
  383. uni.navigateTo({
  384. url: `/pages/admin/cancel/list?info=${JSON.stringify(res.data)}&verifyCode=${verifyCode}`
  385. })
  386. } else {
  387. self.$util.Tips({
  388. title: res.message
  389. });
  390. }
  391. })
  392. })
  393. },
  394. changeclose: function(msg) {
  395. this.change = msg;
  396. },
  397. async savePrice(opt) {
  398. if (!opt.remark) {
  399. return this.$util.Tips({
  400. title: '请输入备注'
  401. })
  402. } else {
  403. this.toMark(this.orderInfo.orderNo, opt.remark)
  404. }
  405. },
  406. //备注
  407. toMark(orderNo, remark) {
  408. employeeOrderMark({
  409. orderNo,
  410. remark
  411. }).then(res => {
  412. res.code == 200 && (this.change = false);
  413. return this.$util.Tips({
  414. title: '备注成功'
  415. })
  416. })
  417. },
  418. // 导航切换
  419. changeStatus(val) {
  420. if (this.state != val) {
  421. this.state = val;
  422. // this.where.status = val == -1 ? '' : val;
  423. this.searchListData.status = val
  424. this.searchListData.page = 1
  425. this.searchListData={...this.searchListData}
  426. this.getInitList()
  427. }
  428. },
  429. dateChange(value) {
  430. if (value == 1) {
  431. this.searchListData.dateLimit = ''
  432. this.dateSelected = value;
  433. return
  434. } else if (value == 2) {
  435. this.searchListData.dateLimit = 'lately30'
  436. } else if (value == 3) {
  437. this.searchListData.dateLimit = 'lately90'
  438. } else if (value == 4) {
  439. this.searchListData.dateLimit = 'lately180'
  440. }
  441. this.dateSelected = value;
  442. },
  443. payChange(val) {
  444. this.searchListData.type = val;
  445. },
  446. // 点击确认按钮
  447. submitBtn() {
  448. this.filterShow = false;
  449. this.searchListData.page=1
  450. this.getInitList()
  451. this.statusHeader()
  452. },
  453. //点击重置按钮
  454. resetBtn() {
  455. this.searchListData.orderNo=''
  456. this.searchListData.dateLimit = ''
  457. this.searchListData.type = '';
  458. this.dateSelected = '1'
  459. }
  460. },
  461. onReachBottom() {
  462. this.searchListData.page += 1
  463. this.totalPage >= this.searchListData.page && this.getInitList('bottom')
  464. }
  465. }
  466. </script>
  467. <style lang="scss" scoped>
  468. @import '../style/admin_order.scss';
  469. </style>
  470. <style scoped lang="scss">
  471. .map {
  472. text-align: center;
  473. padding-left: 36rpx;
  474. position: relative;
  475. @include main_color(theme);
  476. &::before {
  477. content: '';
  478. display: inline-block;
  479. width: 2rpx;
  480. height: 42rpx;
  481. background-color: #DDDDDD;
  482. position: absolute;
  483. left: 0;
  484. top: 18rpx;
  485. }
  486. .iconfont {
  487. color: var(--view-theme);
  488. }
  489. .map_text {
  490. color: var(--view-theme);
  491. }
  492. }
  493. .order-item {
  494. background-color: #fff;
  495. border-radius: 23rpx;
  496. padding: 19rpx 38rpx;
  497. }
  498. .order-top {
  499. display: flex;
  500. align-items: center;
  501. justify-content: space-between;
  502. padding: 17rpx;
  503. border-bottom: 2rpx dashed #D6D7DC;
  504. }
  505. .bold-size {
  506. white-space: nowrap;
  507. overflow: hidden;
  508. text-overflow: ellipsis;
  509. font-weight: 500;
  510. font-size: 27rpx;
  511. color: #141414;
  512. z-index: 9999;
  513. }
  514. .onBold-size {
  515. font-weight: 400;
  516. font-size: 23rpx;
  517. color: #999999;
  518. }
  519. .order-content {
  520. padding: 10rpx 0 15rpx 0;
  521. .box-item {
  522. display: flex;
  523. align-items: center;
  524. justify-content: space-between;
  525. margin-bottom: 10rpx;
  526. }
  527. .order-info {
  528. width: 100%;
  529. background: #F8F9FB;
  530. padding: 19rpx 38rpx 45rpx 19rpx;
  531. .store-name {
  532. font-weight: 600;
  533. font-size: 27rpx;
  534. color: #141414;
  535. }
  536. .scroll-container {
  537. display: flex;
  538. flex-wrap: nowrap;
  539. margin: 20rpx 0;
  540. overflow-x: auto;
  541. /* 允许水平滚动 */
  542. white-space: nowrap;
  543. /* 防止项目换行 */
  544. -webkit-overflow-scrolling: touch;
  545. /* 在iOS上平滑滚动 */
  546. .item {
  547. display: flex;
  548. flex-direction: column;
  549. align-items: center;
  550. justify-content: center;
  551. margin-right: 19rpx;
  552. image {
  553. width: 115rpx;
  554. height: 115rpx;
  555. }
  556. text {
  557. font-weight: 400;
  558. font-size: 21rpx;
  559. color: #141414;
  560. margin-top: 9rpx;
  561. }
  562. }
  563. }
  564. .container2 {
  565. display: flex;
  566. justify-content: space-between;
  567. align-items: center;
  568. font-weight: 500;
  569. font-size: 21rpx;
  570. color: #141414;
  571. view {
  572. display: flex;
  573. align-items: center;
  574. }
  575. .image2 {
  576. width: 42rpx;
  577. height: 42rpx;
  578. }
  579. }
  580. }
  581. }
  582. .order-dis {
  583. font-weight: 400;
  584. font-size: 23rpx;
  585. color: #141414;
  586. }
  587. .order-icon {
  588. display: inline-block;
  589. margin-left: 10rpx;
  590. margin-right: 20rpx;
  591. padding: 5rpx 10rpx;
  592. font-weight: 400;
  593. font-size: 23rpx;
  594. color: #FFFFFF;
  595. border-radius: 50%;
  596. background-color: $bg-color-primary;
  597. }
  598. .order-bottom {
  599. border-top: 2rpx dashed #D6D7DC;
  600. .bottom-but {
  601. padding: 39rpx 67rpx;
  602. .sub {
  603. width: 100%;
  604. background-color: $bg-color-primary;
  605. font-weight: 500;
  606. font-size: 31rpx;
  607. color: #FFFFFF;
  608. padding: 17rpx 0;
  609. }
  610. }
  611. }
  612. .icon-info {
  613. width: 8rpx;
  614. height: 31rpx;
  615. background: $bg-color-primary;
  616. margin-right: 15rpx;
  617. }
  618. .line {
  619. z-index: 1;
  620. position: absolute;
  621. left: 28rpx;
  622. width: 1rpx;
  623. height: 100%;
  624. border-left: 1rpx dashed $bg-color-primary;
  625. }
  626. </style>