|
|
@ -3,26 +3,24 @@ import { computed, onMounted, reactive, ref, watch } from 'vue' |
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
|
import API from '@/util/http.js' |
|
|
|
import moment from 'moment' |
|
|
|
// import _ from 'lodash' |
|
|
|
import {useAdminStore} from "@/store/index.js"; |
|
|
|
import {storeToRefs} from "pinia"; |
|
|
|
import {findMenuById, permissionMapping} from "@/utils/menuTreePermission.js" |
|
|
|
import { ta } from 'element-plus/es/locales.mjs'; |
|
|
|
|
|
|
|
const adminStore = useAdminStore(); |
|
|
|
const {adminData, menuTree} = storeToRefs(adminStore); |
|
|
|
|
|
|
|
const addRe = ref({ |
|
|
|
typeR: '0' |
|
|
|
}) |
|
|
|
const tableData = ref([]) |
|
|
|
const pagination = ref({ |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
total: 0 |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//这是获取用户信息的接口 |
|
|
|
const adminData = ref({}) |
|
|
|
const getAdminData = async function () { |
|
|
|
try { |
|
|
|
const result = await API({ url: '/admin/userinfo', data: {} }) |
|
|
|
adminData.value = result |
|
|
|
addRefund.value.adminId = adminData.value.id |
|
|
|
console.log('请求成功', result) |
|
|
|
console.log('用户信息', user.value) |
|
|
|
} catch (error) { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
// 精网号去空格 |
|
|
|
const trimJwCode = () => { |
|
|
|
if (addRefund.value.jwcode) { |
|
|
@ -63,8 +61,8 @@ const cancel = function () { |
|
|
|
addRe.value.typeR = '0' |
|
|
|
} |
|
|
|
|
|
|
|
const show = function(){ |
|
|
|
console.log('===================================',addRefund.value.refundType) |
|
|
|
const show = function () { |
|
|
|
console.log('===================================', addRefund.value.refundType) |
|
|
|
} |
|
|
|
// 这是添加退款信息的接口 |
|
|
|
const add = async function () { |
|
|
@ -281,7 +279,7 @@ const getGoods = async function (jwcode) { |
|
|
|
orderCodes.value = [] |
|
|
|
return; |
|
|
|
} |
|
|
|
console.log('=======================',addRefund.value.refundType) |
|
|
|
console.log('=======================', addRefund.value.refundType) |
|
|
|
if (addRefund.value.refundType === '商品退款') { |
|
|
|
addRefund.value.type = 1 |
|
|
|
} else { |
|
|
@ -290,10 +288,16 @@ const getGoods = async function (jwcode) { |
|
|
|
try { |
|
|
|
const result = await API({ |
|
|
|
url: '/refund/selectGoods', |
|
|
|
data: { jwcode: addRefund.value.jwcode, |
|
|
|
data: { |
|
|
|
jwcode: addRefund.value.jwcode, |
|
|
|
type: addRefund.value.type |
|
|
|
} |
|
|
|
}) |
|
|
|
tableData.value = result.data |
|
|
|
if (result.data.length === 0) { |
|
|
|
ElMessage.error('该用户没有商品订单') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (Array.isArray(result.data)) { |
|
|
|
// 存储完整商品数据 |
|
|
@ -459,14 +463,13 @@ watch(calculatedRechargeGoods, (newVal) => { |
|
|
|
addRefund.value.sumGold = newVal |
|
|
|
console.log('计算的总金币', newVal) |
|
|
|
}) |
|
|
|
const handlePageSizeChange = function (val) { |
|
|
|
pagination.value.pageSize = val |
|
|
|
} |
|
|
|
const handleCurrentChange = function (val) { |
|
|
|
pagination.value.pageNum = val |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 挂载 |
|
|
|
onMounted(async function () { |
|
|
|
await getAdminData() |
|
|
|
// await getRefundTypes() |
|
|
|
// await getGoods() |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
@ -481,7 +484,8 @@ onMounted(async function () { |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="refundType" label="退款类型" @change="show"> |
|
|
|
<el-select v-model="addRefund.refundType" placeholder="请选择" style="width: 220px" @change="getGoods(addRefund.jwcode)"> |
|
|
|
<el-select v-model="addRefund.refundType" placeholder="请选择" style="width: 220px" |
|
|
|
@change="getGoods(addRefund.jwcode)"> |
|
|
|
<el-option v-for="item in refundType" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -552,7 +556,7 @@ onMounted(async function () { |
|
|
|
<el-text size="large" style="padding:30%; ">客户信息</el-text> |
|
|
|
|
|
|
|
<!-- 第一行:姓名 + 历史金币 --> |
|
|
|
<el-row style="margin-top: 20px"> |
|
|
|
<el-row style="margin-top: 10px;height:5vh;"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="姓名"> |
|
|
|
<p>{{ user.name }}</p> |
|
|
@ -576,7 +580,7 @@ onMounted(async function () { |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第二行:精网号 + 当前金币(独立行) --> |
|
|
|
<el-row> |
|
|
|
<el-row style="margin-top: 1px;height:5vh;"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="精网号"> |
|
|
|
<p>{{ user.jwcode }}</p> |
|
|
@ -593,7 +597,7 @@ onMounted(async function () { |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第四行:消费次数 + 所属门店 --> |
|
|
|
<el-row> |
|
|
|
<el-row style="margin-top: 1px;height:3vh;"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="所属门店"> |
|
|
|
<p>{{ user.market }}</p> |
|
|
@ -605,7 +609,38 @@ onMounted(async function () { |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="right-down"> |
|
|
|
|
|
|
|
<el-card class="card" v-if="tableData.length > 0"> |
|
|
|
<el-table :data="tableData" style="height:43vh;width:50vw"> |
|
|
|
<el-table-column type="index" label="序号" width="60" /> |
|
|
|
<el-table-column prop="type" label="类型" width="120" > |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ row.orderCode.slice(3, 5) === 'CZ' ? '充值' : '消费' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="goodsName" label="商品名称" width="120" /> |
|
|
|
<el-table-column prop="orderCode" label="订单号" width="240px" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="permanentGold" label="永久金币" width="120"> |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ row.permanentGold / 100 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="freeGold" label="免费金币" width="120"> |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ (row.freeGold) / 100 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="taskGold" label="任务金币" width="120"> |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ row.taskGold / 100 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="isRefund" label="订单状态" width="120" /> |
|
|
|
</el-table> |
|
|
|
<el-pagination class="pagination" v-model:current-page="pagination.pageNum" |
|
|
|
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" |
|
|
|
:total="pagination.total" @size-change="handlePageSizeChange" |
|
|
|
@current-change="handleCurrentChange"></el-pagination> |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -616,20 +651,19 @@ p { |
|
|
|
margin: 0px; |
|
|
|
} |
|
|
|
|
|
|
|
.father{ |
|
|
|
.father { |
|
|
|
width: 75vw; |
|
|
|
height: 70vh; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
|
|
|
|
.userAndForm { |
|
|
|
width:25vw; |
|
|
|
width: 25vw; |
|
|
|
height: 100%; |
|
|
|
display: flex; |
|
|
|
background-color: azure; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.left { |
|
|
|
.left { |
|
|
|
width: 35%; |
|
|
|
display: flex; |
|
|
|
|
|
|
@ -637,26 +671,32 @@ p { |
|
|
|
width: 100%; |
|
|
|
margin-top: 50px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.right-up { |
|
|
|
.right-up { |
|
|
|
width: 35vw; |
|
|
|
height:30vh; |
|
|
|
margin-left: 20px; |
|
|
|
height: 20vh; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
.customer-info { |
|
|
|
width: 90%; |
|
|
|
display: flex; |
|
|
|
margin-left: 20px; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
padding: 0 10px; |
|
|
|
margin-left: 5vw; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.right-down{ |
|
|
|
flex:1; |
|
|
|
background-color: antiquewhite; |
|
|
|
} |
|
|
|
.card { |
|
|
|
width: 50vw; |
|
|
|
height: 50vh; |
|
|
|
margin-left: 5vw; |
|
|
|
margin-top: 1vh; |
|
|
|
} |
|
|
|
|
|
|
|
.pagination { |
|
|
|
display: flex; |
|
|
|
margin-top: 0.5vh; |
|
|
|
} |
|
|
|
</style> |