退款对接

This commit is contained in:
Aaron
2021-07-02 15:50:14 +08:00
parent 458753f40a
commit cea854a807
3 changed files with 38 additions and 16 deletions

View File

@ -16,11 +16,11 @@ export function salesCheck(data) {
})
}
export function rebackMoney(data) {
export function rebackMoney(params) {
return request({
url: '/api/yxStoreAfterSales/makeMoney',
method: '',
data
method: 'post',
params
})
}
export function add(data) {

View File

@ -84,8 +84,8 @@
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">退出</el-button>
<el-button v-if="isShow" :loading="loading" type="primary" @click="submit">确认</el-button>
<el-button class="refuse" type="danger" v-if="isShow" :loading="loading" @click="submit(1)">拒绝</el-button>
<el-button class="check" type="primary" v-if="isShow" :loading="loading" @click="submit(0)">确认</el-button>
</div>
</el-dialog>
</template>
@ -122,20 +122,21 @@ export default {
this.visible = false
this.$refs['form'].resetFields()
},
async submit() {
async submit(type) {
this.loading = true
if (this.serviceType === 0) {
consignee = ''
phoneNumber = ''
address = ''
}
this.form.approvalStatus = 0
this.form.approvalStatus = type // 0成功 1失败
var res = await salesCheck(this.form)
if (res) {
this.$message.success('审核成功')
this.visible = false
this.$emit('checkSuccess')
} else {
this.$message.error(res.msg || '审核失败!')
this.$message.error(res.message || '审核失败!')
}
this.loading = false
}
@ -145,6 +146,7 @@ export default {
<style lang="scss" scoped>
.afterSealsAdd{
padding-bottom: 10vh;
span{
color: #F56C6C;
line-height: 40px;
@ -156,4 +158,14 @@ export default {
.afterSealsAdd ::v-deep.el-input.is-disabled .el-input__inner{
color: #333333;
}
.afterSealsAdd ::v-deep .dialog-footer{
display: flex;
justify-content: space-around;
.el-button{
width: 120px;
height: 40px;
}
.refuse{}
.check{}
}
</style>

View File

@ -99,12 +99,18 @@
v-permission="['admin','yxStoreAfterSales:edit','yxStoreAfterSales:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="text" @click="checkItem(scope.row, 0)">订单详情</el-button>
<el-button size="mini" type="success" v-if="scope.row.state === 0" @click="checkItem(scope.row, 1)">审核</el-button>
<el-button
size="mini"
type="success"
v-if="scope.row.state === 0 && scope.row.salesState === 0"
@click="checkItem(scope.row, 1)">审核</el-button>
<el-button
size="mini"
type="danger"
v-if="scope.row.state === 2"
@click="rebackVisible = true;rebackQuery.salesId = scope.row.id;rebackQuery.orderCode = scope.row.orderCode">
@click="rebackVisible = true;
rebackQuery.salesId = scope.row.id;
rebackQuery.orderCode = scope.row.orderCode">
退款</el-button>
</template>
</el-table-column>
@ -172,8 +178,8 @@ export default {
],
// 退款参数
rebackQuery: {
salesId: 0, // 数据的id
orderCode: '' // 订单号
orderCode: '', // 订单号
salesId: 0 // 数据的id
}
}
},
@ -185,7 +191,6 @@ export default {
methods: {
beforeInit() {
this.url = 'api/yxStoreAfterSales/sales/List'
console.log(this.searchTime)
this.params = {
page: this.page,
size: this.size,
@ -223,9 +228,14 @@ export default {
},
// 退款
async rebackItem() {
console.log(this.rebackQuery)
// var res = await rebackMoney(this.rebackQuery)
// console.log(res)
var res = await rebackMoney(this.rebackQuery)
if (res) {
this.$message.success('提交退款成功!')
this.rebackVisible = false
this.toQuery()
} else {
this.$message.error(res.message || '提交退款失败!')
}
}
}
}