diff --git a/src/views/refund/gold/addCoinRefund.vue b/src/views/refund/gold/addCoinRefund.vue index cc49ff0..1ad5309 100644 --- a/src/views/refund/gold/addCoinRefund.vue +++ b/src/views/refund/gold/addCoinRefund.vue @@ -3,13 +3,13 @@ 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 {useAdminStore} from "@/store/index.js"; -import {storeToRefs} from "pinia"; -import {findMenuById, permissionMapping} from "@/utils/menuTreePermission.js" +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 { adminData, menuTree } = storeToRefs(adminStore); const addRe = ref({ typeR: '0' @@ -60,9 +60,37 @@ const cancel = function () { } addRe.value.typeR = '0' } - -const show = function () { - console.log('===================================', addRefund.value.refundType) +const getRefund = async function () { + let type = null + if(addRefund.value.refundType === '商品退款'){ + type = 1 + }else{ + type = 0 + } + const params = { + pageNum: pagination.value.pageNum, + pageSize: pagination.value.pageSize, + goldDetail: { + jwcode: addRefund.value.jwcode, + flag: 0, + type: type + } + } + try { + const res = await API({ + url: '/goldDetail/getGoldDetail', + data: { + ...params + } + }) + tableData.value = res.data.list + pagination.value.total = res.data.total + } catch (error) { + console.log('goldDetail有错误', error) + ElMessage.error('请求失败') + tableData.value = [] + pagination.value.total = 0 + } } // 这是添加退款信息的接口 const add = async function () { @@ -206,7 +234,6 @@ const user = ref({ }) const getUser = async function (jwcode) { trimJwCode(); - // cancelExceptJwcode(); // 验证精网号 if (!jwcode) { ElMessage.warning('精网号不能为空'); @@ -247,12 +274,13 @@ const getUser = async function (jwcode) { } user.value = processedData; console.log("用户信息", user.value); - //ElMessage.success(result.msg); + + tableData.value = [] + addRefund.value.refundType = '' } } catch (error) { console.log("请求失败", error); ElMessage.error("精网号错误"); - } } @@ -293,11 +321,6 @@ const getGoods = async function (jwcode) { type: addRefund.value.type } }) - tableData.value = result.data - if (result.data.length === 0) { - ElMessage.error('该用户没有商品订单') - return - } if (Array.isArray(result.data)) { // 存储完整商品数据 @@ -465,9 +488,11 @@ watch(calculatedRechargeGoods, (newVal) => { }) const handlePageSizeChange = function (val) { pagination.value.pageSize = val + getRefund() } const handleCurrentChange = function (val) { pagination.value.pageNum = val + getRefund() } @@ -483,15 +508,15 @@ const handleCurrentChange = function (val) { 查询 - + + @change="getRefund(addRefund.jwcode)"> + @change="handleOrderChange"> @@ -552,73 +577,69 @@ const handleCurrentChange = function (val) {
- - 客户信息 - - - - - -

{{ user.name }}

-
-
- - - {{ - user.nowSumGold - }} - - - - (永久金币:{{ - user.nowPermanentGold - }}; - 免费金币:{{ user.nowFreeGold }}; - 任务金币:{{ user.nowTaskGold }}) - - + + 客户信息 + + +
+ 姓名 + {{ user.name }} + 当前金币总数 + {{ + user.nowSumGold + }} +
- - - - - -

{{ user.jwcode }}

-
-
- - -

{{ user.consumeNum }}

-
- -

(仅统计2025-01-01后的数据)

-
-
+ + (永久金币:{{ + user.nowPermanentGold + }}; + 免费金币:{{ user.nowFreeGold }}; + 任务金币:{{ user.nowTaskGold }}) + + + +
+ 精网号 + {{ user.jwcode }} + + 消费次数 + {{ user.consumeNum }} +
+
+ + (仅统计2025-01-01后的数据) - - - - -

{{ user.market }}

-
-
+ + +
+ 所属门店 + {{ user.market }} +
-
+
- - + + + + - - + + - + @@ -668,12 +689,13 @@ p { } .left { - width: 35%; + width: 35vw; display: flex; + background-color: aliceblue; .add-form { width: 100%; - margin-top: 50px; + margin-top: 30px; } } @@ -681,14 +703,19 @@ p { width: 35vw; height: 20vh; display: flex; + justify-content: center; + align-items: center; + margin-left: 5vw; .customer-info { - width: 90%; - display: flex; - justify-content: center; - align-items: center; - padding: 0 10px; - margin-left: 5vw; + width: 35vw; + height: 19vh; + padding-left: 5%; + + .line { + display: flex; + height: 2vh; + } } }