From 81d372d6edcd34b9bdc2fb0fc7ae620b9cf44b71 Mon Sep 17 00:00:00 2001
From: donghaolin <17667510818@163.com>
Date: Tue, 7 Jan 2025 11:57:51 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=99=E6=98=AF=E8=91=A3=E6=B5=A9=E9=9C=96?=
=?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/gold-system/src/views/recharge/addRecharge.vue | 458 ++++++++++++++++-----
vue/gold-system/src/views/usergold/index.vue | 128 +++---
2 files changed, 432 insertions(+), 154 deletions(-)
diff --git a/vue/gold-system/src/views/recharge/addRecharge.vue b/vue/gold-system/src/views/recharge/addRecharge.vue
index 8b18081..74ca9cf 100644
--- a/vue/gold-system/src/views/recharge/addRecharge.vue
+++ b/vue/gold-system/src/views/recharge/addRecharge.vue
@@ -7,8 +7,8 @@ import { ElMessageBox } from "element-plus";
import API from "../../api/index.js";
import moment from "moment";
import { range, re } from "mathjs";
-import * as xlsx from 'xlsx';
-import _ from 'lodash';
+import * as xlsx from "xlsx";
+import _ from "lodash";
// 这是添加上传图片的接口
const imageUrl = ref("");
@@ -398,7 +398,7 @@ const addLine = function () {
showInput: true,
});
};
-const loading = ref(false);
+const loading = ref(true);
// 添加多行
// const addLines = async function () {
// try {
@@ -415,23 +415,16 @@ const loading = ref(false);
// }
// }
const addLines = async function () {
+ loading.value = true;
try {
- loading.value = true; // 操作开始前,将loading设为true,显示加载动画
+ // 操作开始前,将loading设为true,显示加载动画
await nextTick(); // 等待视图更新,确保加载动画能及时显示出来
-
- const addLinesPromises = [];
for (let j = 0; j < addLineObj.value; j++) {
- addLinesPromises.push(
- new Promise((resolve) => {
- batchData.value.unshift({
- line: ++i.value,
- showInput: true,
- });
- resolve();
- })
- );
+ batchData.value.unshift({
+ line: ++i.value,
+ showInput: true,
+ });
}
- await Promise.all(addLinesPromises);
// 所有数据添加操作完成后,准备关闭加载动画
await nextTick(); // 再次等待视图更新,确保数据添加操作引起的视图变化已完成
@@ -646,7 +639,7 @@ const handleBatchAvatarSuccess = (response, uploadFile) => {
//批量充值确认按钮
const batchAdd = async function () {
console.log("batchData===", batchData.value);
- let msg = '';
+ let msg = "";
if (batchData.value.length == 0) {
ElMessage({
type: "error",
@@ -658,34 +651,34 @@ const batchAdd = async function () {
batchData.value[i].adminId = adminData.value.adminId;
batchData.value[i].area = adminData.value.area;
batchData.value[i].rechargeWay = "客服充值";
- if (
- batchData.value[i].jwcode == "" ||
- batchData.value[i].jwcode == null) {
+ if (batchData.value[i].jwcode == "" || batchData.value[i].jwcode == null) {
msg += `精网号不能为空! 个
`;
}
if (
batchData.value[i].activityId == "" ||
- batchData.value[i].activityId == null) {
+ batchData.value[i].activityId == null
+ ) {
msg += `活动不能为空!
`;
}
if (
batchData.value[i].paidGold == "" ||
- batchData.value[i].paidGold == null) {
+ batchData.value[i].paidGold == null
+ ) {
msg += `充值金币不能为空!
`;
}
if (
batchData.value[i].rechargeGold == "" ||
- batchData.value[i].rechargeGold == null) {
+ batchData.value[i].rechargeGold == null
+ ) {
msg += `充值金额不能为空!
`;
}
- if (
- batchData.value[i].payWay == "" ||
- batchData.value[i].payWay == null) {
+ if (batchData.value[i].payWay == "" || batchData.value[i].payWay == null) {
msg += `收款方式不能为空!
`;
}
if (
batchData.value[i].rechargeTime == "" ||
- batchData.value[i].rechargeTime == null) {
+ batchData.value[i].rechargeTime == null
+ ) {
msg += `交款时间不能为空!
`;
}
ElMessage({
@@ -831,14 +824,36 @@ onMounted(async function () {
-
+