diff --git a/dist.rar b/dist.rar index 5288ede..bec6356 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/api/super/gameManagement.js b/src/api/super/gameManagement.js index 3f1df3a..5ab5038 100644 --- a/src/api/super/gameManagement.js +++ b/src/api/super/gameManagement.js @@ -7,4 +7,13 @@ export function superGameList(query) { method: 'get', params: query }) -} \ No newline at end of file +} + +// 拉取数据 +export function superFetchDataExcute(data) { + return request({ + url: '/super/fetchData/excute', + method: 'post', + data: data + }) + } \ No newline at end of file diff --git a/src/api/super/platform.js b/src/api/super/platform.js index 7f3b8f3..a079195 100644 --- a/src/api/super/platform.js +++ b/src/api/super/platform.js @@ -32,6 +32,14 @@ export function superGameList(query) { params: query }) } + // 第三方余额 +export function superQueryBalance(query) { + return request({ + url: '/super/member/queryBalance', + method: 'get', + params: query + }) +} // 更新游戏 export function createGameuUpdate(data) { return request({ @@ -64,6 +72,7 @@ export function createGameuUpdateStatus(data) { method: 'get' }) } + // 平台状态 export function createPlatformSwitch(data) { return request({ diff --git a/src/views/betting/gameRecords/index.vue b/src/views/betting/gameRecords/index.vue index 76dab0d..460adfc 100644 --- a/src/views/betting/gameRecords/index.vue +++ b/src/views/betting/gameRecords/index.vue @@ -40,7 +40,7 @@ /> - + + @@ -10,7 +10,7 @@ @@ -31,7 +31,7 @@ const props = defineProps({ }); const operateTimeType = defineModel('operateTimeType'), dateRange = defineModel('dateRange'); -const formatType = 'YYYY-MM-DD'; // 时间格式 +const formatType = 'YYYY-MM-DD HH:mm:ss'; // 时间格式 const emits = defineEmits(['dateChange']); const isFirst = ref(true); // 是否第一次加载 @@ -54,8 +54,8 @@ const timeTypeChange = (val) => { break case 'week': dateRange.value = [ - dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD'), - dayjs().endOf('day').format('YYYY-MM-DD') + dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') ] break case 'month': @@ -151,8 +151,8 @@ const dateRangeChange = (dataValue) => { start.setHours(0, 0, 0); // 设置开始时间为当天的00:00:00点 end.setHours(23, 59, 59); // 设置结束时间为当天的23:59:59 - dateRange.value[0] = dayjs(start).format('YYYY-MM-DD'); - dateRange.value[1] = dayjs(end).format('YYYY-MM-DD'); + dateRange.value[0] = dayjs(start).format('YYYY-MM-DD HH:mm:ss'); + dateRange.value[1] = dayjs(end).format('YYYY-MM-DD HH:mm:ss'); } // 初始化时不触发父组件的查询 @@ -163,7 +163,7 @@ const dateRangeChange = (dataValue) => { // 生成日期区间 const getTimeFn = (startTime) => { - return [startTime.format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')]; + return [startTime.format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')]; } // 父组件重置 diff --git a/src/views/components/OperationCard.vue b/src/views/components/OperationCard.vue index 2798722..aa9c182 100644 --- a/src/views/components/OperationCard.vue +++ b/src/views/components/OperationCard.vue @@ -154,9 +154,9 @@ --> -
+
@@ -180,10 +180,10 @@ import { el } from 'element-plus/es/locales.mjs'; const props = defineProps({ currencyType: { type: Array, - default: () => [] + default: () => ['VND'] } }) - const operateTimeType = ref('week'); // 操作时间类型 + const operateTimeType = ref('day'); // 操作时间类型 const dataList = ref([]); const getList = () => { let obj = { @@ -237,6 +237,7 @@ import { el } from 'element-plus/es/locales.mjs'; let obj = { operationType:tabPosition.value, timeZone:timeZones, + currencyCode:props.currencyType.join(","), startTime:finalTimestamp(dateRange.value[0]), endTime:finalTimestamp(dateRange.value[1]), } diff --git a/src/views/finance/prepaymentRecord/index.vue b/src/views/finance/prepaymentRecord/index.vue index 0d694c2..e8fbeaa 100644 --- a/src/views/finance/prepaymentRecord/index.vue +++ b/src/views/finance/prepaymentRecord/index.vue @@ -239,7 +239,7 @@ import { nextTick } from "vue"; const openCron = ref(false); const expression = ref(""); const tenantAgentPlatforms = ref([]); - const dateRange = ref([]),operateTimeType = ref(""); + const dateRange = ref([]),operateTimeType = ref("day"); const loadingButton = ref(false); const formAll = reactive({ currencyAgreement:'0', diff --git a/src/views/index.vue b/src/views/index.vue index 22586aa..0948abc 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -2,9 +2,9 @@
- - @@ -23,10 +23,10 @@ -
- + -
@@ -58,7 +58,7 @@ import CheckboxSelect from '@/components/CheckboxSelect'; import auth from '@/plugins/auth' import {getHomeIndex,getHomerealTimeFocusTenant} from "@/api/home"; import { nextTick } from "vue"; -const currencyCodes = ref([]); +const currencyCodes = ref(['VND']); const platformCodes = ref([]); const tenantKeys = ref([]); const cardData = ref({}); diff --git a/src/views/login.vue b/src/views/login.vue index a3628a7..48cf7db 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -311,6 +311,7 @@ const gooleCode = ref('');// google验证码 const goodDialogShow = ref(false); const handleClose = () => { goodDialogVisible.value = false; + loading.value = false; }; const clickVisible = () => { loading.value = false; diff --git a/src/views/member/member/index.vue b/src/views/member/member/index.vue index d5143c1..f9c3d1f 100644 --- a/src/views/member/member/index.vue +++ b/src/views/member/member/index.vue @@ -30,7 +30,7 @@ /> - + - + - + - + + + + - + {{formAdjustment.tenantKey}} + {{formAdjustment.currencyCode}} + -
-
- {{ t('余额') }} -
-
{{getcurrencySign(formAdjustment.currencyCode)}} {{ formAdjustment.balance||'00' }}
-
- - -
- - + + +
+ +
-
- {{ t('如需扣余额,则输入负数,例如:-10.50') }} + + +
+ + +
+ + + + + + +
+ {{ t('如需扣余额,则输入负数,例如:-10.50') }} +
@@ -138,6 +150,11 @@ const props = defineProps({ // 父组件向子组件传值 } }) +let resData = getLocalStorage('currencySelect'); + const currencyCodesOptions = ref([]); + currencyCodesOptions.value = resData.map(item => { + return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode } + }) const currencySelectAll = getLocalStorage('currencySelect').map(item => { return {...item, label: item.currencyCode, value: item.currencyCode } }); @@ -179,7 +196,6 @@ const formCreditType = ref({ }) const getcurrencySign = (val) => { let currencySignItem = currencySelectAll.find(item => item.value == val); - console.log(currencySignItem) return currencySignItem.currencySign } const rulesCreditType = ref({ @@ -196,7 +212,68 @@ const rules = ref({ realBalanceNum: [{ required: true, message: proxy.t('信誉额度不能为空'), trigger: "change" }], }) const rulesAdjustment = ref({ - balance: [{ required: true, message: proxy.t('调额额度不能为空'), trigger: "change" }], + balanceReal: [ + { + validator: (rule, value, callback) => { + // 1. 如果禁用,不校验 + if (props.modifyDate.tenantType == 2) { + return callback(); + } + + // 2. 必填 + if (value === '' || value === null || value === undefined) { + return callback(new Error("请输入可用额度")); + } + + const num = Number(value); + const realBalance = Number(formAdjustment.value.realBalance); + + // 3. 如果是负数,绝对值不能超过 realBalance + if (num < 0) { + if (Math.abs(num) > realBalance) { + return callback( + new Error(`要减的额度绝对值不能超过可用余额 ${realBalance}`) + ); + } + } + + // 4. 通过 + return callback(); + }, + trigger: "change" + } +], +balanceCredit: [ + { + validator: (rule, value, callback) => { + // 1. 如果禁用,不校验 + if (props.modifyDate.tenantType == 1) { + return callback(); + } + + // 2. 必填 + if (value === '' || value === null || value === undefined) { + return callback(new Error("请输入额度")); + } + + const num = Number(value); + const creditBalance = Number(formAdjustment.value.creditBalance); + + // 3. 如果是负数,绝对值不能超过 creditBalance + if (num < 0) { + if (Math.abs(num) > creditBalance) { + return callback( + new Error(`要减的额度绝对值不能超过信誉余额 ${creditBalance}`) + ); + } + } + + // 4. 通过 + return callback(); + }, + trigger: "change" + } +], googleCode: [{ required: true, message: proxy.t('谷歌验证码不能为空'), trigger: "change" }], }) const platAdjustment = ref({ @@ -216,6 +293,43 @@ const handleAdjustment = (row) => { }) } + +// +const sumPlatformBalance = (jsonStr) => { + + try { + // 转成对象 + const obj = JSON.parse(jsonStr); + + // 累加所有 value + return Object.values(obj).reduce((sum, val) => sum + Number(val), 0).toFixed(4); + } catch (e) { + // console.error("JSON 解析失败:", e); + return 0; + } +} +// +const parsePlatformBalance = (jsonStr) => { + + try { + const obj = JSON.parse(jsonStr); + + // 遍历生成数组 + const result = Object.entries(obj).map(([key, value]) => { + // 取前缀("_" 前面的部分,比如 "AG_VND_FALSE" → "AG") + const name = key.split("_")[0]; + return { + name, + balance: Number(value) + }; + }); + + return result; + } catch (e) { + // console.error("JSON 解析失败:", e); + return []; + } +} //修改时数据更新区域 nextTick(() => { handleAdjustment(props.modifyDate); @@ -270,37 +384,44 @@ superCommonCurrencySelects(); superCommonQuotaTypeSelects(); const openCreditType = ref(false); const handleAddType = (value) => { - openCreditType.value = true; + if (!platAdjustment.value.currencyCode){ + ElMessage.warning('请选择币种!'); + return + } + // openCreditType.value = true; + visible.value = true; + formAdjustment.value.id = ''; + formAdjustment.value.platformBalanceJson = '{}'; + formAdjustment.value.realBalance = 0; + formAdjustment.value.creditBalance = 0; + formAdjustment.value.tenantKey = props.modifyDate.tenantKey; + formAdjustment.value.currencyCode = platAdjustment.value.currencyCode; } const visible = ref(false); const handleAdd = (value,row) => { + let rowOpen = JSON.parse(JSON.stringify(row)); visible.value = true; - formAdjustment.value.id = row.id; - formAdjustment.value.googleCode = ''; - formAdjustment.value.balance = row.balance - formAdjustment.value.currencyCode = row.currencyCode; - formAdjustment.value.tenantKey = row.tenantKey; - - -} -//减金额 -const handleReduce = (value,row) => { - visible.value = true; - formAdjustment.value.id = row.id; - formAdjustment.value.isOut = false; - formAdjustment.value.googleCode = ''; - formAdjustment.value.balance = '' + formAdjustment.value.id = rowOpen.id; + formAdjustment.value = rowOpen; } const onSubmit = () => { proxy.$refs["formAdjustmentRef"].validate(valid => { if (valid) { let numBalance = 0; - if(Number(formAdjustment.value.balance) <= 0){ + if(Number(formAdjustment.value.balanceReal) <= 0 || Number(formAdjustment.value.balanceCredit) <= 0){ formAdjustment.value.isOut = false; - numBalance = Math.abs(formAdjustment.value.balance) - }else{ + if (formAdjustment.value.balanceReal !=0){ + numBalance = Math.abs(formAdjustment.value.balanceReal); + }else if (formAdjustment.value.balanceCredit !=0){ + numBalance = Math.abs(formAdjustment.value.balanceCredit); + } + }else{ formAdjustment.value.isOut = true; - numBalance = formAdjustment.value.balance + if (formAdjustment.value.balanceReal !=0){ + numBalance = formAdjustment.value.balanceReal + }else if (formAdjustment.value.balanceCredit ==0){ + numBalance = formAdjustment.value.balanceCredit; + } } let obj = { id: formAdjustment.value.id, @@ -359,6 +480,8 @@ function submitForm() { openCreditType.value = false; formCreditTypes.value?.resetFields() handleAdjustment(props.modifyDate); + }).catch(() => { + loadingButton.value = false; }); } diff --git a/src/views/merchant/quota/index.vue b/src/views/merchant/quota/index.vue index 4a642c2..4bc2c1f 100644 --- a/src/views/merchant/quota/index.vue +++ b/src/views/merchant/quota/index.vue @@ -2,6 +2,7 @@
- + - + @@ -220,14 +221,15 @@ import { getLocalStorage } from "@/utils/auth"; import CopyIcon from '@/components/CopyIcon' import CustomSelect from '@/components/CustomSelect' + import TableSearchDate from '@/components/TableSearchDate' import IconTips from '@/components/IconTips' import { parseTime } from '@/utils/ruoyi'; // 时间格式化 -import { nextTick } from "vue"; +import { nextTick, onMounted } from "vue"; import { get } from "@vueuse/core"; const router = useRouter(); const { proxy } = getCurrentInstance(); const { ff_tenant_type, ff_tenant_status } = proxy.useDict("ff_tenant_type", "ff_tenant_status"); - + const dateRange = ref([]),operateTimeType = ref("day"); const agentList = ref([]); const open = ref(false); @@ -248,17 +250,22 @@ import { get } from "@vueuse/core"; { label: proxy.t('商户账号'), value: "account" }, { label: proxy.t('商户状态'), value: "status" }, ]); + const today = new Date(); +const yyyy = today.getFullYear(); +const mm = String(today.getMonth() + 1).padStart(2, '0'); +const dd = String(today.getDate()).padStart(2, '0'); const data = reactive({ form: {}, queryParams: { pageNum: 1, pageSize: 10, orderByColumn:'createTime', + currencyCode: 'VND', isAsc:'desc', - params:{ - beginTime:'', - endTime:'', - }, + // params:{ + // beginTime: `${yyyy}-${mm}-${dd} 00:00:00`, + // endTime: `${yyyy}-${mm}-${dd} 23:59:59` + // }, tenantKey: "", memberAccount:'' }, @@ -279,7 +286,7 @@ import { get } from "@vueuse/core"; /** 查询列表 */ function getList() { loading.value = true; - superTenantQuotaflow(queryParams.value).then(response => { + superTenantQuotaflow(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { agentList.value = response.rows; total.value = response.total; loading.value = false; @@ -427,10 +434,13 @@ const getsuperCommonPlatformTypeSelect = async () => { } }); } - - getList(); - getsuperCommonCurrencySelect(); - getsuperCommonPlatformTypeSelect(); + //初始化 + onMounted(() => { + getList(); + getsuperCommonCurrencySelect(); + getsuperCommonPlatformTypeSelect(); + }) + + \ No newline at end of file