处理loading
This commit is contained in:
parent
3f1ad80a8f
commit
cfd68bf3c9
|
|
@ -16,7 +16,7 @@
|
|||
<template #footer v-if="showFooter">
|
||||
<slot name="footer">
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
<el-button type="primary" :loading="buttonLoading" @click="handleConfirm">确定</el-button>
|
||||
</slot>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -31,6 +31,7 @@ interface Props {
|
|||
type?: string
|
||||
showFooter?: boolean
|
||||
fullscreen?: boolean
|
||||
buttonLoading?: boolean
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
|
|
@ -45,6 +46,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
destroyOnClose: true,
|
||||
showFooter: true,
|
||||
fullscreen: false,
|
||||
buttonLoading: false,
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@
|
|||
|
||||
<!-- 操作按钮 -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$emit('search')">
|
||||
<el-button type="primary" :loading="buttonLoading" @click="$emit('search')">
|
||||
{{ buttonConfig.searchText || '搜索' }}
|
||||
</el-button>
|
||||
<el-button @click="$emit('reset')">
|
||||
<el-button :loading="buttonLoading" @click="$emit('reset')">
|
||||
{{ buttonConfig.resetText || '重置' }}
|
||||
</el-button>
|
||||
<!-- 按钮区插槽 -->
|
||||
|
|
@ -99,6 +99,10 @@ const props = defineProps({
|
|||
type: Object as () => ButtonConfig,
|
||||
default: () => ({}),
|
||||
},
|
||||
buttonLoading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
// 暴露事件
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="table_form-container">
|
||||
<!-- 搜索 -->
|
||||
<CustomerListSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
||||
<CustomerListSearch :search-form="searchForm" :search-options="searchOptions" :button-loading="searchLoading" @search="handleSearch"
|
||||
@reset="handleReset"></CustomerListSearch>
|
||||
|
||||
<!-- 表格 -->
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<!-- dialog -->
|
||||
<CustomerListDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :fullscreen="dialogFullscreen"
|
||||
:show-footer="dialogType !== 'view'" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
||||
:show-footer="dialogType !== 'view'" :button-loading="submitLoading" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
||||
<CustomerListTable :table-data="marginRatioTree" :columns="marginRatioTableColumnsOptions" row-key="id"
|
||||
v-if="dialogType === 'editMarginRatio'" style="height: 600px">
|
||||
<template #assignedPointDiff="{ row }">
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
</CustomerListDialog>
|
||||
|
||||
<!-- 调整金额弹窗 -->
|
||||
<CustomerListDialog :visible="adjustAmountVisible" title="调整金额" type="adjust" @confirm="handleAdjustAmountSubmit"
|
||||
<CustomerListDialog :visible="adjustAmountVisible" title="调整金额" type="adjust" :button-loading="adjustAmountLoading" @confirm="handleAdjustAmountSubmit"
|
||||
@cancel="handleAdjustAmountCancel" @close="handleAdjustAmountClose">
|
||||
<el-form :model="adjustAmountForm" :rules="adjustAmountRules" ref="adjustAmountFormRef" label-width="120px">
|
||||
<el-form-item label="账号名" prop="username">
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
<!-- 修改客户弹窗 -->
|
||||
<CustomerListDialog :visible="editCustomerVisible" title="" type="editCustomer"
|
||||
@confirm="handleEditCustomerSubmit" @cancel="handleEditCustomerCancel" @close="handleEditCustomerClose">
|
||||
:button-loading="editCustomerLoading" @confirm="handleEditCustomerSubmit" @cancel="handleEditCustomerCancel" @close="handleEditCustomerClose">
|
||||
<el-form :model="editCustomerForm" :rules="editCustomerRules" ref="editCustomerFormRef" label-width="140px">
|
||||
<!-- <el-form-item label="手续费模板" prop="feeSettingId">
|
||||
<el-select v-model="editCustomerForm.feeSettingId" placeholder="请选择手续费模板" style="width: 100%">
|
||||
|
|
@ -126,7 +126,7 @@ defineOptions({
|
|||
// 组件
|
||||
import CustomerListSearch from '@/components/common/Search.vue'
|
||||
import CustomerListTable from '@/components/common/Table.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import CustomerListPagination from '@/components/common/Pagination.vue'
|
||||
import CustomerListDialog from '@/components/common/Dialog.vue'
|
||||
import CustomerListForm from '@/components/common/Form.vue'
|
||||
|
|
@ -172,6 +172,10 @@ const searchOptions = ref(search)
|
|||
const tableColumnsOptions = ref(tableColumns)
|
||||
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: searchLoading, startButtonLoading: startSearchLoading, stopButtonLoading: stopSearchLoading } = useButtonLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const { buttonLoading: adjustAmountLoading, startButtonLoading: startAdjustAmountLoading, stopButtonLoading: stopAdjustAmountLoading } = useButtonLoading()
|
||||
const { buttonLoading: editCustomerLoading, startButtonLoading: startEditCustomerLoading, stopButtonLoading: stopEditCustomerLoading } = useButtonLoading()
|
||||
/**
|
||||
* @description: 定义表格数据
|
||||
*/
|
||||
|
|
@ -326,6 +330,7 @@ const roleMap: any = {
|
|||
// 获取客户列表
|
||||
const getCustomerList = async (id: string) => {
|
||||
startLoading()
|
||||
try {
|
||||
const params = {
|
||||
user_id: id,
|
||||
page: currentPage.value,
|
||||
|
|
@ -363,14 +368,19 @@ const getCustomerList = async (id: string) => {
|
|||
}))
|
||||
console.log('tableTree', tableTree.value)
|
||||
//分页数据
|
||||
stopLoading()
|
||||
total.value = data.total
|
||||
currentPage.value = data.current_page
|
||||
pageSize.value = Number(data.per_page)
|
||||
} catch (err) {
|
||||
console.error('获取客户列表失败:', err)
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
//获取代理点差数据
|
||||
const getSelfVarietyPointDiffConfig = async (id: string) => {
|
||||
try {
|
||||
const params = {
|
||||
user_id: id,
|
||||
}
|
||||
|
|
@ -385,6 +395,9 @@ const getSelfVarietyPointDiffConfig = async (id: string) => {
|
|||
}
|
||||
})
|
||||
console.log('marginRatioTree', marginRatioTree.value)
|
||||
} catch (err) {
|
||||
console.error('获取代理点差数据失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -398,7 +411,15 @@ onMounted(() => {
|
|||
* @description: 定义搜索方法
|
||||
*/
|
||||
const handleSearch = async () => {
|
||||
getCustomerList(userId.value)
|
||||
currentPage.value = 1
|
||||
startSearchLoading()
|
||||
try {
|
||||
await getCustomerList(userId.value)
|
||||
} catch (err) {
|
||||
console.error('搜索失败:', err)
|
||||
} finally {
|
||||
stopSearchLoading()
|
||||
}
|
||||
}
|
||||
const handleReset = () => {
|
||||
searchForm.value = {
|
||||
|
|
@ -407,7 +428,7 @@ const handleReset = () => {
|
|||
endTime: '',
|
||||
status: '',
|
||||
}
|
||||
getCustomerList(userId.value)
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -448,6 +469,7 @@ const handleCommissionRatio = (row: any) => {
|
|||
|
||||
// 获取子列表
|
||||
const handleGetSubList = async (row: any) => {
|
||||
try {
|
||||
const params = {
|
||||
user_name: '',
|
||||
user_id: row.userId,
|
||||
|
|
@ -484,6 +506,9 @@ const handleGetSubList = async (row: any) => {
|
|||
]
|
||||
: undefined,
|
||||
}))
|
||||
} catch (err) {
|
||||
console.error('获取子列表失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -500,6 +525,8 @@ const handlePaginationChange = (page: { currentPage: number; pageSize: number })
|
|||
*/
|
||||
//提交
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
const params = {
|
||||
user_id: selectId.value,
|
||||
toucun_percent: '',
|
||||
|
|
@ -532,7 +559,7 @@ const handleSubmit = async () => {
|
|||
dialogVisible.value = false
|
||||
await getCustomerList(userId.value)
|
||||
} catch (err) {
|
||||
console.log('提交失败:', err)
|
||||
console.error('提交失败:', err)
|
||||
}
|
||||
}
|
||||
if (dialogType.value === 'editCommissionRatio') {
|
||||
|
|
@ -545,9 +572,12 @@ const handleSubmit = async () => {
|
|||
dialogVisible.value = false
|
||||
await getCustomerList(userId.value)
|
||||
} catch (err) {
|
||||
console.log('提交失败:', err)
|
||||
console.error('提交失败:', err)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
// 取消
|
||||
const handleCancel = () => {
|
||||
|
|
@ -587,6 +617,7 @@ const handleAdjustAmountInput = () => {
|
|||
|
||||
// 提交调整金额
|
||||
const handleAdjustAmountSubmit = async () => {
|
||||
startAdjustAmountLoading()
|
||||
try {
|
||||
await adjustAmountFormRef.value?.validate()
|
||||
await updateCapitalApi({
|
||||
|
|
@ -597,6 +628,8 @@ const handleAdjustAmountSubmit = async () => {
|
|||
adjustAmountVisible.value = false
|
||||
} catch (err) {
|
||||
console.error('调整金额表单验证失败', err)
|
||||
} finally {
|
||||
stopAdjustAmountLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -659,6 +692,7 @@ const handleEditCustomer = async (row: any) => {
|
|||
|
||||
// 提交修改客户
|
||||
const handleEditCustomerSubmit = async () => {
|
||||
startEditCustomerLoading()
|
||||
try {
|
||||
await editCustomerFormRef.value?.validate()
|
||||
await editUserApi({
|
||||
|
|
@ -673,6 +707,8 @@ const handleEditCustomerSubmit = async () => {
|
|||
editCustomerVisible.value = false
|
||||
} catch (err) {
|
||||
console.error('修改客户表单验证失败', err)
|
||||
} finally {
|
||||
stopEditCustomerLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@
|
|||
<FundDetailHeader title="入金货币" :buttons="buttonsOptions" @button-click="handleButtonClick">
|
||||
</FundDetailHeader>
|
||||
<!-- 表格 -->
|
||||
<FundDetailTable :table-data="tableData" :columns="tableColumnsOptions" @row-click="handleRowClick" row-key="id" :loading="loading" />
|
||||
<FundDetailDialog :visible="visible" :title="dialogTitle" @close="visible = false" @cancel="visible = false"
|
||||
@confirm="handleConfirm">
|
||||
<FundDetailForm :formData="formData" :formItems="formItems" :formRules="formRules" :optionsMap="optionsMap">
|
||||
<FundDetailTable :table-data="tableData" :columns="tableColumnsOptions" @row-click="handleRowClick" row-key="id"
|
||||
:loading="loading" />
|
||||
<FundDetailDialog :visible="visible" :title="dialogTitle" :button-loading="buttonLoading" @close="visible = false"
|
||||
@cancel="visible = false" @confirm="handleConfirm">
|
||||
<FundDetailForm :formData="formData" ref="commissionRatioFormRef" :formItems="formItems" :formRules="formRules"
|
||||
:optionsMap="optionsMap">
|
||||
</FundDetailForm>
|
||||
</FundDetailDialog>
|
||||
</div>
|
||||
|
|
@ -20,7 +22,7 @@ defineOptions({
|
|||
})
|
||||
import FundDetailHeader from '@/components/common/header.vue'
|
||||
import FundDetailTable from '@/components/common/Table.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import FundDetailDialog from '@/components/common/Dialog.vue'
|
||||
import FundDetailForm from '@/components/common/Form.vue'
|
||||
import type { ButtonProps } from 'element-plus'
|
||||
|
|
@ -43,11 +45,13 @@ interface HeaderButton {
|
|||
}
|
||||
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading, startButtonLoading, stopButtonLoading } = useButtonLoading()
|
||||
const buttonsOptions = ref(buttons)
|
||||
const formItems = ref(form)
|
||||
const tableData = ref([])
|
||||
const tableColumnsOptions = ref(tableColumns)
|
||||
const dialogTitle = ref('')
|
||||
const commissionRatioFormRef = ref()
|
||||
const formRules = ref(rules)
|
||||
const formData = ref({
|
||||
name: '',
|
||||
|
|
@ -72,9 +76,11 @@ let rowData: any = {}
|
|||
const visible = ref<boolean>(false)
|
||||
|
||||
const getTableList = async () => {
|
||||
try {
|
||||
|
||||
startLoading()
|
||||
const data = await getCurrencyList()
|
||||
stopLoading()
|
||||
|
||||
tableData.value = (data || []).map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
|
|
@ -83,6 +89,9 @@ const getTableList = async () => {
|
|||
}
|
||||
})
|
||||
console.log('tableData.value', tableData.value)
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
const handleRowClick = (row: any) => {
|
||||
|
|
@ -140,6 +149,9 @@ const handleEdit = () => {
|
|||
}
|
||||
|
||||
const handleConfirm = async () => {
|
||||
await commissionRatioFormRef.value.validate()
|
||||
startButtonLoading()
|
||||
try {
|
||||
if (dialogTitle.value === '添加') {
|
||||
await createCurrency(formData.value)
|
||||
} else {
|
||||
|
|
@ -148,6 +160,9 @@ const handleConfirm = async () => {
|
|||
visible.value = false
|
||||
resetForm()
|
||||
await getTableList()
|
||||
} finally {
|
||||
stopButtonLoading()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -5,29 +5,14 @@
|
|||
<el-button type="primary" @click="handleEdit" v-auth="'channel_editChannel'">编辑</el-button>
|
||||
<el-button type="danger" @click="handleDelete" v-auth="'channel_delChannel'">删除</el-button>
|
||||
</div>
|
||||
<DepositChannelTable
|
||||
ref="tableRef"
|
||||
:table-data="tableData"
|
||||
:columns="tableColumnsOptions"
|
||||
row-key="id"
|
||||
:loading="loading"
|
||||
@rowClick="handleRowClick"
|
||||
/>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitleType === 1 ? '添加充值渠道' : '编辑充值渠道'"
|
||||
width="700"
|
||||
>
|
||||
<Form
|
||||
:formItems="formItems"
|
||||
:formRules="formRules"
|
||||
:formData="formData"
|
||||
:optionsMap="optionsMap"
|
||||
/>
|
||||
<DepositChannelTable ref="tableRef" :table-data="tableData" :columns="tableColumnsOptions" row-key="id"
|
||||
:loading="loading" @rowClick="handleRowClick" />
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitleType === 1 ? '添加充值渠道' : '编辑充值渠道'" width="700">
|
||||
<Form :formItems="formItems" ref="formRef" :formRules="formRules" :formData="formData" :optionsMap="optionsMap" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitDetail">确认</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitDetail">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -41,7 +26,7 @@ defineOptions({
|
|||
//组件
|
||||
import DepositChannelTable from '@/components/common/Table.vue'
|
||||
import Form from '@/components/common/Form.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import { tableColumns, formItemsData, formRulesData, optionsMapData } from './options'
|
||||
import {
|
||||
getChannelList,
|
||||
|
|
@ -67,17 +52,22 @@ const getStatusText = (status: number | string) => {
|
|||
return ['', '正常', '禁用'][status]
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const initData = async () => {
|
||||
try {
|
||||
startLoading()
|
||||
const res = await getChannelList()
|
||||
stopLoading()
|
||||
console.log(res)
|
||||
tableData.value = res.map((item: ChannelType) => ({
|
||||
...item,
|
||||
statusStr: getStatusText(item.status),
|
||||
})) as ChannelType[]
|
||||
clearSelection()
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
//表格数据
|
||||
|
|
@ -107,12 +97,18 @@ const formItems = ref(formItemsData)
|
|||
const formRules = ref(formRulesData)
|
||||
const optionsMap = ref(optionsMapData)
|
||||
const submitDetail = async () => {
|
||||
dialogVisible.value = false
|
||||
await formRef.value.validate()
|
||||
startSubmitLoading();
|
||||
try {
|
||||
if (dialogTitleType.value === 1) {
|
||||
await createChannel(formData.value)
|
||||
} else {
|
||||
await editChannel(formData.value)
|
||||
}
|
||||
} finally {
|
||||
dialogVisible.value = false
|
||||
stopSubmitLoading();
|
||||
}
|
||||
await initData()
|
||||
}
|
||||
|
||||
|
|
@ -204,4 +200,3 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ defineOptions({
|
|||
name: 'RechangeCheck',
|
||||
})
|
||||
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import RechangeSearch from '@/components/common/Search.vue'
|
||||
import Table from '@/components/common/Table.vue'
|
||||
|
|
@ -202,10 +202,23 @@ const handleApprove = async () => {
|
|||
ElMessage.warning('请先选择要通过的记录')
|
||||
return
|
||||
}
|
||||
console.log(selectedRows.value)
|
||||
try {
|
||||
await ElMessageBox.confirm(`是否确认通过该审核?订单号:${selectedRows.value[0].orderNo}`, '审核确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
startLoading()
|
||||
try {
|
||||
await reviewRechargeOrder({ id: selectedRows.value[0].id, status: '3' })
|
||||
ElMessage.success('审核通过')
|
||||
await getList()
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 审核驳回:当前保留前端提示,等待后续接接口。
|
||||
|
|
@ -214,10 +227,24 @@ const handleReject = async () => {
|
|||
ElMessage.warning('请先选择要驳回的记录')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(`是否确认驳回该审核?订单号:${selectedRows.value[0].orderNo}`, '审核确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
//充值状态:1未审核,2未付款,3已付款,4驳回
|
||||
startLoading()
|
||||
try {
|
||||
await reviewRechargeOrder({ id: selectedRows.value[0].id, status: '4' })
|
||||
ElMessage.success('审核驳回')
|
||||
await getList()
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 导出:先导出当前页接口数据,后续如需全量导出可切成独立导出接口。
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
width="700"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:formItems="formItems"
|
||||
:formRules="formRules"
|
||||
:formData="formData"
|
||||
|
|
@ -27,7 +28,7 @@
|
|||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitDetail">确认</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitDetail">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -40,7 +41,7 @@ defineOptions({
|
|||
//组件
|
||||
import Table from '@/components/common/Table.vue'
|
||||
import Form from '@/components/common/Form.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import { tableColumns, formItemsData, formRulesData, optionsMapData } from './options'
|
||||
import {
|
||||
getChannelWithdrawList,
|
||||
|
|
@ -67,7 +68,9 @@ const getStatusText = (status: number | string) => {
|
|||
return ['', '正常', '禁用'][status]
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const initData = async () => {
|
||||
startLoading()
|
||||
const res = await getChannelWithdrawList()
|
||||
|
|
@ -101,6 +104,9 @@ const formItems = ref(formItemsData)
|
|||
const formRules = ref(formRulesData)
|
||||
const optionsMap = ref(optionsMapData)
|
||||
const submitDetail = async () => {
|
||||
await formRef.value.validate()
|
||||
startSubmitLoading();
|
||||
try {
|
||||
dialogVisible.value = false
|
||||
if (dialogTitleType.value === 1) {
|
||||
await createChannelWithdraw(formData.value)
|
||||
|
|
@ -108,6 +114,9 @@ const submitDetail = async () => {
|
|||
await editChannelWithdraw(formData.value)
|
||||
}
|
||||
await initData()
|
||||
} finally {
|
||||
stopSubmitLoading();
|
||||
}
|
||||
}
|
||||
|
||||
let currentRow: any = {}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="submit">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detaildialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitDetail">确认</el-button>
|
||||
<el-button type="primary" :loading="submitDetailLoading" @click="submitDetail">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -55,7 +55,7 @@ defineOptions({
|
|||
})
|
||||
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import {
|
||||
getFeeSettingList,
|
||||
getFeeSettingDetail,
|
||||
|
|
@ -86,7 +86,9 @@ const detaildialogVisible = ref(false)
|
|||
|
||||
// 加载状态
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const detailLoading = ref(false)
|
||||
const { buttonLoading: detailLoading, startButtonLoading: startDetailLoading, stopButtonLoading: stopDetailLoading } = useButtonLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const { buttonLoading: submitDetailLoading, startButtonLoading: startSubmitDetailLoading, stopButtonLoading: stopSubmitDetailLoading } = useButtonLoading()
|
||||
|
||||
// 主表格相关
|
||||
const tableData = ref<any[]>([])
|
||||
|
|
@ -156,12 +158,12 @@ const handleTableDataAfterLoad = () => {
|
|||
|
||||
// 获取详情数据
|
||||
const fetchItemDetail = async (id: number) => {
|
||||
detailLoading.value = true
|
||||
startDetailLoading();
|
||||
try {
|
||||
const res = await getFeeSettingDetail({ id })
|
||||
tableDataDetail.value = res || []
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
stopDetailLoading();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -199,6 +201,8 @@ const changeStatus = (status: number) => {
|
|||
|
||||
// 提交主表单
|
||||
const submit = async () => {
|
||||
startSubmitLoading();
|
||||
try {
|
||||
if (dialogTitleType.value === 1) {
|
||||
await createFeeSetting(formData.value)
|
||||
} else {
|
||||
|
|
@ -207,6 +211,9 @@ const submit = async () => {
|
|||
resetFormData()
|
||||
dialogVisible.value = false
|
||||
getTableData()
|
||||
} finally {
|
||||
stopSubmitLoading();
|
||||
}
|
||||
}
|
||||
|
||||
// 打开编辑详情弹窗
|
||||
|
|
@ -216,6 +223,8 @@ const editFeeDetail = () => {
|
|||
|
||||
// 提交详情表单
|
||||
const submitDetail = async () => {
|
||||
startSubmitDetailLoading();
|
||||
try {
|
||||
const contentsJson: Record<string, any> = {}
|
||||
|
||||
tableDataDetail.value.forEach((item) => {
|
||||
|
|
@ -229,6 +238,9 @@ const submitDetail = async () => {
|
|||
|
||||
detaildialogVisible.value = false
|
||||
getTableData()
|
||||
} finally {
|
||||
stopSubmitDetailLoading();
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</RiskTableContent>
|
||||
</div>
|
||||
<!-- dialog -->
|
||||
<RiskDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" @confirm="handleSubmit"
|
||||
<RiskDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :button-loading="submitLoading" @confirm="handleSubmit"
|
||||
@cancel="handleCancel" @close="handleClose">
|
||||
<RiskForm :form-data="dialogForm" :form-rules="riskRules" :form-items="RiskFormItems"
|
||||
:options-map="riskFormOptionsMap" :row-gutter="rowGutter" :col-span="colSpan" ref="riskFormRef" />
|
||||
|
|
@ -37,8 +37,9 @@ defineOptions({
|
|||
name: 'Risk'
|
||||
})
|
||||
// 组件
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
|
||||
import RiskTableSwitch from '@/components/common/Table.vue'
|
||||
import RiskTableContent from '@/components/common/Table.vue'
|
||||
|
|
@ -283,6 +284,8 @@ const handleRowClick = (row: any) => {
|
|||
* @description: 定义弹窗方法
|
||||
*/
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
await riskFormRef.value?.validate()
|
||||
const params = {
|
||||
name: dialogForm.value.name,
|
||||
|
|
@ -330,6 +333,9 @@ const handleSubmit = async () => {
|
|||
dialogTitle.value = '编辑'
|
||||
dialogType.value = 'edit'
|
||||
}
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
const handleCancel = () => {
|
||||
dialogVisible.value = false
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="table_form-container">
|
||||
<!-- 搜索 -->
|
||||
<CustomerListSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
||||
<CustomerListSearch :buttonLoading="loading" :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
||||
@reset="handleReset"></CustomerListSearch>
|
||||
<!-- 表格 -->
|
||||
<CustomerListTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="userId"
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
@pagination-change="handlePaginationChange" />
|
||||
<!-- dialog -->
|
||||
<CustomerListDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :fullscreen="dialogFullscreen"
|
||||
:show-footer="dialogType !== 'view'" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
||||
:show-footer="dialogType !== 'view'" :button-loading="submitLoading" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
||||
<CustomerListTable :table-data="marginRatioTree" :columns="marginRatioTableColumnsOptions" row-key="id"
|
||||
v-if="dialogType === 'editMarginRatio'" style="height: 500px">
|
||||
<template #assignedPointDiff="{ row }">
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
</CustomerListDialog>
|
||||
|
||||
<!-- 调整金额弹窗 -->
|
||||
<CustomerListDialog :visible="adjustAmountVisible" title="调整金额" type="adjust" @confirm="handleAdjustAmountSubmit"
|
||||
<CustomerListDialog :visible="adjustAmountVisible" title="调整金额" type="adjust" :button-loading="adjustAmountLoading" @confirm="handleAdjustAmountSubmit"
|
||||
@cancel="handleAdjustAmountCancel" @close="handleAdjustAmountClose">
|
||||
<el-form :model="adjustAmountForm" :rules="adjustAmountRules" ref="adjustAmountFormRef" label-width="120px">
|
||||
<el-form-item label="账号名" prop="username">
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
<!-- 修改客户弹窗 -->
|
||||
<CustomerListDialog :visible="editCustomerVisible" title="修改客户" type="editCustomer"
|
||||
@confirm="handleEditCustomerSubmit" @cancel="handleEditCustomerCancel" @close="handleEditCustomerClose">
|
||||
:button-loading="editCustomerLoading" @confirm="handleEditCustomerSubmit" @cancel="handleEditCustomerCancel" @close="handleEditCustomerClose">
|
||||
<el-form :model="editCustomerForm" :rules="editCustomerRules" ref="editCustomerFormRef" label-width="140px">
|
||||
<el-form-item label="手续费模板" prop="feeSettingId">
|
||||
<el-select v-model="editCustomerForm.feeSettingId" placeholder="请选择手续费模板" style="width: 100%">
|
||||
|
|
@ -112,7 +112,7 @@ defineOptions({
|
|||
// 组件
|
||||
import CustomerListSearch from '@/components/common/Search.vue'
|
||||
import CustomerListTable from '@/components/common/Table.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import CustomerListPagination from '@/components/common/Pagination.vue'
|
||||
import CustomerListDialog from '@/components/common/Dialog.vue'
|
||||
import CustomerListForm from '@/components/common/Form.vue'
|
||||
|
|
@ -147,6 +147,9 @@ const searchOptions = ref(search)
|
|||
const tableColumnsOptions = ref(tableColumns)
|
||||
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const { buttonLoading: adjustAmountLoading, startButtonLoading: startAdjustAmountLoading, stopButtonLoading: stopAdjustAmountLoading } = useButtonLoading()
|
||||
const { buttonLoading: editCustomerLoading, startButtonLoading: startEditCustomerLoading, stopButtonLoading: stopEditCustomerLoading } = useButtonLoading()
|
||||
/**
|
||||
* @description: 定义表格数据
|
||||
*/
|
||||
|
|
@ -442,8 +445,9 @@ const handlePaginationChange = (page: { currentPage: number; pageSize: number })
|
|||
/**
|
||||
* @description: 定义弹窗方法
|
||||
*/
|
||||
//提交
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
const params = {
|
||||
user_id: selectId.value,
|
||||
toucun_percent: '',
|
||||
|
|
@ -491,6 +495,9 @@ const handleSubmit = async () => {
|
|||
console.log('提交失败:', err)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
// 取消
|
||||
const handleCancel = () => {
|
||||
|
|
@ -531,6 +538,7 @@ const handleAdjustAmountInput = () => {
|
|||
|
||||
// 提交调整金额
|
||||
const handleAdjustAmountSubmit = async () => {
|
||||
startAdjustAmountLoading()
|
||||
try {
|
||||
await adjustAmountFormRef.value?.validate()
|
||||
await updateCapitalApi({
|
||||
|
|
@ -541,6 +549,8 @@ const handleAdjustAmountSubmit = async () => {
|
|||
adjustAmountVisible.value = false
|
||||
} catch (err) {
|
||||
console.error('调整金额表单验证失败', err)
|
||||
} finally {
|
||||
stopAdjustAmountLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -602,6 +612,7 @@ const handleEditCustomer = async (row: any) => {
|
|||
|
||||
// 提交修改客户
|
||||
const handleEditCustomerSubmit = async () => {
|
||||
startEditCustomerLoading()
|
||||
try {
|
||||
await editCustomerFormRef.value?.validate()
|
||||
await editUserApi({
|
||||
|
|
@ -616,6 +627,8 @@ const handleEditCustomerSubmit = async () => {
|
|||
editCustomerVisible.value = false
|
||||
} catch (err) {
|
||||
console.error('修改客户表单验证失败', err)
|
||||
} finally {
|
||||
stopEditCustomerLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<!-- 搜索 -->
|
||||
<MarketSearch
|
||||
:search-form="marketSearchForm"
|
||||
:buttonLoading="loading"
|
||||
:search-options="marketSearchOptions"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
|
|
@ -196,7 +197,7 @@ defineOptions({
|
|||
// 组件
|
||||
import MarketSearch from '@/components/common/Search.vue'
|
||||
import MarketTable from '@/components/common/Table.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import MarketPagination from '@/components/common/Pagination.vue'
|
||||
import MarketDialog from '@/components/common/Dialog.vue'
|
||||
import MarketForm from '@/components/common/Form.vue'
|
||||
|
|
@ -242,6 +243,7 @@ const marketSearchForm = ref({
|
|||
const marketSearchOptions = ref(marketSearch)
|
||||
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
/**
|
||||
* @description 定义表格数据
|
||||
*/
|
||||
|
|
@ -801,6 +803,8 @@ const formatPointDiffToObject = () => {
|
|||
|
||||
//提交
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
// console.log('提交', marketPointTree.value);
|
||||
await marketFormRef.value?.validate()
|
||||
const pointDiffObj = formatPointDiffToObject()
|
||||
|
|
@ -851,6 +855,9 @@ const handleSubmit = async () => {
|
|||
dialogVisible.value = false
|
||||
marketForm.value = { ...initMarketForm }
|
||||
}
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 取消
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
</div>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<Dialog :visible="dialogVisible" :title="dialogTitle" width="500px" @confirm="handleEditConfirm"
|
||||
<Dialog :visible="dialogVisible" :title="dialogTitle" width="500px" :button-loading="editLoading" @confirm="handleEditConfirm"
|
||||
@cancel="handleEditDialogReset" @close="handleEditDialogReset">
|
||||
<el-form ref="editFormRef" :model="editForm" :rules="getEditRules()" label-width="80px" label-position="top">
|
||||
<el-form-item v-if="editField === 'mobile'" :label="editForm.label" prop="value" class="phone-item">
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
<!-- 密码修改弹窗 → 验证码模式 -->
|
||||
<Dialog :visible="passwordDialogVisible" :title="t('personalCenter.modifyPassword')" width="500px"
|
||||
@confirm="handlePasswordConfirm" @cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
|
||||
:button-loading="passwordLoading" @confirm="handlePasswordConfirm" @cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
|
||||
<el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordFormRules" label-width="100px"
|
||||
label-position="top">
|
||||
<!-- 选择验证方式 -->
|
||||
|
|
@ -174,6 +174,8 @@ import {
|
|||
updatePwdByCaptchaApi
|
||||
} from '@/api/modules/profile/personalCenter';
|
||||
|
||||
import { useButtonLoading } from '@/composables/useLoading';
|
||||
|
||||
const userInfo = reactive<UserInfo>({
|
||||
id: 0,
|
||||
username: '',
|
||||
|
|
@ -186,6 +188,8 @@ const userInfo = reactive<UserInfo>({
|
|||
|
||||
const dialogVisible = ref(false);
|
||||
const passwordDialogVisible = ref(false);
|
||||
const { buttonLoading: editLoading, startButtonLoading: startEditLoading, stopButtonLoading: stopEditLoading } = useButtonLoading();
|
||||
const { buttonLoading: passwordLoading, startButtonLoading: startPasswordLoading, stopButtonLoading: stopPasswordLoading } = useButtonLoading();
|
||||
const editFormRef = ref<FormInstance>();
|
||||
const passwordFormRef = ref<FormInstance>();
|
||||
const editField = ref<string>('');
|
||||
|
|
@ -399,6 +403,7 @@ const handleLanguageChange = async (val: number) => {
|
|||
// 提交修改
|
||||
const handleEditConfirm = async () => {
|
||||
if (!editFormRef.value) return;
|
||||
startEditLoading();
|
||||
try {
|
||||
await editFormRef.value.validate();
|
||||
|
||||
|
|
@ -425,6 +430,8 @@ const handleEditConfirm = async () => {
|
|||
} catch (err) {
|
||||
// 表单验证失败或API调用失败时,不显示错误消息,因为ElMessage已经在其他地方处理
|
||||
console.error('操作失败:', err);
|
||||
} finally {
|
||||
stopEditLoading();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -512,6 +519,7 @@ watch(
|
|||
// 提交修改密码
|
||||
const handlePasswordConfirm = async () => {
|
||||
if (!passwordFormRef.value) return;
|
||||
startPasswordLoading();
|
||||
try {
|
||||
await passwordFormRef.value.validate();
|
||||
|
||||
|
|
@ -536,6 +544,8 @@ const handlePasswordConfirm = async () => {
|
|||
} catch (err) {
|
||||
// 表单验证失败或API调用失败时,不显示错误消息,因为ElMessage已经在其他地方处理
|
||||
console.error('密码修改失败:', err);
|
||||
} finally {
|
||||
stopPasswordLoading();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
<template>
|
||||
<div class="client table_form-container">
|
||||
<!-- 搜索组件 -->
|
||||
<ClientSearch
|
||||
:search-form="clientSearchForm"
|
||||
:search-options="clientSearchOptions"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
>
|
||||
<ClientSearch :search-form="clientSearchForm" :search-options="clientSearchOptions" :buttonLoading="loading"
|
||||
@search="handleSearch" @reset="handleReset">
|
||||
<template #button="{ form }">
|
||||
<el-button type="primary" @click="handleAdd()" v-auth="'user_createUser'">
|
||||
添加客户
|
||||
|
|
@ -29,44 +25,21 @@
|
|||
</template>
|
||||
</ClientTable>
|
||||
<!-- 分页组件 -->
|
||||
<ClientPagination
|
||||
v-model="currentPage"
|
||||
v-model:pageSizeValue="pageSize"
|
||||
:total="total"
|
||||
@pagination-change="handlePaginationChange"
|
||||
/>
|
||||
<ClientPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
|
||||
@pagination-change="handlePaginationChange" />
|
||||
</div>
|
||||
<!-- 客户弹窗 -->
|
||||
<ClientDialog
|
||||
:visible="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
:type="dialogType"
|
||||
@confirm="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
@close="handleClose"
|
||||
>
|
||||
<ClientForm
|
||||
:form-data="clientForm"
|
||||
:form-rules="clientFormRules"
|
||||
:form-items="clientFormOptions"
|
||||
:options-map="clientFormOptionsMap"
|
||||
ref="clientFormRef"
|
||||
>
|
||||
<ClientDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :button-loading="submitLoading"
|
||||
@confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
||||
<ClientForm :form-data="clientForm" :form-rules="clientFormRules" :form-items="clientFormOptions"
|
||||
:options-map="clientFormOptionsMap" ref="clientFormRef">
|
||||
<template #phoneOrEmail="{ formData }" style="margin-left: 0">
|
||||
<div class="phone-email">
|
||||
<div class="tab-btn">
|
||||
<el-button
|
||||
:type="activeTab === 'email' ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="activeTab = 'email'"
|
||||
>
|
||||
<el-button :type="activeTab === 'email' ? 'primary' : 'default'" size="small" @click="activeTab = 'email'">
|
||||
邮箱
|
||||
</el-button>
|
||||
<el-button
|
||||
:type="activeTab === 'phone' ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="activeTab = 'phone'"
|
||||
>
|
||||
<el-button :type="activeTab === 'phone' ? 'primary' : 'default'" size="small" @click="activeTab = 'phone'">
|
||||
手机号
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -76,12 +49,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item prop="phone" class="phone-item" v-if="activeTab === 'phone'">
|
||||
<el-select v-model="clientForm.countryCode" placeholder="请选择国家区号">
|
||||
<el-option
|
||||
v-for="item in countryOptions"
|
||||
:key="item.code"
|
||||
:label="item.code"
|
||||
:value="item.code"
|
||||
>
|
||||
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code" :value="item.code">
|
||||
<div class="country-option">
|
||||
<span class="country-name">{{ item.name }}</span>
|
||||
<span class="country-code">{{ item.code }}</span>
|
||||
|
|
@ -97,14 +65,8 @@
|
|||
</ClientDialog>
|
||||
|
||||
<!-- 调整金额弹窗 -->
|
||||
<ClientDialog
|
||||
:visible="adjustAmountVisible"
|
||||
title="调整金额"
|
||||
type="adjust"
|
||||
@confirm="handleAdjustAmountSubmit"
|
||||
@cancel="handleAdjustAmountCancel"
|
||||
@close="handleAdjustAmountClose"
|
||||
>
|
||||
<ClientDialog :visible="adjustAmountVisible" title="调整金额" type="adjust" :button-loading="adjustAmountLoading"
|
||||
@confirm="handleAdjustAmountSubmit" @cancel="handleAdjustAmountCancel" @close="handleAdjustAmountClose">
|
||||
<el-form :model="adjustAmountForm" :rules="adjustAmountRules" ref="adjustAmountFormRef" label-width="120px">
|
||||
<el-form-item label="账号名" prop="username">
|
||||
<el-input v-model="adjustAmountForm.username" disabled />
|
||||
|
|
@ -116,11 +78,8 @@
|
|||
<el-input v-model="adjustAmountForm.currentBalance" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="调整金额" prop="adjustAmount">
|
||||
<el-input
|
||||
v-model="adjustAmountForm.adjustAmount"
|
||||
placeholder="请输入调整金额(可为负数)"
|
||||
@input="handleAdjustAmountInput"
|
||||
/>
|
||||
<el-input v-model="adjustAmountForm.adjustAmount" placeholder="请输入调整金额(可为负数)"
|
||||
@input="handleAdjustAmountInput" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调整后余额" prop="afterBalance">
|
||||
<el-input v-model="adjustAmountForm.afterBalance" disabled />
|
||||
|
|
@ -137,7 +96,7 @@ defineOptions({
|
|||
// 组件
|
||||
import ClientSearch from '@/components/common/Search.vue'
|
||||
import ClientTable from '@/components/common/Table.vue'
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
import ClientPagination from '@/components/common/Pagination.vue'
|
||||
import ClientDialog from '@/components/common/Dialog.vue'
|
||||
import ClientForm from '@/components/common/Form.vue'
|
||||
|
|
@ -174,6 +133,8 @@ const clientSearchForm = ref({
|
|||
})
|
||||
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
const { buttonLoading: adjustAmountLoading, startButtonLoading: startAdjustAmountLoading, stopButtonLoading: stopAdjustAmountLoading } = useButtonLoading()
|
||||
/**
|
||||
* @description 定义表格数据
|
||||
*/
|
||||
|
|
@ -283,6 +244,7 @@ const mapObjectToOptions = (obj: Record<string, string>) => {
|
|||
* @description 统一获取数据方法
|
||||
*/
|
||||
const getClientList = async () => {
|
||||
try {
|
||||
startLoading()
|
||||
const params = {
|
||||
page: currentPage.value,
|
||||
|
|
@ -309,9 +271,11 @@ const getClientList = async () => {
|
|||
}))
|
||||
total.value = Number(data.total)
|
||||
//分页数据
|
||||
stopLoading()
|
||||
currentPage.value = Number(data.current_page)
|
||||
pageSize.value = Number(data.per_page)
|
||||
} finally {
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 获取客户表单选项
|
||||
|
|
@ -356,11 +320,8 @@ onMounted(async () => {
|
|||
* @description 搜索方法
|
||||
*/
|
||||
const handleSearch = async () => {
|
||||
try {
|
||||
|
||||
await getClientList()
|
||||
} catch (err) {
|
||||
console.error('获取客户列表失败', err)
|
||||
}
|
||||
}
|
||||
const handleReset = async () => {
|
||||
// 重置搜索表单
|
||||
|
|
@ -370,11 +331,7 @@ const handleReset = async () => {
|
|||
startDateTime: '',
|
||||
endDateTime: '',
|
||||
}
|
||||
try {
|
||||
await getClientList()
|
||||
} catch (err) {
|
||||
console.error('获取客户列表失败', err)
|
||||
}
|
||||
}
|
||||
// 添加客户
|
||||
const handleAdd = () => {
|
||||
|
|
@ -435,8 +392,9 @@ const handlePaginationChange = (page: { currentPage: number; pageSize: number })
|
|||
* @description 客户弹窗方法
|
||||
*/
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await clientFormRef.value?.validate()
|
||||
startSubmitLoading()
|
||||
try {
|
||||
if (dialogType.value === 'add') {
|
||||
const params = {
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
|
|
@ -464,6 +422,8 @@ const handleSubmit = async () => {
|
|||
}
|
||||
} catch (err) {
|
||||
console.error('客户表单验证失败', err)
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
const handleCancel = () => {
|
||||
|
|
@ -501,16 +461,19 @@ const handleAdjustAmountInput = () => {
|
|||
|
||||
// 提交调整金额
|
||||
const handleAdjustAmountSubmit = async () => {
|
||||
try {
|
||||
await adjustAmountFormRef.value?.validate()
|
||||
startAdjustAmountLoading()
|
||||
try {
|
||||
await updateCapitalApi({
|
||||
target_user_id: adjustUserId.value,
|
||||
amount: adjustAmountForm.value.adjustAmount,
|
||||
})
|
||||
await getClientList()
|
||||
adjustAmountVisible.value = false
|
||||
} catch (err) {
|
||||
console.error('调整金额表单验证失败', err)
|
||||
} finally {
|
||||
adjustAmountVisible.value = false
|
||||
stopAdjustAmountLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -526,8 +489,8 @@ const handleAdjustAmountClose = () => {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.client{
|
||||
}
|
||||
.client {}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<!-- 搜索 -->
|
||||
<NoticeSearch
|
||||
:search-form="searchForm"
|
||||
:buttonLoading="loading"
|
||||
:search-options="searchOptions"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
|
|
@ -55,6 +56,7 @@
|
|||
:title="dialogTitle"
|
||||
:type="dialogType"
|
||||
:show-footer="dialogType !== 'view'"
|
||||
:button-loading="submitLoading"
|
||||
@confirm="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
@close="handleClose"
|
||||
|
|
@ -99,8 +101,9 @@
|
|||
defineOptions({
|
||||
name: 'Notice'
|
||||
})
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
|
||||
// 组件
|
||||
import NoticeSearch from '@/components/common/Search.vue'
|
||||
|
|
@ -345,6 +348,8 @@ const handlePaginationChange = async (page: { currentPage: number; pageSize: num
|
|||
* @description: 定义弹窗方法
|
||||
*/
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
await noticeFormRef.value.validate()
|
||||
if (dialogType.value === 'create') {
|
||||
noticeForm.value.noticeContent = valueHtml.value
|
||||
|
|
@ -368,6 +373,9 @@ const handleSubmit = async () => {
|
|||
dialogVisible.value = false
|
||||
getNoticeList()
|
||||
}
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
|
||||
const handleCancel = () => {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<!-- 搜索 -->
|
||||
<VarietySearch
|
||||
:search-form="searchForm"
|
||||
:buttonLoading="loading"
|
||||
:search-options="searchOptions"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
|
|
@ -43,6 +44,7 @@
|
|||
:visible="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
:type="dialogType"
|
||||
:button-loading="submitLoading"
|
||||
@confirm="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
@close="handleClose"
|
||||
|
|
@ -95,8 +97,9 @@ defineOptions({
|
|||
name: 'Variety'
|
||||
})
|
||||
// 组件
|
||||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import { usePageLoading, useButtonLoading } from '@/composables/useLoading'
|
||||
const { loading, startLoading, stopLoading } = usePageLoading()
|
||||
const { buttonLoading: submitLoading, startButtonLoading: startSubmitLoading, stopButtonLoading: stopSubmitLoading } = useButtonLoading()
|
||||
|
||||
import VarietySearch from '@/components/common/Search.vue'
|
||||
import VarietyTable from '@/components/common/Table.vue'
|
||||
|
|
@ -443,6 +446,8 @@ const beforeUpload = (file: File) => {
|
|||
* @description: 定义弹窗方法
|
||||
*/
|
||||
const handleSubmit = async () => {
|
||||
startSubmitLoading()
|
||||
try {
|
||||
await varietyFormRef.value?.validate()
|
||||
console.log(varietyForm.value)
|
||||
const params = {
|
||||
|
|
@ -484,6 +489,9 @@ const handleSubmit = async () => {
|
|||
await getVarietyList()
|
||||
}
|
||||
dialogVisible.value = false
|
||||
} finally {
|
||||
stopSubmitLoading()
|
||||
}
|
||||
}
|
||||
const handleCancel = () => {
|
||||
dialogVisible.value = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue