commit message

This commit is contained in:
Chopper
2021-05-13 10:56:04 +08:00
commit ec3e958037
728 changed files with 132685 additions and 0 deletions

View File

@@ -0,0 +1,357 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
clearable
placeholder="请输入会员名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="订单号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
clearable
placeholder="请输入商品名"
style="width: 200px"
/>
</Form-item>
<Form-item label="状态" prop="status">
<Select v-model="searchForm.status" placeholder="请选择" clearable style="width: 200px">
<Option value="NEW">新投诉</Option>
<Option value="CANCEL">已撤销</Option>
<Option value="WAIT_APPEAL">待申诉</Option>
<Option value="COMMUNICATION">对话中</Option>
<Option value="WAIT_ARBITRATION">等待仲裁</Option>
<Option value="COMPLETE">已完成</Option>
</Select>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</Col>
</Row>
<Modal
:title="modalTitle"
v-model="modalVisible"
:mask-closable="false"
:width="500"
>
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="评价内容">
<span v-if="content == ''">暂无评价</span>
<span v-else>{{content}}</span>
</FormItem>
<FormItem label="评价图片">
<upload-pic-thumb
v-model="image"
:disable="true"
:remove="false"
></upload-pic-thumb>
</FormItem>
<FormItem label="回复内容" prop="reply">
<Input v-if="replyStatus == false"
v-model="form.reply"
type="textarea"
maxlength="200"
:rows="4"
clearable
style="width:260px"
/>
<span v-else>
{{form.reply}}
</span>
</FormItem>
<FormItem label="回复图片" prop="replyImage">
<upload-pic-thumb v-if="replyStatus == false"
v-model="form.replyImage"
:limit="5"
></upload-pic-thumb>
<upload-pic-thumb v-else
v-model="form.replyImage"
:disable="true"
:remove="false"
></upload-pic-thumb>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button v-if="replyStatus == false" type="primary" :loading="submitLoading" @click="handleSubmit" >回复
</Button
>
</div>
</Modal>
</div>
</template>
<script>
import * as API_Member from "@/api/member";
import * as API_Order from "@/api/order";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
export default {
name: "orderComplaint",
components: {
uploadPicThumb
},
data() {
return {
image:[],//评价图片
replyStatus:false,//回复状态
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
openTip: true, // 显示提示
loading: true, // 表单加载状态
content: "",//评价内容
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
form: {}, // 表单数据
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
// 表头
{
title: "会员名称",
key: "memberName",
minWidth: 120,
sortable: false,
},
{
title: "订单编号",
key: "orderSn",
minWidth: 120,
sortType: "desc",
},
{
title: "商品名称",
key: "goodsName",
minWidth: 120,
sortType: "desc",
},
{
title: "投诉主题",
key: "complainTopic",
minWidth: 120,
},
{
title: "投诉时间",
key: "createTime",
minWidth: 120,
},
{
title: "投诉状态",
key: "complainStatus",
minWidth: 120,
render: (h, params) => {
if (params.row.complainStatus == "NEW") {
return h('div', [h('span', { }, '新投诉'),]);
} else if (params.row.complainStatus == "CANCEL") {
return h('div', [h('span', { }, '已撤销'),]);
} else if (params.row.complainStatus == "WAIT_APPEAL") {
return h('div', [h('span', { }, '待申诉'),]);
} else if (params.row.complainStatus == "COMMUNICATION") {
return h('div', [h('span', { }, '对话中'),]);
}else if (params.row.complainStatus == "WAIT_ARBITRATION") {
return h('div', [h('span', { }, '等待仲裁'),]);
}else if (params.row.complainStatus == "COMPLETE") {
return h('div', [h('span', { }, '已完成'),]);
}
}
},
{
title: "操作",
key: "action",
align: "center",
width: 200,
render: (h, params) => {
if(params.row.complainStatus === "COMPLETE"){
return h("div", [
h(
"Button",
{
props: {
type: "primary",
size: "small",
icon: "ios-create-outline",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"详情"
),
]);
}else{
return h("div", [
h(
"Button",
{
props: {
type: "primary",
size: "small",
icon: "ios-create-outline",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"处理"
),
]);
}
},
},
],
data: [], // 表格数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
dropDown() {
if (this.drop) {
this.dropDownContent = "展开";
this.dropDownIcon = "ios-arrow-down";
} else {
this.dropDownContent = "收起";
this.dropDownIcon = "ios-arrow-up";
}
this.drop = !this.drop;
},
getDataList() {
this.loading = true;
API_Order.getComplainPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
//回复
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
API_Member.replyMemberReview(this.form.id, this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("回复成功");
this.getDataList();
this.modalVisible = false;
}
});
}
});
},
//投诉详情
detail(v) {
let id = v.id;
this.$router.push({
name: "order-complaint-detail",
query: { id: id },
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,554 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<div class="main-content">
<div class="div-flow-left">
<div class="div-form-default">
<h3>投诉信息</h3>
<dl>
<dt>投诉商品</dt>
<dd>{{ complaintInfo.goodsName }}</dd>
</dl>
<dl>
<dt>投诉状态</dt>
<dd v-if="complaintInfo.complainStatus =='NEW'">新投诉</dd>
<dd v-if="complaintInfo.complainStatus =='CANCEL'">已撤销</dd>
<dd v-if="complaintInfo.complainStatus =='WAIT_APPEAL'">待申诉</dd>
<dd v-if="complaintInfo.complainStatus =='COMMUNICATION'">对话中</dd>
<dd v-if="complaintInfo.complainStatus =='WAIT_ARBITRATION'">等待仲裁</dd>
<dd v-if="complaintInfo.complainStatus =='COMPLETE'">已完成</dd>
</dl>
<dl>
<dt>投诉时间</dt>
<dd>{{ complaintInfo.createTime }}</dd>
</dl>
<dl>
<dt>投诉主题</dt>
<dd>{{ complaintInfo.complainTopic }}</dd>
</dl>
<dl>
<dt>投诉内容</dt>
<dd>{{ complaintInfo.content }}</dd>
</dl>
<dl>
<dt>投诉凭证</dt>
<dd v-if="images === ''">
暂无投诉凭证
</dd>
<dd v-else>
<div class="div-img" v-for="(item, index) in images">
<img class="complain-img" :src=item>
</div>
</dd>
</dl>
</div>
<div class="div-form-default" v-if="complaintInfo.complainStatus !== 'WAIT_APPEAL'">
<h3>商家申诉信息</h3>
<dl>
<dt>申诉时间</dt>
<dd>{{ complaintInfo.appealTime }}</dd>
</dl>
<dl>
<dt>申诉内容</dt>
<dd>{{ complaintInfo.appealContent }}</dd>
</dl>
<dl>
<dt>申诉凭证</dt>
<dd v-if="appealImages == ''">
暂无申诉凭证
</dd>
<dd v-else>
<div class="div-img" v-for="(item, index) in appealImages">
<img class="complain-img" :src=item>
</div>
</dd>
</dl>
</div>
<div class="div-form-default" v-if="complaintInfo.complainStatus === 'WAIT_APPEAL'">
<h3>商家申诉</h3>
<dl>
<dt>申诉内容</dt>
<dd>
<Input v-model="appeal.appealContent" type="textarea" maxlength="200" :rows="4" clearable style="width:260px" />
</dd>
</dl>
<dl>
<dt>申诉凭证</dt>
<dd>
<div class="complain-upload-list" :key="index" v-for="(item,index) in appeal.appealImages">
<template v-if="item.status === 'finished'">
<img class="complain-img" :src="item.url">
<div class="complain-upload-list-cover">
<Icon type="ios-eye-outline" @click.native="handleView(item.url)"></Icon>
<Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
</div>
</template>
<template v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</template>
</div>
<Upload ref="upload" :show-upload-list="false" :on-format-error="handleFormatError" :action="uploadFileUrl" :headers="accessToken" :on-success="handleSuccessGoodsPicture"
:format="['jpg','jpeg','png']" :max-size="2048" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUpload" multiple type="drag"
style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<Modal title="View Image" v-model="visible">
<img :src="imgName" v-if="visible" style="width: 100%">
</Modal>
<!-- <Input v-model="appeal.appealImages" type="textarea" maxlength="200" :rows="4" clearable
style="width:260px"/> -->
</dd>
</dl>
<dl>
<dt></dt>
<dd>
<Button type="primary" :loading="submitLoading" @click="appealSubmit()" style="margin-left: 5px">
提交申诉
</Button>
</dd>
</dl>
</div>
<div class="div-form-default">
<h3>对话详情</h3>
<dl>
<dt>对话记录</dt>
<dd>
<div class="div-content">
<p v-for="(item, index) in complaintInfo.orderComplaintCommunications">
<span v-if="item.owner === 'STORE'">商家[{{ item.createTime }}]</span>
<span v-if="item.owner === 'BUYER'">买家[{{ item.createTime }}]</span>
<span v-if="item.owner === 'PLATFORM'">平台[{{ item.createTime }}]</span>
{{ item.content }}
</p>
</div>
</dd>
</dl>
<dl v-if="complaintInfo.complainStatus!='COMPLETE'">
<dt>发送对话</dt>
<dd>
<Input v-model="params.content" type="textarea" maxlength="200" :rows="4" clearable style="width:260px" />
</dd>
</dl>
<dl>
<dt></dt>
<dd v-if="complaintInfo.complainStatus != 'COMPLETE'">
<div style="text-align: right;width: 45%;margin-top: 10px">
<Button type="primary" :loading="submitLoading" @click="handleSubmit" style="margin-left: 5px">
回复
</Button>
<Button type="primary" :loading="submitLoading" @click="returnDataList" style="margin-left: 5px">
返回列表
</Button>
</div>
</dd>
</dl>
</div>
<div class="div-form-default" v-if="complaintInfo.complainStatus === 'COMPLETE'">
<h3>仲裁结果</h3>
<dl>
<dt>仲裁意见</dt>
<dd>
{{ complaintInfo.arbitrationResult }}
</dd>
</dl>
</div>
</div>
<div class="div-flow-center">
</div>
<div class="div-flow-right">
<div class="div-form-default">
<h3>相关商品交易信息</h3>
<dl>
<dt>
<img :src="complaintInfo.goodsImage" height="60px">
</dt>
<dd>
<a>{{ complaintInfo.goodsName }}</a><br>
<span>{{ complaintInfo.goodsPrice | unitPrice }} * {{ complaintInfo.num }}(数量)</span>
</dd>
</dl>
</div>
<div class="div-form-default">
<h3>订单相关信息</h3>
<dl>
<dt>
订单编号
</dt>
<dd>
{{ complaintInfo.orderSn }}
</dd>
</dl>
<dl>
<dt>
下单时间
</dt>
<dd>
{{ complaintInfo.orderTime }}
</dd>
</dl>
<dl>
<dt>
订单金额
</dt>
<dd>
{{ complaintInfo.orderPrice }}
</dd>
</dl>
</div>
<div class="div-form-default">
<h3>收件人信息</h3>
<dl>
<dt>
收货人
</dt>
<dd>
{{ complaintInfo.consigneeName }}
</dd>
</dl>
<dl>
<dt>
收货地址
</dt>
<dd>
{{ complaintInfo.consigneeAddressPath }}
</dd>
</dl>
<dl>
<dt>
收货人手机
</dt>
<dd>
{{ complaintInfo.consigneeMobile }}
</dd>
</dl>
</div>
</div>
</div>
</Card>
</Col>
</Row>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
import * as API_GOODS from "@/api/goods";
export default {
name: "orderComplaint",
components: {
uploadPicThumb,
},
data() {
return {
//展示图片层
visible: false,
//上传图片路径
uploadFileUrl: API_GOODS.uploadFile,
accessToken: "", // 验证token
id: 0, // 投诉单id
complaintInfo: "", // 投诉信息
images: [], //会员申诉图片
appealImages: [], //商家申诉的图片
applyAppealImages: [], //商家申诉表单填写的图片
submitLoading: false, // 添加或编辑提交状态
//商家回复内容
params: {
content: "",
complainId: "",
},
//投诉
appeal: {
orderComplaintId: "",
appealContent: "",
appealImages: [],
},
};
},
watch: {
$route() {
this.getDetail();
},
},
methods: {
handleView(name) {
this.imgName = name;
this.visible = true;
},
handleRemove(file) {
this.appeal.appealImages = this.appeal.appealImages.filter(
(i) => i.url !== file.url
);
},
handleSuccessGoodsPicture(res, file) {
if (file.response) {
file.url = file.response.result;
this.appeal.appealImages.push(file);
}
},
handleBeforeUpload() {
const check =
this.images.images !== undefined && this.images.images.length > 5;
if (check) {
this.$Notice.warning({
title: "Up to five pictures can be uploaded.",
});
}
return !check;
},
handleFormatError(file) {
this.$Notice.warning({
title: "图片格式不正确",
desc:
"File format of " +
file.name +
" is incorrect, please select jpg or png.",
});
},
handleMaxSize(file) {
this.$Notice.warning({
title: "超过文件大小限制",
desc: "图片 " + file.name + " 不能超过2mb",
});
},
getDetail() {
this.loading = true;
API_Order.getComplainDetail(this.id).then((res) => {
this.loading = false;
if (res.success) {
this.complaintInfo = res.result;
this.images = (res.result.images || "").split(",");
this.appealImages = (res.result.appealImages || "").split(",");
}
});
},
//返回列表
returnDataList() {
this.$router.push({
name: "orderComplaint",
});
},
//回复
handleSubmit() {
if (this.params.content === "") {
this.$Message.error("请填写对话内容");
return;
}
this.params.complainId = this.id;
API_Order.addOrderComplaint(this.params).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("对话成功");
this.params.content = "";
this.getDetail();
}
});
},
//回复
appealSubmit() {
if (this.appeal.appealContent === "") {
this.$Message.error("请填写内容");
return;
}
this.appeal.appealImages = this.appeal.appealImages.map(item=> item.url)
this.appeal.orderComplaintId = this.id;
API_Order.appeal(this.appeal).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("申诉成功");
this.getDetail();
}
});
},
},
mounted() {
this.id = this.$route.query.id;
this.getDetail();
this.accessToken = {
accessToken: this.getStore("accessToken"),
};
},
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-col {
width: 100% !important;
}
.complain-upload-list {
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 4px;
}
.complain-upload-list img {
width: 100%;
height: 100%;
}
.complain-upload-list-cover {
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
}
.complain-upload-list:hover .complain-upload-list-cover {
display: block;
}
.complain-upload-list-cover i {
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.main-content {
min-height: 600px;
padding: 10px;
}
.div-flow-left {
width: 49%;
letter-spacing: normal;
display: inline-block;
border-right: solid #f5f5f5 1px;
.div-form-default {
width: 97%;
h3 {
font-weight: 600;
line-height: 22px;
background-color: #f5f5f5;
padding: 6px 0 6px 12px;
border-bottom: solid 1px #e7e7e7;
}
dl {
font-size: 0;
line-height: 30px;
clear: both;
padding: 0;
margin: 0;
border-bottom: dotted 1px #e6e6e6;
overflow: hidden;
dt {
display: inline-block;
width: 13%;
vertical-align: top;
text-align: right;
padding: 15px 1% 15px 0;
margin: 0;
font-size: 12px;
}
dd {
display: inline-block;
width: 84%;
padding: 15px 0 15px 1%;
margin: 0;
border-left: 1px solid #f0f0f0;
font-size: 12px;
}
}
}
}
.div-img {
width: 130px;
height: 130px;
text-align: center;
float: left;
}
.div-flow-center {
width: 2%;
display: inline-block;
}
.div-flow-right {
width: 49%;
vertical-align: top;
word-spacing: normal;
display: inline-block;
.div-form-default {
width: 97%;
h3 {
font-weight: 600;
line-height: 22px;
background-color: #f5f5f5;
padding: 6px 0 6px 12px;
border-bottom: solid 1px #e7e7e7;
}
dl {
font-size: 0;
line-height: 30px;
clear: both;
padding: 0;
margin: 0;
border-bottom: dotted 1px #e6e6e6;
overflow: hidden;
dt {
display: inline-block;
width: 13%;
vertical-align: top;
text-align: right;
padding: 15px 1% 15px 0;
margin: 0;
font-size: 12px;
}
dd {
display: inline-block;
width: 84%;
padding: 15px 0 15px 1%;
margin: 0;
border-left: 1px solid #f0f0f0;
font-size: 12px;
}
}
}
}
.complain-img {
width: 120px;
height: 120px;
text-align: center;
}
.div-content {
overflow-y: auto;
overflow-x: auto;
height: 150px;
}
</style>

View File

@@ -0,0 +1,318 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="商品" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
clearable
placeholder="请输入商品名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
clearable
placeholder="请输入会员名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="订单编号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
clearable
placeholder="请输入订单编号"
style="width: 200px"
/>
</Form-item>
<Form-item label="申请时间">
<DatePicker
v-model="selectDate"
type="datetimerange"
format="yyyy-MM-dd HH:mm:ss"
clearable
@on-change="selectDateRange"
placeholder="选择起始时间"
style="width: 200px"
></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<!-- 商品栏目格式化 -->
<template slot="goodsSlot" slot-scope="scope">
<div style="margin-top: 5px;height: 90px; display: flex;">
<div style="">
<img :src="scope.row.goodsImage" style="height: 80px;margin-top: 3px">
</div>
<div style="margin-left: 13px;margin-top: 3px;">
<div class="div-zoom" >
<a>{{scope.row.goodsName}}</a>
</div>
</div>
</div>
</template>
</Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</Col>
</Row>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
export default {
name: "returnGoodsOrder",
components: {},
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
startDate: "", // 起始时间
endDate: "", // 终止时间
serviceType:"RETURN_GOODS",
orderSn:"",
memberName:"",
goodsName:""
},
selectDate: null,
form: {
// 添加或编辑表单对象初始化数据
sn: "",
sellerName: "",
startTime: "",
endTime: "",
billPrice: "",
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "售后单号",
key: "sn",
minWidth: 150,
},
{
title: "订单号",
key: "orderSn",
minWidth: 150,
},
{
title: "商品",
key: "sn",
minWidth: 200,
slot: "goodsSlot",
},
{
title: "申请退款金额",
key: "applyRefundPrice",
width: 130,
sortType: "desc",
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.applyRefundPrice, "¥")
);
},
},
{
title: "会员名称",
key: "memberName",
minWidth: 120,
},
{
title: "状态",
key: "serviceStatus",
width: 120,
render: (h, params) => {
if (params.row.serviceStatus == "APPLY") {
return h('div', [h('span', { }, '申请售后'),]);
} else if (params.row.serviceStatus == "PASS") {
return h('div', [h('span', { }, '审核通过'),]);
} else if (params.row.serviceStatus == "REFUSE") {
return h('div', [h('span', { }, '审核拒绝'),]);
} else if (params.row.serviceStatus == "BUYER_RETURN") {
return h('div', [h('span', { }, '买家退货,待卖家收货'),]);
}else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") {
return h('div', [h('span', { }, '商家换货/补发'),]);
}else if (params.row.serviceStatus == "SELLER_CONFIRM") {
return h('div', [h('span', { }, '卖家确认收货'),]);
}else if (params.row.serviceStatus == "SELLER_TERMINATION") {
return h('div', [h('span', { }, '卖家终止售后'),]);
}else if (params.row.serviceStatus == "BUYER_CONFIRM") {
return h('div', [h('span', { }, '买家确认收货'),]);
}else if (params.row.serviceStatus == "BUYER_CANCEL") {
return h('div', [h('span', { }, '买家取消售后'),]);
}else if (params.row.serviceStatus == "COMPLETE") {
return h('div', [h('span', { }, '完成'),]);
}
}
},
{
title: "申请时间",
key: "createTime",
width: 170
},
{
title: "操作",
key: "action",
align: "center",
width: 120,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"查看"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
dropDown() {
if (this.drop) {
this.dropDownContent = "展开";
this.dropDownIcon = "ios-arrow-down";
} else {
this.dropDownContent = "收起";
this.dropDownIcon = "ios-arrow-up";
}
this.drop = !this.drop;
},
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() {
this.loading = true;
API_Order.afterSaleOrderPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
detail(v) {
let sn = v.sn;
this.$router.push({
name: "return-goods-order-detail",
query: { sn: sn },
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,312 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="商品" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
clearable
placeholder="请输入商品名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
clearable
placeholder="请输入会员名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="订单编号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
clearable
placeholder="请输入订单编号"
style="width: 200px"
/>
</Form-item>
<Form-item label="申请时间">
<DatePicker
v-model="selectDate"
type="datetimerange"
format="yyyy-MM-dd HH:mm:ss"
clearable
@on-change="selectDateRange"
placeholder="选择起始时间"
style="width: 200px"
></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<!-- 商品栏目格式化 -->
<template slot="goodsSlot" slot-scope="scope">
<div style="margin-top: 5px;height: 90px; display: flex;">
<div style="">
<img :src="scope.row.goodsImage" style="height: 80px;margin-top: 3px">
</div>
<div style="margin-left: 13px;margin-top: 3px;">
<div class="div-zoom" >
<a>{{scope.row.goodsName}}</a>
</div>
</div>
</div>
</template>
</Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</Col>
</Row>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
export default {
name: "returnMoneyOrder",
components: {},
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
startDate: "", // 起始时间
endDate: "", // 终止时间
serviceType:"RETURN_MONEY",
orderSn:"",
memberName:"",
goodsName:""
},
selectDate: null,
form: {
// 添加或编辑表单对象初始化数据
sn: "",
sellerName: "",
startTime: "",
endTime: "",
billPrice: "",
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
// 表头
{
title: "退款编号",
key: "sn",
minWidth: 150,
},
{
title: "订单号",
key: "orderSn",
minWidth: 150,
},
{
title: "商品",
key: "sn",
minWidth: 250,
sortable: false,
slot: "goodsSlot",
},
{
title: "申请退款金额",
key: "applyRefundPrice",
width: 130,
sortType: "desc",
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.applyRefundPrice, "¥")
);
},
},
{
title: "会员",
key: "memberName",
minWidth: 130,
tooltip: true
},
{
title: "申请时间",
key: "createTime",
width: 170
},
{
title: "售后状态",
key: "serviceStatus",
minWidth: 120,
render: (h, params) => {
if (params.row.serviceStatus == "APPLY") {
return h('div', [h('span', { }, '申请售后'),]);
} else if (params.row.serviceStatus == "PASS") {
return h('div', [h('span', { }, '审核通过'),]);
} else if (params.row.serviceStatus == "REFUSE") {
return h('div', [h('span', { }, '审核拒绝'),]);
} else if (params.row.serviceStatus == "BUYER_RETURN") {
return h('div', [h('span', { }, '买家退货,待卖家收货'),]);
}else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") {
return h('div', [h('span', { }, '商家换货/补发'),]);
}else if (params.row.serviceStatus == "SELLER_CONFIRM") {
return h('div', [h('span', { }, '卖家确认收货'),]);
}else if (params.row.serviceStatus == "SELLER_TERMINATION") {
return h('div', [h('span', { }, '卖家终止售后'),]);
}else if (params.row.serviceStatus == "BUYER_CONFIRM") {
return h('div', [h('span', { }, '买家确认收货'),]);
}else if (params.row.serviceStatus == "BUYER_CANCEL") {
return h('div', [h('span', { }, '买家取消售后'),]);
}else if (params.row.serviceStatus == "WAIT_REFUND") {
return h('div', [h('span', { }, '等待平台退款'),]);
}else if (params.row.serviceStatus == "COMPLETE") {
return h('div', [h('span', { }, '完成'),]);
}
}
},
{
title: "操作",
key: "action",
align: "center",
width: 100,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"查看"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() {
this.loading = true;
API_Order.afterSaleOrderPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
detail(v) {
let sn = v.sn;
this.$router.push({
name: "return-goods-order-detail",
query: { sn: sn },
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,697 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<div class="main-content">
<div class="div-flow-left">
<div class="div-form-default">
<h3>售后申请</h3>
<dl>
<dt>售后状态</dt>
<dd v-if="afterSaleInfo.serviceStatus =='APPLY'">申请售后</dd>
<dd v-if="afterSaleInfo.serviceStatus =='PASS'">申请通过</dd>
<dd v-if="afterSaleInfo.serviceStatus =='REFUSE'">申请拒绝</dd>
<dd v-if="afterSaleInfo.serviceStatus =='BUYER_RETURN'">买家退货待卖家收货</dd>
<dd v-if="afterSaleInfo.serviceStatus =='SELLER_RE_DELIVERY'">商家换货</dd>
<dd v-if="afterSaleInfo.serviceStatus =='SELLER_CONFIRM'">卖家确认收货</dd>
<dd v-if="afterSaleInfo.serviceStatus =='SELLER_TERMINATION'">卖家终止售后</dd>
<dd v-if="afterSaleInfo.serviceStatus =='BUYER_CONFIRM'">买家确认收货</dd>
<dd v-if="afterSaleInfo.serviceStatus =='BUYER_CANCEL'">买家取消售后</dd>
<dd v-if="afterSaleInfo.serviceStatus =='WAIT_REFUND'">等待平台退款</dd>
<dd v-if="afterSaleInfo.serviceStatus =='COMPLETE'">已完成</dd>
</dl>
<dl>
<dt>退货退款编号</dt>
<dd>{{ afterSaleInfo.sn }}</dd>
</dl>
<dl>
<dt>退货退款原因</dt>
<dd>{{ afterSaleInfo.reason }}</dd>
</dl>
<dl>
<dt>申请退款金额</dt>
<dd>{{ afterSaleInfo.applyRefundPrice | unitPrice('¥') }}</dd>
</dl>
<dl v-if="afterSaleInfo.actualRefundPrice">
<dt>实际退款金额</dt>
<dd>{{ afterSaleInfo.actualRefundPrice | unitPrice('¥') }}</dd>
</dl>
<dl v-if="afterSaleInfo.refundPoint">
<dt>退还积分</dt>
<dd>{{ afterSaleInfo.refundPoint }}</dd>
</dl>
<dl>
<dt>退货数量</dt>
<dd>{{ afterSaleInfo.num }}</dd>
</dl>
<dl>
<dt>问题描述</dt>
<dd>{{ afterSaleInfo.problemDesc }}</dd>
</dl>
<dl>
<dt>凭证</dt>
<dd v-if="afterSaleImage == ''">
暂无凭证
</dd>
<dd v-else>
<div class="div-img" @click="()=>{picFile=item; picVisible = true}"
v-for="(item, index) in afterSaleImage" :key="index">
<img class="complain-img" :src="item">
</div>
<Modal footer-hide mask-closable v-model="picVisible">
<img :src="picFile" alt="无效的图片链接" style="width: 100%; margin: 0 auto; display: block"/>
</Modal>
</dd>
</dl>
</div>
<div class="div-form-default" v-if="afterSaleInfo.serviceStatus=='APPLY'">
<h3>商家处理意见</h3>
<dl>
<dt>商家</dt>
<dd>
<div class="div-content">
{{ afterSaleInfo.storeName }}
</div>
</dd>
</dl>
<dl>
<dt>是否同意</dt>
<dd>
<div class="div-content">
<RadioGroup v-model="params.serviceStatus">
<Radio label="PASS">
<span>同意</span>
</Radio>
<Radio label="REFUSE">
<span>拒绝</span>
</Radio>
</RadioGroup>
</div>
</dd>
</dl>
<dl>
<dt>申请退款金额</dt>
<dd>{{ afterSaleInfo.applyRefundPrice | unitPrice('¥') }}</dd>
</dl>
<dl>
<dt>实际退款金额</dt>
<dd>
<Input v-model="params.actualRefundPrice" style="width:260px"/>
</dd>
</dl>
<dl>
<dt>备注信息</dt>
<dd>
<Input v-model="params.remark" type="textarea" maxlength="200" :rows="4" clearable
style="width:260px"/>
</dd>
</dl>
<dl>
<dt></dt>
<dd>
<div style="text-align: right;width: 45%;margin-top: 10px">
<Button type="primary" :loading="submitLoading" @click="handleSubmit" style="margin-left: 5px">
确定
</Button>
</div>
</dd>
</dl>
</div>
<div class="div-form-default" v-if="afterSaleInfo.serviceStatus !='APPLY'">
<h3>商家处理</h3>
<dl>
<dt>商家</dt>
<dd>
<div class="div-content">
{{ afterSaleInfo.storeName }}
</div>
</dd>
</dl>
<dl>
<dt>审核结果</dt>
<dd>
<div class="div-content">
<span v-if="params.serviceStatus=='PASS'">
审核通过
</span>
<span v-else>
审核拒绝
</span>
</div>
</dd>
</dl>
<dl>
<dt>备注信息</dt>
<dd>
{{ afterSaleInfo.auditRemark }}
</dd>
</dl>
</div>
</div>
<div class="div-flow-center">
</div>
<div class="div-flow-right">
<div class="div-form-default">
<h3>相关商品交易信息</h3>
<dl>
<dt>
<img :src="afterSaleInfo.goodsImage" height="60px">
</dt>
<dd>
<a>{{ afterSaleInfo.goodsName }}</a><br>
<span>{{ afterSaleInfo.num }}(数量)</span><br>
</dd>
</dl>
</div>
<div class="div-form-default">
<h3>订单相关信息</h3>
<dl>
<dt>
订单编号
</dt>
<dd>
{{ afterSaleInfo.orderSn }}
</dd>
</dl>
</div>
<div class="div-form-default"
v-if="afterSaleInfo.serviceStatus =='BUYER_RETURN' || afterSaleInfo.serviceStatus =='COMPLETE' && afterSaleInfo.serviceType !='RETURN_MONEY'">
<h3>回寄物流信息</h3>
<dl>
<dt>
物流公司
</dt>
<dd>
{{ afterSaleInfo.mlogisticsName }}
</dd>
</dl>
<dl>
<dt>
物流单号
</dt>
<dd>
{{ afterSaleInfo.mlogisticsNo }}
</dd>
</dl>
<dl>
<dt>操作</dt>
<dd>
<Button type="info" :loading="submitLoading" @click="sellerConfirmSubmit('PASS')"
style="margin-left: 5px" v-if="afterSaleInfo.afterSaleAllowOperationVO.rog">
确认收货
</Button>
<Button type="primary" :loading="submitLoading" @click="sellerConfirmSubmit('REFUSE')"
style="margin-left: 5px" v-if="afterSaleInfo.afterSaleAllowOperationVO.rog">
拒收
</Button>
<Button type="default" :loading="submitLoading" @click="logisticsBuyer()" style="margin-left: 5px">
查询物流
</Button>
</dd>
</dl>
</div>
<div class="div-form-default"
v-if="afterSaleInfo.afterSaleAllowOperationVO.return_goods && afterSaleInfo.serviceType == 'EXCHANGE_GOODS'">
<h3>换货</h3>
<dl>
<dt>
换货
</dt>
<dd>
<Button type="primary" :loading="submitLoading" @click="exchangeGoods" style="margin-left: 5px">
发货
</Button>
</dd>
</dl>
</div>
<div class="div-form-default"
v-if=" afterSaleInfo.serviceType == 'EXCHANGE_GOODS' && afterSaleInfo.serviceStatus =='SELLER_RE_DELIVERY'">
<h3>物流信息</h3>
<dl>
<dt>
物流公司
</dt>
<dd>
{{ afterSaleInfo.slogisticsName }}
</dd>
</dl>
<dl>
<dt>
物流单号
</dt>
<dd>
{{ afterSaleInfo.slogisticsNo }}
</dd>
</dl>
<dl>
<dt>操作</dt>
<dd>
<Button type="primary" :loading="submitLoading" @click="logisticsSeller()" style="margin-left: 5px">
查询物流
</Button>
</dd>
</dl>
</div>
</div>
</div>
</Card>
</Col>
</Row>
<!-- 订单发货 -->
<Modal v-model="modalVisible" width="500px">
<p slot="header">
<span>订单发货</span>
</p>
<div>
<Form ref="form" :model="form" :label-width="90" :rules="formValidate" style="position:relative">
<FormItem label="物流公司" prop="logisticsId">
<Select v-model="form.logisticsId" placeholder="请选择" style="width:250px">
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
</Option>
</Select>
</FormItem>
<FormItem label="物流单号" prop="logisticsNo">
<Input v-model="form.logisticsNo" style="width:250px"/>
</FormItem>
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button size="large" @click="orderDeliverCancel">取消</Button>
<Button type="success" size="large" @click="orderDeliverySubmit">发货</Button>
</div>
</Modal>
<!-- 查询物流 -->
<Modal v-model="logisticsModal" width="40">
<p slot="header">
<span>查询物流</span>
</p>
<div class="layui-layer-wrap">
<dl>
<dt>售后单号</dt>
<dd>
<div class="text-box">{{ sn }}</div>
</dd>
</dl>
<dl>
<dt>物流公司</dt>
<dd>
<div class="text-box">{{ logisticsInfo.shipper }}</div>
</dd>
</dl>
<dl>
<dt>快递单号</dt>
<dd>
<div nctype="ordersSn" class="text-box">{{ logisticsInfo.logisticCode }}</div>
</dd>
</dl>
<div class="div-express-log">
<ul class="express-log">
<li v-for="(item,index) in logisticsInfo.traces" :key="index">
<span class="time">{{ item.AcceptTime }}</span>
<span class="detail">{{ item.AcceptStation }}</span>
</li>
</ul>
</div>
</div>
<div slot="footer" style="text-align: right">
<Button @click="logisticsClose">取消</Button>
</div>
</Modal>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
export default {
name: "orderComplaint",
components: {
uploadPicThumb,
},
data() {
return {
picFile: "", // 预览图片地址
picVisible: false, // 预览图片
sn: "", // 订单号
logisticsModal: false, //查询物流模态框
logisticsInfo: {}, //物流信息
form: { // 物流信息
logisticsNo: "",
logisticsId: "",
}, //换货发货form
formValidate: {
logisticsNo: [
{required: true, message: "发货单号不能为空", trigger: "change"},
],
logisticsId: [
{required: true, message: "请选择物流公司", trigger: "blur"},
],
},
modalVisible: false, // 添加或编辑显示
afterSaleInfo: { // 售后信息
afterSaleAllowOperationVO: {
return_goods: false,
},
},
afterSaleImage: [], //会员申诉图片
appealImages: [], //商家申诉的图片
submitLoading: false, // 添加或编辑提交状态
checkedLogistics: [], //选中的物流公司集合
//商家处理意见
params: {
serviceStatus: "PASS",
remark: "",
actualRefundPrice: 0,
},
};
},
watch: {
$route(to, from) {
},
},
methods: {
getDetail() {
this.loading = true;
API_Order.afterSaleOrderDetail(this.sn).then((res) => {
this.loading = false;
if (res.success) {
this.afterSaleInfo = res.result;
this.afterSaleImage = (res.result.afterSaleImage || "").split(",");
this.params.actualRefundPrice = res.result.flowPrice;
}
});
},
//换货弹出框
exchangeGoods() {
API_Order.getLogisticsChecked().then((res) => {
if (res.success) {
this.checkedLogistics = res.result;
this.modalVisible = true;
this.getDetail();
}
});
},
orderDeliverCancel() {
this.modalVisible = false;
},
//商家确认收货
sellerConfirmSubmit(type) {
let title = "确认收货";
let content = "请确认已经收到退货货物?";
let message = "收货成功";
if (type !== "PASS") {
title = "确认拒收";
content = "确认拒收此货物?";
message = "拒收成功";
this.params.serviceStatus = "REFUSE";
}
this.$Modal.confirm({
title: title,
content: content,
loading: true,
onOk: () => {
API_Order.afterSaleSellerConfirm(this.sn, this.params).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success(message);
this.getDetail();
}
});
},
});
},
//查询物流
logisticsSeller() {
this.logisticsModal = true;
API_Order.getSellerDeliveryTraces(this.sn).then((res) => {
if (res.success && res.result != null) {
this.logisticsInfo = res.result;
}
});
},
//查询物流
logisticsBuyer() {
this.logisticsModal = true;
API_Order.getAfterSaleTraces(this.sn).then((res) => {
if (res.success && res.result != null) {
this.logisticsInfo = res.result;
}
});
},
//关闭物流弹出框
logisticsClose() {
this.logisticsModal = false;
},
//换货发货
orderDeliverySubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
API_Order.afterSaleSellerDelivery(this.sn, this.form).then((res) => {
if (res.success) {
this.$Message.success("订单发货成功");
this.modalVisible = false;
this.getDataDetail();
}
});
}
});
},
//回复
handleSubmit() {
if (this.params.remark == "") {
this.$Message.error("请输入备注信息");
return;
}
API_Order.afterSaleSellerReview(this.sn, this.params).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("审核成功");
this.params.remark = "";
this.getDetail();
}
});
},
},
mounted() {
this.sn = this.$route.query.sn;
this.getDetail();
},
};
</script>
<style lang="scss" scoped>
.ivu-row {
display: block !important;
}
.main-content {
min-height: 600px;
padding: 10px;
}
.div-flow-left {
width: 49%;
letter-spacing: normal;
display: inline-block;
border-right: solid #f5f5f5 1px;
.div-form-default {
width: 97%;
h3 {
font-weight: 600;
line-height: 22px;
background-color: #f5f5f5;
padding: 6px 0 6px 12px;
border-bottom: solid 1px #e7e7e7;
}
dl {
font-size: 0;
line-height: 30px;
clear: both;
padding: 0;
margin: 0;
border-bottom: dotted 1px #e6e6e6;
overflow: hidden;
dt {
display: inline-block;
width: 13%;
vertical-align: top;
text-align: right;
padding: 15px 1% 15px 0;
margin: 0;
font-size: 12px;
}
dd {
display: inline-block;
width: 84%;
padding: 15px 0 15px 1%;
margin: 0;
border-left: 1px solid #f0f0f0;
font-size: 12px;
}
}
}
}
dl dt {
width: 100px;
text-align: right;
}
.div-express-log {
max-height: 300px;
border: solid 1px #e7e7e7;
background: #fafafa;
overflow-y: auto;
overflow-x: auto;
}
.express-log {
margin-right: -10px;
margin: 5px;
padding: 10px;
list-style-type: none;
.time {
width: 30%;
display: inline-block;
float: left;
}
.detail {
width: 60%;
margin-left: 30px;
display: inline-block;
}
li {
line-height: 30px;
}
}
.layui-layer-wrap {
dl {
border-top: solid 1px #f5f5f5;
margin-top: -1px;
overflow: hidden;
dt {
font-size: 14px;
line-height: 28px;
display: inline-block;
padding: 8px 1% 8px 0;
color: #999;
}
dd {
font-size: 14px;
line-height: 28px;
display: inline-block;
padding: 8px 0 8px 8px;
border-left: solid 1px #f5f5f5;
.text-box {
line-height: 40px;
color: #333;
word-break: break-all;
}
}
}
}
.div-img {
width: 130px;
height: 130px;
text-align: center;
float: left;
}
.div-flow-center {
width: 2%;
display: inline-block;
}
.div-flow-right {
width: 49%;
vertical-align: top;
word-spacing: normal;
display: inline-block;
.div-form-default {
width: 97%;
h3 {
font-weight: 600;
line-height: 22px;
background-color: #f5f5f5;
padding: 6px 0 6px 12px;
border-bottom: solid 1px #e7e7e7;
}
dl {
font-size: 0;
line-height: 30px;
clear: both;
padding: 0;
margin: 0;
border-bottom: dotted 1px #e6e6e6;
overflow: hidden;
dt {
display: inline-block;
width: 13%;
vertical-align: top;
text-align: right;
padding: 15px 1% 15px 0;
margin: 0;
font-size: 12px;
}
dd {
display: inline-block;
width: 84%;
padding: 15px 0 15px 1%;
margin: 0;
border-left: 1px solid #f0f0f0;
font-size: 12px;
}
}
}
}
.complain-img {
width: 120px;
height: 120px;
text-align: center;
}
</style>

