|
@ -1,5 +1,5 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import { computed, reactive, ref, watch } from 'vue' |
|
|
|
|
|
|
|
|
import { computed, onMounted, reactive, ref, watch } from 'vue' |
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
import API from '@/util/http.js' |
|
|
import API from '@/util/http.js' |
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
import { useAdminStore } from "@/store/index.js"; |
|
@ -35,7 +35,8 @@ const addRefund = ref({ |
|
|
taskGold: '', |
|
|
taskGold: '', |
|
|
sumGold: 0, |
|
|
sumGold: 0, |
|
|
remark: '', |
|
|
remark: '', |
|
|
adminId: null, |
|
|
|
|
|
|
|
|
adminId: adminData.value.id, |
|
|
|
|
|
adminName: adminData.value.name, |
|
|
orderCode: '', |
|
|
orderCode: '', |
|
|
type: 0 |
|
|
type: 0 |
|
|
}) |
|
|
}) |
|
@ -209,23 +210,6 @@ const rules = reactive({ |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 取消按钮 |
|
|
|
|
|
const cancelExceptJwcode = function () { |
|
|
|
|
|
addRefund.value = { |
|
|
|
|
|
jwcode: addRefund.value.jwcode, // 保留精网号 |
|
|
|
|
|
goodsName: '', |
|
|
|
|
|
refundType: '', |
|
|
|
|
|
refundModel: 0, |
|
|
|
|
|
permanentGold: '', |
|
|
|
|
|
freeGold: '', |
|
|
|
|
|
taskGold: '', |
|
|
|
|
|
sumGold: 0, |
|
|
|
|
|
remark: '', |
|
|
|
|
|
adminId: adminData.value.id |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查找客户信息的方法 |
|
|
// 查找客户信息的方法 |
|
|
const user = ref({ |
|
|
const user = ref({ |
|
|
firstRechargeTime: '' |
|
|
firstRechargeTime: '' |
|
@ -287,7 +271,7 @@ const getUser = async function (jwcode) { |
|
|
const refundType = ref([ |
|
|
const refundType = ref([ |
|
|
{ value: '商品退款', label: '商品退款' }, |
|
|
{ value: '商品退款', label: '商品退款' }, |
|
|
{ value: '金币退款', label: '金币退款' } |
|
|
{ value: '金币退款', label: '金币退款' } |
|
|
]); |
|
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
// 存储所有商品信息和订单号下拉数据 |
|
|
// 存储所有商品信息和订单号下拉数据 |
|
|
const goodsName = ref([]) |
|
|
const goodsName = ref([]) |
|
@ -309,12 +293,14 @@ const handleOrderChange = (orderCode) => { |
|
|
freeGold: Number(order.freeGold) || 0, |
|
|
freeGold: Number(order.freeGold) || 0, |
|
|
taskGold: Number(order.taskGold) || 0 |
|
|
taskGold: Number(order.taskGold) || 0 |
|
|
} |
|
|
} |
|
|
|
|
|
console.log('看看金币退款参数', selectedGoodsGold.value) |
|
|
} else { |
|
|
} else { |
|
|
selectedGoodsGold.value = { |
|
|
selectedGoodsGold.value = { |
|
|
permanentGold: -Number(order.permanentGold) || 0, |
|
|
permanentGold: -Number(order.permanentGold) || 0, |
|
|
freeGold: -Number(order.freeGold) || 0, |
|
|
freeGold: -Number(order.freeGold) || 0, |
|
|
taskGold: -Number(order.taskGold) || 0 |
|
|
taskGold: -Number(order.taskGold) || 0 |
|
|
} |
|
|
} |
|
|
|
|
|
console.log('看看商品退款参数', selectedGoodsGold.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 全部退款的填充 |
|
|
// 全部退款的填充 |
|
@ -359,26 +345,6 @@ const handleRefundModelChange = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleSelectionChange = (selectedOption) => { |
|
|
|
|
|
if (selectedOption) { |
|
|
|
|
|
// 更新商品名称 |
|
|
|
|
|
addRefund.value.goodsName = selectedOption.value; |
|
|
|
|
|
|
|
|
|
|
|
// 更新金币字段 |
|
|
|
|
|
addRefund.value.permanentGold = selectedOption.permanentGold || 0; |
|
|
|
|
|
addRefund.value.freeGold = selectedOption.freeGold || 0; |
|
|
|
|
|
addRefund.value.taskGold = selectedOption.taskGold || 0; |
|
|
|
|
|
|
|
|
|
|
|
// 记录选中商品的金币花费 |
|
|
|
|
|
selectedGoodsGold.value.permanentGold = Number(selectedOption.permanentGold) || 0; |
|
|
|
|
|
selectedGoodsGold.value.freeGold = Number(selectedOption.freeGold) || 0; |
|
|
|
|
|
selectedGoodsGold.value.taskGold = Number(selectedOption.taskGold) || 0; |
|
|
|
|
|
} else { |
|
|
|
|
|
// 清空逻辑保持不变 |
|
|
|
|
|
} |
|
|
|
|
|
console.log('选择的商品', selectedOption); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 统一的输入处理函数 |
|
|
// 统一的输入处理函数 |
|
|
const handleGoldInput = (type, value) => { |
|
|
const handleGoldInput = (type, value) => { |
|
|
// 1. 过滤非法字符(只允许数字和小数点) |
|
|
// 1. 过滤非法字符(只允许数字和小数点) |
|
@ -454,6 +420,9 @@ const handleCurrentChange = function (val) { |
|
|
pagination.value.pageNum = val |
|
|
pagination.value.pageNum = val |
|
|
getRefund() |
|
|
getRefund() |
|
|
} |
|
|
} |
|
|
|
|
|
onMounted(() =>{ |
|
|
|
|
|
console.log(adminData.value) |
|
|
|
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
@ -615,9 +584,9 @@ const handleCurrentChange = function (val) { |
|
|
{{ row.taskGold }} |
|
|
{{ row.taskGold }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="isRefund" label="订单状态" width="120"> |
|
|
|
|
|
|
|
|
<el-table-column prop="isRefund" label="允许退款" width="120"> |
|
|
<template #default="{ row }"> |
|
|
<template #default="{ row }"> |
|
|
{{ row.isRefund === 1 ? '已退款' : '未处理' }} |
|
|
|
|
|
|
|
|
{{ row.isRefund === 1 ? '否' : '是' }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|