master
xy 1 year ago
parent 326b755ccc
commit 8de4c4636b

@ -35,3 +35,12 @@ export function destroy(params, isLoading = true) {
isLoading
})
}
export function orderRefund(data, isLoading = true) {
return request({
method: 'post',
url: '/api/admin/order-refund/save',
data,
isLoading
})
}

@ -128,7 +128,7 @@
</template>
</vxe-column>
<vxe-column field="operate" header-align="center" title="操作" min-width="220">
<vxe-column field="operate" header-align="center" title="操作" min-width="280">
<template #default="{ row }">
<template v-if="isActiveStatus(row)">
<el-button
@ -150,13 +150,6 @@
type="primary"
@click="isShowAssign = true,$refs['Assign'].row = row"
>分配</el-button>
<el-button
v-if="isHasAuth('detail')"
size="small"
type="primary"
plain
@click="detail(row)"
>查看</el-button>
<el-button
v-if="isHasAuth('edit')"
size="small"
@ -253,8 +246,7 @@ export default {
status: new Map([
[0, '待支付'],
[1, '已支付'],
[2, '服务中'],
[3, '已完成']
[2, '已退款']
])
}
},

@ -123,6 +123,13 @@
>取消</el-button>
</template>
<template v-else>
<el-button
v-if="isHasAuth('refund')"
size="small"
type="danger"
plain
@click="$refs['refund'].setForm('id', row.id),isShowRefund = true"
>退单</el-button>
<el-button
v-if="isHasAuth('detail')"
size="small"
@ -182,7 +189,7 @@
:is-show.sync="isShowDetail"
/>
<refund ref="refund" :visible.sync="isShowRefund" />
</div>
</template>
@ -195,13 +202,14 @@ import { deepCopy } from '@/utils'
import { destroy, index, save } from '@/api/accompany-order-refund/accompany-order-refund'
import AddAccompanyOrderRefund from './components/AddAccompanyOrderRefund.vue'
import ShowAccompanyOrderRefund from './components/ShowAccompanyOrderRefund.vue'
import refund from './components/Refund.vue'
import axios from 'axios'
import { getToken } from '@/utils/auth'
export default {
name: 'AccompanyOrderRefund',
components: {
refund,
AddAccompanyOrderRefund,
ShowAccompanyOrderRefund
},
@ -212,6 +220,7 @@ export default {
examineKey: 0,
isShowAdd: false,
isShowDetail: false,
isShowRefund: false,
loading: false,
tableHeight: 400,

@ -0,0 +1,90 @@
<template>
<div>
<vxe-modal
:value="visible"
show-footer
:z-index="zIndex"
title="退款"
show-confirm-button
transfer
resize
:width="440"
:height="200"
@input="e => $emit('update:visible',e)"
@confirm="submit"
>
<el-form :model="form" :rules="rules">
<el-form-item prop="status" label="退款状态">
<el-select v-model="form.status">
<el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
</vxe-modal>
</div>
</template>
<script>
import { PopupManager } from 'element-ui/lib/utils/popup'
import { orderRefund } from '@/api/accompany-order/accompany-order'
export default {
props: {
visible: {
type: Boolean,
default: false,
required: true
}
},
data() {
return {
zIndex: PopupManager.nextZIndex(),
form: {
id: '',
status: 0
},
rules: {
status: [
{ required: true, message: '请选择退款状态' }
]
},
status: [
{
value: 0,
label: '未退款'
},
{
value: 1,
label: '退款成功'
},
{
value: 2,
label: '退款失败'
}
]
}
},
computed: {},
watch: {
async visible(newVal) {
if (newVal) {
this.zIndex = PopupManager.nextZIndex()
}
}
},
methods: {
setForm(key, val) {
this.form[key] = val
},
submit() {
this.$confirm('确认操作?').then(_ => {
orderRefund(this.form).then(_ => {
this.$message.success('添加记录成功')
})
})
}
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save