Browse Source

add mall order

account
刘嘉炜 3 years ago
parent
commit
f703781e4f
  1. 1
      src/components/order_list/mall/mall.vue
  2. 1
      src/subpackage/order/js/api.js
  3. 56
      src/subpackage/order/pages/mall/check_logistic/check_logistic.vue
  4. 50
      src/subpackage/order/pages/mall/detail/detail.vue
  5. 141
      src/subpackage/order/pages/mall/refund_operate/refund_operate.vue
  6. 150
      src/subpackage/order/pages/mall/send_out/send_out.vue
  7. 2
      src/subpackage/order/pages/order_manage/order_manage.vue
  8. BIN
      src/subpackage/order/static/images/package_icon.png

1
src/components/order_list/mall/mall.vue

@ -87,7 +87,6 @@ export default {
width: 152upx;
height: 152upx;
border-radius: 10upx;
background-color: skyblue;
}
.ri-view{

1
src/subpackage/order/js/api.js

@ -20,6 +20,7 @@ export const ORDER_API = {
erpshList:`${ORIGIN}/stadium/erpsh/newList`, // 商城订单管理-统一的仓库列表
shop2OrderLogistics:`${ORIGIN}/admin/shop2/orderLogistics`, // 商城订单管理 - 发货_
logisticsCompanyLs:`${ORIGIN}/shop2/logisticsCompany/List`, // 商城订单管理 - 快递公司列表
orderGoodsRefund:`${ORIGIN}/admin/shop2/orderGoodsRefund`, // 商城-商品退款_copy
}

56
src/subpackage/order/pages/mall/check_logistic/check_logistic.vue

@ -1,24 +1,64 @@
<template>
<view class="check-logistic">
<view class="package-list">
<view class="pl-item" v-for="i in 2" :key="i">
<view class="pi-tit">包裹1</view>
<view class="pi-express"><view>快递顺丰速递 SF1090317923085</view><view>复制</view></view>
<view class="pl-item" v-for="(e, i) in logisticsInfo" :key="i">
<view class="pi-tit">包裹{{ i+1 }}</view>
<view class="pi-express">
<view>快递快递{{ e.logistics_info.logistics_name || '-' }} {{ e.logistics_info.logistics_no || '-' }}</view>
<view @click="copyNo(e.logistics_info.logistics_no || '-')">复制</view>
</view>
<view class="pi-goods">
<view class="pg-item" v-for="i in 4" :key="i">
<image></image>
<view>克洛羽毛球</view>
<view class="pg-item" v-for="(k, j) in e.logistics_product_lite_list" :key="j">
<image mode="aspectFill" :src="k.product_imgs"></image>
<view>{{ k.product_name || '-' }}</view>
</view>
</view>
<view class="pi-total">10件商品</view>
<view class="pi-total">{{ e.logistics_product_lite_list.length || 0 }}件商品</view>
</view>
</view>
</view>
</template>
<script>
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
export default {
computed: {
logisticsInfo(){
let { orderInfo } = this;
if(orderInfo.product_order_logistics_data&&orderInfo.product_order_logistics_data.length){
return orderInfo.product_order_logistics_data
}
return []
},
},
onLoad(options){
this.getInfo(options.order_no);
},
data(){
return {
orderInfo: {},
}
},
methods: {
copyNo(num){
uni.setClipboardData({ data: num });
},
getInfo(order_no){
util.showLoad();
server.get({
url: ORDER_API.shop2OrderInfo,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
let _order = res.order || {};
this.orderInfo = _order;
})
},
}
}
</script>

50
src/subpackage/order/pages/mall/detail/detail.vue

@ -2,12 +2,12 @@
<view class="mall-detail">
<view class="md-send">
<view class="ms-status-bar">{{ orderInfo.status_text || '-' }}</view>
<view class="ms-send-info">
<view class="ms-send-info" v-if="logisticsInfo" @click="toLogisticInfo">
<view class="msi-txt">
<view>快递顺丰速递 SF1090317923085</view>
<view>复制</view>
<view>快递{{ logisticsInfo.logistics_info.logistics_name || '-' }} {{ logisticsInfo.logistics_info.logistics_no || '-' }}</view>
<view @click.stop="copyLogisticNum(logisticsInfo.logistics_info.logistics_no || '-')">复制</view>
</view>
<image></image>
<image mode="aspectFit" src="/subpackage/order/static/images/arrow.png"></image>
</view>
<view class="ms-main">
<view class="md-box ms-consignee">
@ -19,7 +19,6 @@
<view class="mc-code">取货码{{ orderInfo.product_order_self_pickup_info.gcode || '-' }}</view>
<view class="mc-time">取货时间 {{ orderInfo.product_order_self_pickup_info.gtime || '-' }}</view>
</block>
</view>
<view class="md-box ms-goods-info">
<view class="md-tit">商品信息</view>
@ -41,7 +40,8 @@
</view>
<view class="mi-amount">
<view>实付¥<text>{{ e.product_price_pay || 0 }}</text></view>
<view>已退款</view>
<!-- <view>已退款</view> -->
</view>
</view>
</view>
@ -80,9 +80,9 @@
</view>
<view class="ms-fixed-bar">
<view class="mfb-btns">
<view>查看退款</view>
<view class="red">主动退款</view>
<view class="green" @click="toSendOut">发货</view>
<!-- <view>查看退款</view> -->
<view v-if="orderInfo.status == 1" class="red" @click="toRefund">主动退款</view>
<view v-if="orderInfo.status == 1" class="green" @click="toSendOut">发货</view>
</view>
</view>
</view>
@ -91,6 +91,7 @@
</template>
<script>
// 0 / 1 / 2 / 3 / 4 / 5 / 6 退 / 7 退 / 8 退 / 9
import p_line from '../../../components/p_line/p_line.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
@ -101,6 +102,13 @@ export default {
let { orderInfo } = this;
if(orderInfo&&orderInfo.product_order_custom)return (orderInfo.product_order_custom || {})
return {};
},
logisticsInfo(){
let { orderInfo } = this;
if(orderInfo.product_order_logistics_data&&orderInfo.product_order_logistics_data.length){
return orderInfo.product_order_logistics_data[orderInfo.product_order_logistics_data.length - 1]; //
}
return null
}
},
components: {
@ -115,6 +123,29 @@ export default {
this.getInfo(options.order_no);
},
methods: {
// 退
toRefund(){
let { orderInfo } = this;
// let _ls = this.sendAndNotRefundList() || [];
// if(!_ls.length)return;
// if(_ls.length == 1)
return util.routeTo(`/subpackage/order/pages/mall/refund_operate/refund_operate?order_no=${orderInfo.order_no}&brand_id=${orderInfo.brand_id}`, 'nT');
// util.routeTo(`/subpackage/order/pages/mall/refund_list/refund_list?order_no=${orderInfo.order_no}&brand_id=${orderInfo.brand_id}`, 'nT');
},
// 退
// sendAndNotRefundList(){
// let { orderInfo } = this;
// let _goodsLs = orderInfo.product_order_goods || [];
// return _goodsLs.filter(ele=>ele.product_logistics_end == 1&&ele.product_refund_utype == 0);
// },
//
toLogisticInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/mall/check_logistic/check_logistic?order_no=${orderInfo.order_no}&brand_id=${orderInfo.brand_id}`, 'nT');
},
copyLogisticNum(_data){
uni.setClipboardData({ data: _data });
},
toSendOut(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/mall/send_out/send_out?order_no=${orderInfo.order_no}&brand_id=${orderInfo.brand_id}`, 'nT');
@ -178,7 +209,6 @@ export default {
flex-shrink: 0;
width: 32upx;
height: 32upx;
background-color: skyblue;
}
}

