初始上传
This commit is contained in:
686
addon/cashier/source/os/pages/order/orderlist.vue
Executable file
686
addon/cashier/source/os/pages/order/orderlist.vue
Executable file
@@ -0,0 +1,686 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="goodslist">
|
||||
<view class="goodslist-box">
|
||||
<view class="goodslist-left">
|
||||
<view class="goods-title">
|
||||
订单管理
|
||||
<view class="screen-btn" @click="showScreen = !showScreen">{{showScreen ? '关闭':'筛选'}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="screen-content" v-if="showScreen">
|
||||
<scroll-view scroll-y="true" class="screen-box">
|
||||
<view class="screen-item">
|
||||
<view class="tit">创建时间</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="(!conditions.start_time_val && !conditions.end_time_val ) && conditions.time_type == '' ? 'active' : ''" @click="changeCondition('time_type','')">全部</view>
|
||||
<view class="value" :class="(!conditions.start_time_val && !conditions.end_time_val ) && conditions.time_type == '7' ? 'active' : ''" @click="changeCondition('time_type','7')">近7天</view>
|
||||
<view class="value" :class="(!conditions.start_time_val && !conditions.end_time_val ) && conditions.time_type == '30' ? 'active' : ''" @click="changeCondition('time_type','30')">近30天</view>
|
||||
<view class="time-range">
|
||||
<uni-datetime-picker class="time-value" :inputDisabled="false" v-model="conditions.start_time_val" type="datetime" placeholder="开始时间" />
|
||||
<view class="line">-</view>
|
||||
<uni-datetime-picker class="time-value" :inputDisabled="false" v-model="conditions.end_time_val" type="datetime" placeholder="结束时间" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="currOrderList == 'online'">
|
||||
<view class="screen-item">
|
||||
<view class="tit">订单类型</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.order_type == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.order_type_list" :key="vIndex" @click="changeCondition('order_type',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen-item">
|
||||
<view class="tit">订单状态</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.order_status == '' ? 'active' : ''" @click="changeCondition('order_status','')">全部</view>
|
||||
<view class="value" :class="conditions.order_status == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.order_status_list" :key="vIndex" @click="changeCondition('order_status',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen-item">
|
||||
<view class="tit">付款方式</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.pay_type == '' ? 'active' : ''" @click="changeCondition('pay_type','')">全部</view>
|
||||
<view class="value" :class="conditions.pay_type == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.pay_type_list" :key="vIndex" @click="changeCondition('pay_type',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen-item">
|
||||
<view class="tit">订单来源</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.order_from == '' ? 'active' : ''" @click="changeCondition('order_from','')">全部</view>
|
||||
<view class="value" :class="conditions.order_from == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.order_from_list" :key="vIndex" @click="changeCondition('order_from',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="screen-item">
|
||||
<view class="tit">订单类型</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.order_type == 'all' ? 'active' : ''" @click="changeCondition('order_type','all')">全部</view>
|
||||
<view class="value" :class="conditions.order_type == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.cashier_order_type_list" :key="vIndex" @click="changeCondition('order_type',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen-item">
|
||||
<view class="tit">订单状态</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.order_status == '' ? 'active' : ''" @click="changeCondition('order_status','')">全部</view>
|
||||
<view class="value" :class="conditions.order_status == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.cashier_order_status_list" :key="vIndex" @click="changeCondition('order_status',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="screen-item">
|
||||
<view class="tit">付款方式</view>
|
||||
<view class="values">
|
||||
<view class="value" :class="conditions.pay_type == '' ? 'active' : ''" @click="changeCondition('pay_type','')">全部</view>
|
||||
<view class="value" :class="conditions.pay_type == vItem.type ? 'active' : ''" v-for="(vItem,vIndex) in orderConditionList.cashier_pay_type_list" :key="vIndex" @click="changeCondition('pay_type',vItem.type)">{{vItem.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="search-btn">
|
||||
<view class="btn" @click="resetCondition()">重置</view>
|
||||
<view class="btn" @click="searchOrder()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!showScreen" class="goods-search">
|
||||
<view class="search">
|
||||
<text class="iconfont icon31sousuo" @click="search('')"></text>
|
||||
<input type="text" v-model="search_text" @keydown.enter="search('enter')" placeholder="输入订单号/商品名称/收货人姓名/手机号/留言/备注" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!showScreen" class="order-type-list">
|
||||
<view class="class-item" :class="{ active: currOrderList == 'cashier' }" @click="selectOrderList('cashier')">收银订单</view>
|
||||
<view class="class-item" :class="{ active: currOrderList == 'online' }" @click="selectOrderList('online')">商城订单</view>
|
||||
</view>
|
||||
<block v-if="!showScreen && !one_judge && order_list.length > 0">
|
||||
<scroll-view :scroll-top="scrollTop" @scroll="scroll" scroll-y="true" class="goods-list-scroll" :show-scrollbar="false" @scrolltolower="getOrderListFn">
|
||||
<view class="item" @click="getOrderDetailFn(item.order_id, index)" v-for="(item, index) in order_list" :key="index" :class="index == selectGoodsKeys ? 'itemhover' : ''">
|
||||
<view class="title">
|
||||
<view>订单编号:{{ item.order_no }}</view>
|
||||
<view v-if="item.order_type == 5">{{ item.cashier_order_type_name }}</view>
|
||||
<view v-else="item.order_type != 5">{{ item.order_type_name }}</view>
|
||||
</view>
|
||||
<view class="total-money-num">
|
||||
<view class="flex-shrink-0">{{ item.order_status_name }}</view>
|
||||
<view class="member-info">
|
||||
<view>买家:</view>
|
||||
<view class="member-info-name" :title="item.nickname" v-if="item.member_id">{{ item.nickname }}</view>
|
||||
<view class="member-info-name" v-else>散客</view>
|
||||
</view>
|
||||
|
||||
<view class="box">
|
||||
<view>实付金额</view>
|
||||
<view>¥{{ item.pay_money }}</view>
|
||||
</view>
|
||||
<view class="refund-state flex-shrink-0" v-if="parseFloat(item.refund_money) > 0">退款</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<view class="notYet" v-else-if="!showScreen && !one_judge && order_list.length == 0">暂无数据</view>
|
||||
|
||||
</view>
|
||||
<view class="goodslist-right" v-show="type == 'detail'">
|
||||
<view class="goods-title">订单详情</view>
|
||||
<view class="order-information tab-wrap" v-show="!one_judge">
|
||||
<view class="tab-head">
|
||||
<text v-for="(item, index) in tabObj.list" :key="index" :class="{ active: tabObj.index == item.value }" @click="tabObj.index = item.value" v-if="(item.value == 3 && order_detail.order_log && order_detail.order_log.length > 0) || item.value != 3">
|
||||
{{ item.name }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="tab-content" v-if="JSON.stringify(order_detail) != '{}'">
|
||||
<view class="other-information" v-if="tabObj.index == 1">
|
||||
<view class="item-info">
|
||||
<view class="info-tit">收货信息</view>
|
||||
<view class="infos">
|
||||
<view class="info">收货人:{{order_detail.name}}</view>
|
||||
<view class="info">收货电话:{{order_detail.mobile}}</view>
|
||||
<view class="info">收货地址:{{order_detail.full_address}}{{ order_detail.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="info-tit">用户信息</view>
|
||||
<view class="infos">
|
||||
<view class="info" v-if="order_detail.member_id">
|
||||
用户昵称:{{ order_detail.nickname }}
|
||||
<text class="look" @click="viewMember()">查看会员</text>
|
||||
</view>
|
||||
<view class="info" v-else>用户昵称:散客</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="info-tit">订单信息</view>
|
||||
<view class="infos">
|
||||
<view class="info">订单类型:{{ order_detail.order_type_name }}</view>
|
||||
<view class="info">订单状态:{{ order_detail.order_status_name }}</view>
|
||||
<view class="info">{{ order_detail.order_type == 2 || order_detail.order_type == 3 ? ( order_detail.order_type == 2 ? '买家预计上门时间:' : '买家要求送达时间:' ) : ''}}{{ ( order_detail.order_type == 2 || order_detail.order_type == 3 ) ? order_detail.buyer_ask_delivery_time : '' }}</view>
|
||||
<view class="info">订单编号:{{order_detail.order_no}}</view>
|
||||
<view class="info">外部交易号:{{order_detail.out_trade_no}}</view>
|
||||
<view class="info">订单来源:{{order_detail.order_from_name}}</view>
|
||||
<view class="info">创建时间:{{$util.timeFormat(order_detail.create_time)}}</view>
|
||||
<view class="info">支付时间:{{$util.timeFormat(order_detail.pay_time)}}</view>
|
||||
<view class="info">支付方式:{{order_detail.pay_type_name}}</view>
|
||||
<view class="info">商品总价:¥{{order_detail.goods_money}}</view>
|
||||
<view class="info">店铺优惠:-¥{{order_detail.promotion_money}}</view>
|
||||
<view class="info">订单减免:-¥{{order_detail.reduction}}</view>
|
||||
<view class="info">优惠券:-¥{{order_detail.coupon_money}}</view>
|
||||
<view class="info">积分抵扣:-¥{{order_detail.point_money}}</view>
|
||||
<view class="info" v-show="order_detail.online_money > 0">线上支付:¥{{ order_detail.online_money | moneyFormat }}</view>
|
||||
<view class="info" v-show="order_detail.cash > 0">现金支付:¥{{ order_detail.cash | moneyFormat }}</view>
|
||||
<view class="info" v-show="order_detail.cash_change > 0">找零:-¥{{ order_detail.cash_change | moneyFormat }}</view>
|
||||
<view class="info" v-show="parseFloat(order_detail.balance_money) > 0">余额抵扣:¥{{ $util.moneyFormat(order_detail.balance_money) }}</view>
|
||||
<view class="info" v-show="order_detail.own_wechatpay > 0">个人微信收款:¥{{ order_detail.own_wechatpay | moneyFormat }}</view>
|
||||
<view class="info" v-show="order_detail.own_alipay > 0">个人支付宝收款:¥{{ order_detail.own_alipay | moneyFormat }}</view>
|
||||
<view class="info" v-show="order_detail.own_pos > 0">个人POS收款:¥{{ order_detail.own_pos | moneyFormat }}</view>
|
||||
<view class="info" >实付金额:¥{{ order_detail.pay_money }}</view>
|
||||
<view class="info" v-if="parseFloat(order_detail.refund_money) > 0">退款金额:¥{{ order_detail.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="info-tit">订单备注</view>
|
||||
<view class="infos remark">
|
||||
<view class="info">买家留言:{{order_detail.buyer_message}}</view>
|
||||
<view class="info">商家备注:{{ order_detail.remark }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="goods-info" v-if="tabObj.index == 2">
|
||||
<view class="table">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:55%">商品(元)</view>
|
||||
<view class="table-td" style="width:15%">价格</view>
|
||||
<view class="table-td" style="width:10%">数量</view>
|
||||
<view class="table-td" style="width:15%;justify-content: flex-end;">小计(元)</view>
|
||||
</view>
|
||||
<view class="table-tr table-all" v-for="(item, index) in order_detail.order_goods" :key="index">
|
||||
<view class="table-td" style="width:55%">
|
||||
<image v-if="item.sku_image == '@/static/goods/goods.png'" src="@/static/goods/goods.png" mode="widthFix"/>
|
||||
<image v-else :src="$util.img(item.sku_image, { size: 'small' })" @error="item.sku_image = '@/static/goods/goods.png'" mode="widthFix"/>
|
||||
<view class="content-text">
|
||||
<view>
|
||||
<text v-if="item.is_gift" class="gift-tag">赠品</text>
|
||||
{{ item.goods_name }}
|
||||
</view>
|
||||
<view class="text-color-gray">
|
||||
{{ item.spec_name }}
|
||||
</view>
|
||||
<view v-if="item.refund_status != 0">
|
||||
<text class="refun-status">{{ item.refund_status_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-td" style="width:15%">{{ item.price }}</view>
|
||||
<view class="table-td" style="width:10%">{{ item.num }}</view>
|
||||
<view class="table-td uni-column" style="width:15%;align-items: flex-end;">
|
||||
<view>{{ item.goods_money }}</view>
|
||||
<view class="refund-success" v-if="item.refund_status == 'refund_complete'">退款成功</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="other-information journal" v-if="order_detail.order_log && order_detail.order_log.length > 0 && tabObj.index == 3">
|
||||
<ns-order-log :list="order_detail.order_log"></ns-order-log>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="notYet" v-if="JSON.stringify(order_detail) == '{}'">暂无数据</view>
|
||||
<ns-loading ref="detailLoading"></ns-loading>
|
||||
</view>
|
||||
<view class="remarks-box" v-if="JSON.stringify(order_detail) != '{}'">
|
||||
|
||||
<button type="primary" class="default-btn comp-btn remarks" @click="printTicket">打印小票</button>
|
||||
<button type="primary" class="default-btn comp-btn remarks" @click="type = 'refund'" v-if="order_detail.is_enable_refund">退款</button>
|
||||
<button type="primary" class="default-btn comp-btn remarks" @click="open('remark')">备注</button>
|
||||
<!-- <button type="primary" class="default-btn comp-btn remarks">调整价格</button> -->
|
||||
<block v-if="order_detail.order_status_action.action">
|
||||
<block v-for="(item, index) in order_detail.order_status_action.action" :key="index">
|
||||
<button type="primary" class="primary-btn btn remarks" @click="open(item['action'])" v-if="item['action'] == 'orderLocalDelivery' || item['action'] == 'orderDelivery' || item['action'] == 'orderClose'||item['action'] == 'orderAdjustMoney'">{{ item.title }}</button>
|
||||
</block>
|
||||
</block>
|
||||
<button v-if="order_detail.order_type == 2 && order_detail.order_status == 2" type="primary" class="primary-btn btn remarks" @click="open('storeOrderTakeDelivery')">提货</button>
|
||||
<button v-for="(item, index) in order_detail.order_action" :key="index" type="primary" class="primary-btn btn remarks" @click="open(item['action'])">{{ item.title }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单退款 -->
|
||||
<view class="goodslist-right refund-wrap" v-show="type == 'refund'">
|
||||
<view class="goods-title">退款</view>
|
||||
<view class="content common-scrollbar">
|
||||
<view v-show="refundStep == 0">
|
||||
<block v-for="(item, index) in order_detail.order_goods" :key="index">
|
||||
<view class="goods-item" v-if="item.refund_status == 0">
|
||||
<view class="iconfont" :class="refundGoods.indexOf(item.order_goods_id) == -1 ? 'iconyuan_checkbox' : 'iconyuan_checked'" @click="selectOrderGoods(item)"></view>
|
||||
<view class="image">
|
||||
<image v-if="item.sku_image == '@/static/goods/goods.png'" src="@/static/goods/goods.png" mode="widthFix"/>
|
||||
<image v-else :src="$util.img(item.sku_image, { size: 'small' })" @error="item.sku_image = '@/static/goods/goods.png'" mode="widthFix"/>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="content-text">{{ item.goods_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="price">¥{{ item.price }}</view>
|
||||
<view class="num">x {{ item.num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<block v-if="refundDetail">
|
||||
<view class="bg-grey" v-show="refundStep == 1">
|
||||
<block v-for="(refundItem, refundIndex) in refundDetail.refund_list" :key="refundIndex">
|
||||
<view class="refund-goods-item">
|
||||
<view class="row">
|
||||
<view class="title">退款商品</view>
|
||||
<view class="cont">
|
||||
<view class="goods-item">
|
||||
<view class="image">
|
||||
<image v-if="refundItem.order_goods_info.sku_image == '@/static/goods/goods.png'" src="@/static/goods/goods.png" mode="widthFix"/>
|
||||
<image v-else :src="$util.img(refundItem.order_goods_info.sku_image, { size: 'small' })" @error="refundItem.order_goods_info.sku_image = '@/static/goods/goods.png'" mode="widthFix"/>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="content-text">{{ refundItem.order_goods_info.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="title">退款金额</view>
|
||||
<view class="cont">
|
||||
<view class="money-box">
|
||||
<input type="number" v-model="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].refund_money" />
|
||||
元
|
||||
</view>
|
||||
<view class="refund-money">
|
||||
可退金额:
|
||||
<text>¥{{ refundItem.order_goods_info.refund_apply_money | moneyFormat }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="margin-top:8px;">
|
||||
<view class="title">是否返还库存</view>
|
||||
<view class="cont">
|
||||
<radio-group @change="changeIsRefundStock(refundItem,$event)" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].is_refund_stock == 1" />
|
||||
是
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].is_refund_stock == 0" />
|
||||
否
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" v-if="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].is_refund_stock == 1" style="margin-top:8px;">
|
||||
<view class="title">退还数量</view>
|
||||
<view class="cont">
|
||||
<view class="money-box">
|
||||
<input type="number" :max="Number(refundItem.order_goods_info.num)" v-model="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].refund_stock_num" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="margin-top:8px;">
|
||||
<view class="title">完成状态</view>
|
||||
<view class="cont">
|
||||
<radio-group @change="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].refund_status = $event.detail.value" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="PARTIAL_REFUND" :checked="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].refund_status == 'PARTIAL_REFUND'" />
|
||||
部分退款状态
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="REFUND_COMPLETE" :checked="refundApply.refund_array[refundItem.order_goods_info.order_goods_id].refund_status == 'REFUND_COMPLETE'" />
|
||||
退款完成状态
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="title"></view>
|
||||
<view class="cont tips">
|
||||
<view>1、如果是退部分金额,退款后可以是部分退款状态或退款完成状态</view>
|
||||
<view>2、如果是退全部金额,则退款后一定是退款完成状态</view>
|
||||
<view>3、退款完成才会执行相关业务如核销码失效,卡包失效等操作</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="refund-goods-item">
|
||||
<view class="row">
|
||||
<view class="title">退款说明</view>
|
||||
<view class="cont">
|
||||
<textarea placeholder="请输入退款说明" v-model="refundApply.refund_remark" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="refundStep == 2">
|
||||
<view class="refund-type" :class="{ active: refundApply.refund_transfer_type == index }" @click="refundApply.refund_transfer_type = index" v-for="(item, index) in refundDetail.refund_transfer_type" :key="index">
|
||||
<view class="title">{{ item.name }}</view>
|
||||
<view class="desc">{{ item.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="remarks-box">
|
||||
<button type="primary" class="default-btn comp-btn remarks" @click="type = 'detail'">取消</button>
|
||||
<button type="primary" class="primary-btn comp-btn remarks" v-show="refundStep > 0" @click="refundStep -= 1">上一步</button>
|
||||
<button type="primary" class="primary-btn comp-btn remarks" @click="refundNext">{{ refundStep == 2 ? '确认退款' : '下一步' }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 留言 -->
|
||||
<unipopup ref="remark" type="center">
|
||||
<view class="message">
|
||||
<view class="title">
|
||||
备注
|
||||
<text class="iconfont iconguanbi1" @click="$refs.remark.close()"></text>
|
||||
</view>
|
||||
<view class="textarea-box">
|
||||
<textarea v-model="order_detail.remark" class="textarea" maxlength="200" placeholder="输入请不多于200字"/>
|
||||
</view>
|
||||
<button @click="saveRemark" type="primary" class="primary-btn btn save">保存</button>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<!-- 订单关闭 -->
|
||||
<unipopup ref="orderClose" type="center">
|
||||
<view class="order-close">
|
||||
<view class="title">是否要关闭订单?</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="orderOperation('close')">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderOperation('save')">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
<!-- 门店提货 -->
|
||||
<unipopup ref="storeOrderTakeDelivery" type="center">
|
||||
<view class="order-close">
|
||||
<view class="title">确定要直接提货吗?</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.storeOrderTakeDelivery.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="storeOrderTakeDelivery()">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<unipopup ref="orderLocalDelivery" type="center">
|
||||
<view class="order-delivery local">
|
||||
<view class="title">订单发货</view>
|
||||
<view class="content">
|
||||
<view class="content-item">
|
||||
<view class="title">收货地址:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.name }}</text>
|
||||
<text>{{ order_detail.mobile }}</text>
|
||||
<text>{{ order_detail.full_address }}{{ order_detail.address }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">配送员:</view>
|
||||
<view class="info">
|
||||
<view class="select">
|
||||
<select-lay :zindex="10" :value="localDelivery.deliverer" name="names" placeholder="请选择配送员" :options="deliverer" @selectitem="selectDeliverer"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">配送员手机号:</view>
|
||||
<view class="info">
|
||||
<input type="text" class="input" v-model="localDelivery.deliverer_mobile" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderLocalDelivery.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderLocalDeliveryFn()">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<unipopup ref="orderDelivery" type="center">
|
||||
<view class="order-delivery express">
|
||||
<view class="title">订单发货</view>
|
||||
<view class="content">
|
||||
<view class="content-item">
|
||||
<view class="title">收货地址:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.name }}</text>
|
||||
<text>{{ order_detail.mobile }}</text>
|
||||
<text>{{ order_detail.full_address }}{{ order_detail.address }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">发货方式:</view>
|
||||
<view class="info">
|
||||
<radio-group @change="expresDelivery.delivery_type = $event.detail.value" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="expresDelivery.delivery_type == 1" />物流发货
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="expresDelivery.delivery_type == 0" />无需物流
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="expresDelivery.delivery_type == 1">
|
||||
<view class="content-item">
|
||||
<view class="title">物流公司:</view>
|
||||
<view class="info">
|
||||
<view class="select">
|
||||
<select-lay :zindex="10" :value="expresDelivery.express_company_id" name="names" placeholder="请选择物流公司" :options="expressCompany" @selectitem="selectExpressCompany"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">快递单号:</view>
|
||||
<view class="info">
|
||||
<input type="text" class="input" v-model="expresDelivery.delivery_no" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="info goods-info common-scrollbar">
|
||||
<view class="table">
|
||||
<checkbox-group @change="expresDelivery.order_goods_ids = $event.detail.value">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:5%"></view>
|
||||
<view class="table-td" style="width:45%">商品(元)</view>
|
||||
<view class="table-td" style="width:10%">数量</view>
|
||||
<view class="table-td" style="width:20%;justify-content: flex-end;">物流单号</view>
|
||||
<view class="table-td" style="width:20%;justify-content: flex-end;">物流状态</view>
|
||||
</view>
|
||||
<view class="table-tr table-all" v-for="(item, index) in order_detail.order_goods" :key="index">
|
||||
<view class="table-td" style="width:5%">
|
||||
<checkbox :value="String(item.order_goods_id)" :disabled="item.delivery_status != 0" />
|
||||
</view>
|
||||
<view class="table-td" style="width:45%">
|
||||
<image v-if="item.sku_image == '@/static/goods/goods.png'" src="@/static/goods/goods.png" mode="widthFix"/>
|
||||
<image v-else :src="$util.img(item.sku_image, { size: 'small' })" @error="item.sku_image = '@/static/goods/goods.png'" mode="widthFix"/>
|
||||
<view class="content-text">
|
||||
<view>{{ item.goods_name }} {{ item.spec_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-td" style="width:10%">{{ item.num }}</view>
|
||||
<view class="table-td uni-column" style="width:20%;align-items: flex-end;">{{ item.delivery_no }}</view>
|
||||
<view class="table-td uni-column" style="width:20%;align-items: flex-end;">{{ item.delivery_status_name }}</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderDelivery.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderDelivery()">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
<!-- 调整价格 -->
|
||||
<unipopup ref="orderAdjustMoney" type="center">
|
||||
<view class="order-adjust-money">
|
||||
<view class="title">
|
||||
<text>调整价格</text>
|
||||
<text class="iconfont iconguanbi1" @click="clear"></text>
|
||||
</view>
|
||||
<view class="tip">注意 : 只有订单未付款时才支持改价,改价后请联系买家刷新订单核实订单金额后再支付。</view>
|
||||
<view class="table">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;">商品信息</view>
|
||||
<view class="table-td" style="width:5%;padding: 0 0.07rem;">单价</view>
|
||||
<view class="table-td" style="width:5%;padding: 0 0.07rem;">数量</view>
|
||||
<view class="table-td" style="width:5%;padding: 0 0.07rem;">小计</view>
|
||||
<view class="table-td" style="width:9%;padding: 0 0.07rem;">商品总额</view>
|
||||
<view class="table-td" style="width:5%;padding: 0 0.07rem;">优惠</view>
|
||||
<view class="table-td" style="width:8%;padding: 0 0.07rem;">优惠券</view>
|
||||
<view class="table-td" style="width:8%;padding: 0 0.07rem;">积分抵现</view>
|
||||
<view class="table-td" style="width:9%;padding: 0 0.07rem;">发票费用</view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;">发票邮寄费用</view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;">调整金额</view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;">运费</view>
|
||||
<view class="table-td" style="width:6%;padding: 0 0.07rem;">总计</view>
|
||||
</view>
|
||||
<view class="table-tr table-all">
|
||||
<view class="table-td" style="width:25%">
|
||||
<view class="table-tr table-all" v-for="(item, index) in order_detail.order_goods" :key="index">
|
||||
<view class="table-td" style="width:40%;padding: 0 0.07rem;">{{ item.sku_name }} </view>
|
||||
<view class="table-td" style="width:20%;padding: 0 0.07rem;">{{ item.price }} </view>
|
||||
<view class="table-td" style="width:20%;padding: 0 0.07rem;">{{ item.num }} </view>
|
||||
<view class="table-td" style="width:20%;padding: 0 0.07rem;">{{ item.goods_money }} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-td left" style="width:9%;padding: 0 0.07rem;">{{order_detail.goods_money}}</view>
|
||||
<view class="table-td" style="width:5%;padding: 0 0.07rem;">{{ order_detail.promotion_money }}</view>
|
||||
<view class="table-td" style="width:8%;padding: 0 0.07rem;">{{ order_detail.coupon_money }}</view>
|
||||
<view class="table-td" style="width:8%;padding: 0 0.07rem;">{{ order_detail.point_money }}</view>
|
||||
<view class="table-td" style="width:9%;padding: 0 0.07rem;">{{order_detail.invoice_money}}</view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;">{{order_detail.invoice_delivery_money}}</view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;"><input type="number" v-model="adjustParams.adjust_money" /></view>
|
||||
<view class="table-td" style="width:10%;padding: 0 0.07rem;"><input type="number" min="0" v-model="adjustParams.delivery_money" /></view>
|
||||
<view class="table-td" style="width:6%;padding: 0 0.07rem;">{{parseFloat(parseFloat(order_detail.goods_money)-parseFloat(order_detail.promotion_money||0)-parseFloat(order_detail.coupon_money||0) -parseFloat(order_detail.point_money||0)+ parseFloat(adjustParams.adjust_money||0) + parseFloat(adjustParams.delivery_money||0)).toFixed(2)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip m-0"><text class="Highlight">{{'实际商品金额 '}}</text>= 商品总额 - 优惠金额 - 优惠券金额 - 积分抵现 + 调价</view>
|
||||
<view class="tip m-0"><text class="Highlight">{{'发票费用 '}}</text>= 实际商品金额 * 发票比率</view>
|
||||
<view class="tip m-0">订单总额 =<text class="Highlight">{{' 实际商品金额 '}}</text>+ <text class="Highlight">{{'发票费用 '}}</text>+ 运费 + 发票邮寄费用</view>
|
||||
<view class="footer">
|
||||
<button type="primary" class="primary-btn btn remarks" @click="adjustSave">确定</button>
|
||||
<button class="default-btn comp-btn remarks clear" @click="clear">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsOrderLog from '@/components/ns-order-log/ns-order-log.vue';
|
||||
import nsLoading from '@/components/ns-loading/ns-loading.vue';
|
||||
import unipopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import orderList from './public/js/order_list.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsOrderLog,
|
||||
nsLoading,
|
||||
unipopup,
|
||||
},
|
||||
mixins: [orderList]
|
||||
};
|
||||
/**
|
||||
* 打印回调
|
||||
* @param {Object} text
|
||||
*/
|
||||
window.POS_PRINT_CALLBACK = function(text) {
|
||||
uni.showToast({
|
||||
title: text,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './public/css/orderlist.scss';
|
||||
|
||||
.tab-wrap {
|
||||
padding: 0 !important;
|
||||
background-color: #fff !important;
|
||||
|
||||
.tab-head {
|
||||
display: flex;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
text {
|
||||
width: 1.15rem;
|
||||
height: 0.55rem;
|
||||
line-height: 0.55rem;
|
||||
text-align: center;
|
||||
font-size: $uni-font-size-lg;
|
||||
|
||||
&.active {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-box {
|
||||
padding: 0.1rem;
|
||||
}
|
||||
|
||||
.form-radio-item {
|
||||
margin-right: .1rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message {
|
||||
width: 5.2rem;
|
||||
min-height: 3.2rem;
|
||||
border-radius: 0.06rem;
|
||||
background: #ffffff;
|
||||
padding-bottom: 0.15rem;
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 0.5rem;
|
||||
border-bottom: 0.01rem solid #e6e6e6;
|
||||
text-align: center;
|
||||
line-height: 0.5rem;
|
||||
font-size: 0.16rem;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
.iconguanbi1 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 0.15rem;
|
||||
font-size: 0.18rem;
|
||||
}
|
||||
}
|
||||
.textarea-box {
|
||||
margin: 0.15rem;
|
||||
height: 2.2rem;
|
||||
border: 0.01rem solid #e6e6e6;
|
||||
border-radius: 0.06rem;
|
||||
padding: 0.15rem;
|
||||
box-sizing: border-box;
|
||||
.textarea {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.save {
|
||||
width: auto !important;
|
||||
float: right;
|
||||
margin-right: 0.15rem;
|
||||
}
|
||||
}
|
||||
.message:after {
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
content: '';
|
||||
height: 0;
|
||||
clear: both;
|
||||
}
|
||||
</style>
|
||||
413
addon/cashier/source/os/pages/order/orderrefund.vue
Executable file
413
addon/cashier/source/os/pages/order/orderrefund.vue
Executable file
@@ -0,0 +1,413 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="goodslist">
|
||||
<view class="goodslist-box">
|
||||
<view class="goodslist-left">
|
||||
<view class="goods-title">
|
||||
退款维权
|
||||
<text class="iconfont icongengduo1"></text>
|
||||
</view>
|
||||
<view class="goods-search">
|
||||
<view class="search">
|
||||
<text class="iconfont icon31sousuo"></text>
|
||||
<input type="text" v-model="search_text" @input="search" placeholder="搜索订单号/商品名称" />
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="!one_judge && order_list.length > 0">
|
||||
<scroll-view :scroll-top="scrollTop" @scroll="scroll" scroll-y="true" class="goods-list-scroll" :show-scrollbar="false" @scrolltolower="getOrderList">
|
||||
<view class="item" @click="getOrderDetail(item.order_goods_id, index)" v-for="(item, index) in order_list" :key="index" :class="index == selectGoodsKeys ? 'itemhover' : ''">
|
||||
<view class="title">
|
||||
<view>退款编号:{{ item.order_no }}</view>
|
||||
<view>{{ item.order_type_name }}</view>
|
||||
</view>
|
||||
<view class="total-money-num">
|
||||
<view class="box">
|
||||
<view>订单金额</view>
|
||||
<view>¥{{ item.real_goods_money }}</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view>退款金额</view>
|
||||
<view>¥{{ item.refund_apply_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total-money-num">
|
||||
<view class="member-info">
|
||||
<view>退款状态:</view>
|
||||
<view>{{ item.refund_status_name }}({{ item.refund_type == 1 ? '仅退款' : '退款退货' }})</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<view class="notYet" v-else-if="!one_judge && order_list.length == 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="goodslist-right">
|
||||
<view class="goods-title">订单详情</view>
|
||||
<view class="order-information tab-wrap" v-if="Object.keys(order_detail).length">
|
||||
<view class="tab-head">
|
||||
<text v-for="(item, index) in tabObj.list" :key="index" :class="{ active: tabObj.index == item.value }" @click="tabObj.index = item.value">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="tab-content">
|
||||
<view class="other-information" v-if="tabObj.index == 1">
|
||||
<view class="item-box">
|
||||
<view class="item">
|
||||
<view>买家:</view>
|
||||
<view v-if="order_detail.nickname">{{ order_detail.nickname }}</view>
|
||||
<view v-else>散客</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款编号:</view>
|
||||
<view>{{ order_detail.refund_no }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>申请时间:</view>
|
||||
<view>{{ $util.timeFormat(order_detail.refund_action_time) }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>维权类型:</view>
|
||||
<view>{{ order_detail.refund_mode > 1 ? '售后' : '退款' }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款方式:</view>
|
||||
<view>
|
||||
{{ order_detail.shop_active_refund == 1 ? '主动退款' : order_detail.refund_type == 1 ? '仅退款' : '退货退款' }}
|
||||
({{ (order_detail.refund_type == 1 && '原路退款') || (order_detail.refund_type == 2 && '线下退款') || '退款到余额' }})
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款金额:</view>
|
||||
<view>¥{{ order_detail.refund_status == 3 ? order_detail.refund_real_money : order_detail.refund_apply_money }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款原因:</view>
|
||||
<view>{{ order_detail.refund_reason || '--' }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款说明:</view>
|
||||
<view>{{ order_detail.refund_remark || '--' }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>商家退款说明:</view>
|
||||
<view>{{ order_detail.shop_refund_remark || '--' }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>退款状态:</view>
|
||||
<view>{{ order_detail.refund_status_name }}</view>
|
||||
</view>
|
||||
<view class="item" v-if="order_detail.refund_refuse_reason">
|
||||
<view>拒绝理由:</view>
|
||||
<view>{{ order_detail.refund_refuse_reason }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="goods-info" v-if="tabObj.index == 2">
|
||||
<view class="table">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:45%">商品(元)</view>
|
||||
<view class="table-td" style="width:15%">价格</view>
|
||||
<view class="table-td" style="width:10%">数量</view>
|
||||
<view class="table-td" style="width:15%;">小计(元)</view>
|
||||
<view class="table-td" style="width:15%;justify-content: flex-end;">状态</view>
|
||||
</view>
|
||||
<view class="table-tr table-all">
|
||||
<view class="table-td" style="width:45%">{{ order_detail.sku_name }}</view>
|
||||
<view class="table-td" style="width:15%">{{ order_detail.price }}</view>
|
||||
<view class="table-td" style="width:10%">{{ order_detail.num }}</view>
|
||||
<view class="table-td" style="width:15%">{{ order_detail.goods_money }}</view>
|
||||
<view class="table-td uni-column" style="width:15%;align-items: flex-end;">{{ order_detail.refund_status_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="other-information journal" v-if="tabObj.index == 3">
|
||||
<ns-order-log :list="order_detail.refund_log_list"></ns-order-log>
|
||||
</view>
|
||||
<view class="remarks-box" v-if="order_detail.refund_action.length">
|
||||
<block v-for="(item, index) in order_detail.refund_action" :key="index">
|
||||
<button type="primary" class="primary-btn btn remarks" @click="open(item['event'])">{{ item.title }}</button>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else-if="!one_judge && !Object.keys(order_detail).length" >
|
||||
<image class="cart-empty" src="@/static/cashier/cart_empty.png" mode="widthFix" />
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 同意退款 -->
|
||||
<unipopup ref="orderRefundAgree" type="center">
|
||||
<view class="order-refund-agree">
|
||||
<view class="title">售后维权处理</view>
|
||||
<view class="content">
|
||||
<view class="content-item">
|
||||
<view class="title">注意:</view>
|
||||
<view class="info">
|
||||
<text v-if="order_detail.pay_type == 'OFFLINE_PAY'">该笔订单通过线下支付,商家同意后,退款将通过线下原路退回。</text>
|
||||
<text v-else>该笔订单通过在线付款,商家同意后,退款将自动原路退回买家付款账户。</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款方式:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.refund_type == 1 ? '仅退款' : '退货退款' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款金额:</view>
|
||||
<view class="info">
|
||||
<text>¥{{ order_detail.refund_apply_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderRefundAgree.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderRefundAgree()">确认退款</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<!-- 拒绝退款 -->
|
||||
<unipopup ref="orderRefundRefuse" type="center">
|
||||
<view class="order-refund-agree">
|
||||
<view class="title">售后维权处理</view>
|
||||
<view class="content">
|
||||
<view class="tips">注意:建议你与买家协商后,再确定是否拒绝退款。如你拒绝退款后,买家可修改退款申请协议重新发起退款。</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款方式:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.refund_type == 1 ? '仅退款' : '退货退款' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款金额:</view>
|
||||
<view class="info">
|
||||
<text>¥{{ order_detail.refund_apply_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item textarea-wrap">
|
||||
<view class="title">拒绝理由:</view>
|
||||
<view class="info textarea-box">
|
||||
<textarea v-model="refundRefuseReason" class="textarea" maxlength="200" placeholder="请输入拒绝理由,最多不超过200字"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderRefundRefuse.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderRefundRefuse()">确认退款</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<!-- 关闭维权 -->
|
||||
<unipopup ref="orderRefundClose" type="center">
|
||||
<view class="order-close">
|
||||
<view class="title">确定要关闭本次维权吗?</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderRefundClose.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderRefundClose()">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<!-- 转账 -->
|
||||
<unipopup ref="orderRefundTransfer" type="center">
|
||||
<view class="order-refund-agree">
|
||||
<view class="title">售后维权处理</view>
|
||||
<view class="content">
|
||||
<view class="content-item">
|
||||
<view class="title">申请退款金额:</view>
|
||||
<view class="info">
|
||||
<text>¥{{ order_detail.refund_apply_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">实际退款金额:</view>
|
||||
<view class="info">
|
||||
<view class="money-box">
|
||||
<input type="number" v-model="refundTransfer.refund_real_money" />
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item" v-if="order_detail.use_point>0">
|
||||
<view class="title">退还积分:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.use_point }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item" v-if="order_detail.coupon_info && order_detail.coupon_info.length>0">
|
||||
<view class="title">退还优惠券:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.coupon_info.coupon_name }}</text>
|
||||
<text v-if="order_detail.coupon_info.money>0">({{order_detail.coupon_info.money}})</text>
|
||||
<text v-else>({{order_detail.coupon_info.discount}}折)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款方式:</view>
|
||||
<view class="info">
|
||||
<radio-group @change="refundTransfer.refund_money_type = $event.detail.value" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="refundTransfer.refund_money_type == 1" />
|
||||
原路退款
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="2" :checked="refundTransfer.refund_money_type == 2" />
|
||||
线下退款
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="3" :checked="refundTransfer.refund_money_type == 3" />
|
||||
退款到余额
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content-item textarea-wrap">
|
||||
<view class="title">退款说明:</view>
|
||||
<view class="info textarea-box">
|
||||
<textarea v-model="refundTransfer.shop_refund_remark" class="textarea" maxlength="200" placeholder="请输入拒绝理由,最多不超过200字"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderRefundTransfer.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderRefundTransfer()">确认退款</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
<!-- 买家退货接收,维权收货 -->
|
||||
<unipopup ref="orderRefundTakeDelivery" type="center">
|
||||
<view class="order-refund-agree">
|
||||
<view class="title">售后维权处理</view>
|
||||
<view class="content">
|
||||
<view class="tips">注意:需你同意退款申请,买家才能退货给你;买家退货后你需再次确认收货后,退款将自动原路退回至买家付款账户。</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款方式:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.refund_type == 1 ? '仅退款' : '退货退款' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退款金额:</view>
|
||||
<view class="info">
|
||||
<text>¥{{ order_detail.refund_apply_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item">
|
||||
<view class="title">退货地址:</view>
|
||||
<view class="info">
|
||||
<text>{{ order_detail.refund_address }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-item textarea-wrap">
|
||||
<view class="title">是否入库:</view>
|
||||
<view class="info">
|
||||
<radio-group @change="isRefundStock = $event.detail.value" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="isRefundStock == 0" />
|
||||
否
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="isRefundStock == 1" />
|
||||
是
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.orderRefundTakeDelivery.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="orderRefundTakeDelivery()">确认收到退货</button>
|
||||
</view>
|
||||
</view>
|
||||
</unipopup>
|
||||
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderRefund from './public/js/order_refund'
|
||||
import nsOrderLog from '@/components/ns-order-log/ns-order-log.vue';
|
||||
import unipopup from '@/components/uni-popup/uni-popup.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsOrderLog,
|
||||
unipopup
|
||||
},
|
||||
mixins: [orderRefund]
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './public/css/orderlist.scss';
|
||||
|
||||
.total-money-num .box {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.goodslist {
|
||||
.goodslist-right {
|
||||
.other-information {
|
||||
.title {
|
||||
margin-bottom: 0.1rem !important;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
margin-bottom: 0.15rem;
|
||||
|
||||
.item {
|
||||
|
||||
&:nth-child(1),
|
||||
&:nth-child(2) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
width: 1rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-wrap {
|
||||
padding: 0 !important;
|
||||
background-color: #fff !important;
|
||||
|
||||
.tab-head {
|
||||
display: flex;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
text {
|
||||
width: 1.15rem;
|
||||
height: 0.55rem;
|
||||
line-height: 0.55rem;
|
||||
text-align: center;
|
||||
font-size: $uni-font-size-lg;
|
||||
|
||||
&.active {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-box {
|
||||
padding: 0.1rem;
|
||||
}
|
||||
/deep/ .goods-list-scroll {
|
||||
width: 100%;
|
||||
height: calc(100% - 1.44rem) !important;
|
||||
}
|
||||
</style>
|
||||
1281
addon/cashier/source/os/pages/order/public/css/orderlist.scss
Executable file
1281
addon/cashier/source/os/pages/order/public/css/orderlist.scss
Executable file
File diff suppressed because it is too large
Load Diff
888
addon/cashier/source/os/pages/order/public/js/order_list.js
Executable file
888
addon/cashier/source/os/pages/order/public/js/order_list.js
Executable file
@@ -0,0 +1,888 @@
|
||||
import {
|
||||
getOrderList,
|
||||
getOrderDetail,
|
||||
orderRemark,
|
||||
orderClose,
|
||||
orderStoreDelivery,
|
||||
orderLocalDelivery,
|
||||
orderPrintTicket,
|
||||
getExpressCompanyList,
|
||||
orderExpressDelivery,
|
||||
getOrderDeliverList,
|
||||
orderAdjustPrice,
|
||||
getorderCondition
|
||||
} from '@/api/order.js'
|
||||
import {getRefundApplyData, orderRefund} from '@/api/order_refund.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectGoodsKeys: 0,
|
||||
otherInfoValue: {
|
||||
order_no: {
|
||||
title: '订单编号:',
|
||||
value: ''
|
||||
},
|
||||
out_trade_no: {
|
||||
title: '订单交易号:',
|
||||
value: ''
|
||||
},
|
||||
create_time: {
|
||||
title: '消费时间:',
|
||||
value: ''
|
||||
},
|
||||
pay_status: {
|
||||
title: '支付状态:',
|
||||
value: ''
|
||||
},
|
||||
order_status: {
|
||||
title: '订单状态:',
|
||||
value: ''
|
||||
},
|
||||
pay_type: {
|
||||
title: '付款方式:',
|
||||
value: ''
|
||||
},
|
||||
operator_name: {
|
||||
title: '收银员:',
|
||||
value: ''
|
||||
},
|
||||
pay_time: {
|
||||
title: '付款时间:',
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
// 订购日志所需列表数据
|
||||
list: [],
|
||||
//获取订单的页数
|
||||
page: 1,
|
||||
//每次获取订单的条数
|
||||
page_size: 8,
|
||||
// 订单搜索是用到的数据
|
||||
search_text: '',
|
||||
conditions: {
|
||||
order_status: '',
|
||||
time_type: '',
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
start_time_val: '',
|
||||
end_time_val: '',
|
||||
order_type: 'all',
|
||||
order_from: '',
|
||||
pay_type: '',
|
||||
},
|
||||
//订单列表类型
|
||||
currOrderList: 'cashier',
|
||||
//订单类型
|
||||
trade_type: '',
|
||||
//初始时加载详情数据判断
|
||||
one_judge: true,
|
||||
//无限滚动请求锁
|
||||
listLock: false,
|
||||
scrollTop: 0,
|
||||
// 订单列表数据
|
||||
order_list: [],
|
||||
//订单详情数据
|
||||
order_detail: {},
|
||||
type: 'detail',
|
||||
refundStep: 0,
|
||||
refundGoods: [],
|
||||
refundDetail: null,
|
||||
refundRepeat: false,
|
||||
refundApply: {
|
||||
refund_remark: '',
|
||||
refund_transfer_type: ''
|
||||
},
|
||||
localDelivery: {
|
||||
deliverer_mobile: '',
|
||||
deliverer: ''
|
||||
},
|
||||
expresDelivery: {
|
||||
delivery_type: 1,
|
||||
express_company_id: 0,
|
||||
delivery_no: '',
|
||||
order_goods_ids: []
|
||||
},
|
||||
expressCompany: [],
|
||||
deliverer: [],
|
||||
tabObj: {
|
||||
list: [{
|
||||
value: 1,
|
||||
name: '基础信息'
|
||||
}, {
|
||||
value: 2,
|
||||
name: '商品信息'
|
||||
}, {
|
||||
value: 3,
|
||||
name: '订单日志'
|
||||
}],
|
||||
index: 1
|
||||
},
|
||||
isLogisticsRepeat: false,
|
||||
//调价
|
||||
adjustParams:{
|
||||
order_id:null,
|
||||
adjust_money:0,
|
||||
delivery_money:0
|
||||
},
|
||||
currGlobalStoreId:'',
|
||||
showScreen: false,
|
||||
orderConditionList: [],
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.search_text = option.order_no || '';
|
||||
this.currOrderList = option.order_from == 'online' ? 'online' : 'cashier';
|
||||
if(uni.getStorageSync('globalStoreId')) this.currGlobalStoreId = uni.getStorageSync('globalStoreId');
|
||||
// 获取订单列表数据
|
||||
this.getOrderListFn();
|
||||
this.getExpressCompany();
|
||||
this.getDeliver();
|
||||
this.getOrderCondition()
|
||||
},
|
||||
watch: {
|
||||
type: function (nval, oval) {
|
||||
if (oval == 'refund') {
|
||||
this.refundStep = 0;
|
||||
this.refundGoods = [];
|
||||
this.refundDetail = null;
|
||||
this.refundRepeat = false;
|
||||
this.refundApply = {
|
||||
refund_remark: '',
|
||||
refund_transfer_type: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeIsRefundStock(refundItem,e) {
|
||||
this.refundApply.refund_array[refundItem.order_goods_info.order_goods_id].is_refund_stock = e.detail.value;
|
||||
this.$forceUpdate()
|
||||
},
|
||||
searchOrder() {
|
||||
if(this.conditions.start_time_val || this.conditions.end_time_val){
|
||||
if(new Date(this.conditions.end_time_val).getTime() <= new Date(this.conditions.start_time_val).getTime()){
|
||||
this.$util.showToast({title:'结束时间不能早于开始时间'})
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = false;
|
||||
this.showScreen = false;
|
||||
this.getOrderListFn();
|
||||
},
|
||||
initCondition() {
|
||||
this.conditions.order_status = '';
|
||||
this.conditions.time_type = '';
|
||||
this.conditions.start_time = '';
|
||||
this.conditions.end_time = '';
|
||||
this.conditions.start_time_val = '';
|
||||
this.conditions.end_time_val = '';
|
||||
this.conditions.order_type = 'all';
|
||||
this.conditions.order_from = '';
|
||||
this.conditions.pay_type = '';
|
||||
},
|
||||
resetCondition() {
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = false;
|
||||
this.initCondition();
|
||||
this.showScreen = false;
|
||||
this.getOrderListFn();
|
||||
},
|
||||
changeCondition(mode,type) {
|
||||
this.conditions[mode] = type;
|
||||
if(mode == 'order_type'){
|
||||
if(this.currOrderList == 'online'){
|
||||
this.orderConditionList.order_type_list.forEach((item,index) => {
|
||||
if(item.type == type) this.orderConditionList.order_status_list = item.status;
|
||||
})
|
||||
this.conditions.order_status = '';
|
||||
}
|
||||
}
|
||||
if(mode == 'time_type'){
|
||||
this.conditions.start_time_val = '';
|
||||
this.conditions.end_time_val = '';
|
||||
switch (type){
|
||||
case '':
|
||||
this.conditions.start_time = '';
|
||||
this.conditions.end_time = '';
|
||||
break;
|
||||
case '7':
|
||||
this.conditions.start_time = this.getDay(type);
|
||||
this.conditions.end_time = this.getNowDate();
|
||||
break;
|
||||
case '30':
|
||||
this.conditions.start_time = this.getDay(type);
|
||||
this.conditions.end_time = this.getNowDate();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
getDay(p_count) {
|
||||
var dd = new Date();
|
||||
dd.setDate(dd.getDate() - p_count); //获取p_count天后的日期
|
||||
var y = dd.getFullYear();
|
||||
var m = dd.getMonth() + 1; //获取当前月份的日期
|
||||
if (m < 10) {
|
||||
m = '0' + m;
|
||||
}
|
||||
var d = dd.getDate();
|
||||
if (d < 10) {
|
||||
d = '0' + d;
|
||||
}
|
||||
return y + '-' + m + '-' + d +' 00:00:00';
|
||||
},
|
||||
getNowDate() {
|
||||
var date = new Date();
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1; //获取当前月份的日期
|
||||
if (m < 10) {
|
||||
m = '0' + m;
|
||||
}
|
||||
var d = date.getDate();
|
||||
if (d < 10) {
|
||||
d = '0' + d;
|
||||
}
|
||||
return y + '-' + m + '-' + d +' 23:59:59';
|
||||
},
|
||||
getOrderCondition() {
|
||||
getorderCondition()
|
||||
.then((res)=>{
|
||||
if(res.code>=0){
|
||||
var data = res.data;
|
||||
for (var index in data) {
|
||||
var arr = [];
|
||||
if (index != 'order_label_list' && index != 'order_status_list' && index != 'pay_type_list' && index != 'cashier_pay_type_list' && index != 'cashier_order_type_list') {
|
||||
for (var index_c in data[index]) {
|
||||
var obj = {
|
||||
type: index_c
|
||||
};
|
||||
obj = Object.assign(obj, data[index][index_c]);
|
||||
arr.push(obj);
|
||||
}
|
||||
} else {
|
||||
for (var index_c in data[index]) {
|
||||
var obj = {
|
||||
type: index_c,
|
||||
name: data[index][index_c]
|
||||
};
|
||||
arr.push(obj);
|
||||
}
|
||||
}
|
||||
data[index] = arr;
|
||||
}
|
||||
this.orderConditionList = data;
|
||||
this.orderConditionList.order_type_list.forEach((item,index)=>{
|
||||
var arr = [];
|
||||
for (var index_c in item.status) {
|
||||
var obj = {
|
||||
type: index_c,
|
||||
name: item.status[index_c]
|
||||
};
|
||||
arr.push(obj);
|
||||
}
|
||||
item.status = arr;
|
||||
if(item.type == 'all'){
|
||||
this.orderConditionList.order_status_list = item.status;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
switchStoreAfter() {
|
||||
if(this.currGlobalStoreId == uni.getStorageSync('globalStoreId')) return;
|
||||
this.currGlobalStoreId = uni.getStorageSync('globalStoreId');
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = false;
|
||||
this.getOrderListFn();
|
||||
this.getDeliver()
|
||||
},
|
||||
// 搜索
|
||||
search(type) {
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = false;
|
||||
if (type == 'enter') {
|
||||
document.onkeydown = e => {
|
||||
if (e.keyCode === 13) {
|
||||
//回车后执行搜索方法
|
||||
this.getOrderListFn();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.getOrderListFn();
|
||||
}
|
||||
|
||||
},
|
||||
selectOrderList(order_type) {
|
||||
this.currOrderList = order_type;
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = false;
|
||||
this.initCondition();
|
||||
this.selectGoodsKeys = 0;
|
||||
this.getOrderListFn();
|
||||
},
|
||||
/**
|
||||
* 获取订单列表
|
||||
*/
|
||||
getOrderListFn() {
|
||||
if (this.listLock) return false;
|
||||
this.listLock = true;
|
||||
getOrderList({
|
||||
page: this.page,
|
||||
page_size: this.page_size,
|
||||
search_text: this.search_text,
|
||||
order_scene: this.currOrderList,
|
||||
order_status: this.conditions.order_status,
|
||||
start_time: this.conditions.start_time_val ? this.conditions.start_time_val : this.conditions.start_time,
|
||||
end_time: this.conditions.end_time_val ? this.conditions.end_time_val : this.conditions.end_time,
|
||||
order_type: this.conditions.order_type,
|
||||
order_from: this.conditions.order_from,
|
||||
pay_type: this.conditions.pay_type,
|
||||
|
||||
}).then((res) => {
|
||||
if (res.data.list.length == 0 && this.one_judge) {
|
||||
this.order_detail = {};
|
||||
this.one_judge = false;
|
||||
if (this.$refs.detailLoading) this.$refs.detailLoading.hide()
|
||||
}
|
||||
if (res.code >= 0 && res.data.list.length != 0) {
|
||||
if (this.order_list.length == 0) {
|
||||
this.order_list = res.data.list;
|
||||
} else {
|
||||
this.order_list = this.order_list.concat(res.data.list);
|
||||
}
|
||||
|
||||
//初始时加载一遍详情数据
|
||||
if (this.one_judge) {
|
||||
this.getOrderDetailFn(this.order_list[0].order_id);
|
||||
}
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.scrollTop = 0
|
||||
}
|
||||
if (res.data.list.length >= this.page_size) {
|
||||
this.page++
|
||||
this.listLock = false
|
||||
}
|
||||
});
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
/**
|
||||
* 获取订单详情数据
|
||||
*/
|
||||
getOrderDetailFn(order_id, keys = 0, callback) {
|
||||
// 清空数据
|
||||
this.localDelivery = {
|
||||
deliverer_mobile: '',
|
||||
deliverer: ''
|
||||
};
|
||||
|
||||
this.selectGoodsKeys = keys;
|
||||
this.type = 'detail';
|
||||
this.$refs.detailLoading.show();
|
||||
getOrderDetail({
|
||||
order_id
|
||||
}).then((res) => {
|
||||
if (res.code >= 0) {
|
||||
this.order_detail = res.data;
|
||||
this.order_detail.order_status_action = JSON.parse(res.data.order_status_action)
|
||||
this.otherInfoValue.order_no.value = res.data.order_no;
|
||||
this.otherInfoValue.out_trade_no.value = res.data.out_trade_no;
|
||||
this.otherInfoValue.create_time.value = this.$util.timeFormat(res.data.create_time);
|
||||
this.otherInfoValue.operator_name.value = res.data.operator_name;
|
||||
this.otherInfoValue.pay_type.value = res.data.pay_type_name;
|
||||
this.otherInfoValue.order_status.value = res.data.order_status_name;
|
||||
if (res.data.pay_status == 1) {
|
||||
this.otherInfoValue.pay_status.value = '已支付';
|
||||
this.otherInfoValue.pay_time.value = this.$util.timeFormat(res.data.pay_time);
|
||||
} else {
|
||||
this.otherInfoValue.pay_status.value = '待支付';
|
||||
this.otherInfoValue.pay_time.value = '';
|
||||
}
|
||||
if (typeof callback == 'function') {
|
||||
callback();
|
||||
}
|
||||
Object.keys(this.adjustParams).forEach(key=>{
|
||||
this.adjustParams[key] = parseFloat(this.order_detail[key])
|
||||
})
|
||||
this.$forceUpdate();
|
||||
this.one_judge = false;
|
||||
if (this.$refs.detailLoading) this.$refs.detailLoading.hide()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 打开弹出框
|
||||
* @param action
|
||||
*/
|
||||
open(action) {
|
||||
this.$refs[action].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出框
|
||||
* @param name
|
||||
*/
|
||||
close(name) {
|
||||
this.$refs[name].close();
|
||||
},
|
||||
/**
|
||||
* 调价提交
|
||||
*/
|
||||
adjustSave(){
|
||||
if(parseFloat(this.adjustParams.delivery_money+0)<0){
|
||||
this.$util.showToast({
|
||||
title: '运费不可小于0'
|
||||
});
|
||||
return false
|
||||
}else if(!parseFloat(this.adjustParams.delivery_money+0)){
|
||||
this.adjustParams.delivery_money = 0
|
||||
}
|
||||
if(parseFloat(parseFloat(this.order_detail.goods_money)-parseFloat(this.order_detail.promotion_money||0)-parseFloat(this.order_detail.coupon_money||0) -parseFloat(this.order_detail.point_money||0)+ parseFloat(this.adjustParams.adjust_money||0) + parseFloat(this.adjustParams.delivery_money||0)).toFixed(2)<0){
|
||||
this.$util.showToast({
|
||||
title: '真实商品价格不可小于0'
|
||||
});
|
||||
return false
|
||||
}
|
||||
orderAdjustPrice(this.adjustParams).then((res)=>{
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetailFn(this.order_list[this.selectGoodsKeys].order_id);
|
||||
this.$refs.orderAdjustMoney.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 关闭调价弹框
|
||||
*/
|
||||
clear(){
|
||||
Object.keys(this.adjustParams).forEach(key=>{
|
||||
this.adjustParams[key] = this.adjustParams[key] = parseFloat(this.order_detail[key])
|
||||
})
|
||||
this.$refs.orderAdjustMoney.close()
|
||||
},
|
||||
/**
|
||||
* 留言数据保存
|
||||
*/
|
||||
saveRemark() {
|
||||
orderRemark({
|
||||
order_id: this.order_detail.order_id,
|
||||
remark: this.order_detail.remark
|
||||
}).then((res) => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetailFn(this.order_list[this.selectGoodsKeys].order_id);
|
||||
this.$refs.remark.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 关闭订单
|
||||
*/
|
||||
orderCloseFn() {
|
||||
orderClose({
|
||||
order_id: this.order_detail.order_id
|
||||
}).then((res) => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetailFn(this.order_list[this.selectGoodsKeys].order_id, this.selectGoodsKeys, () => {
|
||||
this.order_list[this.selectGoodsKeys] = this.order_detail;
|
||||
this.$forceUpdate();
|
||||
});
|
||||
this.$refs.orderClose.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 订单取消
|
||||
*/
|
||||
orderOperation(type) {
|
||||
switch (type) {
|
||||
case 'save':
|
||||
this.orderCloseFn();
|
||||
break;
|
||||
case 'close':
|
||||
this.$refs.orderClose.close();
|
||||
break;
|
||||
}
|
||||
},
|
||||
selectOrderGoods(data) {
|
||||
let index = this.refundGoods.indexOf(data.order_goods_id);
|
||||
if (index == -1) this.refundGoods.push(data.order_goods_id);
|
||||
else this.refundGoods.splice(index, 1);
|
||||
},
|
||||
/**
|
||||
* 退款下一步
|
||||
*/
|
||||
refundNext() {
|
||||
|
||||
if (this.refundStep == 0) {
|
||||
if (!this.refundGoods.length) {
|
||||
this.$util.showToast({
|
||||
title: '请选择要退款的商品'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
getRefundApplyData({
|
||||
refund_array: JSON.stringify(this.refundGoods)
|
||||
}).then((res) => {
|
||||
|
||||
if (res.code == 0) {
|
||||
this.refundDetail = res.data;
|
||||
this.refundStep = 1;
|
||||
let refundData = {};
|
||||
|
||||
this.refundDetail.refund_list.forEach(refundItem => {
|
||||
refundData[refundItem.order_goods_info.order_goods_id] = {
|
||||
refund_pay_money: this.$util.moneyFormat(refundItem.order_goods_info.refund_apply_money),
|
||||
refund_money: this.$util.moneyFormat(refundItem.order_goods_info.refund_apply_money),
|
||||
refund_status:'PARTIAL_REFUND',
|
||||
is_refund_stock: 1,
|
||||
refund_stock_num: refundItem.order_goods_info.num
|
||||
};
|
||||
});
|
||||
Object.assign(this.refundApply, {
|
||||
order_id: this.order_detail.order_id,
|
||||
refund_array: refundData,
|
||||
refund_transfer_type: Object.keys(this.refundDetail.refund_transfer_type)[0]
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (this.refundStep == 1) {
|
||||
if (this.refundVerify()) this.refundStep = 2;
|
||||
} else if (this.refundStep == 2) {
|
||||
this.createRefund();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 退款验证
|
||||
*/
|
||||
refundVerify() {
|
||||
try {
|
||||
this.refundDetail.refund_list.forEach(refundItem => {
|
||||
let data = this.refundApply.refund_array[refundItem.order_goods_info.order_goods_id];
|
||||
if (isNaN(parseFloat(data.refund_money))) {
|
||||
this.$util.showToast({
|
||||
title: '退款金额输入错误'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
if (parseFloat(data.refund_money) < 0) {
|
||||
this.$util.showToast({
|
||||
title: '退款金额不能小于0'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
if (parseFloat(data.refund_money) > parseFloat(data.refund_pay_money)) {
|
||||
this.$util.showToast({
|
||||
title: '退款金额超出可退金额'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
|
||||
if(data.is_refund_stock == 1){
|
||||
if(!Number(data.refund_stock_num)){
|
||||
this.$util.showToast({
|
||||
title: '请输入返还数量'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
|
||||
if(data.refund_stock_num <= 0){
|
||||
this.$util.showToast({
|
||||
title: '返还数量不能小于0'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(refundItem.order_goods_info.goods_class != 6 || (refundItem.order_goods_info.goods_class == 6 && refundItem.order_goods_info.pricing_type != 'weight' )){
|
||||
// 不能为小数
|
||||
if(String(data.refund_stock_num).indexOf('.') != -1){
|
||||
this.$util.showToast({
|
||||
title: '商品'+refundItem.order_goods_info.goods_name+'的返还数量只能是正整数'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
}
|
||||
|
||||
if(data.refund_stock_num > refundItem.order_goods_info.num){
|
||||
this.$util.showToast({
|
||||
title: '商品'+refundItem.order_goods_info.goods_name+'最多返还'+refundItem.order_goods_info.num+'件'
|
||||
});
|
||||
throw new Error('');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 退款申请
|
||||
*/
|
||||
createRefund() {
|
||||
if (this.refundRepeat) return;
|
||||
this.refundRepeat = true;
|
||||
|
||||
uni.showLoading({
|
||||
title: ''
|
||||
});
|
||||
|
||||
let data = this.$util.deepClone(this.refundApply);
|
||||
data.refund_array = JSON.stringify(data.refund_array);
|
||||
|
||||
orderRefund(data).then((res) => {
|
||||
uni.hideLoading();
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '退款成功'
|
||||
});
|
||||
this.getOrderDetailFn(this.order_detail.order_id);
|
||||
this.type = 'detail';
|
||||
} else {
|
||||
this.refundRepeat = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
/**
|
||||
* 提货
|
||||
*/
|
||||
storeOrderTakeDelivery() {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
uni.showLoading({
|
||||
title: ''
|
||||
});
|
||||
orderStoreDelivery(this.order_detail.order_id).then(res => {
|
||||
uni.hideLoading();
|
||||
this.isRepeat = false;
|
||||
if (res.code == 0) {
|
||||
this.getOrderDetailFn(this.order_detail.order_id);
|
||||
this.$refs.storeOrderTakeDelivery.close();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 本地配送
|
||||
*/
|
||||
orderLocalDeliveryFn() {
|
||||
if (!this.localDelivery.deliverer) {
|
||||
this.$util.showToast({
|
||||
title: '请选择配送员'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.localDelivery.deliverer_mobile) {
|
||||
this.$util.showToast({
|
||||
title: '请输入配送员联系方式'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
uni.showLoading({
|
||||
title: ''
|
||||
});
|
||||
|
||||
orderLocalDelivery({
|
||||
order_id: this.order_detail.order_id,
|
||||
deliverer: this.localDelivery.deliverer,
|
||||
deliverer_mobile: this.localDelivery.deliverer_mobile
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
this.isRepeat = false;
|
||||
if (res.code == 0) {
|
||||
this.getOrderDetailFn(this.order_detail.order_id);
|
||||
this.localDelivery = {
|
||||
deliverer_mobile: '',
|
||||
deliverer: ''
|
||||
};
|
||||
this.$refs.orderLocalDelivery.close();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getDeliver() {
|
||||
getOrderDeliverList().then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.deliverer = res.data.map(item => {
|
||||
return {
|
||||
label: item.deliver_name,
|
||||
value: item.deliver_name, // 废弃,deliver_id
|
||||
mobile: item.deliver_mobile
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDeliverer(index, item) {
|
||||
if (index >= 0) {
|
||||
this.localDelivery.deliverer_mobile = this.deliverer[index].mobile; // 配送员手机号
|
||||
this.localDelivery.deliverer = item.value; // 配送员
|
||||
} else {
|
||||
this.localDelivery.deliverer_mobile = '';
|
||||
this.localDelivery.deliverer = '';
|
||||
}
|
||||
},
|
||||
viewMember() {
|
||||
this.$util.redirectTo('/pages/member/list', {member_id: this.order_detail.member_id});
|
||||
},
|
||||
/**
|
||||
* 打印小票
|
||||
*/
|
||||
printTicket() {
|
||||
orderPrintTicket(this.order_detail.order_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (Object.values(res.data).length) {
|
||||
let data = Object.values(res.data);
|
||||
try {
|
||||
let print = {
|
||||
printer: []
|
||||
};
|
||||
data.forEach((item) => {
|
||||
print.printer.push({
|
||||
printer_type: item.printer_info.printer_type,
|
||||
host: item.printer_info.host,
|
||||
ip: item.printer_info.ip,
|
||||
port: item.printer_info.port,
|
||||
content: item.content,
|
||||
print_width: item.printer_info.print_width
|
||||
})
|
||||
});
|
||||
this.$pos.send('Print', JSON.stringify(print));
|
||||
} catch (e) {
|
||||
console.log('err', e, res.data)
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未开启订单小票打印'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message ? res.message : '小票打印失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getExpressCompany() {
|
||||
getExpressCompanyList().then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.expressCompany = res.data.map(item => {
|
||||
return {
|
||||
label: item.company_name,
|
||||
value: item.company_id
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
selectExpressCompany(index, item) {
|
||||
if (index >= 0) {
|
||||
this.expresDelivery.express_company_id = parseInt(item.value)
|
||||
} else {
|
||||
this.expresDelivery.express_company_id = 0
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 物流配送订单发货
|
||||
*/
|
||||
orderDelivery() {
|
||||
if (this.expresDelivery.delivery_type == 1) {
|
||||
if (!this.expresDelivery.express_company_id) {
|
||||
this.$util.showToast({
|
||||
title: '请选择物流公司'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.expresDelivery.delivery_no) {
|
||||
this.$util.showToast({
|
||||
title: '请输入物流单号'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!this.expresDelivery.order_goods_ids.length) {
|
||||
this.$util.showToast({
|
||||
title: '请选择要发货的商品'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isLogisticsRepeat) return;
|
||||
this.isLogisticsRepeat = true;
|
||||
|
||||
uni.showLoading({
|
||||
title: ''
|
||||
});
|
||||
orderExpressDelivery({
|
||||
order_id: this.order_detail.order_id,
|
||||
delivery_type: this.expresDelivery.delivery_type,
|
||||
express_company_id: this.expresDelivery.express_company_id,
|
||||
delivery_no: this.expresDelivery.delivery_no,
|
||||
order_goods_ids: this.expresDelivery.order_goods_ids.toString()
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code == 0) {
|
||||
this.isLogisticsRepeat = false;
|
||||
this.getOrderDetailFn(this.order_detail.order_id);
|
||||
this.expresDelivery = {
|
||||
delivery_type: 1,
|
||||
express_company_id: 0,
|
||||
delivery_no: '',
|
||||
order_goods_ids: []
|
||||
};
|
||||
this.$refs.orderDelivery.close();
|
||||
} else {
|
||||
this.isLogisticsRepeat = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
251
addon/cashier/source/os/pages/order/public/js/order_refund.js
Executable file
251
addon/cashier/source/os/pages/order/public/js/order_refund.js
Executable file
@@ -0,0 +1,251 @@
|
||||
import {
|
||||
orderRefundComplete,
|
||||
getOrderRefundLists,
|
||||
getOrderRefundDetail,
|
||||
orderRefundAgree,
|
||||
orderRefundClose,
|
||||
orderRefundRefuse,
|
||||
orderRefundReceive
|
||||
} from '@/api/order_refund.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectGoodsKeys: 0,
|
||||
//获取订单的页数
|
||||
page: 1,
|
||||
//每次获取订单的条数
|
||||
page_size: 8,
|
||||
// 订单搜索是用到的数据
|
||||
search_text: '',
|
||||
//初始时加载详情数据判断
|
||||
one_judge: true,
|
||||
//无限滚动请求锁
|
||||
listLock: true,
|
||||
scrollTop: 0,
|
||||
// 订单列表数据
|
||||
order_list: [],
|
||||
//订单详情数据
|
||||
order_detail: {},
|
||||
tabObj: {
|
||||
list: [{
|
||||
value: 1,
|
||||
name: '基础信息'
|
||||
}, {
|
||||
value: 2,
|
||||
name: '商品信息'
|
||||
}, {
|
||||
value: 3,
|
||||
name: '订单日志'
|
||||
}],
|
||||
index: 1
|
||||
},
|
||||
isRepeat: false,
|
||||
refundRefuseReason: '', // 拒绝理由
|
||||
refundTransfer: {
|
||||
refund_real_money: 0,
|
||||
refund_money_type: 1,
|
||||
shop_refund_remark: ''
|
||||
},
|
||||
isRefundStock: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
// 搜索
|
||||
search() {
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = true;
|
||||
this.getOrderList();
|
||||
},
|
||||
/**
|
||||
* 获取订单列表
|
||||
*/
|
||||
getOrderList() {
|
||||
if (!this.listLock) return false;
|
||||
getOrderRefundLists({
|
||||
page: this.page,
|
||||
page_size: this.page_size,
|
||||
search: this.search_text
|
||||
}).then(res => {
|
||||
if (res.data.list.length == 0) {
|
||||
this.order_detail = {};
|
||||
this.one_judge = false;
|
||||
}
|
||||
if (res.code >= 0) {
|
||||
if (this.order_list.length == 0) {
|
||||
this.order_list = res.data.list;
|
||||
} else {
|
||||
this.order_list = this.order_list.concat(res.data.list);
|
||||
}
|
||||
//初始时加载一遍详情数据
|
||||
if (this.one_judge) {
|
||||
this.getOrderDetail(this.order_list[0].order_goods_id);
|
||||
}
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.scrollTop = 0
|
||||
}
|
||||
if (res.data.list.length < this.page_size) {
|
||||
this.listLock = false
|
||||
} else {
|
||||
this.page++
|
||||
}
|
||||
})
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
/**
|
||||
* 获取订单详情数据
|
||||
*/
|
||||
getOrderDetail(order_goods_id, keys = 0, callback) {
|
||||
this.selectGoodsKeys = keys;
|
||||
getOrderRefundDetail({order_goods_id}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.order_detail = res.data;
|
||||
if (typeof callback == 'function') {
|
||||
callback();
|
||||
}
|
||||
this.$forceUpdate();
|
||||
this.one_judge = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 打开弹出框
|
||||
*/
|
||||
open(action) {
|
||||
if (action == 'orderRefundTransfer') {
|
||||
this.refundTransfer.order_goods_id = this.order_detail.order_goods_id;
|
||||
this.refundTransfer.refund_real_money = this.order_detail.refund_apply_money;
|
||||
this.refundTransfer.refund_money_type = 1;
|
||||
this.refundTransfer.shop_refund_remark = '';
|
||||
}
|
||||
this.$refs[action].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出框
|
||||
*/
|
||||
close(name) {
|
||||
this.$refs[name].close();
|
||||
},
|
||||
// 同意维权
|
||||
orderRefundAgree() {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
orderRefundAgree({order_goods_id: this.order_detail.order_goods_id}).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetail(this.order_detail.order_goods_id);
|
||||
this.$refs.orderRefundAgree.close();
|
||||
}
|
||||
this.isRepeat = false;
|
||||
});
|
||||
},
|
||||
// 拒绝维权
|
||||
orderRefundRefuse() {
|
||||
if (!this.refundRefuseReason) {
|
||||
this.$util.showToast({
|
||||
title: '请输入拒绝理由'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
orderRefundRefuse({
|
||||
order_goods_id: this.order_detail.order_goods_id,
|
||||
refund_refuse_reason: this.refundRefuseReason
|
||||
}).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetail(this.order_detail.order_goods_id);
|
||||
this.$refs.orderRefundRefuse.close();
|
||||
}
|
||||
this.isRepeat = false;
|
||||
});
|
||||
},
|
||||
// 关闭维权
|
||||
orderRefundClose() {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
orderRefundClose({
|
||||
order_goods_id: this.order_detail.order_goods_id
|
||||
}).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetail(this.order_detail.order_goods_id);
|
||||
this.$refs.orderRefundClose.close();
|
||||
}
|
||||
this.isRepeat = false;
|
||||
});
|
||||
},
|
||||
// 转账
|
||||
orderRefundTransfer() {
|
||||
if (!this.refundTransfer.refund_real_money) {
|
||||
this.$util.showToast({
|
||||
title: '请输入退款金额'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var money = parseFloat(this.refundTransfer.refund_real_money);
|
||||
if (isNaN(money)) {
|
||||
this.$util.showToast({
|
||||
title: '请输入正确的退款金额'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (money < 0) {
|
||||
this.$util.showToast({
|
||||
title: '退款金额不能为负数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
orderRefundComplete(this.refundTransfer).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetail(this.order_detail.order_goods_id);
|
||||
this.$refs.orderRefundTransfer.close();
|
||||
}
|
||||
this.isRepeat = false;
|
||||
})
|
||||
},
|
||||
// 买家退货接收,维权收货
|
||||
orderRefundTakeDelivery() {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
orderRefundReceive({
|
||||
order_goods_id: this.order_detail.order_goods_id,
|
||||
is_refund_stock: this.isRefundStock
|
||||
}).then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.getOrderDetail(this.order_detail.order_goods_id);
|
||||
this.$refs.orderRefundTakeDelivery.close();
|
||||
}
|
||||
this.isRepeat = false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
96
addon/cashier/source/os/pages/order/public/js/recharge_order.js
Executable file
96
addon/cashier/source/os/pages/order/public/js/recharge_order.js
Executable file
@@ -0,0 +1,96 @@
|
||||
import {getOrderRechargeDetail, getOrderRechargeList} from '@/api/recharge.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectGoodsKeys: 0,
|
||||
// 订购日志所需列表数据
|
||||
list: [],
|
||||
//获取订单的页数
|
||||
page: 1,
|
||||
//每次获取订单的条数
|
||||
page_size: 8,
|
||||
// 订单搜索是用到的数据
|
||||
search_text: '',
|
||||
//订单类型
|
||||
trade_type: '',
|
||||
//初始时加载详情数据判断
|
||||
one_judge: true,
|
||||
//无限滚动请求锁
|
||||
listLock: true,
|
||||
scrollTop: 0,
|
||||
// 订单列表数据
|
||||
order_list: [],
|
||||
//订单详情数据
|
||||
order_detail: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
// 搜索
|
||||
search() {
|
||||
this.page = 1;
|
||||
this.order_list = [];
|
||||
this.one_judge = true;
|
||||
this.listLock = true;
|
||||
this.getOrderList();
|
||||
},
|
||||
/**
|
||||
* 获取订单列表
|
||||
*/
|
||||
getOrderList() {
|
||||
if (!this.listLock) return false;
|
||||
getOrderRechargeList({
|
||||
page: this.page,
|
||||
page_size: this.page_size,
|
||||
search_text: this.search_text
|
||||
}).then(res => {
|
||||
if (res.data.list.length == 0 && this.one_judge) {
|
||||
this.order_detail = {};
|
||||
this.one_judge = false;
|
||||
}
|
||||
if (res.code >= 0 && res.data.list.length != 0) {
|
||||
if (this.order_list.length == 0) {
|
||||
this.order_list = res.data.list;
|
||||
} else {
|
||||
this.order_list = this.order_list.concat(res.data.list);
|
||||
}
|
||||
|
||||
//初始时加载一遍详情数据
|
||||
if (this.one_judge) {
|
||||
this.getOrderDetail(this.order_list[0].order_id);
|
||||
}
|
||||
}
|
||||
if (this.page == 1) {
|
||||
this.scrollTop = 0
|
||||
}
|
||||
if (res.data.list.length < this.page_size) {
|
||||
this.listLock = false
|
||||
} else {
|
||||
this.page++
|
||||
}
|
||||
})
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
/**
|
||||
* 获取订单详情数据
|
||||
*/
|
||||
getOrderDetail(order_id, keys = 0, callback) {
|
||||
this.selectGoodsKeys = keys;
|
||||
getOrderRechargeDetail({order_id}).then(res => {
|
||||
if (res.code >= 0) {
|
||||
this.order_detail = res.data;
|
||||
if (typeof callback == 'function') {
|
||||
callback();
|
||||
}
|
||||
this.$forceUpdate();
|
||||
this.one_judge = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
174
addon/cashier/source/os/pages/order/rechargeorder.vue
Executable file
174
addon/cashier/source/os/pages/order/rechargeorder.vue
Executable file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="goodslist">
|
||||
<view class="goodslist-box">
|
||||
<view class="goodslist-left">
|
||||
<view class="goods-title">
|
||||
充值订单
|
||||
<text class="iconfont icongengduo1"></text>
|
||||
</view>
|
||||
|
||||
<view class="goods-search">
|
||||
<view class="search">
|
||||
<text class="iconfont icon31sousuo"></text>
|
||||
<input type="text" v-model="search_text" @input="search" placeholder="搜索订单号/流水号/买家" />
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="!one_judge && order_list.length > 0">
|
||||
<scroll-view :scroll-top="scrollTop" @scroll="scroll" scroll-y="true" class="goods-list-scroll" :show-scrollbar="false" @scrolltolower="getOrderList">
|
||||
<view class="item" @click="getOrderDetail(item.order_id, index)" v-for="(item, index) in order_list" :key="index" :class="index == selectGoodsKeys ? 'itemhover' : ''">
|
||||
<view class="title">
|
||||
<view>订单编号:{{ item.order_no }}</view>
|
||||
<view>充值订单</view>
|
||||
</view>
|
||||
<view class="total-money-num">
|
||||
<view class="member-info">
|
||||
<view>买家:</view>
|
||||
<view v-if="item.member_id">{{ item.nickname }}</view>
|
||||
<view v-else>散客</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view>充值金额</view>
|
||||
<view>¥{{ item.face_value }}</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view>实付金额</view>
|
||||
<view>¥{{ item.price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<view class="notYet" v-else-if="!one_judge && order_list.length == 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="goodslist-right">
|
||||
<view class="goods-title">订单详情</view>
|
||||
<view class="order-information" v-show="!one_judge">
|
||||
<block v-if="JSON.stringify(order_detail) != '{}'">
|
||||
<view class="order-status">充值订单</view>
|
||||
<view class="order-types">
|
||||
<view class="type type1">
|
||||
<view>订单编号:</view>
|
||||
<view>{{ order_detail.order_no }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>订单流水号:</view>
|
||||
<view>{{ order_detail.out_trade_no }}</view>
|
||||
</view>
|
||||
|
||||
<view class="type type1">
|
||||
<view>买家:</view>
|
||||
<view v-if="order_detail.member_id">
|
||||
{{ order_detail.nickname }}
|
||||
<text class="look" @click="$util.redirectTo('/pages/member/list', { member_id: order_detail.member_id })">查看</text>
|
||||
</view>
|
||||
<view v-else>散客</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>实付金额:</view>
|
||||
<view>{{ order_detail.price }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>实付方式:</view>
|
||||
<view>{{ order_detail.pay_type_name }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>状态:</view>
|
||||
<view>{{ order_detail.status == 2 ? '已支付' : '未支付' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>支付时间:</view>
|
||||
<view>{{ order_detail.pay_time > 0 ? $util.timeFormat(order_detail.pay_time) : '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>订单来源:</view>
|
||||
<view>{{ order_detail.order_from_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="other-information">
|
||||
<view class="title">其他信息</view>
|
||||
<view class="item-box">
|
||||
<view class="item">
|
||||
<view>套餐名称:</view>
|
||||
<view>{{ order_detail.recharge_name }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>充值面值:</view>
|
||||
<view>{{ order_detail.face_value }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>售价:</view>
|
||||
<view>{{ order_detail.buy_price }}</view>
|
||||
</view>
|
||||
<view class="item" v-if="order_detail.point > 0">
|
||||
<view>赠送积分:</view>
|
||||
<view>{{ order_detail.point }}</view>
|
||||
</view>
|
||||
<view class="item" v-if="order_detail.growth > 0">
|
||||
<view>赠送成长值:</view>
|
||||
<view>{{ order_detail.growth }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-info" v-if="order_detail.coupon_list && order_detail.coupon_list['data'].length > 0">
|
||||
<view class="title">赠送优惠券</view>
|
||||
<view class="table">
|
||||
<view class="table-th table-all">
|
||||
<view class="table-td" style="width:25%">优惠券名称</view>
|
||||
<view class="table-td" style="width:15%">类型</view>
|
||||
<view class="table-td" style="width:35%">优惠金额</view>
|
||||
<view class="table-td" style="width:25%;justify-content: flex-end;">有效期</view>
|
||||
</view>
|
||||
<block v-for="(item, index) in order_detail.coupon_list['data']" :key="index">
|
||||
<view class="table-tr table-all">
|
||||
<view class="table-td" style="width:25%">{{ item.coupon_name }}</view>
|
||||
<view class="table-td" style="width:15%">{{ item.type == 'reward' ? '满减券' : '折扣券' }}</view>
|
||||
<view class="table-td" style="width:40%" v-if="item.type == 'reward'">满{{ item.at_least }}元减{{ item.money }}</view>
|
||||
<view class="table-td" style="width:35%" v-if="item.type == 'discount'">
|
||||
满{{ item.at_least }}元打{{ item.discount }}折
|
||||
<block v-if="item.discount_limit">(最多抵扣{{ item.discount_limit }}元)</block>
|
||||
</view>
|
||||
<view class="table-td uni-column" style="width:25%;text-align: right;align-items: flex-end;">
|
||||
<view v-if="item.end_time">{{ $util.timeFormat(item.end_time) }}</view>
|
||||
<view v-else>长期有效</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="cart-empty" src="@/static/cashier/cart_empty.png" mode="widthFix" />
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import unipopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import rechargeOrder from './public/js/recharge_order';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
unipopup
|
||||
},
|
||||
mixins: [rechargeOrder]
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './public/css/orderlist.scss';
|
||||
|
||||
.goodslist .goodslist-box .goodslist-right .order-information .goods-info {
|
||||
padding: 0.2rem 0;
|
||||
}
|
||||
|
||||
/deep/ .goods-list-scroll {
|
||||
width: 100%;
|
||||
height: calc(100% - 1.71rem) !important;
|
||||
}</style>
|
||||
Reference in New Issue
Block a user