This commit is contained in:
weipengfei 2023-12-27 15:00:12 +08:00
parent b4a459f0cb
commit 8b82c6be8c
6 changed files with 1523 additions and 3 deletions

View File

@ -15,6 +15,18 @@ import request from './request'
export function orderListApi(data) {
return request.get('order/lst', data)
}
/**
* @description 转账订单 -- 列表
*/
export function orderOtherListApi(data) {
return request.get('order_other/lst', data)
}
/**
* @description 转账订单 -- 上传凭证
*/
export function orderOtherPayOrder(data) {
return request.post('order_other/pay_order', data)
}
/**
* @description 订单 -- 表头
@ -43,18 +55,31 @@ export function orderDeliveryApi(id) {
return request.get(`store/order/delivery/${id}/form`)
}
/**
* @description 订单 -- 详情
*/
export function orderDetailApi(id) {
return request.get(`order/detail/${id}`)
}
/**
* @description 订单 -- 详情
*/
export function orderOtherDetailApi(id) {
return request.get(`order_other/detail/${id}`)
}
/**
* @description 订单 -- 记录
*/
export function orderLogApi(id, data) {
return request.get(`order/status/${id}`, data)
}
/**
* @description 订单 -- 记录
*/
export function orderOtherLogApi(id, data) {
return request.get(`order_other/status/${id}`, data)
}
/**
* @description 退款订单 -- 列表
*/
@ -67,6 +92,12 @@ export function refundorderListApi(data) {
export function getChildrenOrderApi(id) {
return request.get(`order/children/${id}`)
}
/**
* @description 订单 -- 子订单
*/
export function getChildrenOrderOtherApi(id) {
return request.get(`order_other/children/${id}`)
}
/**
* @description 获取物流信息
*/
@ -79,6 +110,12 @@ export function getExpress(id) {
export function exportOrderApi(data) {
return request.get(`order/excel`, data )
}
/**
* @description 导出订单
*/
export function exportOrderOtherApi(data) {
return request.get(`order_other/excel`, data )
}
/**
* @description 导出退款单
*/
@ -156,4 +193,4 @@ export function takeOrderListApi(data) {
*/
export function rechargeBalancei() {
return request.get(`delivery/belence`)
}
}

17
src/api/public.js Normal file
View File

@ -0,0 +1,17 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import request from './request'
/**
* @description 上传图片
*/
export function uploadImage(data) {
return request.post('upload/image/0/file', data)
}

View File

@ -44,7 +44,15 @@ const orderRouter =
title: '核销订单'
},
component: () => import('@/views/order/orderCancellate/index')
}
},
{
path: 'listTransfer',
name: 'listTransfer',
meta: {
title: '转账订单'
},
component: () => import('@/views/order/listTransfer/index')
},
]
}

View File