141
src/subpackage/order/pages/mall/refund_operate/refund_operate.vue

@ -1,40 +1,147 @@
<template>
<view class="refund-operate">
<view class="ro-num">订单编号 sc20 0822 0815 6894</view>
<view class="ro-num">订单编号 {{ orderInfo.order_no || '-' }}</view>
<view class="ro-box ro-goods-info">
<view class="rgi-list" v-if="false">
<view class="rl-item" v-for="i in 3" :key="i">
<image></image>
<view>克洛羽毛球</view>
<view class="rgi-single" v-if="refundLs.length == 1">
<image mode="aspectFill" :src="refundLs[0].product_imgs"></image>
<view>{{ refundLs[0].product_name || '-' }}</view>
</view>
<view class="rgi-list" v-else>
<view class="rl-item" v-for="(e, i) in refundLs" :key="i">
<image mode="aspectFill" :src="e.product_imgs"></image>
<view>{{ e.product_name || '-' }}</view>
</view>
</view>
<view class="rgi-single">
<image></image>
<view>克洛斯威羽毛球拍2支装C8正品碳素成人进攻型羽毛球比赛用</view>
<view class="rgi-total">
<text>{{ refundLs.length || 0 }}</text>
<!-- <image v-if="refundLs.length > 1" mode="aspectFit" src="/subpackage/order/static/images/arrow.png"></image> -->
</view>
<view class="rgi-total"><text>共3件</text><image></image></view>
</view>
<view class="ro-box ro-refund-info">
<view class="rri-txt">最大可退金额 <text>179.7</text>含运费0</view>
<view class="rri-txt">可退积分100积分</view>
<view class="rri-line">
<view class="rri-txt">最大可退金额 <text>{{ orderInfo.pay_amount || 0 }}</text>含运费{{ orderInfo.product_logistics_price || 0 }}</view>
<view class="rri-txt">可退积分{{ orderInfo.deduction_integral || 0 }} 积分</view>
<!-- 不支持部分退款 -->
<!-- <view class="rri-line">
<view class="rl-name"><text>*</text>退款金额</view>
<view class="rl-frame"><input /></view>
<view class="rl-frame"><input v-model="refundAmount" /></view>
</view>
<view class="rri-line">
<view class="rl-name"><text>*</text>回退积分</view>
<view class="rl-frame"><input /></view>
<view class="rl-frame"><input v-model="refundIntegral" /></view>
</view>
</view>
</view> -->
<view class="ro-bar">
<view>确定</view>
<view @click="confirmRefund">确定</view>
</view>
</view>
</template>
<script>
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
import { servers } from '../../../../../js/server';
export default {
computed: {
maxAmount(){
let { refundLs } = this;
let _amount = 0;
refundLs.forEach(ele=>_amount+=(+ele.refundable_amount || 0));
return _amount.toFixed(2);
},
maxIntegral(){
let { refundLs } = this;
let _integral = 0;
refundLs.forEach(ele=>_integral+=(+ele.refundable_integral || 0));
return _integral.toFixed(0);
},
refundLs(){
let { orderInfo, selectedLs } = this;
let _selectedArr = selectedLs.split(',');
let _goodsArr = orderInfo.product_order_goods || [];
return _goodsArr;
// 退
// return _goodsArr.filter(ele=>{
// return _selectedArr.includes((ele.product_id + ''));
// })
},
},
data(){
return {
orderInfo: {},
selectedLs: '',
refundAmount: '',
refundIntegral: '',
}
},
onLoad(options){
this.getInfo(options.order_no);
},
methods: {
confirmRefund: util.debounce(function(){
util.showModal({
title: '提示',
content: '确认对该订单进行退款操作吗?',
showCancel: true,
confirmText: '确认',
success: res => {
let { orderInfo } = this;
if(res.confirm)this.refundReq({
brand_id: orderInfo.brand_id,
order_no: orderInfo.order_no,
product_cart_id: orderInfo.product_order_goods.map(ele=>ele.product_cart_id).join(','),
integral: orderInfo.integral,
amount: orderInfo.amount,
})
}
})
}, 300, true),
refundReq({
brand_id,
order_no,
product_cart_id,
integral,
amount,
}){
util.showLoad();
servers.post({
url: ORDER_API.orderGoodsRefund,
data: {
brand_id,
order_no: order_no,
product_cart_id: product_cart_id,
integral: integral,
amount: amount,
},
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setInterval(util.routeTo, 1200);
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},
getInfo(order_no){
util.showLoad();
server.get({
url: ORDER_API.shop2OrderInfo,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
let _order = res.order || {};
this.orderInfo = _order;
})
},
}
}
</script>
@ -71,7 +178,6 @@ export default {
vertical-align: middle;
width: 30upx;
height: 30upx;
background-color: skyblue;
}
}
.rgi-list{
@ -83,7 +189,6 @@ export default {
width: 152upx;
height: 152upx;
border-radius: 10upx;
background-color: skyblue;
}
>view{

150
src/subpackage/order/pages/mall/send_out/send_out.vue

@ -25,105 +25,108 @@
<view class="os-wait" v-if="curTab == 0">
<!-- 没数据 -->
<view class="os-null" v-if="!waitdeliverLs.length">
<image></image>
<view>发货</view>
<image src="/subpackage/order/static/images/package_icon.png"></image>
<view>发货</view>
</view>
<view class="oh-box ow-goods" v-else>
<view class="og-header">
<view class="oh-tit"><text>*</text>请选择商品发货</view>
<view class="oh-select">
<view @click="sendOutSelectAll">全选</view>
<view>
<image v-if="isSelectedAllSendOut" mode="aspectFit" src="/subpackage/order/static/images/selected.png"></image>
<block v-else>
<view class="oh-box ow-goods">
<view class="og-header">
<view class="oh-tit"><text>*</text>请选择商品发货</view>
<view class="oh-select">
<view @click="sendOutSelectAll">全选</view>
<view>
<image v-if="isSelectedAllSendOut" mode="aspectFit" src="/subpackage/order/static/images/selected.png"></image>
</view>
</view>
</view>
</view>
<view class="og-list">
<view class="ol-item" v-for="(e, i) in waitdeliverLs" :key="i" @click="goodsItemClick(e)">
<view class="oi-select">
<image v-if="selectedSendOutIds.includes(e.product_id)" mode="aspectFit" src="/subpackage/order/static/images/selected.png"></image>
</view>
<image mode="aspecfFill" :src="e.product_imgs"></image>
<view class="oi-info">
<view class="oi-tit">{{ e.product_name || '-' }}</view>
<view class="oi-spec" v-if="e.product_spec_multi_info&&e.product_spec_multi_info.spec_info&&e.product_spec_multi_info.spec_info.length">
<block v-for="(k, j) in e.product_spec_multi_info.spec_info" :key="j">
{{ k + ';' }}
</block>
<view class="og-list">
<view class="ol-item" v-for="(e, i) in waitdeliverLs" :key="i" @click="goodsItemClick(e)">
<view class="oi-select">
<image v-if="selectedSendOutIds.includes(e.product_id)" mode="aspectFit" src="/subpackage/order/static/images/selected.png"></image>
</view>
<image mode="aspecfFill" :src="e.product_imgs"></image>
<view class="oi-info">
<view class="oi-tit">{{ e.product_name || '-' }}</view>
<view class="oi-spec" v-if="e.product_spec_multi_info&&e.product_spec_multi_info.spec_info&&e.product_spec_multi_info.spec_info.length">
<block v-for="(k, j) in e.product_spec_multi_info.spec_info" :key="j">
{{ k + ';' }}
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="oh-box ow-warehouse" >
<view class="oh-tit"><text>*</text>发货仓库</view>
<picker :range="warehouseList" range-key="erp_name" @change="warehouseChange">
<view class="ow-picker">
<input disabled placeholder="请选择发货仓库" :value="selectedWarehouse.erp_name" />
<image mode="aspectFit" src="/subpackage/order/static/images/down_arrow.png"></image>
</view>
</picker>
<view class="ow-tip">商品如果不在同一仓库请分开发货</view>
</view>
<view class="oh-box ow-logistics">
<view class="oh-tit">发货物流</view>
<view class="ol-line">
<view class="ol-name"><text>* </text>发货方式</view>
<view class="ol-mode">
<view class="om-item">
<view :class="[ sendOutMethod == 0 ? 'active' : '' ]" @click="sendOutMethod = 0"></view>
<view @click="sendOutMethod = 0">快递</view>
<view class="oh-box ow-warehouse" >
<view class="oh-tit"><text>*</text>发货仓库</view>
<picker :range="warehouseList" range-key="erp_name" @change="warehouseChange">
<view class="ow-picker">
<input disabled placeholder="请选择发货仓库" :value="selectedWarehouse.erp_name" />
<image mode="aspectFit" src="/subpackage/order/static/images/down_arrow.png"></image>
</view>
<view class="om-item">
<view :class="[ sendOutMethod == 1 ? 'active' : '' ]" @click="sendOutMethod = 1"></view>
<view @click="sendOutMethod = 1">无需快递</view>
</view>
</view>
</picker>
<view class="ow-tip">商品如果不在同一仓库请分开发货</view>
</view>
<block v-if="sendOutMethod == 0">
<view class="oh-box ow-logistics">
<view class="oh-tit">发货物流</view>
<view class="ol-line">
<view class="ol-name"><text>* </text>物流公司</view>
<view class="ol-company">
<picker :range="logisticsCompanyLs" @change="logisticsChange">
<view class="ol-name"><text>* </text>发货方式</view>
<view class="ol-mode">
<view class="om-item">
<view :class="[ sendOutMethod == 0 ? 'active' : '' ]" @click="sendOutMethod = 0"></view>
<view @click="sendOutMethod = 0">快递</view>
</view>
<view class="om-item">
<view :class="[ sendOutMethod == 1 ? 'active' : '' ]" @click="sendOutMethod = 1"></view>
<view @click="sendOutMethod = 1">无需快递</view>
</view>
</view>
</view>
<block v-if="sendOutMethod == 0">
<view class="ol-line">
<view class="ol-name"><text>* </text>物流公司</view>
<view class="ol-company">
<picker :range="logisticsCompanyLs" @change="logisticsChange">
<view class="oc-ipt-frame">
<input disabled placeholder="请选择物流公司" :value="curlogisticsName" />
<image mode="aspectFit" src="/subpackage/order/static/images/down_arrow.png"></image>
</view>
</picker>
</view>
</view>
<view class="ol-line">
<view class="ol-name"><text>* </text>物流单号</view>
<view class="ol-company">
<view class="oc-ipt-frame">
<input disabled placeholder="请选择物流公司" :value="curlogisticsName" />
<image mode="aspectFit" src="/subpackage/order/static/images/down_arrow.png"></image>
<input placeholder="请输入物流单号" v-model="logisticsOrderNum" />
</view>
</picker>
</view>
</view>
</view>
<view class="ol-line">
<view class="ol-name"><text>* </text>物流单号</view>
</block>
<view class="ol-line" v-if="sendOutMethod == 1">
<view class="ol-name"><text>* </text>备注</view>
<view class="ol-company">
<view class="oc-ipt-frame">
<input placeholder="请输入物流单号" v-model="logisticsOrderNum" />
<input placeholder="备注" v-model="sendOutRemark" />
</view>
</view>
</view>
</block>
<view class="ol-line" v-if="sendOutMethod == 1">
<view class="ol-name"><text>* </text>备注</view>
<view class="ol-company">
<view class="oc-ipt-frame">
<input placeholder="备注" v-model="sendOutRemark" />
</view>
</view>
</view>
</view>
<cover-view class="ow-btn">
<cover-view class="ob-btn" @click="confirmSendOutBtn">确认发货</cover-view>
</cover-view>
<cover-view class="ow-btn">
<cover-view class="ob-btn" @click="confirmSendOutBtn">确认发货</cover-view>
</cover-view>
</block>
</view>
<!-- 已发货 -->
<view class="os-yet" v-if="curTab == 1">
<!-- 没数据 -->
<view class="os-null" v-if="!shippedLs.length">
<image></image>
<image mode="aspectFit" src="/subpackage/order/static/images/package_icon.png"></image>
<view>无已发货</view>
</view>
<view class="package-list" v-else>
@ -720,7 +723,6 @@ export default {
margin: 0 auto 68upx;
width: 260upx;
height: 260upx;
background-color: skyblue;
}
>view{
line-height: 44upx;

2
src/subpackage/order/pages/order_manage/order_manage.vue

@ -38,7 +38,7 @@ export default {
util.routeTo(getTabRoutePath() + `?order_type=${ele.orderType}`,'nT');
},
isFinish(key){
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8 ];
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11 ];
return _endKeyArr.includes(key);
}
}

BIN
src/subpackage/order/static/images/package_icon.png

After

Width: 520  |  Height: 520  |  Size: 14 KiB

Loading…
Cancel
Save