Browse Source

限额相关修改

main
GhubCy 1 month ago
parent
commit
97a1cfa5e8
  1. 44
      src/api/business/walletLimitConfig.js
  2. 276
      src/languages/en.js
  3. 42
      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'
})
}

276
src/languages/en.js

@ -135,7 +135,9 @@ export default {
'代理管理': 'Agent Management', '代理管理': 'Agent Management',
'代理商注册': 'Agent Registration', '代理商注册': 'Agent Registration',
'代理商信息': 'Agent Information', '代理商信息': 'Agent Information',
'代理商认证': 'Agent Certification' '代理商认证': 'Agent Certification',
'限额配置': 'Limit the allocation',
'钱包限额': 'Wallet limits',
}, },
system: { system: {
common: {}, common: {},
@ -397,130 +399,130 @@ export default {
addTitle: 'Add User Behavior Statistical Aggregation', addTitle: 'Add User Behavior Statistical Aggregation',
editTitle: 'Edit User Behavior Statistical Aggregation', editTitle: 'Edit User Behavior Statistical Aggregation',
detailTitle: 'User Behavior Statistical Aggregation Details', detailTitle: 'User Behavior Statistical Aggregation Details',
dimensionTypeLabel : "Dimension Type", dimensionTypeLabel: 'Dimension Type',
realNameAuth : "Real - Name Authentication", realNameAuth: 'Real - Name Authentication',
visitPage : "Visit Page", visitPage: 'Visit Page',
clickOperation : "Click Operation", clickOperation: 'Click Operation',
logout : "Log Out", logout: 'Log Out',
payment : "Payment", payment: 'Payment',
login : "Log In" login: 'Log In'
}, },
userBehaviorLog: { userBehaviorLog: {
idLabel: "ID", idLabel: 'ID',
userNameLabel: "User Name", userNameLabel: 'User Name',
uaLabel: "User Agent", uaLabel: 'User Agent',
behaviorLog: "User Behavior Log", behaviorLog: 'User Behavior Log',
userIdLabel: "User ID", userIdLabel: 'User ID',
userIdPlaceholder: "Please enter the user ID", userIdPlaceholder: 'Please enter the user ID',
ipLabel: "IP Address", ipLabel: 'IP Address',
ipPlaceholder: "Please enter the IP address", ipPlaceholder: 'Please enter the IP address',
behaviorTypeLabel: "Behavior Type", behaviorTypeLabel: 'Behavior Type',
behaviorTypePlaceholder: "Please select the behavior type", behaviorTypePlaceholder: 'Please select the behavior type',
deviceTypeLabel: "Device Type", deviceTypeLabel: 'Device Type',
deviceTypePlaceholder: "Please select the device type", deviceTypePlaceholder: 'Please select the device type',
platformLabel: "Platform Type", platformLabel: 'Platform Type',
platformPlaceholder: "Please select the platform type", platformPlaceholder: 'Please select the platform type',
operationLabel: "Operation", operationLabel: 'Operation',
addTitle: "Add User Behavior Log", addTitle: 'Add User Behavior Log',
editTitle: "Edit User Behavior Log", editTitle: 'Edit User Behavior Log',
detailUserIdLabel: "User ID", detailUserIdLabel: 'User ID',
detailUserNameLabel: "User Name", detailUserNameLabel: 'User Name',
detailIpLabel: "IP Address", detailIpLabel: 'IP Address',
detailUaLabel: "User Agent", detailUaLabel: 'User Agent',
detailBehaviorTypeLabel: "Behavior Type", detailBehaviorTypeLabel: 'Behavior Type',
detailDeviceTypeLabel: "Device Type", detailDeviceTypeLabel: 'Device Type',
detailPlatformLabel: "Platform Type", detailPlatformLabel: 'Platform Type',
userIdRequired: "The user ID cannot be empty", userIdRequired: 'The user ID cannot be empty',
userIdMustNumber: "The user ID must be a number", userIdMustNumber: 'The user ID must be a number',
loginLabel: "Log In", loginLabel: 'Log In',
paymentLabel: "Payment", paymentLabel: 'Payment',
realNameAuthLabel: "Real - Name Authentication", realNameAuthLabel: 'Real - Name Authentication',
clickOperationLabel: "Click Operation", clickOperationLabel: 'Click Operation',
visitPageLabel: "Visit Page", visitPageLabel: 'Visit Page',
logoutLabel: "Log Out", logoutLabel: 'Log Out',
mobileDeviceLabel: "Mobile Device", mobileDeviceLabel: 'Mobile Device',
tabletDeviceLabel: "Tablet Device" tabletDeviceLabel: 'Tablet Device'
} }
}, },
customerSupport: { customerSupport: {
faq: { faq: {
questionDesc: "Question Description", questionDesc: 'Question Description',
enterQuestionDesc: "Please enter the question description", enterQuestionDesc: 'Please enter the question description',
answerContent: "Answer Content", answerContent: 'Answer Content',
enterAnswerContent: "Please enter the answer content", enterAnswerContent: 'Please enter the answer content',
category: "Category", category: 'Category',
selectCategory: "Please select the category", selectCategory: 'Please select the category',
status: "Status", status: 'Status',
selectStatus: "Please select the status", selectStatus: 'Please select the status',
search: "Search", search: 'Search',
reset: "Reset", reset: 'Reset',
add: "Add", add: 'Add',
edit: "Edit", edit: 'Edit',
delete: "Delete", delete: 'Delete',
export: "Export", export: 'Export',
id: "ID", id: 'ID',
detail: "Details", detail: 'Details',
addTitle: "Add Frequently Asked Questions and Answers", addTitle: 'Add Frequently Asked Questions and Answers',
editTitle: "Edit Frequently Asked Questions and Answers", editTitle: 'Edit Frequently Asked Questions and Answers',
detailTitle: "Frequently Asked Questions and Answers Details", detailTitle: 'Frequently Asked Questions and Answers Details',
confirm: "Confirm", confirm: 'Confirm',
cancel: "Cancel", cancel: 'Cancel',
close: "Close", close: 'Close',
categoryPayment: "Payment Issues", categoryPayment: 'Payment Issues',
categoryAccount: "Account Issues", categoryAccount: 'Account Issues',
categoryTrade: "Transaction Issues", categoryTrade: 'Transaction Issues',
categoryTechOrPoints: "Technical or Points Issues", categoryTechOrPoints: 'Technical or Points Issues',
invalid: "Invalid", invalid: 'Invalid',
valid: "Valid", valid: 'Valid',
questionRequired: "The question description cannot be empty", questionRequired: 'The question description cannot be empty',
answerRequired: "The answer content cannot be empty", answerRequired: 'The answer content cannot be empty',
categoryRequired: "The category cannot be empty", categoryRequired: 'The category cannot be empty',
statusRequired: "The status cannot be empty", statusRequired: 'The status cannot be empty',
updateSuccess: "Edit successful", updateSuccess: 'Edit successful',
addSuccess: "Add successful", addSuccess: 'Add successful',
deleteConfirm: "Are you sure you want to delete?", deleteConfirm: 'Are you sure you want to delete?',
deleteSuccess: "Delete successful" deleteSuccess: 'Delete successful'
}, },
customerServiceChat: { customerServiceChat: {
id: "ID", id: 'ID',
senderType: "Sender Type", senderType: 'Sender Type',
operation: "Operation", operation: 'Operation',
sessionId: "Session ID", sessionId: 'Session ID',
sessionIdPlaceholder: "Please enter the session ID", sessionIdPlaceholder: 'Please enter the session ID',
userId: "User ID", userId: 'User ID',
userIdPlaceholder: "Please enter the user ID", userIdPlaceholder: 'Please enter the user ID',
message: "Message Content", message: 'Message Content',
messagePlaceholder: "Please enter the message content", messagePlaceholder: 'Please enter the message content',
timestamp: "Timestamp", timestamp: 'Timestamp',
timestampPlaceholder: "Please select the time", timestampPlaceholder: 'Please select the time',
isRead: "Is Read", isRead: 'Is Read',
isReadPlaceholder: "Please select whether it has been read", isReadPlaceholder: 'Please select whether it has been read',
isReadYes: "Read", isReadYes: 'Read',
isReadNo: "Unread", isReadNo: 'Unread',
search: "Search", search: 'Search',
reset: "Reset", reset: 'Reset',
addTitle: "Add Chat Record between Customer Service and User", addTitle: 'Add Chat Record between Customer Service and User',
detailTitle: "View Chat Record Details between Customer Service and User", detailTitle: 'View Chat Record Details between Customer Service and User',
updateTitle: "Edit Chat Record between Customer Service and User", updateTitle: 'Edit Chat Record between Customer Service and User',
sessionIdLabel: "Session ID", sessionIdLabel: 'Session ID',
userIdLabel: "User ID", userIdLabel: 'User ID',
messageLabel: "Message Content", messageLabel: 'Message Content',
timestampLabel: "Timestamp", timestampLabel: 'Timestamp',
isReadLabel: "Is Read", isReadLabel: 'Is Read',
required: "Required field", required: 'Required field',
sessionIdRequired: "The session ID cannot be empty", sessionIdRequired: 'The session ID cannot be empty',
userIdRequired: "The user ID cannot be empty", userIdRequired: 'The user ID cannot be empty',
messageRequired: "The message content cannot be empty", messageRequired: 'The message content cannot be empty',
senderTypeRequired: "The sender type cannot be empty", senderTypeRequired: 'The sender type cannot be empty',
timestampRequired: "The timestamp cannot be empty", timestampRequired: 'The timestamp cannot be empty',
isReadRequired: "Whether it has been read cannot be empty", isReadRequired: 'Whether it has been read cannot be empty',
updateSuccess: "Edit successful", updateSuccess: 'Edit successful',
addSuccess: "Add successful", addSuccess: 'Add successful',
deleteConfirmPrefix: "Are you sure you want to delete the record with ID ", deleteConfirmPrefix: 'Are you sure you want to delete the record with ID ',
deleteConfirmSuffix: "?", deleteConfirmSuffix: '?',
deleteSuccess: "Delete successful" deleteSuccess: 'Delete successful'
}, },
commonFeedback: { commonFeedback: {
@ -1481,8 +1483,48 @@ export default {
collection: 'Collection', collection: 'Collection',
paymentOut: 'Payment' 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: { public: {
commonInfo: { commonInfo: {
version: 'Version', version: 'Version',
@ -1742,8 +1784,8 @@ export default {
legalPersonIdCardPattern: 'Please enter valid ID card number', legalPersonIdCardPattern: 'Please enter valid ID card number',
failureReasonRequired: 'Failure reason cannot be empty', failureReasonRequired: 'Failure reason cannot be empty',
deleteConfirm: 'Confirm deletion of selected {ids} data entries?', deleteConfirm: 'Confirm deletion of selected {ids} data entries?',
rejectConfirm: 'Confirm rejection of authentication application for "{agentName}"?', rejectConfirm: 'Confirm rejection of authentication application for',
passConfirm: 'Confirm approval of authentication application for "{agentName}"?', passConfirm: 'Confirm approval of authentication application for ?',
addSuccess: 'Add successful', addSuccess: 'Add successful',
updateSuccess: 'Update successful', updateSuccess: 'Update successful',
deleteSuccess: 'Delete successful', deleteSuccess: 'Delete successful',

42
src/languages/zh.js

@ -136,6 +136,8 @@ export default {
'代理商注册': '代理商注册', '代理商注册': '代理商注册',
'代理商信息': '代理商信息', '代理商信息': '代理商信息',
'代理商认证': '代理商认证', '代理商认证': '代理商认证',
'限额配置': '限额配置',
'钱包限额': '钱包限额',
}, },
system: { system: {
common: {}, common: {},
@ -1481,8 +1483,48 @@ export default {
collection: '收款', collection: '收款',
paymentOut: '付款' 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: { public: {
commonInfo: { commonInfo: {
version: '版本', version: '版本',

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