11.8 退款申请新增

master
shilei 2 weeks ago
parent baed8ed29c
commit 26ee88577a

@ -153,4 +153,9 @@ export const OutChargeOrderApi = {
changeoutstatusOrder: async (data: OutChargeOrderVO) => { changeoutstatusOrder: async (data: OutChargeOrderVO) => {
return await request.post({ url: `/cloud/out-charge-order/changeStatus`, data }) return await request.post({ url: `/cloud/out-charge-order/changeStatus`, data })
}, },
// 退款
createRefundOrder: async (data: OutChargeOrderVO) => {
return await request.post({ url: `/cloud/refund-order/create`, data })
},
} }

@ -43,8 +43,8 @@
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> /> </el-form-item
</el-form-item><el-form-item label="" prop="nickName"> ><el-form-item label="司机" prop="nickName">
<el-input <el-input
v-model="queryParams.nickName" v-model="queryParams.nickName"
placeholder="请输入司机" placeholder="请输入司机"
@ -53,8 +53,7 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="车牌号" prop="vehicleNo"> <el-form-item label="车牌号" prop="vehicleNo">
<el-input <el-input
v-model="queryParams.vehicleNo" v-model="queryParams.vehicleNo"
placeholder="请输入车牌号" placeholder="请输入车牌号"
@ -94,11 +93,11 @@
{{ handle_stationNo(scope.row.stationNo) }} {{ handle_stationNo(scope.row.stationNo) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="充电订单号" align="center" prop="chargeOrder" width="120"/> <el-table-column label="充电订单号" align="center" prop="chargeOrder" width="120" />
<el-table-column label="充电机编号" align="center" prop="epm" width="120" /> <el-table-column label="充电机编号" align="center" prop="epm" width="120" />
<el-table-column label="枪号" align="center" prop="chargerGunNo" width="120" > <el-table-column label="枪号" align="center" prop="chargerGunNo" width="120">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.GUN_LIST" :value="scope.row.chargerGunNo" /> <dict-tag :type="DICT_TYPE.GUN_LIST" :value="scope.row.chargerGunNo" />
</template> </template>
@ -126,14 +125,14 @@
<!-- <el-table-column label="开始SOE" align="center" prop="startSoe" width="120" /> --> <!-- <el-table-column label="开始SOE" align="center" prop="startSoe" width="120" /> -->
<!-- <el-table-column label="结束SOE" align="center" prop="endSoe" width="120" /> --> <!-- <el-table-column label="结束SOE" align="center" prop="endSoe" width="120" /> -->
<el-table-column label="充电电量" align="center" prop="chargingCapacity" /> <el-table-column label="充电电量" align="center" prop="chargingCapacity" />
<el-table-column label="充电时长(min)" align="center" prop="chargingTime" width="120"/> <el-table-column label="充电时长(min)" align="center" prop="chargingTime" width="120" />
<!-- <el-table-column label="车架号" align="center" prop="vin" /> --> <!-- <el-table-column label="车架号" align="center" prop="vin" /> -->
<el-table-column label="订单状态" align="center" prop="orderStatus" width="120"> <el-table-column label="订单状态" align="center" prop="orderStatus" width="120">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.ORDERSTATUS" :value="scope.row.orderStatus" /> <dict-tag :type="DICT_TYPE.ORDERSTATUS" :value="scope.row.orderStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总费用" align="center" prop="totalFee" > <el-table-column label="总费用" align="center" prop="totalFee">
<template #default="scope"> <template #default="scope">
{{ scope.row.totalFee / 100 }} {{ scope.row.totalFee / 100 }}
</template> </template>
@ -177,9 +176,24 @@
</el-button> </el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button> <el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
<el-button link type="primary" @click="open_drawer(scope.row)"> </el-button> <el-button link type="primary" @click="open_drawer(scope.row)"> </el-button>
<el-button
link
type="danger"
@click="handle_refund(scope.row)"
v-if="scope.row.orderStatus == 5"
>
申请退款
</el-button>
<!-- <el-button link type="primary" @click="handle_Offline(scope.row) " > 线下结算 </el-button> --> <!-- <el-button link type="primary" @click="handle_Offline(scope.row) " > 线下结算 </el-button> -->
<el-button link type="primary" @click="handle_Offline(scope.row) " v-if="scope.row.orderStatus == 6"> 线 </el-button> <el-button
link
type="primary"
@click="handle_Offline(scope.row)"
v-if="scope.row.orderStatus == 6"
>
线下结算
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -198,7 +212,7 @@
<el-dialog v-model="dialogFormVisible" title="填写结算金额" width="500"> <el-dialog v-model="dialogFormVisible" title="填写结算金额" width="500">
<el-form :model="actualPay_form"> <el-form :model="actualPay_form">
<el-form-item label="金额(元)" label-width="100"> <el-form-item label="金额(元)" label-width="100">
<el-input v-model.number="actualPay_form.actualPay" autocomplete="off" /> <el-input v-model.number="actualPay_form.actualPay" autocomplete="off" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -286,8 +300,8 @@ const queryParams = reactive({
priceId: undefined, priceId: undefined,
dateId: undefined, dateId: undefined,
timeId: undefined, timeId: undefined,
vehicleNo:undefined, vehicleNo: undefined,
nickName:undefined, nickName: undefined
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -389,6 +403,23 @@ const handleDelete = async (id: number) => {
} catch {} } catch {}
} }
const handle_refund = async (row: any) => {
let params = {
orderNo: row.chargeOrder,
refundPrice: row.totalFee,
type: 2
}
// console.log(params, 'params')
try {
await message.confirm('确定退款吗?', '提示')
await OutChargeOrderApi.createRefundOrder(params)
message.success('创建退款成功')
//
await getList()
} catch {}
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
try { try {

@ -1,94 +1,94 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
v-loading="formLoading" v-loading="formLoading"
> >
<el-form-item label="退款状态" prop="status"> <el-form-item label="退款状态" prop="status">
<el-radio-group v-model="formData.status"> <el-radio-group v-model="formData.status">
<el-radio <el-radio
v-for="dict in getIntDictOptions(DICT_TYPE.REFUND_STATUS_two )" v-for="dict in getIntDictOptions(DICT_TYPE.REFUND_STATUS_two)"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
> >
{{ dict.label }} {{ dict.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="审核备注" prop="applyReason"> <el-form-item label="审核备注" prop="auditReason">
<el-input v-model="formData.applyReason" placeholder="请输入审核备注" type="textarea" /> <el-input v-model="formData.auditReason" placeholder="请输入审核备注" type="textarea" />
</el-form-item> </el-form-item>
</el-form>
</el-form> <template #footer>
<template #footer> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> </template>
</template> </Dialog>
</Dialog> </template>
</template> <script setup lang="ts">
<script setup lang="ts"> import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import { RefundOrderApi, RefundOrderVO } from '@/api/system/orderManagement/refundOrder'
import { RefundOrderApi, RefundOrderVO } from '@/api/system/orderManagement/refundOrder' /** 退款订单 表单 */
/** 退款订单 表单 */ defineOptions({ name: 'RefundOrderForm' })
defineOptions({ name: 'RefundOrderForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = reactive({
id: undefined,
applyReason: '',
status:undefined,
})
const formRules = reactive({
// stationNo: [{ required: true, message: '', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (id?: number) => {
formData.id = id
dialogVisible.value = true
const { t } = useI18n() //
const message = useMessage() //
} const dialogVisible = ref(false) //
defineExpose({ open }) // open const dialogTitle = ref('') //
const formLoading = ref(false) // 12
/** 提交表单 */ const formType = ref('') // create - update -
const emit = defineEmits(['success']) // success const formData = reactive({
const submitForm = async () => { id: undefined,
// auditReason: '',
await formRef.value.validate() status: undefined
// })
formLoading.value = true const formRules = reactive({
try { // stationNo: [{ required: true, message: '', trigger: 'blur' }],
const data = await RefundOrderApi.checkRefundOrder(formData) })
if(data){ const formRef = ref() // Ref
dialogVisible.value = false
message.success('成功') /** 打开弹窗 */
}else{ const open = async (id?: number) => {
message.error('失败') formData.id = id
} dialogVisible.value = true
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = await RefundOrderApi.checkRefundOrder(formData)
if (data) {
dialogVisible.value = false dialogVisible.value = false
// message.success('成功')
emit('success') } else {
} finally { message.error('失败')
formLoading.value = false
} }
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
} }
watch(()=>dialogVisible.value,(newValue)=>{
if(!newValue){
formData.applyReason=''
} }
},{ watch(
deep:true () => dialogVisible.value,
}) (newValue) => {
if (!newValue) {
</script> formData.auditReason = ''
}
},
{
deep: true
}
)
</script>

Loading…
Cancel
Save