1.新增获取充值/提现配置接口/api/finance/depositWithdrawConfig
2.优化充值和提现方式
This commit is contained in:
@@ -30,6 +30,17 @@ const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const optButtons: OptButton[] = defaultOptButtons(['edit', 'delete'])
|
||||
|
||||
function formatAmount2(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') {
|
||||
return '-'
|
||||
}
|
||||
const n = Number(cellValue)
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
new baTableApi('/admin/agent.CommissionRecord/'),
|
||||
{
|
||||
@@ -74,9 +85,30 @@ const baTable = new baTableClass(
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
render: 'tags',
|
||||
},
|
||||
{ label: t('agent.commissionRecord.commission_rate'), prop: 'commission_rate', align: 'center', minWidth: 110, operator: 'RANGE' },
|
||||
{ label: t('agent.commissionRecord.calc_base_amount'), prop: 'calc_base_amount', align: 'center', minWidth: 120, operator: 'RANGE' },
|
||||
{ label: t('agent.commissionRecord.commission_amount'), prop: 'commission_amount', align: 'center', minWidth: 120, operator: 'RANGE' },
|
||||
{
|
||||
label: t('agent.commissionRecord.commission_rate'),
|
||||
prop: 'commission_rate',
|
||||
align: 'center',
|
||||
minWidth: 110,
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.commissionRecord.calc_base_amount'),
|
||||
prop: 'calc_base_amount',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.commissionRecord.commission_amount'),
|
||||
prop: 'commission_amount',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.commissionRecord.status'),
|
||||
prop: 'status',
|
||||
@@ -138,7 +170,7 @@ const baTable = new baTableClass(
|
||||
],
|
||||
},
|
||||
{
|
||||
defaultItems: { status: 0, commission_rate: '0.0000' },
|
||||
defaultItems: { status: 0, commission_rate: '0.00' },
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
placeholder: t('Click select'),
|
||||
}"
|
||||
/>
|
||||
<FormItem :label="t('agent.commissionRecord.commission_rate')" type="number" v-model="baTable.form.items!.commission_rate" prop="commission_rate" :input-attr="{ min: 0, precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.calc_base_amount')" type="number" v-model="baTable.form.items!.calc_base_amount" prop="calc_base_amount" :input-attr="{ min: 0, precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.commission_amount')" type="number" v-model="baTable.form.items!.commission_amount" prop="commission_amount" :input-attr="{ precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.commission_rate')" type="number" v-model="baTable.form.items!.commission_rate" prop="commission_rate" :input-attr="{ min: 0, precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.calc_base_amount')" type="number" v-model="baTable.form.items!.calc_base_amount" prop="calc_base_amount" :input-attr="{ min: 0, precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.commission_amount')" type="number" v-model="baTable.form.items!.commission_amount" prop="commission_amount" :input-attr="{ precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.commissionRecord.status')" type="radio" v-model="baTable.form.items!.status" prop="status" :input-attr="{ content: { '0': t('agent.commissionRecord.status 0'), '1': t('agent.commissionRecord.status 1'), '2': t('agent.commissionRecord.status 2') } }" />
|
||||
<FormItem :label="t('agent.commissionRecord.settled_at')" type="datetime" v-model="baTable.form.items!.settled_at" prop="settled_at" />
|
||||
<FormItem :label="t('agent.commissionRecord.remark')" type="textarea" v-model="baTable.form.items!.remark" prop="remark" :input-attr="{ rows: 2 }" />
|
||||
|
||||
@@ -30,6 +30,17 @@ const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const optButtons: OptButton[] = defaultOptButtons(['edit', 'delete'])
|
||||
|
||||
function formatAmount2(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') {
|
||||
return '-'
|
||||
}
|
||||
const n = Number(cellValue)
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
new baTableApi('/admin/agent.SettlementPeriod/'),
|
||||
{
|
||||
@@ -67,13 +78,21 @@ const baTable = new baTableClass(
|
||||
sortable: 'custom',
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
},
|
||||
{ label: t('agent.settlementPeriod.total_bet_amount'), prop: 'total_bet_amount', align: 'center', operator: 'RANGE', minWidth: 120 },
|
||||
{
|
||||
label: t('agent.settlementPeriod.total_bet_amount'),
|
||||
prop: 'total_bet_amount',
|
||||
align: 'center',
|
||||
operator: 'RANGE',
|
||||
minWidth: 120,
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.settlementPeriod.total_payout_amount'),
|
||||
prop: 'total_payout_amount',
|
||||
align: 'center',
|
||||
operator: 'RANGE',
|
||||
minWidth: 120,
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.settlementPeriod.platform_profit_amount'),
|
||||
@@ -81,6 +100,7 @@ const baTable = new baTableClass(
|
||||
align: 'center',
|
||||
operator: 'RANGE',
|
||||
minWidth: 120,
|
||||
formatter: formatAmount2,
|
||||
},
|
||||
{
|
||||
label: t('agent.settlementPeriod.status'),
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
<FormItem :label="t('agent.settlementPeriod.settlement_no')" type="string" v-model="baTable.form.items!.settlement_no" prop="settlement_no" />
|
||||
<FormItem :label="t('agent.settlementPeriod.period_start_at')" type="datetime" v-model="baTable.form.items!.period_start_at" prop="period_start_at" />
|
||||
<FormItem :label="t('agent.settlementPeriod.period_end_at')" type="datetime" v-model="baTable.form.items!.period_end_at" prop="period_end_at" />
|
||||
<FormItem :label="t('agent.settlementPeriod.total_bet_amount')" type="number" v-model="baTable.form.items!.total_bet_amount" prop="total_bet_amount" :input-attr="{ min: 0, precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.total_payout_amount')" type="number" v-model="baTable.form.items!.total_payout_amount" prop="total_payout_amount" :input-attr="{ min: 0, precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.platform_profit_amount')" type="number" v-model="baTable.form.items!.platform_profit_amount" prop="platform_profit_amount" :input-attr="{ precision: 4, step: 0.0001 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.total_bet_amount')" type="number" v-model="baTable.form.items!.total_bet_amount" prop="total_bet_amount" :input-attr="{ min: 0, precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.total_payout_amount')" type="number" v-model="baTable.form.items!.total_payout_amount" prop="total_payout_amount" :input-attr="{ min: 0, precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.platform_profit_amount')" type="number" v-model="baTable.form.items!.platform_profit_amount" prop="platform_profit_amount" :input-attr="{ precision: 2, step: 0.01 }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.status')" type="radio" v-model="baTable.form.items!.status" prop="status" :input-attr="{ content: { '0': t('agent.settlementPeriod.status 0'), '1': t('agent.settlementPeriod.status 1'), '2': t('agent.settlementPeriod.status 2'), '3': t('agent.settlementPeriod.status 3') } }" />
|
||||
<FormItem :label="t('agent.settlementPeriod.remark')" type="textarea" v-model="baTable.form.items!.remark" prop="remark" :input-attr="{ rows: 2 }" />
|
||||
</el-form>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
type="number"
|
||||
v-model="baTable.form.items!.affiliate_share_rate"
|
||||
prop="affiliate_share_rate"
|
||||
:input-attr="{ step: 0.000001, precision: 6, min: 0, max: 1 }"
|
||||
:input-attr="{ step: 0.0001, precision: 2, min: 0, max: 1 }"
|
||||
:placeholder="`${t('Please input field', { field: t('channel.affiliate_share_rate') })} (例如 0.240000)`"
|
||||
/>
|
||||
<FormItem
|
||||
@@ -100,7 +100,7 @@
|
||||
type="number"
|
||||
v-model="baTable.form.items!.affiliate_fee_rate"
|
||||
prop="affiliate_fee_rate"
|
||||
:input-attr="{ step: 0.000001, precision: 6, min: 0, max: 1 }"
|
||||
:input-attr="{ step: 0.0001, precision: 2, min: 0, max: 1 }"
|
||||
:placeholder="`${t('Please input field', { field: t('channel.affiliate_fee_rate') })} (例如 0.070000)`"
|
||||
/>
|
||||
<el-form-item :label="t('channel.settle_cycle')" prop="settle_plan">
|
||||
@@ -140,7 +140,7 @@
|
||||
</div>
|
||||
<div v-for="(item, idx) in ladderRuleList" :key="idx" class="ladder-rule-row">
|
||||
<el-input-number v-model="item.minLoss" class="w100" :precision="4" :step="0.0001" :min="0" />
|
||||
<el-input-number v-model="item.shareRate" class="w100" :precision="6" :step="0.000001" :min="0" :max="1" />
|
||||
<el-input-number v-model="item.shareRate" class="w100" :precision="6" :step="0.0001" :min="0" :max="1" />
|
||||
<el-button type="danger" link @click="removeLadderRule(idx)">{{ t('Delete') }}</el-button>
|
||||
</div>
|
||||
<el-button type="primary" link @click="addLadderRule">{{ t('Add') }}</el-button>
|
||||
@@ -480,7 +480,7 @@ baTable.before.onSubmit = ({ items }) => {
|
||||
}
|
||||
}
|
||||
items.affiliate_ladder_rules = sorted.map((r) => ({
|
||||
minLoss: Number(r.minLoss).toFixed(4),
|
||||
minLoss: Number(r.minLoss).toFixed(2),
|
||||
shareRate: Number(r.shareRate).toFixed(6),
|
||||
}))
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,6 @@ const baTable = new baTableClass(
|
||||
defaultOrder: { prop: 'sort', order: 'asc' },
|
||||
extend: {
|
||||
registry: {} as Record<string, { name: string; name_en: string; sort: number }>,
|
||||
tier_options: [] as { id: string; label: string }[],
|
||||
},
|
||||
column: [
|
||||
{ type: 'selection', align: 'center', operator: false },
|
||||
@@ -83,25 +82,6 @@ const baTable = new baTableClass(
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
label: t('config.depositChannel.tier_ids'),
|
||||
prop: 'tier_ids',
|
||||
align: 'center',
|
||||
minWidth: 240,
|
||||
operator: false,
|
||||
render: 'tags',
|
||||
formatter: (row: anyObj) => {
|
||||
const ids = row.tier_ids
|
||||
if (!Array.isArray(ids) || ids.length === 0) {
|
||||
return [t('config.depositChannel.tier_all')]
|
||||
}
|
||||
const opts = (baTable.table.extend?.tier_options ?? []) as { id: string; label: string }[]
|
||||
return ids.map((id: string) => {
|
||||
const o = opts.find((x) => x.id === id)
|
||||
return o ? o.label : id
|
||||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('Operate'),
|
||||
align: 'center',
|
||||
@@ -119,7 +99,6 @@ const baTable = new baTableClass(
|
||||
code: '',
|
||||
sort: 10,
|
||||
status: 1,
|
||||
tier_ids: [] as string[],
|
||||
},
|
||||
},
|
||||
{},
|
||||
@@ -128,15 +107,11 @@ const baTable = new baTableClass(
|
||||
const d = res.data as
|
||||
| {
|
||||
registry?: Record<string, { name: string; name_en: string; sort: number }>
|
||||
tier_options?: { id: string; label: string }[]
|
||||
}
|
||||
| undefined
|
||||
if (d?.registry) {
|
||||
baTable.table.extend.registry = d.registry
|
||||
}
|
||||
if (d?.tier_options) {
|
||||
baTable.table.extend.tier_options = d.tier_options
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -43,20 +43,6 @@
|
||||
<el-switch v-model="baTable.form.items!.status" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('config.depositChannel.tier_ids')" prop="tier_ids">
|
||||
<el-select
|
||||
v-model="baTable.form.items!.tier_ids"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
filterable
|
||||
clearable
|
||||
class="w100"
|
||||
:placeholder="t('config.depositChannel.tier_ids_ph')"
|
||||
>
|
||||
<el-option v-for="opt in tierOptions" :key="opt.id" :label="opt.label" :value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
@@ -77,18 +63,11 @@ import { computed, inject, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
|
||||
type TierOpt = { id: string; label: string }
|
||||
|
||||
const config = useConfig()
|
||||
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||
const baTable = inject('baTable') as baTable
|
||||
const { t } = useI18n()
|
||||
|
||||
const tierOptions = computed(() => {
|
||||
const raw = baTable.table.extend?.tier_options
|
||||
return Array.isArray(raw) ? (raw as TierOpt[]) : []
|
||||
})
|
||||
|
||||
const registryDisplayName = computed(() => {
|
||||
const code = String(baTable.form.items?.code ?? '')
|
||||
const reg = baTable.table.extend?.registry as Record<string, { name?: string }> | undefined
|
||||
|
||||
@@ -42,7 +42,7 @@ function formatAmount4(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(4)
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
function formatPayCell(row: anyObj, _column: any, cellValue: unknown) {
|
||||
@@ -59,7 +59,7 @@ function formatTotalPlatform(row: anyObj) {
|
||||
const b = parseFloat(String(row.bonus_amount ?? '0').replace(',', '.'))
|
||||
const base = Number.isFinite(a) ? a : 0
|
||||
const bonus = Number.isFinite(b) ? b : 0
|
||||
return (base + bonus).toFixed(4)
|
||||
return (base + bonus).toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
@@ -68,7 +68,7 @@ const baTable = new baTableClass(
|
||||
pk: 'id',
|
||||
filter: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 100,
|
||||
},
|
||||
defaultOrder: { prop: 'sort', order: 'asc' },
|
||||
column: [
|
||||
|
||||
@@ -87,16 +87,37 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { FormInstance, FormItemRule } from 'element-plus'
|
||||
import { inject, reactive, useTemplateRef } from 'vue'
|
||||
import { inject, onMounted, reactive, ref, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
const config = useConfig()
|
||||
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||
const baTable = inject('baTable') as baTable
|
||||
const { t } = useI18n()
|
||||
|
||||
const payCurrencies = ['MYR', 'CNY', 'USD', 'USDT', 'VND', 'THB', 'SGD', 'IDR']
|
||||
const payCurrencies = ref<string[]>(['MYR', 'CNY', 'USD', 'USDT', 'VND', 'THB', 'SGD', 'IDR'])
|
||||
|
||||
async function loadPayCurrencies() {
|
||||
try {
|
||||
const res = await createAxios({
|
||||
url: '/admin/config.DepositTier/currencyOptions',
|
||||
method: 'GET',
|
||||
})
|
||||
const listRaw = (res as anyObj)?.data?.list
|
||||
if (Array.isArray(listRaw)) {
|
||||
const list = listRaw
|
||||
.map((x: unknown) => (typeof x === 'string' ? x.trim().toUpperCase() : ''))
|
||||
.filter((x: string) => x !== '')
|
||||
if (list.length > 0) {
|
||||
payCurrencies.value = Array.from(new Set(list))
|
||||
}
|
||||
}
|
||||
} catch (_e) {
|
||||
// 下拉拉取失败时保持内置兜底列表,避免阻断表单编辑
|
||||
}
|
||||
}
|
||||
|
||||
function positiveAmountRule(msg: string): FormItemRule {
|
||||
return {
|
||||
@@ -143,6 +164,10 @@ const rules = reactive({
|
||||
amount: [positiveAmountRule(t('config.depositTier.rule_platform_base'))],
|
||||
bonus_amount: [nonNegAmountRule(t('config.depositTier.rule_bonus'))],
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadPayCurrencies()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -103,22 +103,6 @@
|
||||
<el-switch v-model="row.status" :active-value="1" :inactive-value="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('config.financeCashierConfig.ch_tier_ids')" min-width="220">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.tier_ids"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
filterable
|
||||
clearable
|
||||
class="w100p"
|
||||
:placeholder="t('config.financeCashierConfig.ch_tier_ids_ph')"
|
||||
>
|
||||
<el-option v-for="opt in tierOptions" :key="opt.id" :label="opt.label" :value="opt.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
@@ -237,13 +221,11 @@ type CurrencyRow = {
|
||||
}
|
||||
type BankRow = { code: string; name_zh: string; name_en: string; sort: number }
|
||||
type ChannelRow = { code: string; sort: number; status: number; tier_ids: string[] }
|
||||
type TierOpt = { id: string; label: string }
|
||||
type RegistryMeta = { name?: string; name_en?: string; sort?: number }
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const registry = ref<Record<string, RegistryMeta>>({})
|
||||
const tierOptions = ref<TierOpt[]>([])
|
||||
|
||||
const form = reactive({
|
||||
platform_coin: { label_zh: '', label_en: '' },
|
||||
@@ -363,24 +345,13 @@ function channelDisplayName(code: string): string {
|
||||
}
|
||||
|
||||
function normalizeChannelRow(c: Record<string, unknown>): ChannelRow {
|
||||
const tierIds: string[] = []
|
||||
if (Array.isArray(c.tier_ids)) {
|
||||
for (const x of c.tier_ids) {
|
||||
if (typeof x === 'string') {
|
||||
const t = x.trim()
|
||||
if (t !== '') {
|
||||
tierIds.push(t)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const st = c.status
|
||||
const statusOn = st === 1 || st === true || st === '1'
|
||||
return {
|
||||
code: typeof c.code === 'string' ? c.code : '',
|
||||
sort: rowSortValue({ sort: c.sort }),
|
||||
status: statusOn ? 1 : 0,
|
||||
tier_ids: tierIds,
|
||||
tier_ids: [],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,8 +377,6 @@ async function load() {
|
||||
regRaw !== null && typeof regRaw === 'object' && !Array.isArray(regRaw)
|
||||
? (regRaw as Record<string, RegistryMeta>)
|
||||
: {}
|
||||
const topts = res.data.tier_options
|
||||
tierOptions.value = Array.isArray(topts) ? (topts as TierOpt[]) : []
|
||||
Object.assign(form.platform_coin, f.platform_coin || {})
|
||||
const curList = Array.isArray(f.currencies) ? f.currencies : []
|
||||
const normalized: CurrencyRow[] = curList.map((c: Record<string, unknown>) => ({
|
||||
|
||||
@@ -248,7 +248,7 @@ const voidReason = ref('')
|
||||
const voidSubmitting = ref(false)
|
||||
const manualNumber = ref<number | null>(1)
|
||||
const calcResultNumber = ref<number | null>(null)
|
||||
const calcEstimatedLoss = ref<string>('0.0000')
|
||||
const calcEstimatedLoss = ref<string>('0.00')
|
||||
|
||||
/** 服务端 Unix 秒 − 本地 Unix 秒,用于派彩倒计时与服务器对齐 */
|
||||
const serverSkewSeconds = ref(0)
|
||||
@@ -487,7 +487,7 @@ async function onCalculate() {
|
||||
snapshot.candidate_numbers = res.data.candidate_numbers || []
|
||||
snapshot.ai_default_number = res.data.ai_default_number ?? null
|
||||
calcResultNumber.value = res.data.final_number ?? null
|
||||
calcEstimatedLoss.value = String(res.data.final_estimated_loss ?? '0.0000')
|
||||
calcEstimatedLoss.value = String(res.data.final_estimated_loss ?? '0.00')
|
||||
}
|
||||
} finally {
|
||||
calcLoading.value = false
|
||||
|
||||
@@ -35,7 +35,7 @@ const formatCoin = (_row: any, _column: any, cellValue: number | string | null |
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') return '—'
|
||||
const n = Number(cellValue)
|
||||
if (Number.isNaN(n)) return '—'
|
||||
return n.toFixed(4)
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
|
||||
@@ -49,7 +49,7 @@ function formatAmount(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(4)
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
<template>
|
||||
<div class="default-main ba-table-box">
|
||||
<el-alert class="ba-table-alert" v-if="baTable.table.remark" :title="baTable.table.remark" type="info" show-icon />
|
||||
|
||||
<TableHeader
|
||||
:buttons="['refresh', 'comSearch', 'quickSearch', 'columnDisplay']"
|
||||
:quick-search-placeholder="t('Quick search placeholder', { fields: t('order.depositChannelOrder.quick Search Fields') })"
|
||||
></TableHeader>
|
||||
|
||||
<Table ref="tableRef"></Table>
|
||||
|
||||
<PopupForm />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, provide, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import PopupForm from '../depositOrder/popupForm.vue'
|
||||
import { baTableApi } from '/@/api/common'
|
||||
import { defaultOptButtons } from '/@/components/table'
|
||||
import TableHeader from '/@/components/table/header/index.vue'
|
||||
import Table from '/@/components/table/index.vue'
|
||||
import baTableClass from '/@/utils/baTable'
|
||||
|
||||
defineOptions({
|
||||
name: 'order/depositChannelOrder',
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const optButtons: OptButton[] = defaultOptButtons(['edit'])
|
||||
|
||||
function formatAmount(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') {
|
||||
return '-'
|
||||
}
|
||||
const s = String(cellValue).trim().replace(',', '.')
|
||||
const n = parseFloat(s)
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
new baTableApi('/admin/order.DepositChannelOrder/'),
|
||||
{
|
||||
pk: 'id',
|
||||
column: [
|
||||
{ type: 'selection', align: 'center', operator: false },
|
||||
{ label: t('order.depositOrder.id'), prop: 'id', align: 'center', width: 80, operator: 'RANGE', sortable: 'custom' },
|
||||
{
|
||||
label: t('order.depositOrder.order_no'),
|
||||
prop: 'order_no',
|
||||
align: 'center',
|
||||
minWidth: 170,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.user_username'),
|
||||
prop: 'user.username',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
render: 'tags',
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.channel_name'),
|
||||
prop: 'channel.name',
|
||||
align: 'center',
|
||||
minWidth: 110,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
render: 'tags',
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.amount'),
|
||||
prop: 'amount',
|
||||
align: 'center',
|
||||
minWidth: 110,
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmount,
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.bonus_amount'),
|
||||
prop: 'bonus_amount',
|
||||
align: 'center',
|
||||
minWidth: 110,
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmount,
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.status'),
|
||||
prop: 'status',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
operator: 'eq',
|
||||
render: 'tag',
|
||||
effect: 'dark',
|
||||
custom: {
|
||||
'0': 'info',
|
||||
'1': 'success',
|
||||
'2': 'danger',
|
||||
'3': 'warning',
|
||||
},
|
||||
replaceValue: {
|
||||
'0': t('order.depositOrder.status 0'),
|
||||
'1': t('order.depositOrder.status 1'),
|
||||
'2': t('order.depositOrder.status 2'),
|
||||
'3': t('order.depositOrder.status 3'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.pay_channel'),
|
||||
prop: 'pay_channel',
|
||||
align: 'center',
|
||||
minWidth: 130,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.deposit_tier_id'),
|
||||
prop: 'deposit_tier_id',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.pay_time'),
|
||||
prop: 'pay_time',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
operator: 'RANGE',
|
||||
comSearchRender: 'datetime',
|
||||
sortable: 'custom',
|
||||
width: 170,
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.idempotency_key'),
|
||||
prop: 'idempotency_key',
|
||||
align: 'center',
|
||||
minWidth: 170,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.remark'),
|
||||
prop: 'remark',
|
||||
align: 'center',
|
||||
minWidth: 150,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.create_time'),
|
||||
prop: 'create_time',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
operator: 'RANGE',
|
||||
comSearchRender: 'datetime',
|
||||
sortable: 'custom',
|
||||
width: 170,
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
},
|
||||
{
|
||||
label: t('order.depositOrder.update_time'),
|
||||
prop: 'update_time',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
operator: 'RANGE',
|
||||
comSearchRender: 'datetime',
|
||||
sortable: 'custom',
|
||||
width: 170,
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: t('Operate'),
|
||||
align: 'center',
|
||||
width: 90,
|
||||
render: 'buttons',
|
||||
buttons: optButtons,
|
||||
operator: false,
|
||||
fixed: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
defaultItems: { status: 0, amount: '0.0000', bonus_amount: '0.0000' },
|
||||
}
|
||||
)
|
||||
|
||||
provide('baTable', baTable)
|
||||
|
||||
onMounted(() => {
|
||||
baTable.table.ref = tableRef.value
|
||||
baTable.mount()
|
||||
baTable.getData()?.then(() => {
|
||||
baTable.initSort()
|
||||
baTable.dragSort()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -195,7 +195,7 @@ const baTable = new baTableClass(
|
||||
],
|
||||
},
|
||||
{
|
||||
defaultItems: { status: 0, amount: '0.0000', bonus_amount: '0.0000' },
|
||||
defaultItems: { status: 0, amount: '0.00', bonus_amount: '0.00' },
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -31,6 +31,17 @@ const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const optButtons: OptButton[] = defaultOptButtons(['edit'])
|
||||
|
||||
function formatAmount(_row: anyObj, _column: any, cellValue: unknown) {
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') {
|
||||
return '-'
|
||||
}
|
||||
const n = Number(cellValue)
|
||||
if (!Number.isFinite(n)) {
|
||||
return String(cellValue)
|
||||
}
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
const baTable = new baTableClass(
|
||||
new baTableApi('/admin/order.WithdrawOrder/'),
|
||||
{
|
||||
@@ -65,9 +76,36 @@ const baTable = new baTableClass(
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
render: 'tags',
|
||||
},
|
||||
{ label: t('order.withdrawOrder.amount'), prop: 'amount', align: 'center', minWidth: 110, operator: 'RANGE' },
|
||||
{ label: t('order.withdrawOrder.fee'), prop: 'fee', align: 'center', minWidth: 110, operator: 'RANGE' },
|
||||
{ label: t('order.withdrawOrder.actual_amount'), prop: 'actual_amount', align: 'center', minWidth: 110, operator: 'RANGE' },
|
||||
{ label: t('order.withdrawOrder.amount'), prop: 'amount', align: 'center', minWidth: 110, operator: 'RANGE', formatter: formatAmount },
|
||||
{ label: t('order.withdrawOrder.fee'), prop: 'fee', align: 'center', minWidth: 110, operator: 'RANGE', formatter: formatAmount },
|
||||
{ label: t('order.withdrawOrder.actual_amount'), prop: 'actual_amount', align: 'center', minWidth: 110, operator: 'RANGE', formatter: formatAmount },
|
||||
{
|
||||
label: t('order.withdrawOrder.receive_type'),
|
||||
prop: 'receive_type',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
},
|
||||
{
|
||||
label: t('order.withdrawOrder.receive_account'),
|
||||
prop: 'receive_account',
|
||||
align: 'center',
|
||||
minWidth: 180,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
label: t('order.withdrawOrder.idempotency_key'),
|
||||
prop: 'idempotency_key',
|
||||
align: 'center',
|
||||
minWidth: 170,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: t('order.withdrawOrder.status'),
|
||||
prop: 'status',
|
||||
@@ -144,7 +182,7 @@ const baTable = new baTableClass(
|
||||
],
|
||||
},
|
||||
{
|
||||
defaultItems: { status: 0, amount: '0.0000', fee: '0.0000', actual_amount: '0.0000' },
|
||||
defaultItems: { status: 0, amount: '0.00', fee: '0.00', actual_amount: '0.00' },
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -39,6 +39,15 @@
|
||||
<el-form-item :label="t('order.withdrawOrder.create_time')">
|
||||
<el-input :model-value="form.create_time_text" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('order.withdrawOrder.receive_type')">
|
||||
<el-input :model-value="form.receive_type || '-'" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('order.withdrawOrder.receive_account')">
|
||||
<el-input :model-value="form.receive_account || '-'" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('order.withdrawOrder.idempotency_key')">
|
||||
<el-input :model-value="form.idempotency_key || '-'" readonly />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('order.withdrawOrder.amount')" prop="amount">
|
||||
<el-input-number
|
||||
@@ -161,6 +170,9 @@ const form = reactive({
|
||||
create_time_text: '',
|
||||
review_admin_text: '-',
|
||||
review_time_text: '-',
|
||||
idempotency_key: '',
|
||||
receive_type: '',
|
||||
receive_account: '',
|
||||
amount: 0,
|
||||
fee: 0,
|
||||
status: 0,
|
||||
@@ -207,6 +219,9 @@ const hydrate = () => {
|
||||
form.fee = parseNumber(row['fee'])
|
||||
form.status = Number(row['status'] ?? 0)
|
||||
form.remark = String(row['remark'] ?? '')
|
||||
form.idempotency_key = String(row['idempotency_key'] ?? '')
|
||||
form.receive_type = String(row['receive_type'] ?? '')
|
||||
form.receive_account = String(row['receive_account'] ?? '')
|
||||
form.create_time_text = formatTime(row['create_time'])
|
||||
form.review_time_text = formatTime(row['review_time'])
|
||||
form.user_text = resolveRelationText(row, 'user', row['user_id'])
|
||||
@@ -316,8 +331,8 @@ const submitApprove = async () => {
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: form.id,
|
||||
amount: form.amount.toFixed(4),
|
||||
fee: form.fee.toFixed(4),
|
||||
amount: form.amount.toFixed(2),
|
||||
fee: form.fee.toFixed(2),
|
||||
},
|
||||
},
|
||||
{ showSuccessMessage: true }
|
||||
|
||||
Reference in New Issue
Block a user