123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650 |
- <template>
- <view class="pos-order-list" ref="container">
- <view class="searchCon acea-row row-center-wrapper">
- <view class="search acea-row row-middle">
- <text class="iconfont icon-sousuo4"></text>
- <input class="inputs" placeholder='搜索订单号、收货人名称、手机号' placeholder-class='placeholder' confirm-type='search' name="search"
- v-model="where.keyword" @confirm="searchSubmit"></input>
- </view>
- </view>
- <view class="nav acea-row row-around row-middle">
- <view class="item" :class="where.status == 0 ? 'on' : ''" @click="changeStatus(0)">
- 待付款
- </view>
- <view class="item" :class="where.status == 1 ? 'on' : ''" @click="changeStatus(1)">
- 待发货
- </view>
- <view class="item" :class="where.status == 2 ? 'on' : ''" @click="changeStatus(2)">
- 待收货
- </view>
- <view class="item" :class="where.status == 3 ? 'on' : ''" @click="changeStatus(3)">
- 待评价
- </view>
- <view class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">
- 已完成
- </view>
- <view class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">
- 退款
- </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>订单号:{{ item.order_id }}</view>
- <view class="time">下单时间:{{ item.add_time }}</view>
- </view>
- <view class="state" :class="(item.refund_status==0 && where.status != 0 && item.refund.length)?'on':''">
- {{item.refund_status==1?'退款中':item.refund_status==2?'已退款':item.refund_status==3?'拒绝退款':item.status_name.status_name}}
- <text v-if="item.refund_status==0 && where.status != 0 && item.refund.length" >{{item.is_all_refund?',退款中':',部分退款中'}}</text>
- </view>
- </view>
- <view class="pos-order-goods" v-for="(val, key) in item._info" :key="key">
- <view class="goods acea-row row-between row-top" @click="toDetail(item)">
- <view class="picTxt acea-row row-between-wrapper">
- <view class="pictrue">
- <image :src="val.cart_info.productInfo.attrInfo?val.cart_info.productInfo.attrInfo.image:val.cart_info.productInfo.image" />
- </view>
- <view class="text acea-row row-between row-column">
- <view class="info line2">
- <text v-if="val.cart_info.is_gift == 1" class="label">[赠品]</text>
- {{ val.cart_info.productInfo.store_name }}
- </view>
- <view class="attr" v-if="val.cart_info.productInfo.attrInfo">
- {{ val.cart_info.productInfo.attrInfo.suk }}
- </view>
- </view>
- </view>
- <view class="money">
- <view class="x-money">¥{{ val.cart_info.productInfo.attrInfo?val.cart_info.productInfo.attrInfo.price:val.cart_info.productInfo.price }}</view>
- <view class="num">x{{ val.cart_info.cart_num }}</view>
- <!-- <view class="y-money">
- ¥{{ val.cart_info.productInfo.ot_price }}
- </view> -->
- <view class="info" v-if="val.cart_info.refund_num && item._status._type !=-2">{{val.cart_info.refund_num}}件退款中</view>
- </view>
- </view>
- </view>
- <view class="public-total">
- 共{{ item.total_num }}件商品,实付款
- <span class="money">¥{{ item.pay_price }}</span> ( 邮费 ¥{{
- item.pay_postage
- }}
- )
- </view>
- <view class="operation acea-row row-between-wrapper">
- <view class="more">
- <!-- <view class="iconfont icon-gengduo" @click="more(index)"></view>-->
- <!-- <view class="order" v-show="current === index">-->
- <!-- <view class="items">-->
- <!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
- <!-- </view>-->
- <!-- <view class="arrow"></view>-->
- <!-- </view>-->
- </view>
- <view class="acea-row row-middle">
- <view class="bnt" :class="openErp?'on':''" @click="modify(item, 0)" v-if="where.status == 0">
- 一键改价
- </view>
- <view class="bnt" @click="modify(item, 1)">订单备注</view>
- <!-- <view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refund_status === 1">
- 立即退款
- </view> -->
- <view class="bnt" :class="openErp?'on':''" @click="modify(item, 2, 1)" v-if="(item.refund_type == 0 || item.refund_type == 1 || item.refund_type == 5 ) && where.status == -3 && parseFloat(item.pay_price) >= 0">
- 立即退款
- </view>
- <view class="bnt" :class="openErp?'on':''" @click="modify(item, 2, 0)" v-if="where.status == -3 && item.refund_type == 2">同意退货</view>
- <view class="wait" :class="openErp?'on':''" v-if="where.status == -3 && item.refund_type == 4">待用户发货</view>
- <view class="bnt cancel" :class="openErp?'on':''" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">
- 确认付款
- </view>
- <view class="bnt" :class="openErp?'on':''" v-if="where.status == 1 && item.shipping_type === 1 && (item.pinkStatus === null || item.pinkStatus === 2)" @click="goDelivery(item)">去发货
- </view>
- </view>
- </view>
- </view>
- </view>
- <view v-else class="nothing">
- <image v-if="!loading" :src="imgHost + '/statics/images/no-thing.png'" alt="">
- <view v-if="!loading">暂无订单</view>
- </view>
- <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>
- </template>
- <script>
- import {
- getAdminOrderList,
- setAdminOrderPrice,
- setAdminOrderRemark,
- setAdminRefundRemark,
- setOfflinePay,
- setOrderRefund,
- orderRefundAgree,
- adminRefundList
- } from "@/api/admin";
- import { erpConfig } from "@/api/esp.js";
- import Loading from '@/components/Loading/index'
- import PriceChange from '../components/PriceChange/index.vue'
- import { isMoney } from '@/utils/validate.js';
- import {HTTP_REQUEST_URL} from '@/config/app';
- export default {
- name: "AdminOrderList",
- components: {
- Loading,
- PriceChange
- },
- data() {
- return {
- openErp:false,
- current: "",
- change: false,
- types: 0,
- where: {
- page: 1,
- limit: 10,
- status: 0,
- keyword:''
- },
- list: [],
- loaded: false,
- loading: false,
- orderInfo: {},
- status: "",
- isRefund:0, //1是仅退款;0是退货退款
- imgHost:HTTP_REQUEST_URL
- };
- },
- onLoad(option) {
- let type = option.types;
- this.where.status = type;
- this.getErpConfig();
- },
- onShow(){
- this.init();
- },
- methods: {
- statusChange(e){
- this.status = e;
- },
- goDelivery(item){
- if(this.openErp) return
- uni.navigateTo({
- url:'/pages/admin/delivery/index?id='+item.order_id+'&listId='+item.id+'&totalNum='+item.total_num+'&orderStatus='+item._status+'&comeType=1&productType='+item.product_type
- })
- },
- getErpConfig(){
- erpConfig().then(res=>{
- this.openErp = res.data.open_erp;
- }).catch(err=>{
- this.$util.Tips({
- title: err
- })
- })
- },
- // 获取数据
- getIndex: function() {
- let that = this;
- if (that.loading || that.loaded) return;
- that.loading = true;
- let obj = '';
- if(this.where.status == -3){
- obj = adminRefundList(that.where);
- }else{
- obj = getAdminOrderList(that.where);
- }
- obj.then(
- res => {
- that.loading = false;
- that.loaded = res.data.length < that.where.limit;
- that.list.push.apply(that.list, res.data);
- that.where.page = that.where.page + 1;
- },
- err => {
- that.$util.Tips({
- title: err
- })
- }
- );
- },
- // 初始化
- init: function() {
- this.list = [];
- this.where.page = 1;
- this.loaded = false;
- this.loading = false;
- this.getIndex();
- this.current = "";
- },
- searchSubmit(){
- this.init();
- },
- // 导航切换
- changeStatus(val) {
- if (this.where.status != val) {
- this.where.status = val;
- this.init();
- }
- },
- // 商品操作
- modify: function(item, status,type) {
- if(this.openErp && status !=1) return
- this.change = true;
- this.status = status.toString();
- this.orderInfo = item;
- if(status==2){
- this.isRefund = type
- }
- },
- changeclose: function(msg) {
- this.change = msg;
- },
- objOrderRefund(data){
- let that = this;
- setOrderRefund(data).then(
- res => {
- that.change = false;
- that.$util.Tips({title: res.msg});
- that.init();
- },
- err => {
- that.change = false;
- that.$util.Tips({title: err});
- }
- );
- },
- async savePrice(opt) {
- let that = this,
- data = {},
- price = opt.price,
- refund_price = opt.refund_price,
- refund_status = that.orderInfo.refund_status,
- remark = opt.remark;
- data.order_id = that.orderInfo.order_id;
- if (that.status == 0) {
- if(!isMoney(price)){
- return that.$util.Tips({title: '请输入正确的金额'});
- }
- data.price = price;
- setAdminOrderPrice(data).then(
- res => {
- that.change = false;
- that.$util.Tips({
- title:'改价成功',
- icon:'success'
- })
- that.init();
- },
- err => {
- that.change = false;
- that.$util.Tips({
- title:'改价失败',
- icon:'none'
- })
- }
- );
- } else if (that.status == 2) {
- if(this.isRefund){
- if(!isMoney(refund_price)){
- return that.$util.Tips({title: '请输入正确的金额'});
- }
- data.price = refund_price;
- data.type = opt.type;
- this.objOrderRefund(data);
- // setOrderRefund(data).then(
- // res => {
- // that.change = false;
- // that.$util.Tips({title: res.msg});
- // that.init();
- // },
- // err => {
- // that.change = false;
- // that.$util.Tips({title: err});
- // }
- // );
- }else{
- if(opt.type == 1){
- orderRefundAgree(this.orderInfo.id).then(res=>{
- that.change = false;
- that.$util.Tips({
- title: res.msg
- });
- that.init();
- }).catch(err=>{
- that.change = false;
- that.$util.Tips({
- title: err
- });
- })
- }
- // else{
- // data.type = opt.type;
- // data.refuse_reason = opt.refuse_reason;
- // this.objOrderRefund(data);
- // }
- }
- } else if(that.status == 8){
- data.type = opt.type;
- data.refuse_reason = opt.refuse_reason;
- this.objOrderRefund(data);
- } else {
- if(!remark){
- return this.$util.Tips({
- title:'请输入备注'
- })
- }
- data.remark = remark;
- let obj = '';
- if(that.where.status == -3){
- obj = setAdminRefundRemark(data);
- }else{
- obj = setAdminOrderRemark(data);
- }
- obj.then(
- res => {
- that.change = false;
- this.$util.Tips({
- title:res.msg,
- icon:'success'
- })
- that.init();
- },
- err => {
- that.change = false;
- that.$util.Tips({title: err});
- }
- );
- }
- },
- toDetail(item){
- uni.navigateTo({
- url:`/pages/admin/orderDetail/index?id=${item.order_id}&types=${this.where.status}`
- })
- },
- offlinePay: function(item) {
- if(this.openErp) return
- setOfflinePay({ order_id: item.order_id }).then(
- res => {
- this.$util.Tips({title:res.msg,icon:"success"});
- this.init();
- },
- error => {
- this.$util.Tips(error);
- }
- );
- }
- },
- onReachBottom() {
- this.getIndex()
- }
- }
- </script>
- <style lang="scss">
- .pos-order-list{
- padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
- padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
- }
- .searchCon{
- position: relative;
- z-index: 9;
- background-color: #fff;
- height: 88rpx;
- width: 100%;
- border-bottom: 1px solid #EBEEF5;
- .search{
- width: 690rpx;
- height: 64rpx;
- background: #F5F5F5;
- border-radius: 12rpx;
- padding: 0 24rpx;
- .iconfont{
- color: #999999;
- margin-right: 12rpx;
- }
- .inputs{
- width: 590rpx;
- font-size: 26rpx;
- }
- .placeholder{
- font-size: 26rpx;
- color: #ccc;
- }
- }
- }
- .pos-order-list .nav {
- width: 100%;
- height: 96upx;
- background-color: #fff;
- font-size: 30upx;
- color: #282828;
- position:sticky;
- top: 0;
- left: 0;
- z-index: 99;
- }
- .pos-order-list .nav .item.on {
- color: #2291f8;
- }
- .pos-order-list .list {
- margin-top: 24upx;
- }
-
- .pos-order-list .nothing{
- margin-top: 120upx;
- text-align: center;
- color: #cfcfcf;
- }
- .pos-order-list .list .item {
- background-color: #fff;
- width: 100%;
- }
- .pos-order-list .list .item~.item {
- margin-top: 24upx;
- }
- .pos-order-list .list .item .order-num {
- height: 124upx;
- border-bottom: 1px solid #eee;
- font-size: 30upx;
- font-weight: bold;
- color: #282828;
- padding: 0 30upx;
- }
-
- .pos-order-list .list .item .order-num .state{
- color: #2291f8;
- font-weight: normal;
- }
-
- .pos-order-list .list .item .order-num .state.on{
- font-size: 24rpx;
- width: 150rpx;
- text-align: right;
- }
- .pos-order-list .list .item .order-num .time {
- font-size: 26upx;
- font-weight: normal;
- color: #999;
- }
- .pos-order-list .list .item .operation {
- padding: 20upx 30upx;
- margin-top: 3upx;
- }
- .pos-order-list .list .item .operation .more {
- position: relative;
- }
- .pos-order-list .list .item .operation .icon-gengduo {
- font-size: 50upx;
- color: #aaa;
- }
- .pos-order-list .list .item .operation .order .arrow {
- width: 0;
- height: 0;
- border-left: 11upx solid transparent;
- border-right: 11upx solid transparent;
- border-top: 20upx solid #e5e5e5;
- position: absolute;
- left: 15upx;
- bottom: -18upx;
- }
- .pos-order-list .list .item .operation .order .arrow:before {
- content: '';
- width: 0;
- height: 0;
- border-left: 7upx solid transparent;
- border-right: 7upx solid transparent;
- border-top: 20upx solid #fff;
- position: absolute;
- left: -7upx;
- bottom: 0;
- }
- .pos-order-list .list .item .operation .order {
- width: 200upx;
- background-color: #fff;
- border: 1px solid #eee;
- border-radius: 10upx;
- position: absolute;
- top: -100upx;
- z-index: 9;
- }
- .pos-order-list .list .item .operation .order .items {
- height: 77upx;
- line-height: 77upx;
- text-align: center;
- }
- .pos-order-list .list .item .operation .order .items~.items {
- border-top: 1px solid #f5f5f5;
- }
- .pos-order-list .list .item .operation .bnt {
- font-size: 28upx;
- color: #5c5c5c;
- width: 170upx;
- height: 60upx;
- border-radius: 30upx;
- border: 1px solid #bbb;
- text-align: center;
- line-height: 60upx;
- &.on{
- color: #c5c8ce!important;
- background-color: #f7f7f7!important;
- border-color: #dcdee2!important;
- }
- }
- .pos-order-list .list .item .operation .bnt~.bnt {
- margin-left: 14upx;
- }
-
- .pos-order-list .list .item .operation .wait{
- margin-left: 30rpx;
- }
- .pos-order-goods {
- padding: 0 30upx;
- background-color: #fff;
- }
- .pos-order-goods .goods {
- padding: 28rpx 0;
- }
- .pos-order-goods .goods~.goods {
- border-top: 1px dashed #e5e5e5;
- }
- .pos-order-goods .goods .picTxt {
- width: 515upx;
- }
- .pos-order-goods .goods .picTxt .pictrue {
- width: 130upx;
- height: 130upx;
- }
- .pos-order-goods .goods .picTxt .pictrue image {
- width: 100%;
- height: 100%;
- border-radius: 6upx;
- }
- .pos-order-goods .goods .picTxt .text {
- width: 365upx;
- height: 130upx;
- }
- .pos-order-goods .goods .picTxt .text .info {
- width: 100%;
- font-size: 28upx;
- color: #282828;
- }
-
- .pos-order-goods .goods .picTxt .text .info .label{
- color: #ff4c3c;
- }
- .pos-order-goods .goods .picTxt .text .attr {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-size: 24upx;
- color: #999;
- }
- .pos-order-goods .goods .money {
- width: 164upx;
- text-align: right;
- font-size: 28upx;
- }
-
- .pos-order-goods .goods .money .info{
- margin-top: 18rpx;
- font-size: 24rpx;
- }
- .pos-order-goods .goods .money .x-money {
- color: #282828;
- }
- .pos-order-goods .goods .money .num {
- color: #ff9600;
- margin: 5upx 0;
- }
- .pos-order-goods .goods .money .y-money {
- color: #999;
- text-decoration: line-through;
- }
- .public-total {
- font-size: 28upx;
- color: #282828;
- border-top: 1px solid #eee;
- height: 92upx;
- line-height: 92upx;
- text-align: right;
- padding: 0 30upx;
- background-color: #fff;
- }
- .public-total .money {
- color: #ff4c3c;
- }
- </style>
|