View File

@@ -0,0 +1,837 @@
<template>
<div class="search">
<Row>
<Col style="width:100%;">
<Row style="flex-direction: column;width: 100%;">
<Card style="height: 60px">
<div style="">
<Button v-if="allowOperation.editPrice" @click="modifyPrice" type="primary">调整价格</Button>
<Button v-if="allowOperation.editConsignee" @click="editAddress" type="primary">修改收货地址
</Button>
<Button v-if="allowOperation.showLogistics" @click="logistics" type="primary">查看物流</Button>
<Button @click="orderLog" type="primary">订单日志</Button>
<Button v-if="allowOperation.take" @click="orderTake" type="primary">订单核销</Button>
<Button v-if="allowOperation.ship" @click="orderDeliver" type="primary">发货</Button>
</div>
</Card>
<Card style="height: 400px">
<div style="width: 30%; float: left; margin-left: 20px">
<div class="div-item">
<div class="div-item-left">订单号</div>
<div class="div-item-right">{{ orderInfo.order.sn }}</div>
</div>
<div class="div-item">
<div class="div-item-left">订单来源</div>
<div class="div-item-right">
{{ orderInfo.order.clientType }}
</div>
</div>
</div>
<div class="div-item">
<div class="div-item-left">订单状态</div>
<div class="div-item-right">
{{ orderInfo.orderStatusValue }}
</div>
</div>
<div class="div-item">
<div class="div-item-left">下单时间</div>
<div class="div-item-right">
{{ orderInfo.order.createTime }}
</div>
</div>
<div style="width: 30%; float: left; margin-left: 20px">
<div class="div-item" v-if="orderInfo.order.needReceipt == false">
<div class="div-item-left">发票信息</div>
<div class="div-item-right">暂无发票信息</div>
</div>
<div class="div-item" v-if="orderInfo.order.needReceipt == true">
<div class="div-item-left">发票抬头</div>
<div class="div-item-right">{{ orderInfo.receipt.receiptTitle ? orderInfo.receipt.receiptTitle : '暂无' }}</div>
</div>
<div class="div-item" v-if="orderInfo.order.needReceipt == true && orderInfo.receipt.taxpayerId">
<div class="div-item-left">发票税号</div>
<div class="div-item-right">{{ orderInfo.receipt.taxpayerId ? orderInfo.receipt.taxpayerId : '暂无' }}</div>
</div>
<div class="div-item" v-if="orderInfo.order.needReceipt == true">
<div class="div-item-left">发票内容</div>
<div class="div-item-right">{{ orderInfo.receipt.receiptContent ? orderInfo.receipt.receiptContent : '暂无' }}</div>
</div>
<div class="div-item" v-if="orderInfo.order.needReceipt == true">
<div class="div-item-left">发票金额</div>
<div class="div-item-right">{{ orderInfo.receipt.receiptPrice ? orderInfo.receipt.receiptPrice : '暂无' | unitPrice('¥')}}</div>
</div>
<div class="div-item" v-if="orderInfo.order.needReceipt == true">
<div class="div-item-left">是否开票</div>
<div class="div-item-right">{{ orderInfo.receipt.receiptStatus == 0 ? '未开' : '已开' }}</div>
</div>
</div>
<div style="width: 36%; float: left">
<div class="div-item">
<div class="div-item-left">收货信息</div>
<div class="div-item-right">
{{ orderInfo.order.consigneeName }}
{{ orderInfo.order.consigneeMobile }}
{{ orderInfo.order.consigneeAddressPath }}
{{ orderInfo.order.consigneeDetail }}
</div>
</div>
<div class="div-item">
<div class="div-item-left">支付方式</div>
<div class="div-item-right">
{{ orderInfo.paymentMethodValue }}
</div>
</div>
<div class="div-item">
<div class="div-item-left">买家留言</div>
<div class="div-item-right">{{ orderInfo.order.remark }}</div>
</div>
<div class="div-item">
<div class="div-item-left">配送方式</div>
<div class="div-item-right">
{{
orderInfo.deliveryMethodValue
? orderInfo.deliveryMethodValue
: "暂无配送方式"
}}
</div>
</div>
</div>
</Card>
</Row>
</Col>
<Card>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
<!-- 商品栏目格式化 -->
<template slot="goodsSlot" slot-scope="scope">
<div style="margin-top: 5px; height: 80px; display: flex">
<div style="">
<img :src="scope.row.image" style="height: 60px; margin-top: 1px; width: 60px" />
</div>
<div style="margin-left: 13px">
<div class="div-zoom">
<a>{{ scope.row.goodsName }}</a>
</div>
<div>
<span v-for="(item, key) in JSON.parse(scope.row.specs)">
<span v-show="key!='images'" style="font-size: 12px;color: #999999;">
{{key}} : {{item}}
</span>
</span>
</div>
</div>
</div>
</template>
</Table>
<div class="goods-total">
<ul>
<li>
<span class="label">商品总额</span>
<span class="txt">{{ orderInfo.order.priceDetailDTO.goodsPrice | unitPrice('¥')}}</span>
</li>
<li>
<span class="label">优惠金额</span>
<span class="txt">
{{
orderInfo.order.priceDetailDTO.couponPrice +
orderInfo.order.priceDetailDTO.discountPrice
| unitPrice('¥')}}
</span>
</li>
<li>
<span class="label">运费</span>
<span class="txt">{{ orderInfo.order.freightPrice | unitPrice('¥')}}</span>
</li>
<li v-if="orderInfo.order.priceDetailDTO.payPoint != 0">
<span class="label">使用积分</span>
<span class="txt">{{
orderInfo.order.priceDetailDTO.payPoint
}}</span>
</li>
<li>
<span class="label">应付金额</span>
<span class="txt flowPrice">¥{{ orderInfo.order.flowPrice | unitPrice }}</span>
</li>
</ul>
</div>
</Card>
</Row>
<Modal v-model="modal" width="530">
<p slot="header">
<Icon type="edit"></Icon>
<span>修改金额</span>
</p>
<div>
<Form ref="modifyPriceForm" :model="modifyPriceForm" label-position="left" :label-width="100" :rules="modifyPriceValidate">
<FormItem label="订单金额" prop="orderPrice">
<InputNumber style="width:100%;" v-model="modifyPriceForm.orderPrice" size="large" :min="0.01" :max="99999"><span slot="append"></span></InputNumber>
</FormItem>
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="modifyPriceSubmit">调整</Button>
</div>
</Modal>
<!--收件地址弹出框-->
<Modal v-model="addressModal" width="530">
<p slot="header">
<Icon type="edit"></Icon>
<span>修改收件信息</span>
</p>
<div>
<Form ref="addressForm" :model="addressForm" label-position="left" :label-width="100" :rules="addressRule">
<FormItem label="收件人" prop="consigneeName">
<Input v-model="addressForm.consigneeName" size="large" maxlength="20"></Input>
</FormItem>
<FormItem label="联系方式" prop="consigneeMobile">
<Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input>
</FormItem>
<FormItem label="地址信息" prop="consigneeAddressPath">
<Input v-model="addressForm.consigneeAddressPath" disabled style="width: 325px" v-if="showRegion == false" />
<Button v-if="showRegion == false" size="small" @click="regionClick" :loading="submitLoading" type="primary" style="margin-left: 8px">修改
</Button>
<region style="width: 400px" @selected="selectedRegion" v-if="showRegion == true" />
</FormItem>
<FormItem label="详细地址" prop="consigneeDetail">
<Input v-model="addressForm.consigneeDetail" size="large" maxlength="11"></Input>
</FormItem>
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="editAddressSubmit">修改</Button>
</div>
</Modal>
<!-- 订单核销 -->
<Modal v-model="orderTakeModal" width="530">
<p slot="header">
<Icon type="edit"></Icon>
<span>订单核销</span>
</p>
<div>
<Form ref="orderTakeForm" :model="orderTakeForm" label-position="left" :label-width="100" :rules="orderTakeValidate">
<FormItem label="核销码" prop="qrCode">
<Input v-model="orderTakeForm.qrCode" size="large" maxlength="10"></Input>
</FormItem>
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="orderTakeSubmit">核销</Button>
</div>
</Modal>
<!-- 订单日志 -->
<Modal v-model="orderLogModal" width="60">
<p slot="header">
<span>订单日志</span>
</p>
<div class="order-log-div">
<Table :loading="loading" border :columns="orderLogColumns" :data="orderLogData" ref="table" sortable="custom"></Table>
</div>
<div slot="footer" style="text-align: right">
<Button @click="handelCancel">取消</Button>
</div>
</Modal>
<!-- 查询物流 -->
<Modal v-model="logisticsModal" width="40">
<p slot="header">
<span>查询物流</span>
</p>
<div class="layui-layer-wrap">
<dl>
<dt>订单号</dt>
<dd>
<div class="text-box">{{ sn }}</div>
</dd>
</dl>
<dl>
<dt>物流公司</dt>
<dd>
<div class="text-box">{{ logisticsInfo.shipper }}</div>
</dd>
</dl>
<dl>
<dt>快递单号</dt>
<dd>
<div nctype="ordersSn" class="text-box">
{{ logisticsInfo.logisticCode }}
</div>
</dd>
</dl>
<div class="div-express-log">
<ul class="express-log">
<li v-for="(item, index) in logisticsInfo.traces" :key="index">
<span class="time">{{ item.AcceptTime }}</span>
<span class="detail">{{ item.AcceptStation }}</span>
</li>
</ul>
</div>
</div>
<div slot="footer" style="text-align: right">
<Button @click="logisticsClose">取消</Button>
</div>
</Modal>
<!-- 订单发货 -->
<Modal v-model="orderDeliverModal" width="500px">
<p slot="header">
<span>订单发货</span>
</p>
<div>
<Form ref="orderDeliveryForm" :model="orderDeliveryForm" :label-width="90" :rules="orderDeliverFormValidate" style="position: relative">
<FormItem label="物流公司" prop="logisticsId">
<Select v-model="orderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
</Option>
</Select>
</FormItem>
<FormItem label="物流单号" prop="logisticsNo">
<Input v-model="orderDeliveryForm.logisticsNo" style="width: 250px" />
</FormItem>
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button size="large" @click="orderDeliverHandelCancel">取消</Button>
<Button type="success" size="large" @click="orderDeliverySubmit">发货</Button>
</div>
</Modal>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
import liliMap from "@/views/my-components/map/index";
import * as RegExp from "@/libs/RegExp.js";
import region from "@/views/lili-components/region";
export default {
name: "orderDetail",
components: {
liliMap,
region,
},
data() {
return {
submitLoading: false, // 添加或编辑提交状态
region: [], //地区
regionId: [], //地区id
showRegion: false,
orderLogInfo: [], //订单日志数据
orderLogModal: false, //弹出调整价格框
logisticsModal: false, //弹出查询物流框
receiptModal: false, //开发票弹出框
orderDeliverModal: false, //订单发货弹出框
orderTakeModal: false, //订单核销弹出框
checkedLogistics: [], //选中的物流公司集合
allowOperation: {}, //订单可才做选项
logisticsInfo: {
shipper: "",
}, //物流信息
sn: "", //订单编号
orderInfo: { // 订单信息
order: {
priceDetailDTO: {},
},
},
modal: false, //弹出调整价格框
searchForm: {
pageNumber: 1, // 当前页数
pageSize: 100, // 页面大小
},
//调整价格表单
modifyPriceForm: {
orderPrice: 0,
},
//订单核销表单
orderTakeForm: {
qrCode: "",
},
//验证要调整的订单金额
orderTakeValidate: {
qrCode: [
{ required: true, message: "订单核销码不能为空", trigger: "blur" },
],
},
//订单发货
orderDeliveryForm: {
logisticsNo: "", //发货单号
logisticsId: "", //物流公司
},
//验证要调整的订单金额
modifyPriceValidate: {
orderPrice: [
{ required: true, message: "请输入大于等于0或小于99999的合法金额" },
{
pattern: /^\d+(\.(([1-9])|(0[1-9])|([\d^0]\d)))?$/,
message: "请输入大于0小于9999的合法金额",
trigger: "change",
},
],
},
addressModal: false, //弹出修改收件信息框
//收件地址表单
addressForm: {
consigneeName: "",
consigneeMobile: "",
consigneeDetail: "",
consigneeAddressPath: "",
consigneeAddressIdPath: "",
},
orderDeliverFormValidate: {
logisticsNo: [
{ required: true, message: "发货单号不能为空", trigger: "change" },
],
logisticsId: [
{ required: true, message: "请选择物流公司", trigger: "blur" },
],
},
addressRule: {
consigneeName: [
{ required: true, message: "收货人姓名不能为空", trigger: "blur" },
],
consigneeMobile: [
{ required: true, message: "联系方式不能为空", trigger: "blur" },
{
pattern: RegExp.mobile,
trigger: "blur",
message: "请输入正确的手机号",
},
],
consigneeDetail: [
{ required: true, message: "详细地址不能为空", trigger: "blur" },
],
},
columns: [
{
title: "商品",
key: "goodsName",
minWidth: 400,
slot: "goodsSlot",
},
{
title: "优惠",
key: "num",
minWidth: 100,
render: (h, params) => {
let resultText = "";
if (params.row.promotionType) {
let type = params.row.promotionType.split(",");
if (type.indexOf("PINTUAN") != -1) {
resultText += "拼团 ";
}
if (type.indexOf("SECKILL") != -1) {
resultText += "秒杀 ";
}
if (type.indexOf("COUPON") != -1) {
resultText += "优惠券 ";
}
if (type.indexOf("FULL_DISCOUNT") != -1) {
resultText += "满减 ";
}
if (type.indexOf("POINTS_GOODS") != -1) {
resultText += "积分商品 ";
}
}
if (resultText === "") {
resultText = "暂无未参与任何促销";
}
return h("div", resultText);
},
},
{
title: "单价",
key: "unitPrice",
minWidth: 100,
render: (h, params) => {
if (!params.row.priceDetailDTO.unitPrice) {
return h("div", this.$options.filters.unitPrice(0, "¥"));
}
return h(
"div",
this.$options.filters.unitPrice(
params.row.priceDetailDTO.unitPrice,
"¥"
)
);
},
},
{
title: "数量",
key: "num",
minWidth: 80,
},
{
title: "小计",
key: "subTotal",
minWidth: 100,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.subTotal, "¥")
);
},
},
],
data: [], // 表单数据
orderLogColumns: [
// 表头
{
title: "时间",
key: "createTime",
minWidth: 120,
},
{
title: "操作者",
key: "operatorName",
minWidth: 120,
},
{
title: "操作类型",
key: "operatorType",
minWidth: 120,
},
{
title: "日志",
key: "message",
minWidth: 200,
},
],
orderLogData: [],
};
},
methods: {
//修改地址
regionClick() {
this.showRegion = true;
this.regionId = "";
},
//弹出订单核销框
orderTake() {
this.orderTakeModal = true;
},
//订单核销提交
orderTakeSubmit() {
this.$refs.orderTakeForm.validate((valid) => {
if (valid) {
API_Order.orderTake(this.sn, this.orderTakeForm).then((res) => {
if (res.success) {
this.$Message.success("订单核销成功");
this.orderTakeModal = false;
this.getDataDetail();
}
});
}
});
},
//获取订单详细信息
getDataDetail() {
this.loading = true;
API_Order.getOrderDetail(this.sn).then((res) => {
this.loading = false;
if (res.success) {
this.orderInfo = res.result;
this.allowOperation = res.result.allowOperationVO;
this.data = res.result.orderItems;
this.orderLogData = res.result.orderLogs;
}
});
},
modifyPrice() {
//默认要修改的金额为订单总金额
this.modifyPriceForm.orderPrice = this.orderInfo.order.flowPrice;
this.modal = true;
},
//修改订单金额提交
modifyPriceSubmit() {
this.$refs.modifyPriceForm.validate((valid) => {
if (valid) {
API_Order.modifyOrderPrice(this.sn, this.modifyPriceForm).then(
(res) => {
if (res.success) {
this.$Message.success("修改订单金额成功");
this.modal = false;
this.getDataDetail();
}
}
);
}
});
},
// 选中的地址
selectedRegion(val) {
this.region = val[1];
this.regionId = val[0];
},
//查询物流
logistics() {
this.logisticsModal = true;
API_Order.getTraces(this.sn).then((res) => {
if (res.success && res.result != null) {
this.logisticsInfo = res.result;
}
});
},
//关闭物流弹出框
logisticsClose() {
this.logisticsModal = false;
},
//订单发货
orderDeliver() {
API_Order.getLogisticsChecked().then((res) => {
if (res.success) {
this.checkedLogistics = res.result;
this.orderDeliverModal = true;
}
});
},
//订单日志取消
orderDeliverHandelCancel() {
this.orderDeliverModal = false;
},
//订单发货提交
orderDeliverySubmit() {
this.$refs.orderDeliveryForm.validate((valid) => {
if (valid) {
API_Order.orderDelivery(this.sn, this.orderDeliveryForm).then(
(res) => {
if (res.success) {
this.$Message.success("订单发货成功");
this.orderDeliverModal = false;
this.getDataDetail();
}
}
);
}
});
},
//订单日志
orderLog() {
this.orderLogModal = true;
},
//订单日志取消
handelCancel() {
this.orderLogModal = false;
},
//弹出修改收货地址框
editAddress() {
this.addressModal = true;
this.showRegion = false;
this.regionId = this.orderInfo.order.consigneeAddressIdPath;
this.region = this.orderInfo.order.consigneeAddressPath;
this.addressForm.consigneeName = this.orderInfo.order.consigneeName;
this.addressForm.consigneeMobile = this.orderInfo.order.consigneeMobile;
this.addressForm.consigneeDetail = this.orderInfo.order.consigneeDetail;
this.addressForm.consigneeAddressPath = this.orderInfo.order.consigneeAddressPath;
this.addressForm.consigneeAddressIdPath = this.orderInfo.order.consigneeAddressIdPath;
},
//修改收货地址
editAddressSubmit() {
if (this.regionId == "") {
this.$Message.error("请选择地址");
return;
}
this.addressForm.consigneeAddressPath = this.region;
this.addressForm.consigneeAddressIdPath = this.regionId;
this.$refs.addressForm.validate((valid) => {
if (valid) {
API_Order.editOrderConsignee(this.sn, this.addressForm).then(
(res) => {
if (res.success) {
this.$Message.success("收货地址修改成功");
this.addressModal = false;
this.getDataDetail();
}
}
);
}
});
},
},
mounted() {
this.sn = this.$route.query.sn;
this.getDataDetail();
},
};
</script>
<style lang="scss" scoped>
// 建议引入通用样式 可删除下面样式代码
// @import "@/styles/table-common.scss";
.order-log-div {
line-height: 30px;
height: 500px;
overflow-y: scroll;
}
dl dt {
width: 100px;
text-align: right;
}
.div-express-log {
max-height: 300px;
border: solid 1px #e7e7e7;
background: #fafafa;
overflow-y: auto;
overflow-x: auto;
}
.express-log {
margin-right: -10px;
margin: 5px;
padding: 10px;
list-style-type: none;
.time {
width: 30%;
display: inline-block;
float: left;
}
.detail {
width: 60%;
margin-left: 30px;
display: inline-block;
}
li {
line-height: 30px;
}
}
.layui-layer-wrap {
dl {
border-top: solid 1px #f5f5f5;
margin-top: -1px;
overflow: hidden;
dt {
font-size: 14px;
line-height: 28px;
display: inline-block;
padding: 8px 1% 8px 0;
color: #999;
}
dd {
font-size: 14px;
line-height: 28px;
display: inline-block;
padding: 8px 0 8px 8px;
border-left: solid 1px #f5f5f5;
.text-box {
line-height: 40px;
color: #333;
word-break: break-all;
}
}
}
}
.flex-card {
display: flex;
height: 600px;
}
.card-item {
margin: 5px 0;
}
.flex-card-left {
flex: 4;
//background: #f8f8f8;
}
.flex-card-right {
flex: 6;
}
.search {
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
.div-item {
line-height: 35px;
display: flex;
> .div-item-left {
width: 80px;
}
> .div-item-right {
flex: 1;
word-break: break-all;
}
}
.div-status-right {
margin-top: 20px;
margin-left: 30px;
font-size: 20px;
}
.page {
margin-top: 2vh;
}
button {
margin-left: 5px;
}
.goods-total {
padding: 20px;
height: 150px;
width: 100%;
ul {
margin-right: 10px;
display: block;
float: right;
list-style-type: none;
line-height: 25px;
}
.label {
float: left;
width: 500px;
text-align: right;
}
.txt {
float: left;
width: 130px;
text-align: right;
font-family: verdana;
}
.flowPrice {
color: #cc0000;
font-size: 22px;
}
}
}
</style>

