Browse Source

feat: 完成金豆审核的中文语言包配置

zhangrenyuan/feature-20251125114759-多语言
zhangrenyuan 3 days ago
parent
commit
3413f3a9ec
  1. 18
      src/components/locales/lang/zh-CN.js
  2. 121
      src/views/audit/bean/beanAudit.vue

18
src/components/locales/lang/zh-CN.js

@ -27,9 +27,11 @@ export default {
reject: '驳回', reject: '驳回',
cancel: '取消', cancel: '取消',
confirm: '确认', confirm: '确认',
// 币种类型
// 币种计量单位类型
SGD: '新币', SGD: '新币',
goldCoin: '金币', goldCoin: '金币',
: '条',
goldBean: '金豆',
// 对话框标题 // 对话框标题
will: '将要', will: '将要',
}, },
@ -40,8 +42,8 @@ export default {
rejectReasonPlaceholder: '请输入驳回理由', rejectReasonPlaceholder: '请输入驳回理由',
rejectSuccess: '驳回操作成功',
rejectFailed: '驳回操作失败',
rejectSuccess: '驳回成功',
rejectFailed: '驳回失败',
operationFailed: '操作失败', operationFailed: '操作失败',
approveSuccess: '审核通过成功', approveSuccess: '审核通过成功',
approveFailed: '审核通过失败', approveFailed: '审核通过失败',
@ -85,6 +87,10 @@ export default {
allRefund: '全部退款', allRefund: '全部退款',
partialRefund: '部分退款', partialRefund: '部分退款',
refundGoods: '退款商品', refundGoods: '退款商品',
// 审核通用-金豆审核列表字段补充
permanentBean: '付费金豆',
freeBean: '免费金豆',
// 金币充值审核 -------------------------------- // 金币充值审核 --------------------------------
rechargeAudit: '充值审核', rechargeAudit: '充值审核',
@ -107,7 +113,11 @@ export default {
// 金币退款审核 -------------------------------- // 金币退款审核 --------------------------------
refundAudit: '退款审核', refundAudit: '退款审核',
refundTotalGold: '退款总金币数', refundTotalGold: '退款总金币数',
// 金豆审核 ---------------------------------
totalNum: '总条数',
totalBean: '总金豆数',
permanentBean: '付费金豆',
freeBean: '免费金豆',
// 对话框的标题 // 对话框的标题
rejectRecord: '驳回该记录!', rejectRecord: '驳回该记录!',
passRecord: '通过该记录!', passRecord: '通过该记录!',

121
src/views/audit/bean/beanAudit.vue

@ -3,13 +3,13 @@
<el-col style="margin-bottom: 1vh"> <el-col style="margin-bottom: 1vh">
<div class="select"> <div class="select">
<div class="selectRow"> <div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="searchForm.jwcode" placeholder="请输入精网号"
<el-text class="text" size="large">{{ $t('common.jwcode') }}</el-text>
<el-input class="selectContent" v-model="searchForm.jwcode" :placeholder="t('common.jwcodePlaceholder')"
style="width: 12vw;margin-right:1vw" clearable /> style="width: 12vw;margin-right:1vw" clearable />
</div> </div>
<div class="selectRow"> <div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader v-model="selectedMarkets" :options="marketOptions" placeholder="请选择所属地区" clearable
<el-text class="text" size="large">{{ $t('common.market') }}</el-text>
<el-cascader v-model="selectedMarkets" :options="marketOptions" :placeholder="$t('common.marketPlaceholder')" clearable
style="width: 12vw" @change="handleMarketChange" /> style="width: 12vw" @change="handleMarketChange" />
</div> </div>
</div> </div>
@ -17,18 +17,18 @@
<el-col> <el-col>
<div class="select"> <div class="select">
<div class="selectRow" style="width: 36vw;"> <div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large" v-show="checkTab === 'pending'">提交时间</el-text>
<el-text class="text" size="large" v-show="checkTab === 'reject' || checkTab === 'pass'">审核时间</el-text>
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="开始时间"
end-placeholder="结束时间" class="selectContent" style="width: 25vw;margin-right:1vw"
<el-text class="text" size="large" v-show="checkTab === 'pending'">{{ $t('common.submitTime') }}</el-text>
<el-text class="text" size="large" v-show="checkTab === 'reject' || checkTab === 'pass'">{{ $t('common.auditTime') }}</el-text>
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="" :start-placeholder="$t('common.startTime')"
:end-placeholder="$t('common.endTime')" class="selectContent" style="width: 25vw;margin-right:1vw"
@change="handleDatePickerChange" :default-time="defaultTime" /> @change="handleDatePickerChange" :default-time="defaultTime" />
<!-- <el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>--> <!-- <el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>-->
<!-- <el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>--> <!-- <el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>-->
<!-- <el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>--> <!-- <el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>-->
</div> </div>
<div class="selectRow" style="justify-content: flex-start;"> <div class="selectRow" style="justify-content: flex-start;">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="success" @click="resetSearch">重置</el-button>
<el-button type="primary" @click="handleSearch">{{ t('common.search') }}</el-button>
<el-button type="success" @click="resetSearch">{{ t('common.reset') }}</el-button>
</div> </div>
</div> </div>
@ -40,62 +40,62 @@
<div class="custom-button-group"> <div class="custom-button-group">
<el-button v-if="hasbeanWait && hasbeanWaitShow" :type="checkTab === 'pending' ? 'primary' : 'default'" <el-button v-if="hasbeanWait && hasbeanWaitShow" :type="checkTab === 'pending' ? 'primary' : 'default'"
class="custom-tab-button" @click="adminWait"> class="custom-tab-button" @click="adminWait">
待审核
{{ $t('audit.waitAudit') }}
</el-button> </el-button>
<el-button v-if="hasbeanThrough" :type="checkTab === 'pass' ? 'primary' : 'default'" class="custom-tab-button" <el-button v-if="hasbeanThrough" :type="checkTab === 'pass' ? 'primary' : 'default'" class="custom-tab-button"
@click="adminPass"> @click="adminPass">
已通过
{{ $t('audit.passed') }}
</el-button> </el-button>
<el-button v-if="hasbeanReject" :type="checkTab === 'reject' ? 'primary' : 'default'" class="custom-tab-button" <el-button v-if="hasbeanReject" :type="checkTab === 'reject' ? 'primary' : 'default'" class="custom-tab-button"
@click="adminReject"> @click="adminReject">
已驳回
{{ $t('audit.rejected') }}
</el-button> </el-button>
</div> </div>
<div class="goldStatistics"> <div class="goldStatistics">
总条数{{ format3(stats.num) }}&nbsp;&nbsp;&nbsp;&nbsp;
总金豆数{{ format3(stats.beanNum) }}金豆&nbsp;&nbsp;&nbsp;&nbsp;
付费金豆{{ format3(stats.permanentBean) }}金豆&nbsp;&nbsp;&nbsp;&nbsp;
免费金豆{{ format3(stats.freeBean) }}金豆
{{ $t('audit.totalNum') }}{{ format3(stats.num) }}{{ $t('common.') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.totalBean') }}{{ format3(stats.beanNum) }}{{ $t('common.goldBean') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.permanentBean') }}{{ format3(stats.permanentBean) }}{{ $t('common.goldBean') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.freeBean') }}{{ format3(stats.freeBean) }}{{ $t('common.goldBean') }}
</div> </div>
<el-table :data="tableData" height="65vh" @sort-change="handleSortChange" :row-style="{ height: '50px' }"> <el-table :data="tableData" height="65vh" @sort-change="handleSortChange" :row-style="{ height: '50px' }">
<el-table-column type="index" label="序号" width="80">
<el-table-column type="index" :label="$t('audit.id')" width="80">
<template #default="scope"> <template #default="scope">
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }} {{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="姓名" width="120" show-overflow-tooltip />
<el-table-column prop="jwcode" label="精网号" width="120" />
<el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="permanentBean" label="付费金豆" width="120" sortable="custom" />
<el-table-column prop="freeBean" label="免费金豆" width="120" sortable="custom" />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="submitName" label="提交人" width="120" />
<el-table-column v-if="checkTab === 'reject'" prop="reason" label="驳回理由" width="120" show-overflow-tooltip />
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" label="审核人" width="120" />
<el-table-column prop="createTime" label="提交时间" width="180" sortable="custom">
<el-table-column prop="name" :label="$t('audit.name')" width="120" show-overflow-tooltip />
<el-table-column prop="jwcode" :label="$t('audit.jwcode')" width="120" />
<el-table-column prop="market" :label="$t('audit.market')" width="120" />
<el-table-column prop="permanentBean" :label="$t('audit.permanentBean')" width="120" sortable="custom" />
<el-table-column prop="freeBean" :label="$t('audit.freeBean')" width="120" sortable="custom" />
<el-table-column prop="remark" :label="$t('audit.note')" width="150" show-overflow-tooltip />
<el-table-column prop="submitName" :label="$t('audit.submitter')" width="120" />
<el-table-column v-if="checkTab === 'reject'" prop="reason" :label="$t('audit.rejectReason')" width="120" show-overflow-tooltip />
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" :label="$t('audit.auditor')" width="120" />
<el-table-column prop="createTime" :label="$t('audit.submitTime')" width="180" sortable="custom">
<template #default="{ row }"> <template #default="{ row }">
{{ moment(row.createTime).format('YYYY-MM-DD HH:mm:ss') }} {{ moment(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="checkTab !== 'pending'" prop="auditTime" label="审核时间" width="240" sortable="custom">
<el-table-column v-if="checkTab !== 'pending'" prop="auditTime" :label="$t('audit.auditTime')" width="240" sortable="custom">
<template #default="{ row }"> <template #default="{ row }">
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }} {{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="checkTab === 'pending' && (hasbeanWaitThough || hasbeanWaitReject)" fixed="right" <el-table-column v-if="checkTab === 'pending' && (hasbeanWaitThough || hasbeanWaitReject)" fixed="right"
prop="operation" label="操作" width="200px">
prop="operation" :label="$t('audit.operation')" width="200px">
<template #default="scope"> <template #default="scope">
<div class="operation"> <div class="operation">
<el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked" <el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked"
type="primary" @click="showApproveDialog(scope.row)"> type="primary" @click="showApproveDialog(scope.row)">
通过
{{ $t('common.pass') }}
</el-link> </el-link>
<el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked" <el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked"
type="primary" @click="showRejectDialog(scope.row)"> type="primary" @click="showRejectDialog(scope.row)">
驳回
{{ $t('common.reject') }}
</el-link> </el-link>
</div> </div>
</template> </template>
@ -109,23 +109,23 @@
</el-card> </el-card>
<!-- 驳回理由对话框 --> <!-- 驳回理由对话框 -->
<el-dialog v-model="rejectReasonDialogVisible" title="驳回理由" width="500px">
<el-dialog v-model="rejectReasonDialogVisible" :title="$t('audit.rejectReason')" width="500px" @close="handleRejectReasonCancel">
<el-form> <el-form>
<el-form-item label="驳回理由" required>
<el-input v-model="reason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200" show-word-limit />
<el-form-item :label="$t('audit.rejectReason')" required>
<el-input v-model="reason" type="textarea" :rows="4" :placeholder="$t('audit.rejectReasonPlaceholder')" maxlength="200" show-word-limit />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="rejectReasonDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleReject()">确定</el-button>
<el-button @click="handleRejectReasonCancel">{{ $t('common.cancel') }}</el-button>
<el-button :disabled="cancelClicked" type="primary" @click="handleReject">{{ $t('common.confirm') }}</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<ConfirmDialog <ConfirmDialog
v-model="rejectDialogVisible" v-model="rejectDialogVisible"
message="驳回该记录!"
:message="$t('audit.rejectRecord')"
@confirm="showRejectReasonInput" @confirm="showRejectReasonInput"
@cancel="handleRejectCancel" @cancel="handleRejectCancel"
@close="handleRejectClose" @close="handleRejectClose"
@ -133,7 +133,7 @@
<ConfirmDialog <ConfirmDialog
v-model="approveDialogVisible" v-model="approveDialogVisible"
message="通过该记录!"
:message="$t('audit.passRecord')"
@confirm="handleApproveConfirm" @confirm="handleApproveConfirm"
@cancel="handleApproveCancel" @cancel="handleApproveCancel"
@close="handleApproveClose" @close="handleApproveClose"
@ -151,6 +151,9 @@ import { storeToRefs } from "pinia";
import _ from 'lodash' import _ from 'lodash'
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'; import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue';
// i18n
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const defaultTime = [ const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 0, 0, 0),
@ -263,7 +266,7 @@ const handleSearch = async function () {
if (searchForm.value.jwcode) { if (searchForm.value.jwcode) {
const numRef = /^\d{1,9}$/; const numRef = /^\d{1,9}$/;
if (!numRef.test(searchForm.value.jwcode)) { if (!numRef.test(searchForm.value.jwcode)) {
ElMessage.error('请检查精网号格式')
ElMessage.error(t('elmessage.checkJwcodeFormat'))
return return
} }
} }
@ -272,7 +275,7 @@ const handleSearch = async function () {
} }
const get = async function () { const get = async function () {
if (!hasbeanWaitShow) { if (!hasbeanWaitShow) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
try { try {
@ -320,7 +323,7 @@ const get = async function () {
} }
const getStats = async () => { const getStats = async () => {
if (!hasbeanWaitShow) { if (!hasbeanWaitShow) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
try { try {
@ -353,7 +356,7 @@ const getStats = async () => {
// //
const showApproveDialog = (row) => { const showApproveDialog = (row) => {
if (!hasbeanWaitThough) { if (!hasbeanWaitThough) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
passRow.value.id = row.id passRow.value.id = row.id
@ -365,7 +368,7 @@ const showApproveDialog = (row) => {
// handleApprove // handleApprove
const handleApproveConfirm = async function() {// rowrow const handleApproveConfirm = async function() {// rowrow
if (!hasbeanWaitThough) { if (!hasbeanWaitThough) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
clicked.value = true clicked.value = true
@ -375,14 +378,14 @@ const handleApproveConfirm = async function() {// 不要再传row了!哪有row
auditName: adminData.value.adminName auditName: adminData.value.adminName
} }
await API({ url: '/beanAudit/status1', data: params }) await API({ url: '/beanAudit/status1', data: params })
ElMessage.success('审核通过成功')
ElMessage.success(t('elmessage.approveSuccess'))
approveDialogVisible.value = false approveDialogVisible.value = false
await get() await get()
clicked.value = false clicked.value = false
await getStats() await getStats()
} catch (error) { } catch (error) {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.approveFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
} }
} }
// //
@ -396,12 +399,12 @@ const handleApproveClose = () => {
// //
const handleReject = async () => { const handleReject = async () => {
if (!hasbeanWaitReject) { if (!hasbeanWaitReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
cancelClicked.value = true cancelClicked.value = true
if (!reason.value.trim()) { if (!reason.value.trim()) {
ElMessage.warning('请输入驳回理由')
ElMessage.warning(t('elmessage.rejectReasonPlaceholder'))
return return
} }
try { try {
@ -411,14 +414,14 @@ const handleReject = async () => {
reason: reason.value reason: reason.value
} }
await API({ url: '/beanAudit/status2', data: params }) await API({ url: '/beanAudit/status2', data: params })
ElMessage.success('驳回成功')
ElMessage.success(t('elmessage.rejectSuccess'))
rejectReasonDialogVisible.value = false rejectReasonDialogVisible.value = false
await get() await get()
cancelClicked.value = false cancelClicked.value = false
await getStats() await getStats()
} catch (error) { } catch (error) {
console.error('驳回失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.rejectFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
} }
} }
// //
@ -434,6 +437,12 @@ const handleRejectCancel = () => {
const handleRejectClose = () => { const handleRejectClose = () => {
rejectDialogVisible.value = false rejectDialogVisible.value = false
} }
//
const handleRejectReasonCancel = () => {
rejectReasonDialogVisible.value = false
cancelClicked.value = false //
reason.value = '' //
}
// handleApproveConfirm // handleApproveConfirm
const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, { const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, {
trailing: false trailing: false
@ -441,7 +450,7 @@ const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, {
// //
const showRejectDialog = (row) => { const showRejectDialog = (row) => {
if (!hasbeanWaitReject) { if (!hasbeanWaitReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
rejectRow.value.id = row.id rejectRow.value.id = row.id
@ -505,19 +514,19 @@ const handleClick = async function (tab) {
checkTab.value = tab.props.name checkTab.value = tab.props.name
if (tab.props.name === 'pending') { if (tab.props.name === 'pending') {
if (!hasbeanWait) { if (!hasbeanWait) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
adminWait() adminWait()
} else if (tab.props.name === 'pass') { } else if (tab.props.name === 'pass') {
if (!hasbeanThrough) { if (!hasbeanThrough) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
adminPass() adminPass()
} else if (tab.props.name === 'reject') { } else if (tab.props.name === 'reject') {
if (!hasbeanReject) { if (!hasbeanReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return return
} }
adminReject() adminReject()

Loading…
Cancel
Save