增加了退款流程
This commit is contained in:
parent
6a1931ae80
commit
be8f6b7576
@ -18,6 +18,7 @@ import com.ruoyi.winery.domain.AppOrder;
|
||||
import com.ruoyi.winery.domain.goods.GoodsMain;
|
||||
import com.ruoyi.winery.service.IAppOrderService;
|
||||
import com.ruoyi.winery.service.IGoodsMainService;
|
||||
import com.ruoyi.winery.vo.AppRequestRefundDetailVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -68,8 +69,7 @@ public class AppOrderDetailController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppOrderDetail appOrderDetail)
|
||||
{
|
||||
public TableDataInfo list(AppOrderDetail appOrderDetail) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<AppOrderDetail> lqw = Wrappers.lambdaQuery(appOrderDetail);
|
||||
if (appOrderDetail.getDeptId() != null) {
|
||||
@ -96,6 +96,7 @@ public class AppOrderDetailController extends BaseController {
|
||||
if (appOrderDetail.getRefundTime() != null) {
|
||||
lqw.eq(AppOrderDetail::getRefundTime, appOrderDetail.getRefundTime());
|
||||
}
|
||||
lqw.orderByDesc(AppOrderDetail::getCreateTime);
|
||||
List<AppOrderDetail> list = iAppOrderDetailService.list(lqw);
|
||||
for (AppOrderDetail detail : list) {
|
||||
detail.setGoods(goodsMainService.getById(detail.getGoodsId()));
|
||||
@ -185,4 +186,17 @@ public class AppOrderDetailController extends BaseController {
|
||||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:query')")
|
||||
@Log(title = "请求退款", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/requestRefund")
|
||||
AjaxResult requestRefund(@RequestBody AppRequestRefundDetailVo vo) {
|
||||
AppOrderDetail detail = iAppOrderDetailService.getById(vo.getId());
|
||||
detail.setStatus(1);
|
||||
detail.setRefundReason(vo.getRefundReason());
|
||||
iAppOrderDetailService.updateById(detail);
|
||||
return AjaxResult.success(detail);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.winery.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.winery.domain.goods.GoodsMain;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 请求退款对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-01-18
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class AppRequestRefundDetailVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
|
||||
@Excel(name = "退款理由")
|
||||
private String refundReason;
|
||||
|
||||
}
|
@ -24,9 +24,10 @@ class OrderApis {
|
||||
})
|
||||
}
|
||||
|
||||
refundOrder(id) {
|
||||
requestRefund(data) {
|
||||
return request.post({
|
||||
url: baseUrl + 'winery/detail/refund/' + id
|
||||
url: baseUrl + 'winery/detail/requestRefund',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
// export const baseUrl = 'http://36.1.50.18:18989/'
|
||||
export const baseUrl = 'http://127.0.0.1:18989/'
|
||||
// export const baseUrl = 'https://mall.xiao4r.com/api/'
|
||||
// export const baseUrl = 'http://127.0.0.1:18989/'
|
||||
export const baseUrl = 'https://mall.xiao4r.com/api/'
|
||||
|
||||
export const imgbaseUrl = 'https://www.xiao4r.com/xiao4rstatic/img/winery/'
|
||||
export const sysImgBaseUrl = 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/'
|
||||
|
@ -185,7 +185,7 @@ wepy.component({
|
||||
|
||||
onRefund(item) {
|
||||
// 申请退款
|
||||
appManager.showToast('即将开放:如需联系退款请拨打客服热线17395097925')
|
||||
eventHub.$emit('onShowRefund', item)
|
||||
},
|
||||
onDetail(item) {
|
||||
appManager.navigateTo(goodsDetailPage + '?id=' + item.goods.id)
|
||||
|
@ -4,7 +4,6 @@ return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports.parseImage = parseImage;
|
||||
|
||||
</wxs>
|
||||
@ -15,9 +14,33 @@ module.exports.parseImage = parseImage;
|
||||
width: 100%;
|
||||
height: 536rpx;
|
||||
z-index: -10;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.cell-item {
|
||||
margin-left: 22px;
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cell-input {
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
input {
|
||||
margin-left: 10px;
|
||||
border: #dddddd solid 1px;
|
||||
border-radius: 8px;
|
||||
padding: 5px 10px;
|
||||
width: 320rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<template>
|
||||
|
||||
@ -31,6 +54,7 @@ module.exports.parseImage = parseImage;
|
||||
bind:cancel="onClose"
|
||||
bind:confirm="onConfirm"
|
||||
:asyncClose="true"
|
||||
|
||||
>
|
||||
|
||||
<van-card
|
||||
@ -41,10 +65,50 @@ module.exports.parseImage = parseImage;
|
||||
:thumb="filters.parseImage(item.goods.goodsFaceImg)"
|
||||
>
|
||||
|
||||
<view slot="footer" style="display: flex;align-items: center;padding:10px;">
|
||||
<span style="font-size: 14px;">如需联系可致电客服热线17395097925</span>
|
||||
<van-radio-group value="{{ refundReason }}" bind:change="onChangeRefundReason">
|
||||
<div style="display: flex;margin: 5px;flex-direction: column;">
|
||||
<div class="cell-item" v-for="(type,index) in reasonType">
|
||||
<div v-if="index === 4" class="cell-input">
|
||||
<van-radio name="其他" checked-color="#AC1630">其他<van-radio/>
|
||||
<input
|
||||
v-model="text"
|
||||
clearable
|
||||
placeholder="请输入退款理由"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<van-radio name="{{type}}" checked-color="#AC1630">{{type}}</van-radio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
|
||||
|
||||
</van-card>
|
||||
|
||||
|
||||
|
||||
<van-radio-group value="{{ refundReason }}" bind:change="onChangeRefundReason">
|
||||
<div style="display: flex;margin: 5px;flex-direction: column;">
|
||||
<div class="cell-item" v-for="(item,index) in reasonTypes">
|
||||
<div v-if="index === 4" class="cell-input">
|
||||
<van-radio name="{{item}}" checked-color="#AC1630" />
|
||||
<input
|
||||
v-model="text"
|
||||
clearable
|
||||
placeholder="请输入退款理由"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<van-radio name="{{item}}" checked-color="#AC1630">{{item}}</van-radio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-radio-group>
|
||||
|
||||
</van-dialog>
|
||||
</div>
|
||||
|
||||
@ -56,17 +120,18 @@ import store from '@/store'
|
||||
import { mapActions, mapState } from '@wepy/x'
|
||||
import eventHub from '../../common/eventHub'
|
||||
import appManager from '../../appManager'
|
||||
import orderApis from '../../apis/orderApis'
|
||||
|
||||
wepy.component({
|
||||
store,
|
||||
props: {
|
||||
|
||||
item: {}
|
||||
},
|
||||
hooks: {},
|
||||
|
||||
data: {
|
||||
isShow: false
|
||||
isShow: false,
|
||||
item: {},
|
||||
refundReason: '',
|
||||
reasonTypes: ['买错,不想要了', '发错货', '商品损坏/包装脏污', '商品与介绍不符', '其他'],
|
||||
text: ''
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
@ -76,11 +141,26 @@ wepy.component({
|
||||
events: {},
|
||||
|
||||
methods: {
|
||||
...mapActions([
|
||||
]),
|
||||
...mapActions([]),
|
||||
|
||||
onChangeRefundReason(e) {
|
||||
this.refundReason = e.$wx.detail
|
||||
},
|
||||
|
||||
onConfirm(event) {
|
||||
|
||||
let refundReason = this.refundReason === '其他' ? this.text : this.refundReason
|
||||
if (!refundReason) {
|
||||
appManager.showToast('请输入您的退款理由.')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
id: this.item.id,
|
||||
refundReason: refundReason
|
||||
}
|
||||
orderApis.requestRefund(data).then(r => {
|
||||
this.$emit('reload')
|
||||
this.isShow = false
|
||||
})
|
||||
},
|
||||
|
||||
onClose() {
|
||||
@ -90,6 +170,11 @@ wepy.component({
|
||||
},
|
||||
|
||||
ready() {
|
||||
eventHub.$on('onShowRefund', (...args) => {
|
||||
console.log('onShowRefund:', args[0])
|
||||
this.item = args[0]
|
||||
this.isShow = true
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -119,7 +119,7 @@ wepy.component({
|
||||
console.log('userInfo:', store.state.user.userInfo)
|
||||
|
||||
if (!this.isChecked) {
|
||||
appManager.showToast('请确认xxxx协议.')
|
||||
appManager.showToast('请同意并遵守紫色名片《隐私政策》以及《用户条款》.')
|
||||
return false
|
||||
}
|
||||
if (!this.user.mobile) {
|
||||
|
@ -36,6 +36,8 @@ input {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<template>
|
||||
<nav-bar />
|
||||
|
@ -150,12 +150,18 @@ wepy.page({
|
||||
this.pageIndex = index
|
||||
},
|
||||
|
||||
init() {
|
||||
mallApis.getHotSwitch().then(r => {
|
||||
store.state.hotSwitch = r.data
|
||||
async init() {
|
||||
wx.showLoading({ title: '正在连接...', mask: true })
|
||||
const r = await mallApis.getHotSwitch()
|
||||
|
||||
if (r && r.code === 200) {
|
||||
store.state.hotSwitch = r.data
|
||||
wx.hideLoading()
|
||||
appManager.login()
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await this.init()
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -188,6 +188,7 @@ wepy.page({
|
||||
wx.hideLoading()
|
||||
|
||||
if (r.code !== 200) {
|
||||
appManager.showToast(r.msg)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ module.exports.parseImage = parseImage;
|
||||
</van-tabs>
|
||||
|
||||
|
||||
<!-- <dialog-refund />-->
|
||||
<dialog-refund @reload="reload" />
|
||||
|
||||
</div>
|
||||
|
||||
@ -80,6 +80,9 @@ wepy.page({
|
||||
},
|
||||
reload() {
|
||||
eventHub.$emit('refreshOrderList')
|
||||
},
|
||||
showRefund() {
|
||||
eventHub.$emit('onShowRefund')
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
@ -205,17 +205,21 @@ tencent-cos:
|
||||
|
||||
#微信小程序支付配置
|
||||
wxmini:
|
||||
# appId: wx76ec015fc31a1946 #微信公众号或者小程序等的appid 必填
|
||||
appId: wx4306452d346f783d #微信公众号或者小程序等的appid 必填
|
||||
# secret: 94ee42c0899a6ceccf353e1e729c50d4 #微信小程序的Secret
|
||||
secret: dc55bc1729090bdff9b63e1a5f0d03b2 #微信小程序的Secret
|
||||
# appId: wx76ec015fc31a1946 # 宁夏通
|
||||
appId: wx4306452d346f783d # 紫色名片
|
||||
# secret: 94ee42c0899a6ceccf353e1e729c50d4 # 宁夏通
|
||||
secret: dc55bc1729090bdff9b63e1a5f0d03b2 # 紫色名片
|
||||
|
||||
|
||||
|
||||
mchId: 1486984962
|
||||
mchKey: 82aZ9Tb6eu5W2HdXKQWZU2SztU8w8nJ8
|
||||
keyPath: "classpath:/cert/apiclient_cert1486984962.p12" # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
|
||||
|
||||
subAppId: #服务商模式下的子商户公众账号ID
|
||||
subMchId: #服务商模式下的子商户号
|
||||
tradeType: JSAPI #交易类型
|
||||
keyPath: "classpath:/cert/apiclient_cert1486984962.p12" # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
|
||||
|
||||
|
||||
token: xiao4r #微信小程序消息服务器配置的token
|
||||
aesKey: jNXajd2sQSMYQNg3rcdMF9HraUJxXF0iswgdMxVik9W #微信小程序消息服务器配置的EncodingAESKey
|
||||
|
@ -51,3 +51,11 @@ export function exportDetail(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 操作退款
|
||||
export function refund(id) {
|
||||
return request({
|
||||
url: '/winery/detail/refund/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
@ -82,7 +82,8 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['winery:detail:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -92,7 +93,8 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['winery:detail:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -102,7 +104,8 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['winery:detail:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -111,7 +114,8 @@
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['winery:detail:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -123,8 +127,13 @@
|
||||
<el-table-column label="用户ID" align="center" prop="userId"/>
|
||||
<el-table-column label="订单ID" align="center" prop="orderId"/>
|
||||
<el-table-column label="商品ID" align="center" prop="goodsId"/>
|
||||
<el-table-column label="退款时间" align="center" prop="goods" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ goods.goodsName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品数量" align="center" prop="goodsCount"/>
|
||||
<el-table-column label="明细状态" align="center" prop="status" />
|
||||
<el-table-column label="明细状态" align="center" prop="status" :formatter="statusFormat"/>
|
||||
<el-table-column label="统一退单号" align="center" prop="refundNo"/>
|
||||
<el-table-column label="退款时间" align="center" prop="refundTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
@ -133,20 +142,32 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleRefund(scope.row)"
|
||||
v-hasPermi="['winery:detail:refund\n']"
|
||||
>退款
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['winery:detail:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['winery:detail:remove']"
|
||||
>删除</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['winery:detail:remove']"-->
|
||||
<!-- >删除-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -203,12 +224,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDetail, getDetail, delDetail, addDetail, updateDetail, exportDetail } from "@/api/winery/detail";
|
||||
import {listDetail, getDetail, delDetail, addDetail, updateDetail, exportDetail, refund} from "@/api/winery/detail";
|
||||
|
||||
export default {
|
||||
name: "Detail",
|
||||
components: {
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -225,6 +245,8 @@ export default {
|
||||
total: 0,
|
||||
// 订单明细表格数据
|
||||
detailList: [],
|
||||
// 退款状态字典
|
||||
statusOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@ -269,6 +291,9 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("refund_status").then(response => {
|
||||
this.statusOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询订单明细列表 */
|
||||
@ -280,6 +305,12 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.statusOptions, row.status);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@ -334,6 +365,18 @@ export default {
|
||||
this.title = "修改订单明细";
|
||||
});
|
||||
},
|
||||
|
||||
/** 退款操作 */
|
||||
handleRefund(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
refund(id).then(response => {
|
||||
this.msgSuccess(response.msg);
|
||||
if (response.code === 200) {
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user