@ -494,7 +494,7 @@ export default {
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return

View File

@ -0,0 +1,732 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" inline label-width="100px">
<!-- <el-form-item label="订单状态:">
<el-radio-group v-model="tableFrom.status" type="button" @change="getList(1),getCardList()">
<el-radio-button label="">全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
<el-radio-button
label="1"
>待付款 {{ '(' +orderChartType.unpaid?orderChartType.unpaid:0+ ')' }}</el-radio-button>
<el-radio-button
label="2"
>待发货 {{ '(' +orderChartType.unshipped?orderChartType.unshipped:0+ ')' }}</el-radio-button>
<el-radio-button
label="3"
>待收货 {{ '(' +orderChartType.untake?orderChartType.untake:0+ ')' }}</el-radio-button>
<el-radio-button
label="4"
>待评价 {{ '(' +orderChartType.unevaluate?orderChartType.unevaluate:0+ ')' }}</el-radio-button>
<el-radio-button
label="5"
>交易完成 {{ '(' +orderChartType.complete?orderChartType.complete:0+ ')' }}</el-radio-button>
<el-radio-button
label="6"
>已退款 {{ '(' +orderChartType.refund?orderChartType.refund:0+ ')' }}</el-radio-button>
<el-radio-button
label="7"
>已删除 {{ '(' +orderChartType.del?orderChartType.del:0+ ')' }}</el-radio-button>
</el-radio-group>
</el-form-item> -->
<el-form-item label="时间选择:" class="width100">
<el-radio-group
v-model="tableFrom.date"
type="button"
class="mr20"
size="small"
@change="selectChange(tableFrom.date)"
>
<el-radio-button
v-for="(item,i) in fromList.fromTxt"
:key="i"
:label="item.val"
>{{ item.text }}</el-radio-button>
</el-radio-group>
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd"
format="yyyy/MM/dd"
size="small"
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 250px;"
@change="onchangeTime"
/>
</el-form-item>
<!-- <el-form-item label="活动类型:" style="display: inline-block;">
<el-select
v-model="tableFrom.activity_type"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option
v-for="item in activity"
:key="item.type"
:label="item.name"
:value="item.type"
/>
</el-select>
</el-form-item> -->
<el-form-item label="商户名称:" style="display: inline-block;">
<el-select
v-model="tableFrom.mer_id"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option
v-for="item in merSelect"
:key="item.mer_id"
:label="item.mer_name"
:value="item.mer_id"
/>
</el-select>
</el-form-item>
<el-form-item label="商户类别:" style="display: inline-block;">
<el-select
v-model="tableFrom.is_trader"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option label="自营" value="1" />
<el-option label="非自营" value="0" />
</el-select>
</el-form-item>
<el-form-item label="商品名称:" class="width100" style="display: inline-block;">
<el-input
v-model="tableFrom.store_name"
@keyup.enter.native="getList(1),getCardList()"
placeholder="请输入商品名称"
class="selWidth"
size="small"
>
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1),getCardList()" />
</el-input>
</el-form-item>
<el-form-item label="关键字:" class="width100" style="display: inline-block;">
<el-input
v-model="tableFrom.keywords"
@keyup.enter.native="getList(1),getCardList()"
placeholder="请输入订单号/收货人/联系方式"
class="selWidth"
size="small"
>
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1),getCardList()" />
</el-input>
</el-form-item>
<el-form-item label="总单单号:" class="width100" style="display: inline-block;">
<el-input
v-model="tableFrom.group_order_sn"
@keyup.enter.native="getList(1),getCardList()"
placeholder="请输入总单单号"
class="selWidth"
size="small"
>
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1),getCardList()" />
</el-input>
</el-form-item>
<el-form-item label="用户信息:" class="width100" style="display: inline-block;">
<el-input
v-model="tableFrom.username"
@keyup.enter.native="getList(1),getCardList()"
placeholder="请输入用户昵称/手机号"
class="selWidth"
size="small"
>
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1),getCardList()" />
</el-input>
<el-button size="small" type="primary" icon="el-icon-top" @click="exports">导出列表</el-button>
<!-- <el-button size="small" type="primary" @click="getExportFileList">导出记录</el-button> -->
</el-form-item>
</el-form>
</div>
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.order_type" @tab-click="getList(1),getCardList()">
<el-tab-pane v-for="(item,index) in headeNum" :key="index" :name="item.order_type.toString()" :label="item.title +'('+item.count +')' " />
</el-tabs>
<!-- <cards-data :card-lists="cardLists" /> -->
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
class="table"
highlight-current-row
:cell-class-name="addTdClass"
>
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="商品总价:">
<span>{{ props.row.total_price | filterEmpty }}</span>
</el-form-item>
<el-form-item label="下单时间:">
<span>{{ props.row.create_time | filterEmpty }}</span>
</el-form-item>
<el-form-item label="用户备注:">
<span>{{ props.row.mark | filterEmpty }}</span>
</el-form-item>
<el-form-item label="商家备注:">
<span>{{ props.row.remark | filterEmpty }}</span>
</el-form-item>
<el-form-item label="总单号:">
<span>{{ props.row.groupOrder ? props.row.groupOrder.group_order_sn : '' }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column label="订单编号" min-width="170">
<template slot-scope="scope">
<span style="display: block;" v-text="scope.row.order_sn" />
<span v-show="scope.row.is_del > 0" style="color: #ED4014;display: block;">用户已删除</span>
</template>
</el-table-column>
<el-table-column label="用户信息" min-width="170">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native="onUserDetails(scope.row.uid)">{{scope.row.user&&scope.row.user.nickname +'/'+ scope.row.uid}}</el-button>
</template>
</el-table-column>
<el-table-column label="订单类型" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.is_virtual == 1 ? "虚拟订单" : scope.row.order_type == 0 ? "普通订单" : "核销订单" }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="活动类型" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.activity_type != 4">{{ scope.row.activity_type === 1 ? "秒杀" : scope.row.activity_type === 2 ? "预售" : scope.row.activity_type === 3 ? "助力" : "--"}}</span>
<span v-else>拼团订单 <span v-if="scope.row.groupUser && scope.row.groupUser.groupBuying">-{{scope.row.groupUser.groupBuying.status | activityOrderStatus}}</span></span>
</template>
</el-table-column> -->
<el-table-column prop="real_name" label="收货人/订购人" min-width="120" />
<el-table-column label="商户名称" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.merchant ? scope.row.merchant.mer_name :'' }}</span>
</template>
</el-table-column>
<el-table-column prop="mer_name" label="商户类别" min-width="90">
<template slot-scope="scope">
<span v-if="scope.row.merchant" class="spBlock">{{ scope.row.merchant.is_trader ? '自营' : '非自营' }}</span>
</template>
</el-table-column>
<el-table-column label="商品信息" min-width="330">
<template slot-scope="scope">
<div
v-for="(val, i) in scope.row.orderProduct"
:key="i"
class="tabBox acea-row row-middle"
>
<div class="demo-image__preview">
<el-image
:src="val.cart_info.product.image"
:preview-src-list="[val.cart_info.product.image]"
/>
</div>
<span
class="tabBox_tit"
>{{ val.cart_info.product.store_name + ' | ' }}{{ val.cart_info.productAttr.sku }}</span>
<span class="tabBox_pice">
{{ '¥'+ val.cart_info.productAttr.price + ' x '+ val.product_num }}
<em
v-if="val.refund_num < val.product_num && val.refund_num > 0"
style="color: red;font-style: normal;"
>(-{{ val.product_num - val.refund_num }})</em>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="实际支付" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.pay_price }}</span>
<p v-if="scope.row.finalOrder">尾款{{ scope.row.finalOrder.pay_price }}</p>
</template>
</el-table-column>
<el-table-column label="订单佣金" min-width="100">
<template slot-scope="scope">
<span>{{ (parseFloat(scope.row.extension_one) + parseFloat(scope.row.extension_two) + parseFloat(scope.row.refund_extension_one) + parseFloat(scope.row.refund_extension_two)).toFixed(2) }}</span>
<em v-if="(scope.row.refund_extension_one > 0) || (scope.row.refund_extension_two > 0)" style="color: red;font-style: normal;">(-{{ (parseFloat(scope.row.refund_extension_one)+parseFloat(scope.row.refund_extension_two)).toFixed(2) }})</em>
</template>
</el-table-column>
<el-table-column label="支付类型" min-width="80">
<template slot-scope="scope">
<span v-if="scope.row.paid === 1">{{ scope.row.pay_type | orderPayType }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column label="支付状态" min-width="80">
<template slot-scope="scope">
<span>{{ scope.row.paid == 0 ? "未支付" : "已支付" }}</span>
</template>
</el-table-column>
<el-table-column label="订单状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.is_del === 0">
<span v-if="scope.row.paid === 0">待付款</span>
<span v-else>
<span v-if="scope.row.order_type === 0 || scope.row.order_type === 2">{{ scope.row.status | orderStatusFilter }}</span>
<span v-else>{{ scope.row.status | takeOrderStatusFilter }}</span>
</span>
</span>
<span v-else>已删除</span>
</template>
</el-table-column>
<el-table-column prop="serviceScore" label="下单时间" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<el-table-column label="推广人" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.spread && scope.row.spread.nickname || '无' }}</span>
</template>
</el-table-column>
<el-table-column label="上级推广人" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.TopSpread && scope.row.TopSpread.nickname || '无' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="80" fixed="right" align="center">
<template slot-scope="scope">
<span v-for="(val, i ) in scope.row.orderProduct" :key="i">
<el-button
v-if="orderFilter(scope.row)"
type="text"
size="small"
@click="onRefundDetail(scope.row.order_sn)"
>查看退款单</el-button>
</span>
<el-button type="text" size="small" @click="onOrderDetails(scope.row.order_id)">详情</el-button>
<el-button type="text" size="small" @click="uploadVoucher(scope.row)">上传凭证</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<!--用户信息-->
<el-dialog v-if="uid" title="用户详情" :visible.sync="visibleDetail" width="1000px" :before-close="Close">
<user-details v-if="visibleDetail" ref="userDetails" :uid="uid" :cancel-time="cancel_time" />
</el-dialog>
<!--导出订单列表-->
<file-list ref="exportList" />
<!--详情-->
<order-detail
ref="orderDetail"
:orderId="orderId"
@closeDrawer="closeDrawer"
@changeDrawer="changeDrawer"
:drawer="drawer"
></order-detail>
<el-dialog
v-if="dialogVoucher"
title="上传凭证"
:visible.sync="dialogVoucher"
width="500px"
:before-close="closeDialogVoucher"
>
<el-form :model="voucherInfo">
<el-form-item label="订单编号" label-width="100px">
<el-input v-model="voucherInfo.order_sn" disabled></el-input>
</el-form-item>
<el-form-item label="凭证图片" label-width="100px">
<div style="display: flex">
<el-upload
class="upload-demo"
drag
action="store/import/import_images"
:multiple="false"
:http-request="uploadVoucherImage"
:accept="'image/*'"
:limit="1"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将凭证图片拖到此处<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
只能上传图片文件
</div>
</el-upload>
</div>
</el-form-item>
<div style="display: flex;justify-content: flex-end;">
<el-button size="small" @click="closeDialogVoucher">取消</el-button>
<el-button size="small" type="primary" @click="addVoucher">确认</el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import { orderOtherListApi, chartApi, cardListApi, exportOrderOtherApi, orderOtherPayOrder } from "@/api/order";
import { merSelectApi } from "@/api/product";
import { uploadImage } from "@/api/public";
import userDetails from '../../user/list/userDetails';
import orderDetail from './orderDetails.vue';
import fileList from '@/components/exportFile/fileList';
import createWorkBook from '@/utils/newToExcel.js';
import cardsData from "@/components/cards/index";
import { fromList } from "@/libs/constants.js";
import { Message } from 'element-ui';
export default {
components: { orderDetail, cardsData, fileList, userDetails },
data() {
return {
orderId: 0,
tableData: {
data: [],
total: 0,
},
dialogVoucher: false, //
voucherInfo: {
group_order_id: '',
order_sn: '',
image: '',
},
activity: [
{name: "秒杀订单",type: 1},
{name: "预售订单",type: 2},
{name: "助力订单",type: 3},
{name: "拼团订单",type: 4}
],
listLoading: true,
tableFrom: {
order_sn: this.$route.query.order_sn ? this.$route.query.order_sn : "",
group_order_sn: '',
keywords: "",
username: "",
store_name: "",
status: "",
date: "",
mer_id: "",
page: 1,
limit: 20,
is_trader: '',
activity_type: ''
},
orderChartType: {},
headeNum: [],
timeVal: [],
fromList: fromList,
selectionList: [],
ids: "",
uid: "",
visibleDetail: false,
tableFromLog: {
page: 1,
limit: 10,
},
tableDataLog: {
data: [],
total: 0,
},
LogLoading: false,
dialogVisible: false,
cardLists: [],
orderDatalist: null,
merSelect: [],
drawer: false,
};
},
mounted() {
if (this.$route.query.hasOwnProperty("order_sn")) {
this.tableFrom.order_sn = this.$route.query.order_sn;
} else {
this.tableFrom.order_sn = "";
}
this.headerList();
this.getMerSelect();
this.getCardList()
this.getList('');
},
//
activated() {
if (this.$route.query.hasOwnProperty("order_sn")) {
this.tableFrom.order_sn = this.$route.query.order_sn;
} else {
this.tableFrom.order_sn = "";
}
this.headerList();
this.getMerSelect();
this.getCardList()
this.getList('');
},
methods: {
// 退
onRefundDetail(sn) {
console.log(sn, "sn");
this.$router.push({
path: "refund",
query: {
sn: sn,
},
});
},
//
orderFilter(item) {
let status = false;
item.orderProduct.forEach((el) => {
if (el.refund_num > 0 && el.refund_num < el.product_num) {
status = true;
}
});
return status;
},
//
addTdClass(val) {
if (val.row.status > 0 && val.row.paid == 1) {
for (let i = 0; i < val.row.orderProduct.length; i++) {
if (val.row.orderProduct[i].refund_num > 0 && val.row.orderProduct[i].refund_num < val.row.orderProduct[i].product_num) {
return "row-bg";
}
}
} else {
return " ";
}
},
//
getMerSelect() {
merSelectApi()
.then((res) => {
this.merSelect = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
onUserDetails(uid) {
this.uid = uid
this.visibleDetail = true
},
Close() {
this.visibleDetail = false
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
exportOrderOtherApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
//
exportRecord() {
exportOrderOtherApi(this.tableFrom)
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: '提示',
message: h('p', null, [
h('span', null, '文件正在生成中,请稍后点击"'),
h('span', { style: 'color: teal' }, '导出记录'),
h('span', null, '"查看~ '),
]),
confirmButtonText: '我知道了',
}).then(action => {
});
})
.catch((res) => {
this.$message.error(res.message)
})
},
//
getExportFileList() {
this.$refs.exportList.exportFileList()
},
//
onOrderDetails(id) {
this.orderId = id;
this.$refs.orderDetail.getInfo(id);
this.drawer = true;
// this.$refs.orderDetail.onOrderDetails(id);
// this.$refs.orderDetail.onOrderLog(id);
},
changeDrawer(v) {
this.drawer = v;
},
closeDrawer() {
this.drawer = false;
},
pageChangeLog(page) {
this.tableFromLog.page = page;
this.getList('');
},
handleSizeChangeLog(val) {
this.tableFromLog.limit = val;
this.getList('');
},
//
selectChange(tab) {
this.tableFrom.date = tab;
this.tableFrom.page = 1;
this.timeVal = [];
this.getCardList()
this.getList(1);
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getCardList()
this.getList(1);
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
orderOtherListApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
// this.cardLists = res.data.stat;
this.listLoading = false;
// this.getCardList();
})
.catch((res) => {
this.$message.error(res.message);
this.listLoading = false;
});
},
getCardList(){
cardListApi(this.tableFrom)
.then((res) => {
this.cardLists = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList('');
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList('');
},
headerList() {
chartApi()
.then((res) => {
this.orderChartType = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
uploadVoucher(data){
this.voucherInfo.group_order_id = data.group_order_id;
this.voucherInfo.order_sn = data.order_sn;
this.dialogVoucher = true;
},
closeDialogVoucher(){
this.dialogVoucher = false;
},
async uploadVoucherImage (options) {
console.log('上传', options);
const file = options.file;
const formData = new FormData();
formData.append('file', file);
uploadImage(formData).then((res) => {
Message.success('上传成功');
this.voucherInfo.image = res.data.src;
}).catch(e => {
Message.error(e);
})
},
//
addVoucher(){
if(!this.voucherInfo.image) return Message.error('请先上传凭证!');
orderOtherPayOrder({
id: this.voucherInfo.group_order_id,
images: this.voucherInfo.image
}).then(res=>{
Message.success(res.message);
this.closeDialogVoucher;
}).catch(e=>{
Message.error(e);
})
}
},
};
</script>
<style lang="scss" scoped>
.demo-table-expand {
/deep/ label {
width: 83px !important;
}
}
.selWidth {
width: 300px;
}
.el-dropdown-link {
cursor: pointer;
color: #409eff;
font-size: 12px;
}
.el-icon-arrow-down {
font-size: 12px;
}
.tabBox_tit {
width: 60%;
font-size: 12px !important;
margin: 0 2px 0 10px;
letter-spacing: 1px;
padding: 5px 0;
box-sizing: border-box;
}
/deep/.row-bg {
.cell {
color: red !important;
}
}
</style>

View File

@ -0,0 +1,726 @@
<template>
<div>
<el-drawer
:with-header="false"
:size="1000"
:visible.sync="drawer"
:direction="direction"
:before-close="handleClose"
>
<div v-loading="loading">
<div class="head">
<div class="full">
<img class="order_icon" :src="orderImg" alt="" />
<div class="text">
<div class="title">{{ orderDetailList.order_type == 0 ? '普通订单' : '核销订单' }}</div>
<div>
<span class="mr20">订单编号{{ orderDetailList.order_sn }}</span>
</div>
</div>
</div>
<ul class="list">
<li class="item">
<div class="title">订单状态</div>
<div>
<div v-if="orderDetailList.order_type === 0 && !orderDetailList.pay_time" class="value1">待付款</div>
<div v-if="orderDetailList.order_type === 0 && orderDetailList.pay_time" class="value1">
<span>{{ orderDetailList.status | orderStatusFilter }}</span>
</div>
<div v-if="orderDetailList.order_type === 1 && orderDetailList.pay_time" class="value1">
<span>{{ orderDetailList.status | cancelOrderStatusFilter }}</span>
</div>
</div>
</li>
<li class="item">
<div class="title">实际支付</div>
<div>¥ {{ orderDetailList.pay_price }}</div>
</li>
<li class="item">
<div class="title">支付方式</div>
<div>{{ orderDetailList.pay_type | payTypeFilter }}</div>
</li>
<li class="item">
<div class="title">支付时间</div>
<div>{{ orderDetailList.create_time }}</div>
</li>
</ul>
</div>
<el-tabs type="border-card" v-model="activeName" @tab-click="tabClick">
<el-tab-pane label="订单信息" name="detail">
<div class="section">
<div class="title">用户信息</div>
<ul class="list">
<li class="item">
<div>用户昵称</div>
<div class="value">
{{
orderDetailList.user.real_name ? orderDetailList.user.real_name : orderDetailList.user.nickname
}}
</div>
</li>
<li class="item">
<div>用户ID</div>
<div class="value">{{ orderDetailList.user.uid ? orderDetailList.user.uid : '-' }}</div>
</li>
<li class="item">
<div>绑定电话</div>
<div class="value">{{ orderDetailList.user.phone ? orderDetailList.user.phone : '-' }}</div>
</li>
</ul>
</div>
<div class="section">
<div class="title">收货信息</div>
<ul class="list">
<li class="item">
<div>收货人</div>
<div class="value">{{ orderDetailList.real_name ? orderDetailList.real_name : '-' }}</div>
</li>
<li class="item">
<div>收货电话</div>
<div class="value">{{ orderDetailList.user_phone ? orderDetailList.user_phone : '-' }}</div>
</li>
<li class="item">
<div>收货地址</div>
<div class="value">{{ orderDetailList.user_address ? orderDetailList.user_address : '-' }}</div>
</li>
</ul>
</div>
<div class="section">
<div class="title">订单信息</div>
<ul class="list">
<li class="item">
<div>创建时间</div>
<div class="value">{{ orderDetailList.create_time ? orderDetailList.create_time : '-' }}</div>
</li>
<li class="item">
<div>商品总数</div>
<div class="value">{{ orderDetailList.total_num ? orderDetailList.total_num : '-' }}</div>
</li>
<li class="item">
<div>实际支付</div>
<div class="value">{{ orderDetailList.finalOrder ? (parseFloat(orderDetailList.finalOrder.pay_price) + parseFloat(orderDetailList.pay_price)) : orderDetailList.pay_price }}</div>
</li>
<li class="item">
<div>优惠券金额</div>
<div class="value">{{ orderDetailList.coupon_price ? orderDetailList.coupon_price : '-' }}</div>
</li>
<li v-if="orderDetailList.integral" class="item">
<div>积分抵扣</div>
<div class="value">使用了{{ orderDetailList.integral }}个积分抵扣了{{ orderDetailList.integral_price }}</div>
</li>
<li class="item">
<div>订单总价</div>
<div class="value">{{ orderDetailList.total_price ? orderDetailList.total_price : '-' }}</div>
</li>
<li class="item" v-if="orderDetailList.svip_discount">
<div>会员商品优惠</div>
<div class="value">{{ orderDetailList.svip_discount }}</div>
</li>
<li class="item">
<div>支付运费</div>
<div class="value">{{ orderDetailList.pay_postage }}</div>
</li>
<li v-if="orderDetailList.TopSpread" class="item">
<div>推广人</div>
<div class="value">{{ orderDetailList.TopSpread.nickname }}</div>
</li>
<li class="item">
<div>一级佣金</div>
<div class="value">
{{ parseFloat(orderDetailList.extension_one) + parseFloat(orderDetailList.refund_extension_one) }}
<em v-if="orderDetailList.refund_extension_one > 0" style="color: red;font-style: normal;">(-{{ orderDetailList.refund_extension_one }})</em>
</div>
</li>
<li class="item">
<div>二级佣金</div>
<div class="value">
{{ parseFloat(orderDetailList.extension_two) + parseFloat(orderDetailList.refund_extension_two) }}
<em v-if="orderDetailList.refund_extension_two > 0" style="color: red;font-style: normal;">(-{{ orderDetailList.refund_extension_two }})</em>
</div>
</li>
</ul>
</div>
<div class="section" v-if="orderDetailList.delivery_type === '1'">
<div class="title">物流信息</div>
<ul class="list">
<li class="item">
<div>快递公司</div>
<div class="value">{{ orderDetailList.delivery_name ? orderDetailList.delivery_name : '-' }}</div>
</li>
<li class="item">
<div>快递单号</div>
<div class="value">{{ orderDetailList.delivery_id ? orderDetailList.delivery_id : '-' }}</div>
<el-button type="primary" size="mini" style="margin-left: 5px" @click="openLogistics">物流查询</el-button>
</li>
</ul>
</div>
<div class="section">
<div class="title">买家留言</div>
<ul class="list">
<li class="item">
<div>{{ orderDetailList.mark ? orderDetailList.mark : '-' }}</div>
</li>
</ul>
</div>
<div class="section">
<div class="title">商家备注</div>
<ul class="list">
<li class="item">
<div>{{ orderDetailList.remark ? orderDetailList.remark : '-' }}</div>
</li>
</ul>
</div>
</el-tab-pane>
<el-tab-pane label="商品信息" name="goods">
<el-table :data="orderDetailList.orderProduct">
<el-table-column label="商品信息" min-width="300">
<template slot-scope="scope">
<div class="tab">
<div class="demo-image__preview">
<el-image
:src="scope.row.cart_info.product.image"
:preview-src-list="[scope.row.cart_info.product.image]"
/>
</div>
<div>
<div class="line1">{{ scope.row.cart_info.product.store_name }}</div>
<div class="line1 gary">
规格{{
scope.row.cart_info.productAttr.sku ? scope.row.cart_info.productAttr.sku : '默认'
}}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="售价" min-width="90">
<template slot-scope="scope">
<div class="tab">
<div class="line1">
{{ scope.row.cart_info.productAttr.price ? scope.row.cart_info.productAttr.price : '-' }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="实付金额" min-width="90">
<template slot-scope="scope">
<div class="tab">
<div class="line1">
{{ scope.row.product_price ? scope.row.product_price : '-' }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="购买数量" min-width="90">
<template slot-scope="scope">
<div class="tab">
<div class="line1">
{{ scope.row.product_num }}
</div>
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="订单记录" name="orderList">
<div>
<el-form size="small" label-width="80px">
<div class="acea-row">
<el-form-item label="操作端:">
<el-select
v-model="tableFromLog.user_type"
placeholder="请选择"
style="width: 140px; margin-right: 20px"
clearable
filterable
@change="onOrderLog(orderId)"
>
<el-option label="系统" value="0" />
<el-option label="用户" value="1" />
<el-option label="平台" value="2" />
<el-option label="商户" value="3" />
<el-option label="商家客服" value="4" />
</el-select>
</el-form-item>
<el-form-item label="操作时间:">
<el-date-picker
style="width: 380px; margin-right: 20px"
v-model="timeVal"
type="datetimerange"
placeholder="选择日期"
value-format="yyyy/MM/dd HH:mm:ss"
clearable
@change="onchangeTime"
>
</el-date-picker>
</el-form-item>
<!-- <div>
<el-button type="primary" size="small" @click="onOrderLog(orderId)">查询</el-button>
</div> -->
</div>
</el-form>
</div>
<el-table :data="tableDataLog.data">
<el-table-column prop="order_id" label="订单编号" min-width="200">
<template slot-scope="scope">
<span>{{ scope.row.order_sn }}</span>
</template>
</el-table-column>
<el-table-column label="操作记录" min-width="200">
<template slot-scope="scope">
<span>{{ scope.row.change_message }}</span>
</template>
</el-table-column>
<el-table-column label="操作角色" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div>{{ operationType(scope.row.user_type) }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作人" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div>{{ scope.row.nickname }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作时间" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div class="line1">{{ scope.row.change_time }}</div>
</div>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFromLog.limit" :current-page="tableFromLog.page" layout="total, sizes, prev, pager, next, jumper" :total="tableDataLog.total" @size-change="handleSizeChangeLog" @current-change="pageChangeLog" />
</div>
</el-tab-pane>
<el-tab-pane v-if="childOrder.length>0" label="关联订单" name="subOrder">
<el-table :data="childOrder">
<el-table-column label="订单编号" prop="order_sn" min-width="150">
<template slot-scope="scope">
<div>{{ scope.row.order_sn }}</div>
</template>
</el-table-column>
<el-table-column label="商品信息" min-width="200">
<template slot-scope="scope">
<div
v-for="(val, i) in scope.row.orderProduct"
:key="i"
class="tabBox acea-row row-middle"
>
<div class="demo-image__preview">
<el-image
:src="val.cart_info.product.image"
:preview-src-list="[val.cart_info.product.image]"
/>
</div>
<span
class="tabBox_tit"
>{{ val.cart_info.product.store_name + ' | ' }}{{ val.cart_info.productAttr.sku }}</span>
<span class="tabBox_pice">
{{ '¥'+ val.cart_info.productAttr.price + ' x '+ val.product_num }}
<em
v-if="val.refund_num < val.product_num && val.refund_num > 0"
style="color: red;font-style: normal;"
>(-{{ val.product_num - val.refund_num }})</em>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="实际支付" min-width="80" align="center">
<template slot-scope="scope">
<span>{{ scope.row.pay_price }}</span>
</template>
</el-table-column>
<el-table-column label="订单生成时间" prop="create_time" min-width="120" />
<el-table-column label="操作" min-width="50" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="getChildOrderDetail(scope.row.order_id)">详情</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</el-drawer>
<el-dialog
title="物流查询"
:visible.sync="dialogLogistics"
width="350px"
v-if="dialogLogistics"
>
<div class="logistics acea-row row-top">
<div class="logistics_img"><img src="@/assets/images/expressi.jpg"></div>
<div class="logistics_cent">
<span>物流公司{{ orderDetailList.delivery_name }}</span>
<span>物流单号{{ orderDetailList.delivery_id }}</span>
</div>
</div>
<div class="acea-row row-column-around trees-coadd">
<div class="scollhide">
<el-timeline>
<el-timeline-item v-for="(item,i) in result" :key="i">
<p class="time" v-text="item.time" />
<p class="content" v-text="item.status" />
</el-timeline-item>
</el-timeline>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getExpress,
orderDeliveryApi,
orderDeleteApi,
orderOtherDetailApi,
orderOtherLogApi,
getChildrenOrderOtherApi
} from '@/api/order';
export default {
props: {
drawer: {
type: Boolean,
default: false,
},
},
data() {
return {
loading: true,
orderId: '',
direction: 'rtl',
activeName: 'detail',
goodsList: [],
orderConfirm: false,
sendGoods: false,
dialogLogistics: false,
confirmReceiptForm: {
id: '',
},
orderData: [],
contentList: [],
nicknameList: [],
result: [],
timeVal: [],
childOrder: [],
childOrder: [],
tableDataLog: {
data: [],
total: 0
},
tableFromLog: {
user_type: '',
date: [],
page: 1,
limit: 10
},
orderDetailList: {
user: {
real_name: '',
},
groupOrder: {
group_order_sn: '',
},
},
orderImg: require('@/assets/images/order_icon.png'),
};
},
filters: {
},
methods: {
//
onchangeTime(e) {
this.timeVal = e
this.tableFromLog.date = e ? this.timeVal.join('-') : ''
this.onOrderLog(this.orderId)
},
handleClose() {
this.activeName = 'detail';
this.$emit('closeDrawer');
this.sendGoods = false;
this.orderRemark = false;
},
openLogistics() {
// this.getOrderData()
this.dialogLogistics = true
},
//
getOrderData() {
getExpress(this.orderId).then(async res => {
this.result = res.data
}).catch(res => {
this.$message.error(res.message)
})
},
//
toSendGoods() {
this.sendGoods = true;
},
getDelivery() {
orderDeliveryApi(this.orderId)
.then((res) => {
this.$message.success(res.message);
this.sendGoods = false;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getChildOrder() {
this.loading = true;
getChildrenOrderOtherApi(this.orderId)
.then((res) => {
this.activeName = 'detail'
this.childOrder = res.data
setTimeout(()=>{
this.loading = false;
},500)
})
.catch((res) => {
this.$message.error(res.message)
})
},
getChildOrderDetail(id){
this.getInfo(id);
},
getInfo(id) {
this.loading = true;
this.orderId = id
orderOtherDetailApi(id)
.then((res) => {
this.drawer = true;
this.orderDetailList = res.data;
this.getChildOrder();
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
handleDelete() {
this.$modalSure().then(() => {
orderDeleteApi(this.orderId)
.then(({ message }) => {
this.$message.success(message);
// this.tableData.data.splice(idx, 1);
})
.catch(({ message }) => {
this.$message.error(message);
});
});
},
tabClick(tab) {
if (tab.name === 'orderList') {
this.onOrderLog(this.orderId)
}
},
onOrderLog(id){
orderOtherLogApi(id, this.tableFromLog).then((res) => {
this.tableDataLog.data = res.data.list
this.tableDataLog.total = res.data.count
});
},
pageChangeLog(page) {
this.tableFromLog.page = page
this.onOrderLog(this.orderId)
},
handleSizeChangeLog(val) {
this.tableFromLog.limit = val
this.onOrderLog(this.orderId)
},
operationType(type) {
if (type == 0) {
return '系统';
} else if (type == 1) {
return '用户';
} else if (type == 2) {
return '平台';
} else if (type == 3) {
return '商户';
} else if (type == 4) {
return '商家客服';
} else {
return '未知';
}
},
},
};
</script>
<style lang="scss" scoped>
.head {
padding: 30px 35px 25px;
.full {
display: flex;
align-items: center;
.order_icon {
width: 60px;
height: 60px;
}
.iconfont {
color: #1890ff;
&.sale-after {
color: #90add5;
}
}
.text {
align-self: center;
flex: 1;
min-width: 0;
padding-left: 12px;
font-size: 13px;
color: #606266;
.title {
margin-bottom: 10px;
font-weight: 500;
font-size: 16px;
line-height: 16px;
color: rgba(0, 0, 0, 0.85);
}
.order-num {
padding-top: 10px;
white-space: nowrap;
}
}
}
.list {
display: flex;
margin-top: 20px;
overflow: hidden;
list-style: none;
padding: 0;
.item {
flex: none;
width: 200px;
font-size: 14px;
line-height: 14px;
color: rgba(0, 0, 0, 0.85);
.title {
margin-bottom: 12px;
font-size: 13px;
line-height: 13px;
color: #666666;
}
.value1 {
color: #f56022;
}
.value2 {
color: #1bbe6b;
}
.value3 {
color: #1890ff;
}
.value4 {
color: #6a7b9d;
}
.value5 {
color: #f5222d;
}
}
}
}
.el-tabs--border-card {
box-shadow: none;
border-bottom: none;
}
.section {
padding: 20px 0 5px;
border-bottom: 1px dashed #eeeeee;
.title {
padding-left: 10px;
border-left: 3px solid #1890ff;
font-size: 15px;
line-height: 15px;
color: #303133;
}
.list {
display: flex;
flex-wrap: wrap;
list-style: none;
padding: 0;
}
.item {
flex: 0 0 calc(100% / 3);
display: flex;
margin-top: 16px;
font-size: 13px;
color: #606266;
&:nth-child(3n + 1) {
padding-right: 20px;
}
&:nth-child(3n + 2) {
padding-right: 10px;
padding-left: 10px;
}
&:nth-child(3n + 3) {
padding-left: 20px;
}
}
.value {
flex: 1;
image {
display: inline-block;
width: 40px;
height: 40px;
margin: 0 12px 12px 0;
vertical-align: middle;
}
}
}
.tab {
display: flex;
align-items: center;
.el-image {
width: 36px;
height: 36px;
margin-right: 10px;
}
}
/deep/.el-drawer__body {
overflow: auto;
}
.gary {
color: #aaa;
}
.logistics{
align-items: center;
padding: 10px 0px;
.logistics_img{
width: 45px;
height: 45px;
margin-right: 12px;
img{
width: 100%;
height: 100%;
}
}
.logistics_cent{
span{
display: block;
font-size: 12px;
}
}
}
.tabBox_tit {
width: 53%;
font-size: 12px !important;
margin: 0 2px 0 10px;
letter-spacing: 1px;
padding: 5px 0;
box-sizing: border-box;
}
</style>