123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758 |
- <template>
- <view class="pos-order-list" ref="container">
- <!-- #ifdef MP || APP-PLUS -->
- <NavBar titleText="订单管理" bagColor="#f5f5f5" :iconColor="iconColor" :textColor="iconColor"
- :isScrolling="isScrolling" showBack></NavBar>
- <!-- #endif -->
- <view class="searchCon acea-row">
- <view class="search acea-row row-middle">
- <text class="iconfont icon-ic_search"></text>
- <input class="inputs" placeholder='请输入订单号' placeholder-style="font-size:28rpx" placeholder-class='placeholder' confirm-type='search'
- name="search" v-model="searchListData.orderNo" @confirm="searchSubmit"></input>
- </view>
- <view class="btn" @click="filterShow = true">
- <text class="iconfont icon-a-icon_filter1x"></text>
- </view>
- </view>
- <view :style="{ height: navHeight + 'px' }" v-if="isFixed"></view>
- <!-- #ifdef MP -->
- <view class="nav acea-row row-around row-middle" :style="{
- top:getHeight.barTop+getHeight.barHeight+'px'
- }" id="nav">
- <!-- #endif -->
- <!-- #ifndef MP -->
- <view class="nav acea-row row-around row-middle" id="nav">
- <!-- #endif -->
- <scroll-view scroll-x="true" class="scroll_view">
- <view class="item" :class="state == 'all' ? 'on' : ''" @click="changeStatus('all')" v-if="searchListData.type ==-1">
- 全部({{headerArr['all']!=undefined?headerArr['all']:0}})
- <image src="../static/adorn.png" v-if="state == 'all'"></image>
- </view>
- <view class="item" :class="state == 'await' ? 'on' : ''" @click="changeStatus('await')" v-if="searchListData.type != -1">
- 待接单
- <image src="../static/adorn.png" v-if="state == 'await'"></image>
- </view>
- <!--view class="item" :class="state == 'notShipped' ? 'on' : ''" @click="changeStatus('notShipped')">
- 待接单({{headerArr['notShipped']!=undefined?headerArr['notShipped']:0}})
- <image src="../static/adorn.png" v-if="state == 'notShipped'"></image>
- </view-->
- <view class="item" :class="state == 'pickUp' ? 'on' : ''" @click="changeStatus('pickUp')">
- 待取货({{headerArr['pickUp']!=undefined?headerArr['pickUp']:0}})
- <image src="../static/adorn.png" v-if="state == 'pickUp'"></image>
- </view>
- <view class="item" :class="state == 'delivery' ? 'on' : ''"
- @click="changeStatus('delivery')">
- 配送中({{headerArr['delivery']!=undefined?headerArr['delivery']:0}})
- <image src="../static/adorn.png" v-if="state == 'delivery'"></image>
- </view>
- <view class="item" :class="state == 'complete' ? 'on' : ''" @click="changeStatus('complete')">
- 已完成({{headerArr['complete']!=undefined?headerArr['complete']:0}})
- <image src="../static/adorn.png" v-if="state == 'complete'"></image>
- </view>
- <!--view class="item" :class="state == 'complete' ? 'on' : ''" @click="changeStatus('complete')">
- 已完成({{headerArr['complete']!=undefined?headerArr['complete']:0}})
- <image src="../static/adorn.png" v-if="state == 'complete'"></image>
- </view>
- <view class="item" :class="state == 'refunded' ? 'on' : ''" @click="changeStatus('refunded')">
- 已退款({{headerArr['refunded']!=undefined?headerArr['refunded']:0}})
- <image src="../static/adorn.png" v-if="state == 'refunded'"></image>
- </view>
- <view class="item" :class="state == 'deleted' ? 'on' : ''" @click="changeStatus('deleted')">
- 已删除({{headerArr['deleted']!=undefined?headerArr['deleted']:0}})
- <image src="../static/adorn.png" v-if="state == 'deleted'"></image>
- </view-->
- </scroll-view>
- </view>
- <view class="list" v-if="list.length">
- <view class="item" v-for="(item, index) in list" :key="index">
- <view class="order-num acea-row row-between-wrapper" @click="toDetail(item)">
- <view>
- <view class="title">
- <view class="type">{{orderType[item.orderType]}}</view>{{item.orderNo}}
- </view>
- </view>
- <view class="state">
- {{orderStatus[item.status]}}
- </view>
- </view>
- <view class="pos-order-goods">
- <view class="goods acea-row" @click="toDetail(item)">
- <!-- <scroll-view class="picTxt scroll-view" scroll-x="true"
- v-if="item.infoResponseList.length > 1">
- <view class="pictrue" v-for="(val, key) in item.infoResponseList" :key="key">
- <image :src="val.image" />
- </view>
- </scroll-view> -->
- <view class="picTxt">
- <view class="acea-row" >
- <view class="order-content">
- <view class="bold-size flex-y-center" style="padding: 10rpx 0;">
- <view class="icon-info"></view>
- <text>配送详情</text>
- </view>
- <view style="padding-bottom: 10rpx;position: relative;" id="myLineRef">
- <view class="line"></view>
- <view class="box-item">
- <view class="bold-size">
- <text class="order-icon">取</text>{{item.merName}}
- </view>
- </view>
- <text class="onBold-size"><text class="order-icon" style="opacity: 0">取</text>{{item.merAddress}}</text>
- </view>
- <view>
- <view class="box-item">
- <view class="bold-size">
- <text class="order-icon">送</text>{{item.userAddress}}
- </view>
- </view>
- <!--text class="onBold-size"><text class="order-icon" style="opacity: 0">送</text>{{remark}}</text-->
- </view>
- </view>
- </view>
- </view>
- <view class="money">
- 配送费 <baseMoney :money="item.deliveCharge" symbolSize="20" integerSize="32" decimalSize="20">
- </baseMoney>
- <view class="num">距离{{ item.distance }}km</view>
- <view class="map" @click="goMap(item)">
- <text class="iconfont icon-chakanditu"></text>
- <view class="map_text">查看地图</view>
- </view>
- </view>
-
- </view>
- </view>
- <view class="operation acea-row row-between-wrapper">
- <view class="more">
- </view>
- <view class="acea-row row-middle">
- <view v-if="item.status==1 || item.status==2" @click="cancel(item)" class="bnt on acea-row row-center-wrapper">取消订单</view>
- <view v-if="item.status==1" class="bnt on acea-row row-center-wrapper">联系商家</view>
- <view v-if="item.status==2" class="bnt on acea-row row-center-wrapper">联系客户</view>
- <view class="bnt primary" v-if="item.status==0"
- @click="receiving(item)">接单
- </view>
- <view class="bnt primary" v-if="item.status==1"
- @click="pickUp(item)">取货配送
- </view>
- <view class="bnt primary" v-if="item.status==2"
- @click="complete(item)">送达完成
- </view>
- </view>
- </view>
- </view>
- </view>
- <emptyPage v-else title="暂无订单~" :imgSrc="urlDomain+'crmebimage/presets/noShopper.png'"></emptyPage>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- <PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund"
- v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)"
- v-on:savePrice="savePrice" :status="status"></PriceChange>
- <view class="mask" v-if="filterShow" @click="filterShow=!filterShow"></view>
- <!-- #ifdef H5 -->
- <view class="filter-popup" :class="{ on: filterShow }">
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <view class="filter-popup" :class="{ on: filterShow }" :style="{
- top:getHeight.barTop+getHeight.barHeight+'px'}">
- <!-- #endif -->
- <view class="search-box">
- <view class="search acea-row row-middle">
- <text class="iconfont icon-ic_search"></text>
- <input class="input" placeholder='请输入要查询的订单' placeholder-style="font-size:28rpx" placeholder-class='placeholder'
- confirm-type='search' name="search" v-model="searchListData.orderNo"
- @confirm="searchSubmit"></input>
- </view>
- </view>
- <view class="content">
- <view class="item">
- <view class="title">按下单时间</view>
- <view class="acea-row list">
- <view class="cell" v-for="(item, index) in dateList" :key="index"
- :class="{ on: item.val == dateSelected }" @click="dateChange(item.val)">{{ item.label }}
- </view>
- </view>
- </view>
- <view class="item">
- <view class="title">按订单类型</view>
- <view class="acea-row list">
- <view class="cell" v-for="(item, index) in payList" :key="index"
- :class="{ on: item.val === searchListData.type }" @click="payChange(item.val)">
- {{ item.label }}
- </view>
- </view>
- </view>
- <view class="bottom">
- <view class="no_view" @click="resetBtn">重置</view>
- <view class="yes_view" @click="submitBtn">确定</view>
- </view>
- </view>
- </view>
- <view v-if="confirmShow" class="mask"></view>
- <view v-if="confirmShow" class="confirm-popup">
- <view class="title">确认付款</view>
- <view class="info">确认该订单用户已付款</view>
- <view class="acea-row btn-box">
- <view class="btn" @click="confirmShow = false">取消</view>
- <view class="btn primary" @click="offlinePay">确认</view>
- </view>
- </view>
- <view class="footerH"></view>
- <footerPage></footerPage>
- </view>
- </template>
- <script>
- // import UniDatetime from '../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- import Loading from '../components/Loading/index'
- import PriceChange from '../components/PriceChange/index.vue'
- import footerPage from '../components/footerPage/index.vue'
-
- import emptyPage from '@/components/emptyPage.vue'
- import baseMoney from '../components/BaseMoney.vue'
- // #ifdef MP || APP-PLUS
- import NavBar from '../components/NavBar.vue';
- // #endif
- import {
- isMoney
- } from '@/utils/validate.js';
- import {
- HTTP_REQUEST_URL
- } from '@/config/app';
- import {
- riderOrderAllList,riderOrderList,riderExpressOrderList,riderOrderReceiving,orderStatusNum,orderPickUp,orderComplete,orderCancel
- } from '@/api/rider.js';
- export default {
- name: "AdminOrderList",
- components: {
- Loading,
- PriceChange,
- footerPage,
- emptyPage,
- baseMoney,
- // #ifdef MP || APP-PLUS
- NavBar,
- // #endif
- },
- data() {
- return {
- urlDomain: this.$Cache.get("imgHost"),
- datetimerange: [],
- orderType: ['外卖','快递'],
- orderStatus: ['待接单', '待取货', '配送中', '已完成'],
- getHeight: this.$util.getWXStatusHeight(),
- iconColor: '#333333',
- isScrolling: false,
- top: 0,
- navHeight: 0,
- isFixed: false,
- filterShow: false,
- current: "",
- change: false,
- types: 0,
- list: [],
- loaded: false,
- loading: false,
- orderInfo: {},
- status: "",
- state: 'all',
- isRefund: 0, //1是仅退款;0是退货退款
- //imgHost: HTTP_REQUEST_URL,
- dateSelected: '1',
- dateList: [{
- label: '全部',
- val: '1',
- },
- {
- label: '今天',
- val: '2',
- },
- {
- label: '最近7天',
- val: '3',
- },
- {
- label: '本周',
- val: '4',
- },
- ],
- payList: [
- {
- label: '全部订单',
- val: '',
- },
- {
- label: '外卖订单',
- val: 0,
- },
- {
- label: '待取快递订单',
- val: 1,
- }
- // {
- // label: '拼团订单',
- // val: 2,
- // }
- ],
- confirmOrder: {},
- confirmShow: false,
- searchListData: {
- dateLimit: '',
- limit: 10,
- merId: '',
- orderNo: '',
- page: 1,
- status: 'await',
- type: 1,
- latitude: uni.getStorageSync('user_latitude'),
- longitude: uni.getStorageSync('user_longitude'),
- },
- headerArr: {},
- totalPage: '',
- };
- },
- computed: mapGetters(['isLogin']),
- onLoad(options) {
- this.state = options.type ? options.type : 'await';
- this.searchListData.status = options.type ? options.type : 'await';
- this.searchListData.type = options.orderType ? options.orderType : -1;
- },
- // created() {
- // this.getInitList()
- // this.statusHeader()
- // },
- onShow() {
- if (this.isLogin) {
- this.searchListData.page=1
- this.getInitList()
- this.statusHeader()
- } else {
- toLogin();
- }
- },
- methods: {
- //订单表头数量
- statusHeader() {
- orderStatusNum(this.searchListData).then(res => {
- this.headerArr = res.data
- })
- },
- // 订单搜索
- searchSubmit() {
- this.searchListData.page=1
- this.getInitList()
- this.statusHeader()
- },
- //订单列表
- getInitList(type) {
- this.loading=true;
- //let api=riderOrderList;
- let api=this.searchListData.type==0?riderOrderList:(this.searchListData.type==1?riderExpressOrderList:riderOrderAllList);
- api(this.searchListData).then(res => {
- //下拉触底
- if (type == 'bottom') {
- this.list = this.list.concat(res.data.list)
- } else {
- this.list = res.data.list
- }
- this.totalPage = res.data.totalPage
- }).catch(err=>{
- this.$util.Tips({
- title: err
- })
- })
- this.loading=false;
- },
- toDetail(item) {
- uni.navigateTo({
- url: this.searchListData.type==1?`/pages/rider_index/express/detail?orderInfo=${JSON.stringify(item)}`:`/pages/rider_index/order/detail?orderInfo=${JSON.stringify(item)}`
- })
-
-
- },
- //查看内置地图
- goMap(item) {
- let that = this;
- let latitude=item.status==1 || item.status==0?item.merLatitude:item.userLatitude;
- let longitude=item.status==1 || item.status==0?item.merLongitude:item.userLongitude;
- let merName=item.status==1 || item.status==0?item.merName:item.userName;
- let address=item.status==1 || item.status==0?item.merAddress:item.userAddress;
- //#ifdef H5
- if (that.$wechat.isWeixin() === true) {
- that.$wechat.seeLocation({
- latitude: parseFloat(latitude),
- longitude: parseFloat(longitude),
- name: merName,
- address: address,
- }).then(res => {
- console.log('success');
- })
- } else {
- //#endif
- uni.openLocation({
- latitude: parseFloat(latitude),
- longitude: parseFloat(longitude),
- scale: 8,
- name: merName,
- address: address,
- success: function(res) {
- that.go_map = true
- },
- });
- // #ifdef H5
- }
- //#endif
- },
- //发送货
- goDelivery(item) {
- if (item.refundStatus == 1) return this.$util.Tips({
- title: '请处理售后,再操作',
- });
- uni.navigateTo({
- url: `/pages/admin/order/send?orderNo=${item.orderNo}`
- })
- },
- // 商品操作
- modify: function(item, status, type) {
- this.change = true;
- this.status = status.toString();
- this.orderInfo = item;
- if (status == 2) {
- this.isRefund = type
- }
- },
- //接单
- receiving(item) {
- riderOrderReceiving(item).then(res => {
- if (res.code == 200) {
- setTimeout(() => {
- this.statusHeader();
- this.getInitList();
- }, 50)
- return this.$util.Tips({
- title: '接单成功'
- })
- } else {
- self.$util.Tips({
- title: res.message
- });
- }
- })
- },
- //取消
- cancel(item) {
- orderCancel(item.orderNo).then(res => {
- if (res.code == 200) {
- setTimeout(() => {
- this.statusHeader();
- this.getInitList();
- }, 50)
- return this.$util.Tips({
- title: '取消成功'
- })
- } else {
- self.$util.Tips({
- title: res.message
- });
- }
- })
- },
- //取货
- pickUp(item) {
- orderPickUp(item.orderNo).then(res => {
- if (res.code == 200) {
- setTimeout(() => {
- this.statusHeader();
- this.getInitList();
- }, 50)
- return this.$util.Tips({
- title: '取货完成,请尽快安排配送'
- })
- } else {
- self.$util.Tips({
- title: res.message
- });
- }
- })
- },
- //收货完成
- complete(item) {
- orderComplete(item.orderNo).then(res => {
- if (res.code == 200) {
- setTimeout(() => {
- this.statusHeader();
- this.getInitList();
- }, 50)
- return this.$util.Tips({
- title: '配送完成'
- })
- } else {
- self.$util.Tips({
- title: res.message
- });
- }
- })
- },
- changeclose: function(msg) {
- this.change = msg;
- },
- async savePrice(opt) {
- if (!opt.remark) {
- return this.$util.Tips({
- title: '请输入备注'
- })
- } else {
- this.toMark(this.orderInfo.orderNo, opt.remark)
- }
- },
- //备注
- toMark(orderNo, remark) {
- employeeOrderMark({
- orderNo,
- remark
- }).then(res => {
- res.code == 200 && (this.change = false);
- return this.$util.Tips({
- title: '备注成功'
- })
- })
- },
- // 导航切换
- changeStatus(val) {
- if (this.state != val) {
- this.state = val;
- // this.where.status = val == -1 ? '' : val;
- this.searchListData.status = val
- this.searchListData.page = 1
- this.searchListData={...this.searchListData}
- this.getInitList()
- }
- },
- dateChange(value) {
- if (value == 1) {
- this.searchListData.dateLimit = ''
- this.dateSelected = value;
- return
- } else if (value == 2) {
- this.searchListData.dateLimit = 'today'
- } else if (value == 3) {
- this.searchListData.dateLimit = 'lately7'
- } else if (value == 4) {
- this.searchListData.dateLimit = 'week'
- }
- this.dateSelected = value;
- },
- payChange(val) {
- this.searchListData.type = val;
- },
- // 点击确认按钮
- submitBtn() {
- this.filterShow = false;
- this.searchListData.page=1
- this.getInitList()
- this.statusHeader()
- },
- //点击重置按钮
- resetBtn() {
- this.searchListData.orderNo=''
- this.searchListData.dateLimit = ''
- this.searchListData.type = '';
- this.dateSelected = '1'
- }
- },
- onReachBottom() {
- this.searchListData.page += 1
- this.totalPage >= this.searchListData.page && this.getInitList('bottom')
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '../style/admin_order.scss';
- </style>
- <style scoped lang="scss">
- .map {
- text-align: center;
- padding-left: 36rpx;
- position: relative;
- @include main_color(theme);
-
- &::before {
- content: '';
- display: inline-block;
- width: 2rpx;
- height: 42rpx;
- background-color: #DDDDDD;
- position: absolute;
- left: 0;
- top: 18rpx;
- }
-
- .iconfont {
- color: var(--view-theme);
- }
-
- .map_text {
- color: var(--view-theme);
- }
- }
- .order-item {
- background-color: #fff;
- border-radius: 23rpx;
- padding: 19rpx 38rpx;
- }
- .order-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 17rpx;
- border-bottom: 2rpx dashed #D6D7DC;
- }
- .bold-size {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-weight: 500;
- font-size: 27rpx;
- color: #141414;
- z-index: 9999;
- }
- .onBold-size {
- font-weight: 400;
- font-size: 23rpx;
- color: #999999;
- }
- .order-content {
- padding: 10rpx 0 15rpx 0;
- .box-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10rpx;
- }
- .order-info {
- width: 100%;
- background: #F8F9FB;
- padding: 19rpx 38rpx 45rpx 19rpx;
- .store-name {
- font-weight: 600;
- font-size: 27rpx;
- color: #141414;
- }
- .scroll-container {
- display: flex;
- flex-wrap: nowrap;
- margin: 20rpx 0;
- overflow-x: auto;
- /* 允许水平滚动 */
- white-space: nowrap;
- /* 防止项目换行 */
- -webkit-overflow-scrolling: touch;
- /* 在iOS上平滑滚动 */
- .item {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-right: 19rpx;
- image {
- width: 115rpx;
- height: 115rpx;
- }
- text {
- font-weight: 400;
- font-size: 21rpx;
- color: #141414;
- margin-top: 9rpx;
- }
- }
- }
- .container2 {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-weight: 500;
- font-size: 21rpx;
- color: #141414;
- view {
- display: flex;
- align-items: center;
- }
- .image2 {
- width: 42rpx;
- height: 42rpx;
- }
- }
- }
- }
- .order-dis {
- font-weight: 400;
- font-size: 23rpx;
- color: #141414;
- }
- .order-icon {
- display: inline-block;
- margin-left: 10rpx;
- margin-right: 20rpx;
- padding: 5rpx 10rpx;
- font-weight: 400;
- font-size: 23rpx;
- color: #FFFFFF;
- border-radius: 50%;
- background-color: $bg-color-primary;
- }
- .order-bottom {
- border-top: 2rpx dashed #D6D7DC;
- .bottom-but {
- padding: 39rpx 67rpx;
- .sub {
- width: 100%;
- background-color: $bg-color-primary;
- font-weight: 500;
- font-size: 31rpx;
- color: #FFFFFF;
- padding: 17rpx 0;
- }
- }
- }
- .icon-info {
- width: 8rpx;
- height: 31rpx;
- background: $bg-color-primary;
- margin-right: 15rpx;
- }
- .line {
- z-index: 1;
- position: absolute;
- left: 28rpx;
- width: 1rpx;
- height: 100%;
- border-left: 1rpx dashed $bg-color-primary;
- }
- </style>
|