View File

@@ -0,0 +1,308 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单编号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
clearable
placeholder="请输入订单编号"
style="width: 200px"
/>
</Form-item>
<Form-item label="会员名称" prop="buyerName">
<Input
type="text"
v-model="searchForm.buyerName"
clearable
placeholder="请输入会员名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="订单状态" prop="orderStatus">
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px">
<Option value="UNPAID">未付款</Option>
<Option value="PAID">已付款</Option>
<Option value="UNDELIVERED">待发货</Option>
<Option value="DELIVERED">已发货</Option>
<Option value="COMPLETED">已完成</Option>
<Option value="TAKE">待核验</Option>
<Option value="CANCELLED">已取消</Option>
</Select>
</Form-item>
<Form-item label="下单时间">
<DatePicker
v-model="selectDate"
type="datetimerange"
format="yyyy-MM-dd HH:mm:ss"
clearable
@on-change="selectDateRange"
placeholder="选择起始时间"
style="width: 200px"
></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</Col>
</Row>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
export default {
name: "orderList",
components: {
},
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
startDate: "", // 起始时间
endDate: "", // 终止时间
orderSn:"",
buyerName:"",
orderStatus:""
},
selectDate: null,
form: {
// 添加或编辑表单对象初始化数据
sn: "",
sellerName: "",
startTime: "",
endTime: "",
billPrice: "",
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "订单号",
key: "sn",
minWidth: 240,
tooltip: true
},
{
title: "订单来源",
key: "clientType",
width: 120,
},
{
title: "订单类型",
key: "orderType",
width: 120,
render: (h, params) => {
if (params.row.orderType == "NORMAL") {
return h('div', [h('span', { }, '普通订单'),]);
} else if (params.row.orderType == "PINTUAN") {
return h('div', [h('span', { }, '拼团订单'),]);
} else if (params.row.orderType == "GIFT") {
return h('div', [h('span', { }, '赠品订单'),]);
}
}
},
{
title: "买家名称",
key: "memberName",
minWidth: 130,
tooltip: true
},
{
title: "订单金额",
key: "flowPrice",
minWidth: 100,
tooltip: true,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.flowPrice, "¥")
);
},
},
{
title: "订单状态",
key: "orderStatus",
minWidth: 100,
render: (h, params) => {
if (params.row.orderStatus == "UNPAID") {
return h('div', [h('span', { }, '未付款'),]);
} else if (params.row.orderStatus == "PAID") {
return h('div', [h('span', { }, '已付款'),]);
} else if (params.row.orderStatus == "UNDELIVERED") {
return h('div', [h('span', { }, '待发货'),]);
}else if (params.row.orderStatus == "DELIVERED") {
return h('div', [h('span', { }, '已发货'),]);
}else if (params.row.orderStatus == "COMPLETED") {
return h('div', [h('span', { }, '已完成'),]);
}else if (params.row.orderStatus == "TAKE") {
return h('div', [h('span', { }, '待核验'),]);
}else if (params.row.orderStatus == "CANCELLED") {
return h('div', [h('span', { }, '已取消'),]);
}
}
},
{
title: "下单时间",
key: "createTime",
width: 170,
sortable: true,
sortType: "desc",
},
{
title: "操作",
key: "action",
align: "center",
width: 100,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.detail(params.row);
},
},
},
"查看"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.selectDate = null;
this.searchForm.startDate = "";
this.searchForm.endDate = "";
// 重新加载数据
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() {
this.loading = true;
API_Order.getOrderList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
detail(v) {
let sn = v.sn;
this.$router.push({
name: "order-detail",
query: { sn: sn },
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,320 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="订单编号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
clearable
placeholder="请输入订单编号"
style="width: 200px"
/>
</Form-item>
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
clearable
placeholder="请输入会员名称"
style="width: 200px"
/>
</Form-item>
<Form-item label="发票抬头" prop="receiptTitle">
<Input
type="text"
v-model="searchForm.receiptTitle"
clearable
placeholder="请输入发票抬头"
style="width: 200px"
/>
</Form-item>
<Form-item label="状态" prop="receiptStatus">
<Select v-model="searchForm.receiptStatus" placeholder="请选择" clearable style="width: 200px">
<Option value="0">未开票</Option>
<Option value="1">已开票</Option>
</Select>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<!-- 订单详情格式化 -->
<template slot="orderSlot" slot-scope="scope">
<a
@click="$router.push({name: 'order-detail',query: {sn: scope.row.orderSn}})">{{scope.row.orderSn}}</a>
</template>
</Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</Col>
</Row>
</div>
</template>
<script>
import * as API_Order from "@/api/order";
export default {
name: "storeBill",
components: {},
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
receiptStatus: "", // 起始时间
},
form: {
// 添加或编辑表单对象初始化数据
sn: "",
sellerName: "",
startTime: "",
endTime: "",
billPrice: "",
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "订单号",
key: "orderSn",
minWidth: 120,
slot: "orderSlot",
},
{
title: "会员名称",
key: "memberName",
minWidth: 90,
tooltip: true
},
{
title: "发票抬头",
key: "receiptTitle",
minWidth: 90,
tooltip: true
},
{
title: "纳税人识别号",
key: "taxpayerId",
minWidth: 100,
tooltip: true
},
{
title: "发票内容",
key: "receiptContent",
minWidth: 120,
tooltip: true
},
{
title: "发票金额",
key: "billPrice",
width: 90,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.receiptPrice, "¥")
);
},
},
{
title: "发票状态",
key: "receiptStatus",
width: 90,
tooltip: true,
render: (h, params) => {
if(params.row.receiptStatus == 0){
return h(
"div",
"未开票"
);
}else{
return h(
"div",
"已开票"
);
}
},
},
{
title: "订单状态",
key: "orderStatus",
width: 90,
render: (h, params) => {
if (params.row.orderStatus == "UNPAID") {
return h('div', [h('span', { }, '未付款'),]);
} else if (params.row.orderStatus == "PAID") {
return h('div', [h('span', { }, '已付款'),]);
} else if (params.row.orderStatus == "UNDELIVERED") {
return h('div', [h('span', { }, '待发货'),]);
}else if (params.row.orderStatus == "DELIVERED") {
return h('div', [h('span', { }, '已发货'),]);
}else if (params.row.orderStatus == "COMPLETED") {
return h('div', [h('span', { }, '已完成'),]);
}else if (params.row.orderStatus == "TAKE") {
return h('div', [h('span', { }, '待核验'),]);
}else if (params.row.orderStatus == "CANCELLED") {
return h('div', [h('span', { }, '已取消'),]);
}
}
},
{
title: "操作",
key: "action",
align: "center",
width: 80,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
attrs: {
disabled: params.row.orderStatus == "COMPLETED" && params.row.receiptStatus == 0? false : true,
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.invoicing(params.row);
},
},
},
"开票"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getData();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getData();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getData();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getData();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getData();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getData() {
this.loading = true;
API_Order.getReceiptPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
//开发票
invoicing(params){
this.$Modal.confirm({
title: "确认开票",
content: "您确认已经开具发票 ?",
loading: true,
onOk: () => {
API_Order.invoicing(params.id).then((res) => {
if (res.success) {
this.$Message.success("开票成功");
}
this.$Modal.remove();
this.getData();
});
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
</style>