Browse Source

限额相关修改

main
GhubCy 1 month ago
parent
commit
97a1cfa5e8
  1. 44
      src/api/business/walletLimitConfig.js
  2. 290
      src/languages/en.js
  3. 44
      src/languages/zh.js
  4. 512
      src/views/business/walletLimitConfig/index.vue

44
src/api/business/walletLimitConfig.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询钱包限制配置列表
export function listWalletLimitConfig(query) {
return request({
url: '/business/walletLimitConfig/list',
method: 'get',
params: query
})
}
// 查询钱包限制配置详细
export function getWalletLimitConfig(id) {
return request({
url: '/business/walletLimitConfig/' + id,
method: 'get'
})
}
// 新增钱包限制配置
export function addWalletLimitConfig(data) {
return request({
url: '/business/walletLimitConfig',
method: 'post',
data: data
})
}
// 修改钱包限制配置
export function updateWalletLimitConfig(data) {
return request({
url: '/business/walletLimitConfig',
method: 'put',
data: data
})
}
// 删除钱包限制配置
export function delWalletLimitConfig(id) {
return request({
url: '/business/walletLimitConfig/' + id,
method: 'delete'
})
}

290
src/languages/en.js

@ -135,7 +135,9 @@ export default {
'代理管理': 'Agent Management',
'代理商注册': 'Agent Registration',
'代理商信息': 'Agent Information',
'代理商认证': 'Agent Certification'
'代理商认证': 'Agent Certification',
'限额配置': 'Limit the allocation',
'钱包限额': 'Wallet limits',
},
system: {
common: {},
@ -182,12 +184,12 @@ export default {
business: {
financial: {
financialRecord: {
orderIdLabel : 'Order ID',
orderIdLabel: 'Order ID',
amountLabel: 'Amount',
currencyLabel: 'Currency Unit',
descriptionLabel: 'Description Information',
inputAmount: 'Please enter the amount',
inputContent : 'Please enter the description information',
inputContent: 'Please enter the description information',
inputUserId: 'Please enter the user ID',
inputOrderId: 'Please enter the relevant order ID',
inputCurrency: 'Please enter the currency unit',
@ -346,9 +348,9 @@ export default {
actionTypeRequired: 'The action type cannot be empty',
riskIdMustNumber: 'The risk ID must be a number',
fromId: 'Source ID',
notifyUser:'Notify User',
pauseAndContact:'Pause and Contact',
enhanceAuth:'Enhanced Authentication',
notifyUser: 'Notify User',
pauseAndContact: 'Pause and Contact',
enhanceAuth: 'Enhanced Authentication',
},
userBehaviorRuleRisk: {
ruleName: 'Rule Name',
@ -375,7 +377,7 @@ export default {
triggerCondition: 'Trigger Condition',
ruleNameLabel: 'Rule Name',
priorityLabel: 'Rule Priority',
descriptionLabel : 'Rule Description',
descriptionLabel: 'Rule Description',
isEnabledLabel: 'Is Enabled',
}
@ -397,130 +399,130 @@ export default {
addTitle: 'Add User Behavior Statistical Aggregation',
editTitle: 'Edit User Behavior Statistical Aggregation',
detailTitle: 'User Behavior Statistical Aggregation Details',
dimensionTypeLabel : "Dimension Type",
realNameAuth : "Real - Name Authentication",
visitPage : "Visit Page",
clickOperation : "Click Operation",
logout : "Log Out",
payment : "Payment",
login : "Log In"
dimensionTypeLabel: 'Dimension Type',
realNameAuth: 'Real - Name Authentication',
visitPage: 'Visit Page',
clickOperation: 'Click Operation',
logout: 'Log Out',
payment: 'Payment',
login: 'Log In'
},
userBehaviorLog: {
idLabel: "ID",
userNameLabel: "User Name",
uaLabel: "User Agent",
behaviorLog: "User Behavior Log",
userIdLabel: "User ID",
userIdPlaceholder: "Please enter the user ID",
ipLabel: "IP Address",
ipPlaceholder: "Please enter the IP address",
behaviorTypeLabel: "Behavior Type",
behaviorTypePlaceholder: "Please select the behavior type",
deviceTypeLabel: "Device Type",
deviceTypePlaceholder: "Please select the device type",
platformLabel: "Platform Type",
platformPlaceholder: "Please select the platform type",
operationLabel: "Operation",
addTitle: "Add User Behavior Log",
editTitle: "Edit User Behavior Log",
detailUserIdLabel: "User ID",
detailUserNameLabel: "User Name",
detailIpLabel: "IP Address",
detailUaLabel: "User Agent",
detailBehaviorTypeLabel: "Behavior Type",
detailDeviceTypeLabel: "Device Type",
detailPlatformLabel: "Platform Type",
userIdRequired: "The user ID cannot be empty",
userIdMustNumber: "The user ID must be a number",
loginLabel: "Log In",
paymentLabel: "Payment",
realNameAuthLabel: "Real - Name Authentication",
clickOperationLabel: "Click Operation",
visitPageLabel: "Visit Page",
logoutLabel: "Log Out",
mobileDeviceLabel: "Mobile Device",
tabletDeviceLabel: "Tablet Device"
idLabel: 'ID',
userNameLabel: 'User Name',
uaLabel: 'User Agent',
behaviorLog: 'User Behavior Log',
userIdLabel: 'User ID',
userIdPlaceholder: 'Please enter the user ID',
ipLabel: 'IP Address',
ipPlaceholder: 'Please enter the IP address',
behaviorTypeLabel: 'Behavior Type',
behaviorTypePlaceholder: 'Please select the behavior type',
deviceTypeLabel: 'Device Type',
deviceTypePlaceholder: 'Please select the device type',
platformLabel: 'Platform Type',
platformPlaceholder: 'Please select the platform type',
operationLabel: 'Operation',
addTitle: 'Add User Behavior Log',
editTitle: 'Edit User Behavior Log',
detailUserIdLabel: 'User ID',
detailUserNameLabel: 'User Name',
detailIpLabel: 'IP Address',
detailUaLabel: 'User Agent',
detailBehaviorTypeLabel: 'Behavior Type',
detailDeviceTypeLabel: 'Device Type',
detailPlatformLabel: 'Platform Type',
userIdRequired: 'The user ID cannot be empty',
userIdMustNumber: 'The user ID must be a number',
loginLabel: 'Log In',
paymentLabel: 'Payment',
realNameAuthLabel: 'Real - Name Authentication',
clickOperationLabel: 'Click Operation',
visitPageLabel: 'Visit Page',
logoutLabel: 'Log Out',
mobileDeviceLabel: 'Mobile Device',
tabletDeviceLabel: 'Tablet Device'
}
},
customerSupport: {
faq: {
questionDesc: "Question Description",
enterQuestionDesc: "Please enter the question description",
answerContent: "Answer Content",
enterAnswerContent: "Please enter the answer content",
category: "Category",
selectCategory: "Please select the category",
status: "Status",
selectStatus: "Please select the status",
search: "Search",
reset: "Reset",
add: "Add",
edit: "Edit",
delete: "Delete",
export: "Export",
id: "ID",
detail: "Details",
addTitle: "Add Frequently Asked Questions and Answers",
editTitle: "Edit Frequently Asked Questions and Answers",
detailTitle: "Frequently Asked Questions and Answers Details",
confirm: "Confirm",
cancel: "Cancel",
close: "Close",
categoryPayment: "Payment Issues",
categoryAccount: "Account Issues",
categoryTrade: "Transaction Issues",
categoryTechOrPoints: "Technical or Points Issues",
invalid: "Invalid",
valid: "Valid",
questionRequired: "The question description cannot be empty",
answerRequired: "The answer content cannot be empty",
categoryRequired: "The category cannot be empty",
statusRequired: "The status cannot be empty",
updateSuccess: "Edit successful",
addSuccess: "Add successful",
deleteConfirm: "Are you sure you want to delete?",
deleteSuccess: "Delete successful"
questionDesc: 'Question Description',
enterQuestionDesc: 'Please enter the question description',
answerContent: 'Answer Content',
enterAnswerContent: 'Please enter the answer content',
category: 'Category',
selectCategory: 'Please select the category',
status: 'Status',
selectStatus: 'Please select the status',
search: 'Search',
reset: 'Reset',
add: 'Add',
edit: 'Edit',
delete: 'Delete',
export: 'Export',
id: 'ID',
detail: 'Details',
addTitle: 'Add Frequently Asked Questions and Answers',
editTitle: 'Edit Frequently Asked Questions and Answers',
detailTitle: 'Frequently Asked Questions and Answers Details',
confirm: 'Confirm',
cancel: 'Cancel',
close: 'Close',
categoryPayment: 'Payment Issues',
categoryAccount: 'Account Issues',
categoryTrade: 'Transaction Issues',
categoryTechOrPoints: 'Technical or Points Issues',
invalid: 'Invalid',
valid: 'Valid',
questionRequired: 'The question description cannot be empty',
answerRequired: 'The answer content cannot be empty',
categoryRequired: 'The category cannot be empty',
statusRequired: 'The status cannot be empty',
updateSuccess: 'Edit successful',
addSuccess: 'Add successful',
deleteConfirm: 'Are you sure you want to delete?',
deleteSuccess: 'Delete successful'
},
customerServiceChat: {
id: "ID",
senderType: "Sender Type",
operation: "Operation",
sessionId: "Session ID",
sessionIdPlaceholder: "Please enter the session ID",
userId: "User ID",
userIdPlaceholder: "Please enter the user ID",
message: "Message Content",
messagePlaceholder: "Please enter the message content",
timestamp: "Timestamp",
timestampPlaceholder: "Please select the time",
isRead: "Is Read",
isReadPlaceholder: "Please select whether it has been read",
isReadYes: "Read",
isReadNo: "Unread",
search: "Search",
reset: "Reset",
addTitle: "Add Chat Record between Customer Service and User",
detailTitle: "View Chat Record Details between Customer Service and User",
updateTitle: "Edit Chat Record between Customer Service and User",
sessionIdLabel: "Session ID",
userIdLabel: "User ID",
messageLabel: "Message Content",
timestampLabel: "Timestamp",
isReadLabel: "Is Read",
required: "Required field",
sessionIdRequired: "The session ID cannot be empty",
userIdRequired: "The user ID cannot be empty",
messageRequired: "The message content cannot be empty",
senderTypeRequired: "The sender type cannot be empty",
timestampRequired: "The timestamp cannot be empty",
isReadRequired: "Whether it has been read cannot be empty",
updateSuccess: "Edit successful",
addSuccess: "Add successful",
deleteConfirmPrefix: "Are you sure you want to delete the record with ID ",
deleteConfirmSuffix: "?",
deleteSuccess: "Delete successful"
id: 'ID',
senderType: 'Sender Type',
operation: 'Operation',
sessionId: 'Session ID',
sessionIdPlaceholder: 'Please enter the session ID',
userId: 'User ID',
userIdPlaceholder: 'Please enter the user ID',
message: 'Message Content',
messagePlaceholder: 'Please enter the message content',
timestamp: 'Timestamp',
timestampPlaceholder: 'Please select the time',
isRead: 'Is Read',
isReadPlaceholder: 'Please select whether it has been read',
isReadYes: 'Read',
isReadNo: 'Unread',
search: 'Search',
reset: 'Reset',
addTitle: 'Add Chat Record between Customer Service and User',
detailTitle: 'View Chat Record Details between Customer Service and User',
updateTitle: 'Edit Chat Record between Customer Service and User',
sessionIdLabel: 'Session ID',
userIdLabel: 'User ID',
messageLabel: 'Message Content',
timestampLabel: 'Timestamp',
isReadLabel: 'Is Read',
required: 'Required field',
sessionIdRequired: 'The session ID cannot be empty',
userIdRequired: 'The user ID cannot be empty',
messageRequired: 'The message content cannot be empty',
senderTypeRequired: 'The sender type cannot be empty',
timestampRequired: 'The timestamp cannot be empty',
isReadRequired: 'Whether it has been read cannot be empty',
updateSuccess: 'Edit successful',
addSuccess: 'Add successful',
deleteConfirmPrefix: 'Are you sure you want to delete the record with ID ',
deleteConfirmSuffix: '?',
deleteSuccess: 'Delete successful'
},
commonFeedback: {
@ -1481,7 +1483,47 @@ export default {
collection: 'Collection',
paymentOut: 'Payment'
}
}
},
limit: {
wallet: {
userType: 'User Type',
isActive: 'Is Active',
ruleId: 'Rule ID',
maxBalance: 'Maximum Balance',
selectUserType: 'Please select user type',
selectIsActive: 'Please select whether to enable',
inputMaxBalance: 'Please enter maximum balance',
selectUnit: 'Please select unit',
hundred: 'Hundred',
thousand: 'Thousand',
tenThousand: 'Ten Thousand',
hundredThousand: 'Hundred Thousand',
million: 'Million',
tenMillion: 'Ten Million',
hundredMillion: 'Hundred Million',
billion: 'Billion',
addTitle: 'Add Wallet Limit Configuration',
editTitle: 'Modify Wallet Limit Configuration',
detailTitle: 'Wallet Limit Configuration Details',
required: 'Required fields cannot be empty',
userTypeRequired: 'Please select user type',
maxBalanceRequired: 'Please enter maximum balance',
maxBalanceNumber: 'Maximum balance must be a number',
unitRequired: 'Please select unit',
isActiveRequired: 'Please select whether to enable',
createByRequired: 'Creator cannot be empty',
updateByRequired: 'Updater cannot be empty',
updateSuccess: 'Modification successful',
addSuccess: 'Addition successful',
deleteConfirm: 'Are you sure to delete the selecte piecesof data?',
deleteSuccess: 'Deletion successful',
personal: 'Personal',
merchant: 'Merchant',
agent: 'Agent',
yes: 'Yes',
no: 'No',
}
},
},
public: {
commonInfo: {
@ -1742,8 +1784,8 @@ export default {
legalPersonIdCardPattern: 'Please enter valid ID card number',
failureReasonRequired: 'Failure reason cannot be empty',
deleteConfirm: 'Confirm deletion of selected {ids} data entries?',
rejectConfirm: 'Confirm rejection of authentication application for "{agentName}"?',
passConfirm: 'Confirm approval of authentication application for "{agentName}"?',
rejectConfirm: 'Confirm rejection of authentication application for',
passConfirm: 'Confirm approval of authentication application for ?',
addSuccess: 'Add successful',
updateSuccess: 'Update successful',
deleteSuccess: 'Delete successful',

44
src/languages/zh.js

@ -136,6 +136,8 @@ export default {
'代理商注册': '代理商注册',
'代理商信息': '代理商信息',
'代理商认证': '代理商认证',
'限额配置': '限额配置',
'钱包限额': '钱包限额',
},
system: {
common: {},
@ -1481,7 +1483,47 @@ export default {
collection: '收款',
paymentOut: '付款'
}
}
},
limit: {
wallet: {
userType: '用户类型',
isActive: '是否启用',
ruleId: '规则ID',
maxBalance: '最大余额',
selectUserType: '请选择用户类型',
selectIsActive: '请选择是否启用',
inputMaxBalance: '请输入最大余额',
selectUnit: '请选择单位',
hundred: '百',
thousand: '千',
tenThousand: '万',
hundredThousand: '十万',
million: '百万',
tenMillion: '千万',
hundredMillion: '亿',
billion: '十亿',
addTitle: '添加钱包限制配置',
editTitle: '修改钱包限制配置',
detailTitle: '钱包限制配置详情',
required: '必填项不能为空',
userTypeRequired: '请选择用户类型',
maxBalanceRequired: '请输入最大余额',
maxBalanceNumber: '最大余额必须为数字',
unitRequired: '请选择单位',
isActiveRequired: '请选择是否启用',
createByRequired: '创建人不能为空',
updateByRequired: '更新人不能为空',
updateSuccess: '修改成功',
addSuccess: '添加成功',
deleteConfirm: '确认删除选中的数据吗?',
deleteSuccess: '删除成功',
personal:'个人',
merchant:'商户',
agent:'代理',
yes:'启用',
no:'禁用',
}
},
},
public: {
commonInfo: {

512
src/views/business/walletLimitConfig/index.vue

@ -0,0 +1,512 @@
<template>
<div class="app-container">
<!-- 搜索列 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('business.deal.limit.wallet.userType')" prop="userType" label-width="100px">
<el-select v-model="queryParams.userType" :placeholder="$t('business.deal.limit.wallet.selectUserType')"
clearable filterable>
<el-option
v-for="item in userTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('business.deal.limit.wallet.isActive')" prop="isActive" label-width="150px">
<el-select v-model="queryParams.isActive" :placeholder="$t('business.deal.limit.wallet.selectIsActive')"
clearable filterable>
<el-option
v-for="item in isActiveOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
{{ $t('common.button.search') }}
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.button.reset') }}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['business:walletLimitConfig:add']"
>{{ $t('common.button.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['business:walletLimitConfig:edit']"
>{{ $t('common.button.edit') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['business:walletLimitConfig:remove']"
>{{ $t('common.button.delete') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['business:walletLimitConfig:export']"
>{{ $t('common.button.export') }}
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 表格列 -->
<el-table v-loading="loading" :data="walletLimitConfigList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column :label="$t('business.deal.limit.wallet.ruleId')" align="center" prop="id" v-if="true"/>
<el-table-column :label="$t('business.deal.limit.wallet.userType')" align="center" prop="userType">
<template slot-scope="scope">
<!-- <dict-tag :options="userTypeOptions || []" :value="scope.row.userType"/>-->
{{ scope.row.userType === 0 ? '个人' : (scope.row.userType === 1 ? '商户' : '代理')}}
</template>
</el-table-column>
<el-table-column :label="$t('business.deal.limit.wallet.maxBalance')" align="center" prop="maxBalance">
<template slot-scope="scope">
{{ formatBalance(scope.row.maxBalance) }}
</template>
</el-table-column>
<el-table-column :label="$t('business.deal.limit.wallet.isActive')" align="center" prop="isActive">
<template slot-scope="scope">
<!-- <dict-tag :options="isActiveOptions || []" :value="scope.row.isActive"/>-->
{{ scope.row.isActive === 1 ? '是' : '否'}}
</template>
</el-table-column>
<el-table-column :label="$t('common.tableMsg.operation')" align="center" width="200"
class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDetail(scope.row)"
>{{ $t('common.button.detail') }}
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['business:walletLimitConfig:edit']"
>{{ $t('common.button.edit') }}
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['business:walletLimitConfig:remove']"
>{{ $t('common.button.delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改钱包限制配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
<el-form-item :label="$t('business.deal.limit.wallet.userType')" prop="userType">
<el-select v-model="form.userType" :placeholder="$t('business.deal.limit.wallet.selectUserType')">
<el-option
v-for="item in userTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('business.deal.limit.wallet.maxBalance')" prop="maxBalance">
<el-input-number
v-model="form.maxBalanceValue"
:min="0"
:precision="2"
:step="1"
controls-position="right"
style="width: 200px"
:placeholder="$t('business.deal.limit.wallet.inputMaxBalance')"
/>
<el-select
v-model="form.maxBalanceUnit"
style="width: 100px; margin-left: 10px"
:placeholder="$t('business.deal.limit.wallet.selectUnit')"
@change="handleUnitChange"
>
<el-option :label="$t('business.deal.limit.wallet.hundred')" value="100"/>
<el-option :label="$t('business.deal.limit.wallet.thousand')" value="1000"/>
<el-option :label="$t('business.deal.limit.wallet.tenThousand')" value="10000"/>
<el-option :label="$t('business.deal.limit.wallet.hundredThousand')" value="100000"/>
<el-option :label="$t('business.deal.limit.wallet.million')" value="1000000"/>
<el-option :label="$t('business.deal.limit.wallet.tenMillion')" value="10000000"/>
<el-option :label="$t('business.deal.limit.wallet.hundredMillion')" value="100000000"/>
<el-option :label="$t('business.deal.limit.wallet.billion')" value="1000000000"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('business.deal.limit.wallet.isActive')" prop="isActive">
<el-select v-model="form.isActive" :placeholder="$t('business.deal.limit.wallet.selectIsActive')"
clearable filterable>
<el-option
v-for="item in isActiveOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">
{{ $t('common.button.confirm') }}
</el-button>
<el-button @click="cancel">{{ $t('common.button.cancel') }}</el-button>
</div>
</el-dialog>
<!-- 钱包限制配置详情 -->
<el-dialog :title="title" :visible.sync="detailOpen" width="700px" append-to-body>
<el-form ref="form" :model="form" label-width="auto">
<el-form-item :label="$t('business.deal.limit.wallet.userType') + ':'">
<dict-tag :options="userTypeOptions || []" :value="form.userType"/>
</el-form-item>
<el-form-item :label="$t('business.deal.limit.wallet.maxBalance') + ':'">
{{ formatBalance(form.maxBalance) }}
</el-form-item>
<el-form-item :label="$t('business.deal.limit.wallet.isActive') + ':'">
<dict-tag :options="isActiveOptions || []" :value="form.isActive"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">{{ $t('common.button.close') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listWalletLimitConfig,
getWalletLimitConfig,
delWalletLimitConfig,
addWalletLimitConfig,
updateWalletLimitConfig
} from "@/api/business/walletLimitConfig";
import DictTag from '@/components/DictTag';
export default {
name: "WalletLimitConfig",
components: {
DictTag
},
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
walletLimitConfigList: [],
//
title: "",
//
open: false,
//
detailOpen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userType: undefined,
maxBalance: undefined,
isActive: undefined,
},
userTypeOptions: [
{
label: this.$t('business.deal.limit.wallet.personal'),
value: 0,
raw: {listClass: "info"}
},
{
label: this.$t('business.deal.limit.wallet.merchant'),
value: 1,
raw: {listClass: "success"}
},
{
label: this.$t('business.deal.limit.wallet.agent'),
value: 2,
raw: {listClass: "warning"}
}
],
isActiveOptions: [
{
label: this.$t('business.deal.limit.wallet.yes'),
value: 1,
raw: {listClass: "success"}
},
{
label: this.$t('business.deal.limit.wallet.no'),
value: 0,
raw: {listClass: "danger"}
}
],
//
form: {},
//
rules: {
id: [
{required: true, message: this.$t('business.deal.limit.wallet.required'), trigger: "blur"}
],
userType: [
{required: true, message: this.$t('business.deal.limit.wallet.userTypeRequired'), trigger: "change"}
],
maxBalanceValue: [
{required: true, message: this.$t('business.deal.limit.wallet.maxBalanceRequired'), trigger: "blur"},
{type: 'number', message: this.$t('business.deal.limit.wallet.maxBalanceNumber'), trigger: "blur"}
],
maxBalanceUnit: [
{required: true, message: this.$t('business.deal.limit.wallet.unitRequired'), trigger: "change"}
],
isActive: [
{required: true, message: this.$t('business.deal.limit.wallet.isActiveRequired'), trigger: "blur"}
],
createBy: [
{required: true, message: this.$t('business.deal.limit.wallet.createByRequired'), trigger: "blur"}
],
updateBy: [
{required: true, message: this.$t('business.deal.limit.wallet.updateByRequired'), trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
formatBalance(balance) {
if (balance === undefined || balance === null) return '-';
const units = [
{value: 1000000000, label: this.$t('business.deal.limit.wallet.billion')},
{value: 100000000, label: this.$t('business.deal.limit.wallet.hundredMillion')},
{value: 10000000, label: this.$t('business.deal.limit.wallet.tenMillion')},
{value: 1000000, label: this.$t('business.deal.limit.wallet.million')},
{value: 100000, label: this.$t('business.deal.limit.wallet.hundredThousand')},
{value: 10000, label: this.$t('business.deal.limit.wallet.tenThousand')},
{value: 1000, label: this.$t('business.deal.limit.wallet.thousand')},
{value: 100, label: this.$t('business.deal.limit.wallet.hundred')}
];
for (const unit of units) {
if (balance >= unit.value) {
return `${(balance / unit.value).toFixed(2)} ${unit.label}`;
}
}
return `${balance.toFixed(2)}`;
},
/** 提交按钮 */
handleUnitChange() {
if (this.form.maxBalanceValue !== undefined) {
this.form.maxBalance = this.form.maxBalanceValue * Number(this.form.maxBalanceUnit);
}
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.maxBalanceValue !== undefined) {
this.form.maxBalance = this.form.maxBalanceValue * Number(this.form.maxBalanceUnit);
}
this.buttonLoading = true;
if (this.form.id != null) {
updateWalletLimitConfig(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.deal.limit.wallet.updateSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addWalletLimitConfig(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.deal.limit.wallet.addSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 查询钱包限制配置列表 */
getList() {
this.loading = true;
listWalletLimitConfig(this.queryParams).then(response => {
this.walletLimitConfigList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.detailOpen = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
userType: undefined,
maxBalance: undefined,
maxBalanceValue: undefined,
maxBalanceUnit: '10000',
isActive: undefined,
createBy: undefined,
updateBy: undefined,
createTime: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = this.$t('business.deal.limit.wallet.addTitle');
},
/** 详情按钮操作 */
handleDetail(row) {
this.reset();
this.form = row;
this.detailOpen = true;
this.title = this.$t('business.deal.limit.wallet.detailTitle');
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getWalletLimitConfig(id).then(response => {
this.loading = false;
this.form = response.data;
//
const units = [
{value: 1000000000, label: this.$t('business.deal.limit.wallet.billion')},
{value: 100000000, label: this.$t('business.deal.limit.wallet.hundredMillion')},
{value: 10000000, label: this.$t('business.deal.limit.wallet.tenMillion')},
{value: 1000000, label: this.$t('business.deal.limit.wallet.million')},
{value: 100000, label: this.$t('business.deal.limit.wallet.hundredThousand')},
{value: 10000, label: this.$t('business.deal.limit.wallet.tenThousand')},
{value: 1000, label: this.$t('business.deal.limit.wallet.thousand')},
{value: 100, label: this.$t('business.deal.limit.wallet.hundred')}
];
for (const unit of units) {
if (this.form.maxBalance >= unit.value) {
this.form.maxBalanceUnit = unit.value.toString();
this.form.maxBalanceValue = this.form.maxBalance / unit.value;
break;
}
}
//
const userType = this.userTypeOptions.find(item => item.value === this.form.userType);
if (userType) {
this.form.userTypeLabel = userType.label;
}
const isActive = this.isActiveOptions.find(item => item.value === this.form.isActive);
if (isActive) {
this.form.isActiveLabel = isActive.label;
}
this.open = true;
this.title = this.$t('business.deal.limit.wallet.editTitle');
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm(this.$t('business.deal.limit.wallet.deleteConfirm', {ids})).then(() => {
this.loading = true;
return delWalletLimitConfig(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess(this.$t('business.deal.limit.wallet.deleteSuccess'));
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('business/walletLimitConfig/export', {
...this.queryParams
}, `walletLimitConfig_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save