index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  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" v-if="item.refundStatus==3">
  71. 已退款
  72. </view>
  73. <view class="state" v-else-if="item.groupBuyRecordStatus===99||item.groupBuyRecordStatus===10|| item.status == 9">
  74. {{orderStatus[item.status]}}
  75. </view>
  76. <view class="state" v-else>
  77. {{item.groupBuyRecordStatus==0?'拼团中':'拼团失败'}}
  78. </view>
  79. </view>
  80. <view class="pos-order-goods">
  81. <view class="goods acea-row" @click="toDetail(item)">
  82. <scroll-view class="picTxt scroll-view" scroll-x="true"
  83. v-if="item.infoResponseList.length > 1">
  84. <view class="pictrue" v-for="(val, key) in item.infoResponseList" :key="key">
  85. <image :src="val.image" />
  86. </view>
  87. </scroll-view>
  88. <view class="picTxt" v-else>
  89. <view class="acea-row" v-for="(val, key) in item.infoResponseList" :key="key">
  90. <view class="pictrue">
  91. <image :src="val.image" />
  92. </view>
  93. <view class="text info-text">
  94. <view class="info line2">
  95. {{ val.productName }}
  96. </view>
  97. <view class="attr">
  98. {{ val.sku }}
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="money">
  104. <baseMoney :money="item.payPrice" symbolSize="20" integerSize="32" decimalSize="20">
  105. </baseMoney>
  106. <view class="num">共{{ item.totalNum }}件</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="operation acea-row row-between-wrapper">
  111. <view class="more">
  112. </view>
  113. <view class="acea-row row-middle">
  114. <view class="bnt" v-if="item.groupBuyRecordStatus==10||item.groupBuyRecordStatus==99" @click="modify(item, 1)">订单备注</view>
  115. <view class="bnt primary" v-if="[1,2].includes(item.status)&&item.refundStatus!=3&&(item.groupBuyRecordStatus==10||item.groupBuyRecordStatus==99)"
  116. @click="goDelivery(item)">立即发货
  117. </view>
  118. <!-- <navigator class="bnt primary" :url="'/pages/admin/logistics/index?orderId='+item.order_id"
  119. v-if="item._status == 4 && item.delivery_type == 'express'&&item.refundStatus!=3">发货记录
  120. </navigator> -->
  121. <view class="bnt primary" v-if="item.status==3&&item.refundStatus!=3&&item.groupBuyRecordStatus==99" @click="verify(item)">
  122. 立即核销</view>
  123. <view class="bnt primary" v-if="item.status==3&&item.groupBuyRecordStatus==10&&item.refundStatus!=3" @click="verify(item)">
  124. 立即核销</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <emptyPage v-else title="暂无订单~" :imgSrc="urlDomain+'crmebimage/presets/noShopper.png'"></emptyPage>
  130. <Loading :loaded="loaded" :loading="loading"></Loading>
  131. <PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund"
  132. v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)"
  133. v-on:savePrice="savePrice" :status="status"></PriceChange>
  134. <view class="mask" v-if="filterShow" @click="filterShow=!filterShow"></view>
  135. <!-- #ifdef H5 -->
  136. <view class="filter-popup" :class="{ on: filterShow }">
  137. <!-- #endif -->
  138. <!-- #ifndef H5 -->
  139. <view class="filter-popup" :class="{ on: filterShow }" :style="{
  140. top:getHeight.barTop+getHeight.barHeight+'px'}">
  141. <!-- #endif -->
  142. <view class="search-box">
  143. <view class="search acea-row row-middle">
  144. <text class="iconfont icon-ic_search"></text>
  145. <input class="input" placeholder='请输入要查询的订单' placeholder-style="font-size:28rpx" placeholder-class='placeholder'
  146. confirm-type='search' name="search" v-model="searchListData.orderNo"
  147. @confirm="searchSubmit"></input>
  148. </view>
  149. </view>
  150. <view class="content">
  151. <view class="item">
  152. <view class="title">按下单时间</view>
  153. <view class="acea-row list">
  154. <view class="cell" v-for="(item, index) in dateList" :key="index"
  155. :class="{ on: item.val == dateSelected }" @click="dateChange(item.val)">{{ item.label }}
  156. </view>
  157. </view>
  158. </view>
  159. <view class="item">
  160. <view class="title">按订单类型</view>
  161. <view class="acea-row list">
  162. <view class="cell" v-for="(item, index) in payList" :key="index"
  163. :class="{ on: item.val === searchListData.type }" @click="payChange(item.val)">
  164. {{ item.label }}
  165. </view>
  166. </view>
  167. </view>
  168. <view class="bottom">
  169. <view class="no_view" @click="resetBtn">重置</view>
  170. <view class="yes_view" @click="submitBtn">确定</view>
  171. </view>
  172. </view>
  173. </view>
  174. <view v-if="confirmShow" class="mask"></view>
  175. <view v-if="confirmShow" class="confirm-popup">
  176. <view class="title">确认付款</view>
  177. <view class="info">确认该订单用户已付款</view>
  178. <view class="acea-row btn-box">
  179. <view class="btn" @click="confirmShow = false">取消</view>
  180. <view class="btn primary" @click="offlinePay">确认</view>
  181. </view>
  182. </view>
  183. <view class="footerH"></view>
  184. <footerPage></footerPage>
  185. </view>
  186. </template>
  187. <script>
  188. // import UniDatetime from '../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
  189. import Loading from '../components/Loading/index'
  190. import PriceChange from '../components/PriceChange/index.vue'
  191. import footerPage from '../components/footerPage/index.vue'
  192. import countDown from '@/components/countDown/index.vue'
  193. import emptyPage from '@/components/emptyPage.vue'
  194. import baseMoney from '../components/BaseMoney.vue'
  195. // #ifdef MP || APP-PLUS
  196. import NavBar from '../components/NavBar.vue';
  197. // #endif
  198. import {
  199. isMoney
  200. } from '@/utils/validate.js';
  201. import {
  202. HTTP_REQUEST_URL
  203. } from '@/config/app';
  204. import {
  205. employeeOrderList,
  206. employeeOrderMark,
  207. orderStatusNum,
  208. employeeOrderInfo,
  209. orderGetVerfication
  210. } from '@/api/work.js';
  211. export default {
  212. name: "AdminOrderList",
  213. components: {
  214. Loading,
  215. PriceChange,
  216. footerPage,
  217. countDown,
  218. emptyPage,
  219. baseMoney,
  220. // #ifdef MP || APP-PLUS
  221. NavBar,
  222. // #endif
  223. },
  224. data() {
  225. return {
  226. urlDomain: this.$Cache.get("imgHost"),
  227. datetimerange: [],
  228. orderType: ['普通','秒杀','拼团'],
  229. orderStatus: ['待支付', '待发货', '部分发货', '待核销', '待收货', '已收货', '已完成', '已取消'],
  230. getHeight: this.$util.getWXStatusHeight(),
  231. iconColor: '#333333',
  232. isScrolling: false,
  233. top: 0,
  234. navHeight: 0,
  235. isFixed: false,
  236. filterShow: false,
  237. current: "",
  238. change: false,
  239. types: 0,
  240. list: [],
  241. loaded: false,
  242. loading: false,
  243. orderInfo: {},
  244. status: "",
  245. state: 'all',
  246. isRefund: 0, //1是仅退款;0是退货退款
  247. imgHost: HTTP_REQUEST_URL,
  248. dateSelected: '1',
  249. dateList: [{
  250. label: '全部',
  251. val: '1',
  252. },
  253. {
  254. label: '近1个月',
  255. val: '2',
  256. },
  257. {
  258. label: '近3个月',
  259. val: '3',
  260. },
  261. {
  262. label: '近6个月',
  263. val: '4',
  264. },
  265. ],
  266. payList: [
  267. {
  268. label: '全部订单',
  269. val: '',
  270. },
  271. {
  272. label: '普通订单',
  273. val: 0,
  274. },
  275. {
  276. label: '秒杀订单',
  277. val: 1,
  278. },
  279. {
  280. label: '拼团订单',
  281. val: 2,
  282. }
  283. ],
  284. confirmOrder: {},
  285. confirmShow: false,
  286. searchListData: {
  287. dateLimit: '',
  288. limit: 10,
  289. merId: '',
  290. orderNo: '',
  291. page: 1,
  292. status: 'all',
  293. type: '',
  294. },
  295. headerArr: {},
  296. totalPage: '',
  297. };
  298. },
  299. onLoad(options) {
  300. this.state = options.type ? options.type : 'all';
  301. this.searchListData.status = options.type ? options.type : 'all';
  302. },
  303. // created() {
  304. // this.getInitList()
  305. // this.statusHeader()
  306. // },
  307. onShow() {
  308. this.searchListData.page=1
  309. this.getInitList()
  310. this.statusHeader()
  311. },
  312. methods: {
  313. //订单表头数量
  314. statusHeader() {
  315. orderStatusNum(this.searchListData).then(res => {
  316. this.headerArr = res.data
  317. })
  318. },
  319. // 订单搜索
  320. searchSubmit() {
  321. this.searchListData.page=1
  322. this.getInitList()
  323. this.statusHeader()
  324. },
  325. //订单列表
  326. getInitList(type) {
  327. employeeOrderList(this.searchListData).then(res => {
  328. //下拉触底
  329. if (type == 'bottom') {
  330. this.list = this.list.concat(res.data.list)
  331. } else {
  332. this.list = res.data.list
  333. }
  334. this.totalPage = res.data.totalPage
  335. }).catch(err=>{
  336. this.$util.Tips({
  337. title: err
  338. })
  339. })
  340. },
  341. toDetail(item) {
  342. if(item.groupBuyRecordStatus===0){
  343. return this.$util.Tips({
  344. title: '拼团中无法查看详情'
  345. })
  346. }else{
  347. uni.navigateTo({
  348. url: `/pages/admin/order/detail?orderNo=${item.orderNo}`
  349. })
  350. }
  351. },
  352. //发送货
  353. goDelivery(item) {
  354. if (item.refundStatus == 1) return this.$util.Tips({
  355. title: '请处理售后,再操作',
  356. });
  357. uni.navigateTo({
  358. url: `/pages/admin/order/send?orderNo=${item.orderNo}`
  359. })
  360. },
  361. // 商品操作
  362. modify: function(item, status, type) {
  363. this.change = true;
  364. this.status = status.toString();
  365. this.orderInfo = item;
  366. if (status == 2) {
  367. this.isRefund = type
  368. }
  369. },
  370. //核销
  371. verify(item) {
  372. employeeOrderInfo(item.orderNo).then(res => {
  373. let verifyCode=res.data.verifyCode
  374. orderGetVerfication({
  375. verifyCode: res.data.verifyCode
  376. }).then(res => {
  377. if (res.code == 200) {
  378. uni.navigateTo({
  379. url: `/pages/admin/cancel/list?info=${JSON.stringify(res.data)}&verifyCode=${verifyCode}`
  380. })
  381. } else {
  382. self.$util.Tips({
  383. title: res.message
  384. });
  385. }
  386. })
  387. })
  388. },
  389. changeclose: function(msg) {
  390. this.change = msg;
  391. },
  392. async savePrice(opt) {
  393. if (!opt.remark) {
  394. return this.$util.Tips({
  395. title: '请输入备注'
  396. })
  397. } else {
  398. this.toMark(this.orderInfo.orderNo, opt.remark)
  399. }
  400. },
  401. //备注
  402. toMark(orderNo, remark) {
  403. employeeOrderMark({
  404. orderNo,
  405. remark
  406. }).then(res => {
  407. res.code == 200 && (this.change = false);
  408. return this.$util.Tips({
  409. title: '备注成功'
  410. })
  411. })
  412. },
  413. // 导航切换
  414. changeStatus(val) {
  415. if (this.state != val) {
  416. this.state = val;
  417. // this.where.status = val == -1 ? '' : val;
  418. this.searchListData.status = val
  419. this.searchListData.page = 1
  420. this.searchListData={...this.searchListData}
  421. this.getInitList()
  422. }
  423. },
  424. dateChange(value) {
  425. if (value == 1) {
  426. this.searchListData.dateLimit = ''
  427. this.dateSelected = value;
  428. return
  429. } else if (value == 2) {
  430. this.searchListData.dateLimit = 'lately30'
  431. } else if (value == 3) {
  432. this.searchListData.dateLimit = 'lately90'
  433. } else if (value == 4) {
  434. this.searchListData.dateLimit = 'lately180'
  435. }
  436. this.dateSelected = value;
  437. },
  438. payChange(val) {
  439. this.searchListData.type = val;
  440. },
  441. // 点击确认按钮
  442. submitBtn() {
  443. this.filterShow = false;
  444. this.searchListData.page=1
  445. this.getInitList()
  446. this.statusHeader()
  447. },
  448. //点击重置按钮
  449. resetBtn() {
  450. this.searchListData.orderNo=''
  451. this.searchListData.dateLimit = ''
  452. this.searchListData.type = '';
  453. this.dateSelected = '1'
  454. }
  455. },
  456. onReachBottom() {
  457. this.searchListData.page += 1
  458. this.totalPage >= this.searchListData.page && this.getInitList('bottom')
  459. }
  460. }
  461. </script>
  462. <style lang="scss" scoped>
  463. @import '../style/admin_order.scss';
  464. </style>