index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  1. <template>
  2. <view class="pos-order-list" ref="container">
  3. <!-- #ifdef MP || APP-PLUS -->
  4. <NavBar titleText="订单管理" bagColor="#f5f5f5" textSize="30rpx" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack></NavBar>
  5. <!-- #endif -->
  6. <view class="searchCon acea-row">
  7. <view class="search acea-row row-middle">
  8. <text class="iconfont icon-ic_search"></text>
  9. <input class="inputs" placeholder='请输入用户手机号/用户昵称/订单号/商品名称' placeholder-class='placeholder' confirm-type='search' name="search" v-model="where.keyword" @confirm="searchSubmit"></input>
  10. </view>
  11. <view class="btn" @click="filterShow = true">
  12. <text class="iconfont icon-ic_sort"></text>
  13. </view>
  14. </view>
  15. <view :style="{ height: navHeight + 'px' }" v-if="isFixed"></view>
  16. <view class="nav acea-row row-around row-middle" :class="{ fixed: isFixed }" :style="{ top: isFixed?popupTop:0 }" id="nav">
  17. <view class="item" :class="state == -1 ? 'on' : ''" @click="changeStatus(-1)">
  18. 全部
  19. <image src="../static/adorn.png" v-if="state == -1"></image>
  20. </view>
  21. <view class="item" :class="state == 0 ? 'on' : ''" @click="changeStatus(0)">
  22. 待付款
  23. <image src="../static/adorn.png" v-if="state == 0"></image>
  24. </view>
  25. <view class="item" :class="state == 1 ? 'on' : ''" @click="changeStatus(1)">
  26. 待发货
  27. <image src="../static/adorn.png" v-if="state == 1"></image>
  28. </view>
  29. <view class="item" :class="state == 2 ? 'on' : ''" @click="changeStatus(2)">
  30. 待收货/核销
  31. <image src="../static/adorn.png" v-if="state == 2"></image>
  32. </view>
  33. <view class="item" :class="state == 3 ? 'on' : ''" @click="changeStatus(3)">
  34. 待评价
  35. <image src="../static/adorn.png" v-if="state == 3"></image>
  36. </view>
  37. <!-- <view class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">
  38. 已完成
  39. </view>
  40. <view class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">
  41. 退款
  42. </view> -->
  43. </view>
  44. <view class="list" v-if="list.length">
  45. <view class="item" v-for="(item, index) in list" :key="index">
  46. <view class="order-num acea-row row-between-wrapper" @click="toDetail(item)">
  47. <view class="acea-row row-middle">
  48. <!-- <countDown v-if="item.status == 0 && item.paid == 0 && item.pay_type != 'offline'" tipText="剩余:" dayText=" " hourText="小时" minuteText="分钟" secondText=" " dotColor="#FF7E00"
  49. colors="#FF7E00" :datatime="item.stop_time" :isSecond="false">
  50. </countDown> -->
  51. <view>{{ item.order_id }}</view>
  52. <view class="label" v-if="item.pink_name && !storeNum">{{item.pink_name}}</view>
  53. <view class="label" v-if="item.plat_name && storeNum">{{item.plat_name}}</view>
  54. </view>
  55. <view class="state" :class="(item.refund_status==0 && where.status != 0 && item.refund.length)?'on':''">
  56. {{item.refund_status==1?'退款中':item.refund_status==2?'已退款':item.refund_status==3?'拒绝退款':item.status_name.status_name}}
  57. <text v-if="item.refund_status==0 && where.status != 0 && item.refund.length">{{item.is_all_refund?',退款中':',部分退款中'}}</text>
  58. </view>
  59. </view>
  60. <view class="pos-order-goods">
  61. <view class="goods acea-row" :class="item.cart_id.length > 1?'row-middle':''" @click="toDetail(item)">
  62. <scroll-view class="picTxt scroll-view" scroll-x="true" v-if="item.cart_id.length > 1">
  63. <view class="pictrue" v-for="(val, key) in item._info" :key="key">
  64. <image :src="val.cart_info.productInfo.attrInfo?val.cart_info.productInfo.attrInfo.image:val.cart_info.productInfo.image" />
  65. </view>
  66. </scroll-view>
  67. <view class="picTxt" v-else>
  68. <view class="acea-row" v-for="(val, key) in item._info" :key="key">
  69. <view class="pictrue">
  70. <image :src="val.cart_info.productInfo.attrInfo?val.cart_info.productInfo.attrInfo.image:val.cart_info.productInfo.image" />
  71. </view>
  72. <view class="text">
  73. <view class="info line2">
  74. <!-- <text v-if="val.cart_info.is_gift == 1" class="label">[赠品]</text> -->
  75. {{ val.cart_info.productInfo.store_name }}
  76. </view>
  77. <view class="attr" v-if="val.cart_info.productInfo.attrInfo">
  78. {{ val.cart_info.productInfo.attrInfo.suk }}
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="money">
  84. <!-- <view class="x-money">¥{{ item.pay_price }}</view> -->
  85. <BaseMoney :money="item.pay_price" symbolSize="20" integerSize="32" decimalSize="20"></BaseMoney>
  86. <view class="num">共{{ item.total_num }}件</view>
  87. <!-- <view class="y-money">
  88. ¥{{ val.cart_info.productInfo.ot_price }}
  89. </view> -->
  90. <!-- <view class="info" v-if="val.cart_info.refund_num && item._status._type !=-2">{{val.cart_info.refund_num}}件退款中</view> -->
  91. </view>
  92. </view>
  93. </view>
  94. <!-- <view class="public-total">
  95. 共{{ item.total_num }}件商品,实付款
  96. <span class="money">¥{{ item.pay_price }}</span> ( 邮费 ¥{{
  97. item.pay_postage
  98. }}
  99. )
  100. </view> -->
  101. <view class="operation acea-row row-between-wrapper">
  102. <view class="more">
  103. <!-- <view class="iconfont icon-gengduo" @click="more(index)"></view>-->
  104. <!-- <view class="order" v-show="current === index">-->
  105. <!-- <view class="items">-->
  106. <!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
  107. <!-- </view>-->
  108. <!-- <view class="arrow"></view>-->
  109. <!-- </view>-->
  110. </view>
  111. <view class="acea-row row-middle">
  112. <view class="bnt" @click="modify(item, 1)">订单备注</view>
  113. <view class="bnt" :class="openErp?'on':''" @click="modify(item, 0)" v-if="item._status == 1">
  114. 一键改价
  115. </view>
  116. <view class="bnt primary" :class="openErp?'on':''" v-if="item.status == 0 && item.paid == 0" @click="confirmPay(item)">
  117. 确认付款
  118. </view>
  119. <view class="bnt" v-if="item.supplier_id!==0 && item._status == 2" @click="btnClick(item)">提醒发货</view>
  120. <view class="bnt primary" :class="openErp?'on':''" v-if="item._status == 2" @click="goDelivery(item)">发送货
  121. </view>
  122. <navigator class="bnt primary" :url="'/pages/admin/logistics/index?orderId='+item.order_id" v-if="item._status == 4 && item.delivery_type == 'express'">查看物流</navigator>
  123. <view class="bnt primary" v-if="item.shipping_type == 2 &&
  124. (item.status == 0 || item.status == 5) &&
  125. item.paid == 1 &&
  126. item.refund_status === 0" @click="verify(item)">订单核销</view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. <view v-else class="px-20 mt-20">
  132. <emptyPage title="暂无订单~" src="/statics/images/noOrder.gif"></emptyPage>
  133. </view>
  134. <Loading :loaded="loaded" :loading="loading"></Loading>
  135. <PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund" v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
  136. :status="status"></PriceChange>
  137. <view class="mask" v-if="filterShow" @click="filterShow = false"></view>
  138. <view class="filter-popup" :class="{ on: filterShow }" :style="{top:popupTop}">
  139. <view class="search-box">
  140. <view class="search acea-row row-middle">
  141. <text class="iconfont icon-ic_search"></text>
  142. <input class="input" placeholder='请输入要查询的订单' placeholder-class='placeholder' confirm-type='search' name="search" v-model="where.keyword" @confirm="searchSubmit"></input>
  143. </view>
  144. </view>
  145. <view class="content">
  146. <view class="item">
  147. <view class="title">按下单时间</view>
  148. <view class="acea-row list">
  149. <view class="cell" v-for="(item, index) in dateList" :key="index" :class="{ on: item.val == dateSelected }" @click="dateChange(item.val)">{{ item.label }}</view>
  150. </view>
  151. </view>
  152. <view class="item">
  153. <view class="title">按支付方式</view>
  154. <view class="acea-row list">
  155. <view class="cell" v-for="(item, index) in payList" :key="index" :class="{ on: item.val == where.pay_type }" @click="payChange(item.val,0)">{{ item.label }}</view>
  156. </view>
  157. </view>
  158. <view class="item" v-if="storeNum">
  159. <view class="title">按订单来源</view>
  160. <view class="acea-row list">
  161. <view class="cell" v-for="(item, index) in orderList" :key="index" :class="{ on: item.val == currentOrder }" @click="payChange(item.val,1)">{{item.label}}</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 typeList" :key="index" :class="{ on: item.val == where.type }" @click="payChange(item.val,2)">{{item.label}}</view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <view v-if="confirmShow" class="mask"></view>
  173. <view v-if="confirmShow" class="confirm-popup">
  174. <view class="title">确认付款</view>
  175. <view class="info">确认该订单用户已付款</view>
  176. <view class="acea-row btn-box">
  177. <view class="btn" @click="confirmShow = false">取消</view>
  178. <view class="btn primary" @click="offlinePay">确认</view>
  179. </view>
  180. </view>
  181. <view class="footerH"></view>
  182. <footerPage :isWork='storeNum'></footerPage>
  183. </view>
  184. </template>
  185. <script>
  186. import {
  187. mapGetters
  188. } from "vuex";
  189. import {
  190. getStoreOrderList,
  191. getAdminOrderList,
  192. setStoreOrderPrice,
  193. setAdminOrderPrice,
  194. setStoreOrderRemark,
  195. setAdminOrderRemark,
  196. setStoreRefundRemark,
  197. setAdminRefundRemark,
  198. setStoreOfflinePay,
  199. setOfflinePay,
  200. setStoreOrderRefund,
  201. setOrderRefund,
  202. storeOrderRefundAgree,
  203. orderRefundAgree,
  204. getDelivery
  205. } from "@/api/admin";
  206. import {
  207. erpConfig
  208. } from "@/api/esp.js";
  209. import Loading from '@/components/Loading/index'
  210. import PriceChange from '../components/PriceChange/index.vue'
  211. import footerPage from '../components/footerPage/index.vue'
  212. import countDown from '@/components/countDown/index.vue'
  213. import emptyPage from '@/components/emptyPage.vue'
  214. // #ifdef MP || APP-PLUS
  215. import NavBar from '@/components/NavBar.vue';
  216. // #endif
  217. import {
  218. isMoney
  219. } from '@/utils/validate.js';
  220. import {
  221. HTTP_REQUEST_URL
  222. } from '@/config/app';
  223. export default {
  224. name: "AdminOrderList",
  225. components: {
  226. Loading,
  227. PriceChange,
  228. footerPage,
  229. countDown,
  230. emptyPage,
  231. // #ifdef MP || APP-PLUS
  232. NavBar,
  233. // #endif
  234. },
  235. computed: mapGetters(["storeNum"]),
  236. data() {
  237. return {
  238. getHeight: this.$util.getWXStatusHeight(),
  239. iconColor: '#333333',
  240. isScrolling: false,
  241. top: 0,
  242. navHeight: 0,
  243. isFixed: false,
  244. filterShow: false,
  245. openErp: false,
  246. current: "",
  247. change: false,
  248. types: 0,
  249. where: {
  250. page: 1,
  251. limit: 10,
  252. status: '',
  253. keyword: '',
  254. data: '', // 时间筛选
  255. type: '', // 订单类型
  256. pay_type: '', // 支付方式
  257. },
  258. list: [],
  259. loaded: false,
  260. loading: false,
  261. orderInfo: {},
  262. status: "",
  263. state: -1,
  264. isRefund: 0, //1是仅退款;0是退货退款
  265. imgHost: HTTP_REQUEST_URL,
  266. dateSelected: '',
  267. dateList: [{
  268. label: '全部',
  269. val: '',
  270. },
  271. {
  272. label: '三天内',
  273. val: '1',
  274. },
  275. {
  276. label: '一个月内',
  277. val: '2',
  278. },
  279. {
  280. label: '三个月内',
  281. val: '3',
  282. },
  283. {
  284. label: '半年内',
  285. val: '4',
  286. },
  287. ],
  288. payList: [{
  289. label: '全部',
  290. val: '',
  291. },
  292. {
  293. label: '微信支付',
  294. val: '1'
  295. },
  296. {
  297. label: '支付宝支付',
  298. val: '4'
  299. },
  300. {
  301. label: '余额支付',
  302. val: '2'
  303. },
  304. {
  305. label: '线下支付',
  306. val: '3'
  307. },
  308. ],
  309. orderList:[
  310. {
  311. label: '全部',
  312. val: '-1'
  313. },
  314. {
  315. label: '平台订单',
  316. val: '0'
  317. },
  318. {
  319. label: '供应商订单',
  320. val: '2'
  321. },
  322. {
  323. label: '门店订单',
  324. val: '1'
  325. }
  326. ],
  327. typeList:[
  328. {
  329. label: '全部',
  330. val: ''
  331. },
  332. {
  333. label: '拼单订单',
  334. val: '9'
  335. },
  336. {
  337. label: '桌码订单',
  338. val: '10'
  339. },
  340. {
  341. label: '普通订单',
  342. val: '0'
  343. },
  344. {
  345. label: '秒杀订单',
  346. val: '1'
  347. },
  348. {
  349. label: '砍价订单',
  350. val: '2'
  351. },
  352. {
  353. label: '拼团订单',
  354. val: '3'
  355. },
  356. {
  357. label: '积分订单',
  358. val: '4'
  359. },
  360. {
  361. label: '套餐订单',
  362. val: '5'
  363. },
  364. {
  365. label: '预售订单',
  366. val: '6'
  367. },
  368. {
  369. label: '新人订单',
  370. val: '7'
  371. },
  372. {
  373. label: '抽奖订单',
  374. val: '8'
  375. }
  376. ],
  377. confirmOrder: {},
  378. confirmShow: false,
  379. popupTop:0,
  380. currentOrder:0
  381. };
  382. },
  383. onLoad(option) {
  384. // #ifdef MP
  385. this.popupTop = this.getHeight.barTop+this.getHeight.barHeight+'px'
  386. // #endif
  387. let type = option.types;
  388. this.where.status = type || '';
  389. this.state = type || -1;
  390. this.getErpConfig();
  391. },
  392. onShow() {
  393. this.init();
  394. },
  395. onPageScroll(option) {
  396. if (this.top - (this.getHeight.barTop + this.getHeight.barHeight) >= option.scrollTop) {
  397. this.isFixed = false;
  398. } else {
  399. this.isFixed = true;
  400. }
  401. // #ifdef MP
  402. if (option.scrollTop > 50) {
  403. this.isScrolling = true;
  404. } else if (option.scrollTop < 50) {
  405. this.isScrolling = false;
  406. }
  407. // #endif
  408. },
  409. mounted() {
  410. const query = uni.createSelectorQuery().in(this);
  411. query.select("#nav").boundingClientRect((data) => {
  412. this.top = data.top;
  413. this.navHeight = data.height;
  414. }).exec();
  415. },
  416. methods: {
  417. btnClick(item){
  418. getDelivery(item.id).then(res=>{
  419. this.$util.Tips({
  420. title: res.msg
  421. })
  422. }).catch(err=>{
  423. this.$util.Tips({
  424. title: err
  425. })
  426. })
  427. },
  428. verify(item) {
  429. if (item.product_type == 4) {
  430. uni.navigateTo({
  431. url: '/pages/admin/writeOffCard/index?id=' + item.id+'&storeNum='+this.storeNum
  432. })
  433. } else {
  434. uni.navigateTo({
  435. url: '/pages/admin/distribution/scanning/detail/index?auth=1&id=' + item.id + '&let=1&code=' + item.verify_code+'&storeNum='+this.storeNum
  436. })
  437. }
  438. },
  439. statusChange(e) {
  440. this.status = e;
  441. },
  442. goDelivery(item) {
  443. if (this.openErp) return
  444. uni.navigateTo({
  445. url: '/pages/admin/delivery/index?id=' + item.order_id + '&listId=' + item.id + '&totalNum=' + item.total_num + '&orderStatus=' + item._status + '&comeType=1&productType=' +
  446. item.product_type+'&storeNum='+this.storeNum
  447. })
  448. },
  449. getErpConfig() {
  450. let funApi = '';
  451. erpConfig().then(res => {
  452. this.openErp = res.data.open_erp;
  453. }).catch(err => {
  454. this.$util.Tips({
  455. title: err
  456. })
  457. })
  458. },
  459. // 获取数据
  460. getIndex: function() {
  461. let that = this;
  462. if (that.loading || that.loaded) return;
  463. that.loading = true;
  464. let funApi = ''
  465. if(this.storeNum){
  466. that.where.plat_type = this.currentOrder;
  467. funApi = getAdminOrderList(that.where);
  468. }else{
  469. funApi = getStoreOrderList(that.where);
  470. }
  471. funApi.then(
  472. res => {
  473. that.loading = false;
  474. that.loaded = res.data.length < that.where.limit;
  475. that.list.push.apply(that.list, res.data);
  476. that.where.page = that.where.page + 1;
  477. },
  478. err => {
  479. that.$util.Tips({
  480. title: err
  481. })
  482. }
  483. );
  484. },
  485. // 初始化
  486. init: function() {
  487. this.list = [];
  488. this.where.page = 1;
  489. this.loaded = false;
  490. this.loading = false;
  491. this.getIndex();
  492. this.current = "";
  493. },
  494. searchSubmit() {
  495. this.init();
  496. },
  497. // 导航切换
  498. changeStatus(val) {
  499. if (this.state != val) {
  500. this.state = val;
  501. this.where.status = val == -1 ? '' : val;
  502. this.init();
  503. }
  504. },
  505. // 商品操作
  506. modify: function(item, status, type) {
  507. if (this.openErp && status != 1) return
  508. this.change = true;
  509. this.status = status.toString();
  510. this.orderInfo = item;
  511. if (status == 2) {
  512. this.isRefund = type
  513. }
  514. },
  515. changeclose: function(msg) {
  516. this.change = msg;
  517. },
  518. objOrderRefund(data) {
  519. let that = this;
  520. let funApi = '';
  521. if(this.storeNum){
  522. funApi = setOrderRefund;
  523. }else{
  524. funApi = setStoreOrderRefund;
  525. }
  526. funApi(data).then(
  527. res => {
  528. that.change = false;
  529. that.$util.Tips({
  530. title: res.msg
  531. });
  532. that.init();
  533. },
  534. err => {
  535. that.change = false;
  536. that.$util.Tips({
  537. title: err
  538. });
  539. }
  540. );
  541. },
  542. async savePrice(opt) {
  543. let that = this,
  544. data = {},
  545. price = opt.price,
  546. refund_price = opt.refund_price,
  547. refund_status = that.orderInfo.refund_status,
  548. remark = opt.remark;
  549. data.order_id = that.orderInfo.order_id;
  550. if (that.status == 0) {
  551. if (!isMoney(price)) {
  552. return that.$util.Tips({
  553. title: '请输入正确的金额'
  554. });
  555. }
  556. data.price = price;
  557. let funApi = '';
  558. if(this.storeNum){
  559. funApi = setAdminOrderPrice;
  560. }else{
  561. funApi = setStoreOrderPrice;
  562. }
  563. funApi(data).then(
  564. res => {
  565. that.change = false;
  566. that.$util.Tips({
  567. title: '改价成功',
  568. icon: 'success'
  569. })
  570. that.init();
  571. },
  572. err => {
  573. that.change = false;
  574. that.$util.Tips({
  575. title: '改价失败',
  576. icon: 'none'
  577. })
  578. }
  579. );
  580. } else if (that.status == 2) {
  581. if (this.isRefund) {
  582. if (!isMoney(refund_price)) {
  583. return that.$util.Tips({
  584. title: '请输入正确的金额'
  585. });
  586. }
  587. data.price = refund_price;
  588. data.type = opt.type;
  589. this.objOrderRefund(data);
  590. // setOrderRefund(data).then(
  591. // res => {
  592. // that.change = false;
  593. // that.$util.Tips({title: res.msg});
  594. // that.init();
  595. // },
  596. // err => {
  597. // that.change = false;
  598. // that.$util.Tips({title: err});
  599. // }
  600. // );
  601. } else {
  602. if (opt.type == 1) {
  603. let funApi = '';
  604. if(this.storeNum){
  605. funApi = orderRefundAgree;
  606. }else{
  607. funApi = storeOrderRefundAgree;
  608. }
  609. funApi(this.orderInfo.id).then(res => {
  610. that.change = false;
  611. that.$util.Tips({
  612. title: res.msg
  613. });
  614. that.init();
  615. }).catch(err => {
  616. that.change = false;
  617. that.$util.Tips({
  618. title: err
  619. });
  620. })
  621. }
  622. // else{
  623. // data.type = opt.type;
  624. // data.refuse_reason = opt.refuse_reason;
  625. // this.objOrderRefund(data);
  626. // }
  627. }
  628. } else if (that.status == 8) {
  629. data.type = opt.type;
  630. data.refuse_reason = opt.refuse_reason;
  631. this.objOrderRefund(data);
  632. } else {
  633. if (!remark) {
  634. return this.$util.Tips({
  635. title: '请输入备注'
  636. })
  637. }
  638. data.remark = remark;
  639. let obj = '';
  640. if (that.where.status == -3) {
  641. let funApi = '';
  642. if(this.storeNum){
  643. funApi = setAdminRefundRemark(data);
  644. }else{
  645. funApi = setStoreRefundRemark(data);
  646. }
  647. obj = funApi;
  648. } else {
  649. let funApi = '';
  650. if(this.storeNum){
  651. funApi = setAdminOrderRemark(data);
  652. }else{
  653. funApi = setStoreOrderRemark(data);
  654. }
  655. obj = funApi;
  656. }
  657. obj.then(
  658. res => {
  659. that.change = false;
  660. this.$util.Tips({
  661. title: res.msg,
  662. icon: 'success'
  663. })
  664. that.init();
  665. },
  666. err => {
  667. that.change = false;
  668. that.$util.Tips({
  669. title: err
  670. });
  671. }
  672. );
  673. }
  674. },
  675. toDetail(item) {
  676. uni.navigateTo({
  677. url: `/pages/admin/orderDetail/index?id=${item.order_id}&types=${this.where.status}&storeNum=`+this.storeNum
  678. })
  679. },
  680. offlinePay: function() {
  681. if (this.openErp) return
  682. let funApi = '';
  683. if(this.storeNum){
  684. funApi = setOfflinePay;
  685. }else{
  686. funApi = setStoreOfflinePay;
  687. }
  688. funApi({
  689. order_id: this.confirmOrder.order_id
  690. }).then(
  691. res => {
  692. this.confirmShow = false;
  693. this.$util.Tips({
  694. title: res.msg,
  695. icon: "success"
  696. });
  697. this.init();
  698. },
  699. error => {
  700. this.$util.Tips(error);
  701. }
  702. );
  703. },
  704. confirmPay(item) {
  705. this.confirmOrder = item;
  706. this.confirmShow = true;
  707. },
  708. dateChange(value) {
  709. const date = new Date();
  710. const end = date.toLocaleString();
  711. let start = '';
  712. if (value == 1) {
  713. date.setDate(date.getDate() - 2)
  714. date.setHours(0, 0, 0, 0);
  715. } else if (value == 2) {
  716. date.setDate(1)
  717. date.setHours(0, 0, 0, 0);
  718. } else if (value == 3) {
  719. date.setMonth(date.getMonth() - 2)
  720. date.setDate(1)
  721. date.setHours(0, 0, 0, 0);
  722. } else if (value == 4) {
  723. date.setMonth(date.getMonth() - 5)
  724. date.setDate(1)
  725. date.setHours(0, 0, 0, 0);
  726. }
  727. start = date.toLocaleString();
  728. this.dateSelected = value;
  729. this.filterShow = false;
  730. this.where.data = start == end ? '' : `${start}-${end}`;
  731. this.init();
  732. },
  733. payChange(val,num) {
  734. this.filterShow = false;
  735. if(num == 0){
  736. this.where.pay_type = val;
  737. }else if(num == 1){
  738. this.currentOrder = val;
  739. }else{
  740. this.where.type = val;
  741. }
  742. this.init();
  743. },
  744. },
  745. onReachBottom() {
  746. this.getIndex()
  747. }
  748. }
  749. </script>
  750. <style lang="scss" scoped>
  751. .pos-order-list {
  752. padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  753. padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  754. /deep/.navbar {
  755. .content {
  756. background: #F5F5F5 !important;
  757. }
  758. }
  759. }
  760. .searchCon {
  761. padding: 10rpx 20rpx;
  762. .search {
  763. flex: 1;
  764. height: 72rpx;
  765. padding: 0 32rpx;
  766. border-radius: 36rpx;
  767. background: #FFFFFF;
  768. .iconfont {
  769. margin-right: 16rpx;
  770. font-size: 32rpx;
  771. color: #999999;
  772. }
  773. .inputs {
  774. flex: 1;
  775. font-size: 28rpx;
  776. color: #333;
  777. }
  778. .placeholder {
  779. font-size: 26rpx;
  780. color: #ccc;
  781. }
  782. }
  783. .btn {
  784. width: 72rpx;
  785. height: 72rpx;
  786. border-radius: 50%;
  787. margin-left: 20rpx;
  788. background: #FFFFFF;
  789. text-align: center;
  790. .iconfont {
  791. font-size: 32rpx;
  792. line-height: 72rpx;
  793. color: #666666;
  794. }
  795. }
  796. }
  797. .pos-order-list .nav {
  798. font-size: 26rpx;
  799. line-height: 42rpx;
  800. color: #333333;
  801. top: 0;
  802. left: 0;
  803. z-index: 99;
  804. &.fixed {
  805. position: fixed;
  806. top: 0;
  807. left: 0;
  808. width: 100%;
  809. background: #F5F5F5;
  810. }
  811. .item {
  812. position: relative;
  813. padding: 28rpx 0;
  814. image {
  815. width: 14rpx;
  816. height: 14rpx;
  817. display: block;
  818. position: absolute;
  819. bottom: 20rpx;
  820. right: -4rpx;
  821. }
  822. }
  823. }
  824. .pos-order-list .nav .item.on {
  825. font-weight: 500;
  826. font-size: 30rpx;
  827. color: #2A7EFB;
  828. }
  829. .pos-order-list .nav .item.on::after {
  830. // content: "";
  831. // position: absolute;
  832. // bottom: 20rpx;
  833. // right: -6rpx;
  834. // width: 28rpx;
  835. // height: 28rpx;
  836. // border: 4rpx solid #2A7EFB;
  837. // border-top-color: transparent;
  838. // border-left-color: transparent;
  839. // border-radius: 14rpx;
  840. // box-sizing: border-box;
  841. }
  842. .pos-order-list .list {
  843. padding: 0 20rpx;
  844. }
  845. .pos-order-list .nothing {
  846. margin-top: 120upx;
  847. text-align: center;
  848. color: #cfcfcf;
  849. }
  850. .pos-order-list .list .item {
  851. padding: 32rpx 24rpx;
  852. border-radius: 24rpx;
  853. background-color: #fff;
  854. /deep/.time {
  855. .title {
  856. color: #FF7E00;
  857. }
  858. }
  859. }
  860. .pos-order-list .list .item~.item {
  861. margin-top: 20rpx;
  862. }
  863. .pos-order-list .list .item .order-num {
  864. font-size: 28rpx;
  865. line-height: 40rpx;
  866. color: #333333;
  867. .label{
  868. font-family: PingFang SC, PingFang SC;
  869. font-weight: 400;
  870. font-size: 20rpx;
  871. color: #2A7EFB;
  872. height: 32rpx;
  873. line-height: 30rpx;
  874. border-radius: 6rpx;
  875. border: 1px solid #2A7EFB;
  876. padding: 0 4rpx;
  877. margin-left: 16rpx;
  878. }
  879. }
  880. .pos-order-list .list .item .order-num .state {
  881. color: #FF7E00;
  882. }
  883. .pos-order-list .list .item .order-num .state.on {
  884. font-size: 24rpx;
  885. width: 180rpx;
  886. text-align: right;
  887. }
  888. .pos-order-list .list .item .order-num .time {
  889. font-size: 26upx;
  890. font-weight: normal;
  891. color: #999;
  892. }
  893. .pos-order-list .list .item .operation {}
  894. .pos-order-list .list .item .operation .more {
  895. position: relative;
  896. }
  897. .pos-order-list .list .item .operation .icon-gengduo {
  898. font-size: 50upx;
  899. color: #aaa;
  900. }
  901. .pos-order-list .list .item .operation .order .arrow {
  902. width: 0;
  903. height: 0;
  904. border-left: 11upx solid transparent;
  905. border-right: 11upx solid transparent;
  906. border-top: 20upx solid #e5e5e5;
  907. position: absolute;
  908. left: 15upx;
  909. bottom: -18upx;
  910. }
  911. .pos-order-list .list .item .operation .order .arrow:before {
  912. content: '';
  913. width: 0;
  914. height: 0;
  915. border-left: 7upx solid transparent;
  916. border-right: 7upx solid transparent;
  917. border-top: 20upx solid #fff;
  918. position: absolute;
  919. left: -7upx;
  920. bottom: 0;
  921. }
  922. .pos-order-list .list .item .operation .order {
  923. width: 200upx;
  924. background-color: #fff;
  925. border: 1px solid #eee;
  926. border-radius: 10upx;
  927. position: absolute;
  928. top: -100upx;
  929. z-index: 9;
  930. }
  931. .pos-order-list .list .item .operation .order .items {
  932. height: 77upx;
  933. line-height: 77upx;
  934. text-align: center;
  935. }
  936. .pos-order-list .list .item .operation .order .items~.items {
  937. border-top: 1px solid #f5f5f5;
  938. }
  939. .pos-order-list .list .item .operation .bnt {
  940. width: 144rpx;
  941. height: 56rpx;
  942. border-radius: 28rpx;
  943. border: 1rpx solid #CCCCCC;
  944. text-align: center;
  945. font-size: 24rpx;
  946. line-height: 54rpx;
  947. color: #333333;
  948. &.primary {
  949. color: #FFFFFF !important;
  950. background-color: #2A7EFB !important;
  951. border-color: #2A7EFB !important;
  952. }
  953. }
  954. .pos-order-list .list .item .operation .bnt~.bnt {
  955. margin-left: 16rpx;
  956. }
  957. .pos-order-list .list .item .operation .wait {
  958. margin-left: 30rpx;
  959. }
  960. .pos-order-goods .goods {
  961. padding: 26rpx 0;
  962. }
  963. .pos-order-goods .goods~.goods {
  964. border-top: 1px dashed #e5e5e5;
  965. }
  966. .pos-order-goods .goods .picTxt {
  967. flex: 1;
  968. min-width: 0;
  969. }
  970. .pos-order-goods .goods .scroll-view {
  971. box-sizing: border-box;
  972. white-space: nowrap;
  973. .pictrue {
  974. display: inline-block;
  975. +.pictrue {
  976. margin-left: 16rpx;
  977. }
  978. }
  979. }
  980. .pos-order-goods .goods .picTxt .pictrue {
  981. width: 136rpx;
  982. height: 136rpx;
  983. }
  984. .pos-order-goods .goods .picTxt .pictrue image {
  985. width: 100%;
  986. height: 100%;
  987. border-radius: 16rpx;
  988. }
  989. .pos-order-goods .goods .picTxt .text {
  990. flex: 1;
  991. min-width: 0;
  992. padding-left: 20rpx;
  993. }
  994. .pos-order-goods .goods .picTxt .text .info {
  995. font-size: 28rpx;
  996. line-height: 40rpx;
  997. color: #333333;
  998. }
  999. .pos-order-goods .goods .picTxt .text .info .label {
  1000. color: #ff4c3c;
  1001. }
  1002. .pos-order-goods .goods .picTxt .text .attr {
  1003. margin-top: 12rpx;
  1004. overflow: hidden;
  1005. white-space: nowrap;
  1006. text-overflow: ellipsis;
  1007. font-size: 24rpx;
  1008. line-height: 34rpx;
  1009. color: #999999;
  1010. }
  1011. .pos-order-goods .goods .money {
  1012. padding-left: 16rpx;
  1013. text-align: right;
  1014. font-size: 28upx;
  1015. }
  1016. .pos-order-goods .goods .money .info {
  1017. margin-top: 18rpx;
  1018. font-size: 24rpx;
  1019. }
  1020. .pos-order-goods .goods .money .x-money {
  1021. color: #282828;
  1022. }
  1023. .pos-order-goods .goods .money .num {
  1024. margin-top: 10rpx;
  1025. font-size: 24rpx;
  1026. line-height: 34rpx;
  1027. color: #999999;
  1028. }
  1029. .pos-order-goods .goods .money .y-money {
  1030. color: #999;
  1031. text-decoration: line-through;
  1032. }
  1033. .public-total {
  1034. font-size: 28upx;
  1035. color: #282828;
  1036. border-top: 1px solid #eee;
  1037. height: 92upx;
  1038. line-height: 92upx;
  1039. text-align: right;
  1040. padding: 0 30upx;
  1041. background-color: #fff;
  1042. }
  1043. .public-total .money {
  1044. color: #ff4c3c;
  1045. }
  1046. .filter-popup {
  1047. position: fixed;
  1048. top: 0;
  1049. left: 0;
  1050. z-index: 100;
  1051. width: 100%;
  1052. border-radius: 0 0 32rpx 32rpx;
  1053. background: #FFFFFF;
  1054. transform: translateY(-100%);
  1055. transition: transform 0.3s;
  1056. &.on {
  1057. transform: translateY(0);
  1058. }
  1059. .search-box {
  1060. padding: 10rpx 32rpx;
  1061. }
  1062. .search {
  1063. height: 58rpx;
  1064. padding: 0 32rpx;
  1065. border-radius: 29rpx;
  1066. background: #F5F5F5;
  1067. }
  1068. .iconfont {
  1069. font-size: 28rpx;
  1070. color: #999999;
  1071. }
  1072. .input {
  1073. flex: 1;
  1074. height: 58rpx;
  1075. padding-left: 16rpx;
  1076. font-size: 24rpx;
  1077. }
  1078. .content {
  1079. padding: 32rpx 30rpx 58rpx;
  1080. }
  1081. .item {
  1082. margin-top: 36rpx;
  1083. &:first-child {
  1084. margin-top: 0;
  1085. }
  1086. }
  1087. .title {
  1088. font-size: 28rpx;
  1089. line-height: 40rpx;
  1090. color: #333333;
  1091. }
  1092. .list {
  1093. padding: 0;
  1094. margin-right: -24rpx;
  1095. }
  1096. .cell {
  1097. width: 154rpx;
  1098. height: 56rpx;
  1099. border: 1rpx solid #F5F5F5;
  1100. border-radius: 28rpx;
  1101. margin: 24rpx 24rpx 0 0;
  1102. background: #F5F5F5;
  1103. text-align: center;
  1104. font-size: 24rpx;
  1105. line-height: 54rpx;
  1106. color: #333333;
  1107. &.on {
  1108. border-color: #2A7EFB;
  1109. background: #E9F2FE;
  1110. color: #2A7EFB;
  1111. }
  1112. }
  1113. }
  1114. .footerH {
  1115. height: 110rpx;
  1116. height: calc(110rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1117. height: calc(110rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1118. }
  1119. .mask {
  1120. z-index: 21;
  1121. }
  1122. .confirm-popup {
  1123. position: fixed;
  1124. top: 50%;
  1125. right: 75rpx;
  1126. left: 75rpx;
  1127. z-index: 21;
  1128. transform: translateY(-50%);
  1129. border-radius: 32rpx;
  1130. background: #FFFFFF;
  1131. text-align: center;
  1132. .title {
  1133. padding: 40rpx 32rpx 0;
  1134. font-weight: 500;
  1135. font-size: 32rpx;
  1136. line-height: 52rpx;
  1137. color: #333333;
  1138. }
  1139. .info {
  1140. padding: 24rpx 40rpx 0;
  1141. font-size: 30rpx;
  1142. line-height: 42rpx;
  1143. color: #666666;
  1144. }
  1145. .btn-box {
  1146. padding: 40rpx;
  1147. }
  1148. .btn {
  1149. flex: 1;
  1150. height: 72rpx;
  1151. border: 1rpx solid #2A7EFB;
  1152. border-radius: 36rpx;
  1153. margin-left: 32rpx;
  1154. font-weight: 500;
  1155. font-size: 26rpx;
  1156. line-height: 70rpx;
  1157. color: #2A7EFB;
  1158. transform: rotateZ(360deg);
  1159. &.primary {
  1160. background: #2A7EFB;
  1161. color: #FFFFFF;
  1162. }
  1163. }
  1164. }
  1165. </style>