增加了退款流程
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;
|
||||
@ -43,13 +44,13 @@ import static com.ruoyi.common.core.domain.AjaxResult.error;
|
||||
|
||||
/**
|
||||
* 订单明细Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-01-18
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/winery/detail" )
|
||||
@RequestMapping("/winery/detail")
|
||||
public class AppOrderDetailController extends BaseController {
|
||||
|
||||
private final IAppOrderDetailService iAppOrderDetailService;
|
||||
@ -68,34 +69,34 @@ 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){
|
||||
lqw.eq(AppOrderDetail::getDeptId ,appOrderDetail.getDeptId());
|
||||
if (appOrderDetail.getDeptId() != null) {
|
||||
lqw.eq(AppOrderDetail::getDeptId, appOrderDetail.getDeptId());
|
||||
}
|
||||
if (appOrderDetail.getUserId() != null){
|
||||
lqw.eq(AppOrderDetail::getUserId ,appOrderDetail.getUserId());
|
||||
if (appOrderDetail.getUserId() != null) {
|
||||
lqw.eq(AppOrderDetail::getUserId, appOrderDetail.getUserId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getOrderId())){
|
||||
lqw.eq(AppOrderDetail::getOrderId ,appOrderDetail.getOrderId());
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getOrderId())) {
|
||||
lqw.eq(AppOrderDetail::getOrderId, appOrderDetail.getOrderId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getGoodsId())){
|
||||
lqw.eq(AppOrderDetail::getGoodsId ,appOrderDetail.getGoodsId());
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getGoodsId())) {
|
||||
lqw.eq(AppOrderDetail::getGoodsId, appOrderDetail.getGoodsId());
|
||||
}
|
||||
if (appOrderDetail.getGoodsCount() != null){
|
||||
lqw.eq(AppOrderDetail::getGoodsCount ,appOrderDetail.getGoodsCount());
|
||||
if (appOrderDetail.getGoodsCount() != null) {
|
||||
lqw.eq(AppOrderDetail::getGoodsCount, appOrderDetail.getGoodsCount());
|
||||
}
|
||||
if (appOrderDetail.getStatus() != null){
|
||||
lqw.eq(AppOrderDetail::getStatus ,appOrderDetail.getStatus());
|
||||
if (appOrderDetail.getStatus() != null) {
|
||||
lqw.eq(AppOrderDetail::getStatus, appOrderDetail.getStatus());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getRefundNo())){
|
||||
lqw.eq(AppOrderDetail::getRefundNo ,appOrderDetail.getRefundNo());
|
||||
if (StringUtils.isNotBlank(appOrderDetail.getRefundNo())) {
|
||||
lqw.eq(AppOrderDetail::getRefundNo, appOrderDetail.getRefundNo());
|
||||
}
|
||||
if (appOrderDetail.getRefundTime() != null){
|
||||
lqw.eq(AppOrderDetail::getRefundTime ,appOrderDetail.getRefundTime());
|
||||
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()));
|
||||
@ -106,22 +107,22 @@ public class AppOrderDetailController extends BaseController {
|
||||
/**
|
||||
* 导出订单明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:export')" )
|
||||
@Log(title = "订单明细" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:export')")
|
||||
@Log(title = "订单明细", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(AppOrderDetail appOrderDetail) {
|
||||
LambdaQueryWrapper<AppOrderDetail> lqw = new LambdaQueryWrapper<AppOrderDetail>(appOrderDetail);
|
||||
List<AppOrderDetail> list = iAppOrderDetailService.list(lqw);
|
||||
ExcelUtil<AppOrderDetail> util = new ExcelUtil<AppOrderDetail>(AppOrderDetail. class);
|
||||
return util.exportExcel(list, "detail" );
|
||||
ExcelUtil<AppOrderDetail> util = new ExcelUtil<AppOrderDetail>(AppOrderDetail.class);
|
||||
return util.exportExcel(list, "detail");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) String id) {
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
AppOrderDetail detail = iAppOrderDetailService.getById(id);
|
||||
detail.setGoods(goodsMainService.getById(detail.getGoodsId()));
|
||||
return AjaxResult.success(detail);
|
||||
@ -130,8 +131,8 @@ public class AppOrderDetailController extends BaseController {
|
||||
/**
|
||||
* 新增订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:add')" )
|
||||
@Log(title = "订单明细" , businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:add')")
|
||||
@Log(title = "订单明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppOrderDetail appOrderDetail) {
|
||||
return toAjax(iAppOrderDetailService.save(appOrderDetail) ? 1 : 0);
|
||||
@ -140,8 +141,8 @@ public class AppOrderDetailController extends BaseController {
|
||||
/**
|
||||
* 修改订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:edit')" )
|
||||
@Log(title = "订单明细" , businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:edit')")
|
||||
@Log(title = "订单明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppOrderDetail appOrderDetail) {
|
||||
return toAjax(iAppOrderDetailService.updateById(appOrderDetail) ? 1 : 0);
|
||||
@ -150,9 +151,9 @@ public class AppOrderDetailController extends BaseController {
|
||||
/**
|
||||
* 删除订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:remove')" )
|
||||
@Log(title = "订单明细" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
@PreAuthorize("@ss.hasPermi('winery:detail:remove')")
|
||||
@Log(title = "订单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(iAppOrderDetailService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
@ -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) {
|
||||
|
@ -56,15 +56,15 @@ spring:
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 20MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 20MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
@ -73,13 +73,13 @@ spring:
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
# expireTime: 30
|
||||
expireTime: 300
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
# expireTime: 30
|
||||
expireTime: 300
|
||||
|
||||
# MyBatis配置
|
||||
# https://baomidou.com/config/
|
||||
@ -170,11 +170,11 @@ mybatis-plus:
|
||||
selectStrategy: NOT_NULL
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
@ -184,7 +184,7 @@ swagger:
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
@ -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
|
||||
|
@ -50,4 +50,12 @@ export function exportDetail(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 操作退款
|
||||
export function refund(id) {
|
||||
return request({
|
||||
url: '/winery/detail/refund/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
@ -48,7 +48,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="明细状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择明细状态" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
<el-option label="请选择字典生成" value=""/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一退单号" prop="refundNo">
|
||||
@ -62,10 +62,10 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="退款时间" prop="refundTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.refundTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择退款时间">
|
||||
v-model="queryParams.refundTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择退款时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -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,21 +114,27 @@
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['winery:detail:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="明细ID" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="部门ID" align="center" prop="deptId" />
|
||||
<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="goodsCount" />
|
||||
<el-table-column label="明细状态" align="center" prop="status" />
|
||||
<el-table-column label="统一退单号" align="center" prop="refundNo" />
|
||||
<el-table-column label="部门ID" align="center" prop="deptId"/>
|
||||
<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" :formatter="statusFormat"/>
|
||||
<el-table-column label="统一退单号" align="center" prop="refundNo"/>
|
||||
<el-table-column label="退款时间" align="center" prop="refundTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.refundTime, '{y}-{m}-{d}') }}</span>
|
||||
@ -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>
|
||||
@ -163,19 +184,19 @@
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="部门ID" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入部门ID" />
|
||||
<el-input v-model="form.deptId" placeholder="请输入部门ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单ID" prop="orderId">
|
||||
<el-input v-model="form.orderId" placeholder="请输入订单ID" />
|
||||
<el-input v-model="form.orderId" placeholder="请输入订单ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品ID" prop="goodsId">
|
||||
<el-input v-model="form.goodsId" placeholder="请输入商品ID" />
|
||||
<el-input v-model="form.goodsId" placeholder="请输入商品ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品数量" prop="goodsCount">
|
||||
<el-input v-model="form.goodsCount" placeholder="请输入商品数量" />
|
||||
<el-input v-model="form.goodsCount" placeholder="请输入商品数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
@ -183,14 +204,14 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一退单号" prop="refundNo">
|
||||
<el-input v-model="form.refundNo" placeholder="请输入统一退单号" />
|
||||
<el-input v-model="form.refundNo" placeholder="请输入统一退单号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款时间" prop="refundTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.refundTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择退款时间">
|
||||
v-model="form.refundTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择退款时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -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: "",
|
||||
// 是否显示弹出层
|
||||
@ -247,28 +269,31 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
userId: [
|
||||
{ required: true, message: "用户ID不能为空", trigger: "blur" }
|
||||
{required: true, message: "用户ID不能为空", trigger: "blur"}
|
||||
],
|
||||
orderId: [
|
||||
{ required: true, message: "订单ID不能为空", trigger: "blur" }
|
||||
{required: true, message: "订单ID不能为空", trigger: "blur"}
|
||||
],
|
||||
goodsId: [
|
||||
{ required: true, message: "商品ID不能为空", trigger: "blur" }
|
||||
{required: true, message: "商品ID不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "明细状态不能为空", trigger: "blur" }
|
||||
{required: true, message: "明细状态不能为空", trigger: "blur"}
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
{required: true, message: "创建时间不能为空", trigger: "blur"}
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
{required: true, message: "更新时间不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
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;
|
||||
@ -315,7 +346,7 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
@ -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 => {
|
||||
@ -358,28 +401,28 @@ export default {
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除订单明细编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delDetail(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delDetail(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有订单明细数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportDetail(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportDetail(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user