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="请输入司机"
@ -54,7 +54,6 @@
/> />
</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="请输入车牌号"
@ -95,10 +94,10 @@
</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>
@ -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 {

@ -10,7 +10,7 @@
<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"
> >
@ -18,62 +18,59 @@
</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 { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = reactive({ const formData = reactive({
id: undefined, id: undefined,
applyReason: '', auditReason: '',
status:undefined, status: undefined
}) })
const formRules = reactive({ const formRules = reactive({
// stationNo: [{ required: true, message: '', trigger: 'blur' }], // stationNo: [{ required: true, message: '', trigger: 'blur' }],
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id?: number) => { const open = async (id?: number) => {
formData.id = id formData.id = id
dialogVisible.value = true dialogVisible.value = true
}
defineExpose({ open }) // open
/** 提交表单 */
} const emit = defineEmits(['success']) // success
defineExpose({ open }) // open const submitForm = async () => {
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
// //
formLoading.value = true formLoading.value = true
try { try {
const data = await RefundOrderApi.checkRefundOrder(formData) const data = await RefundOrderApi.checkRefundOrder(formData)
if(data){ if (data) {
dialogVisible.value = false dialogVisible.value = false
message.success('成功') message.success('成功')
}else{ } else {
message.error('失败') message.error('失败')
} }
dialogVisible.value = false dialogVisible.value = false
@ -82,13 +79,16 @@
} finally { } finally {
formLoading.value = false 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