Browse Source

feat: 完成充值审核,退款审核的全部中文语言包的编写

zhangrenyuan/feature-20251125114759-多语言
zhangrenyuan 3 days ago
parent
commit
845ee2b5d3
  1. 3
      src/components/dialogs/ConfirmDialog.vue
  2. 28
      src/components/dialogs/LanguageSwitch.vue
  3. 104
      src/components/locales/lang/en.js
  4. 32
      src/components/locales/lang/th.js
  5. 117
      src/components/locales/lang/zh-CN.js
  6. 2
      src/views/audit/gold/audit.vue
  7. 164
      src/views/audit/gold/rechargeAudit.vue
  8. 193
      src/views/audit/gold/refundAudit.vue

3
src/components/dialogs/ConfirmDialog.vue

@ -14,7 +14,7 @@
@close="handleClose">
<div class="confirm-content">
将要{{ message }}
{{ $t('common.will') }}{{ message }}
<br>
</div>
@ -34,6 +34,7 @@
<script setup>
import { ref, watch } from 'vue'
import BackgroundSvg from '@/assets/SvgIcons/promptBackground.svg'
import { useI18n } from 'vue-i18n'
//
const props = defineProps({

28
src/components/dialogs/LanguageSwitch.vue

@ -7,13 +7,14 @@
append-to-body
>
<el-form label-width="80px">
<el-form-item label="当前语言">
<!-- <el-form-item label="当前语言">
<el-input
:model-value="getLangLabel(currentLang)"
disabled
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="切换语言">
<el-select
v-model="tempLang"
@ -42,7 +43,7 @@
<script setup>
import { ref, computed } from 'vue'
import { useI18n } from 'vue-i18n'
// === Element Plus ===
// === Element Plus ===
import {
ElDialog,
ElForm,
@ -54,11 +55,6 @@ import {
ElMessage
} from 'element-plus'
//
// import 'element-plus/es/components/dialog/style/css'
// import 'element-plus/es/components/form/style/css'
// ...
const { locale } = useI18n()
//
@ -70,13 +66,13 @@ const currentLang = computed(() => locale.value)
//
const tempLang = ref('')
//
//
const langOptions = [
{ label: '中文(简体)', value: 'zh-CN' },
{ label: '中文(繁)', value: 'zh-TW' },
{ label: '中文(繁)', value: 'zh-TW' },
{ label: '英语', value: 'en' },
{ label: '泰语', value: 'th' },
{ label: '越南语', value: 'vi' }
{ label: 'ภาษาไทย', value: 'th' },
{ label: 'Tiếng Việt', value: 'vi' }
]
//
@ -104,10 +100,10 @@ defineExpose({
})
</script>
<!-- 去掉scoped全局生效 -->
<style >
<style>
.el-dialog__body {
height: 500px !important;
height: 220px !important;
overflow-y: auto;
}
.dialog-footer {
@ -115,4 +111,4 @@ defineExpose({
justify-content: center;
gap: 20px;
}
</style>
</style>

104
src/components/locales/lang/en.js

@ -1,10 +1,102 @@
export default {
// Common Group
common: {
// Filters
jwcode: 'jwcode',
jwcodePlaceholder: 'Please enter jwcode',
activityName: 'Activity Name',
activityNamePlaceholder: 'Please enter activity name',
goodsName: 'Goods Name',
goodsNamePlaceholder: 'Please enter goods name',
payModel: 'Payment Method',
payModelPlaceholder: 'Please select payment method',
refundType: 'Refund Type',
refundTypePlaceholder: 'Please select refund type',
market: 'Market',
marketPlaceholder: 'Please select market',
submitTime: 'Submit Time',
auditTime: 'Audit Time',
startTime: 'Start Time',
to: 'To',
endTime: 'End Time',
// Button Group
search: 'Search',
reset: 'Reset',
edit: 'Edit',
pass: 'Pass',
reject: 'Reject',
cancel: 'Cancel',
confirm: 'Confirm',
cancel: 'Cancel'
// Currency Types
SGD: 'SGD',
goldCoin: '', // Gold Coin label intentionally empty
},
audit: {
rechargeAudit: 'Recharge Audit',
status: 'Status'
}
}
// Audit Group
audit: {
// Audit Common
refundTypeOptions: {
'商品退款': 'Product Refund',
'金币退款': 'Gold Refund',
},
waitAudit: 'Pending Audit',
passed: 'Approved',
rejected: 'Rejected',
permanentGold: 'Permanent',
freeGold: 'Free',
taskGold: 'Task',
// Audit Common - List Fields
id: 'ID',
name: 'Name',
jwcode: 'JW Code',
market: 'Market',
activityName: 'Activity Name',
currencyName: 'Currency Name',
rechargeAmount: 'Recharge Amount',
note: 'Note',
payModel: 'Payment Method',
paymentVoucher: 'Payment Voucher',
submitter: 'Submitter',
auditor: 'Auditor',
rejectReason: 'Reject Reason',
rejectReasonPlaceholder: 'Please enter reject reason',
paymentTime: 'Payment Time',
submitTime: 'Submit Time',
auditTime: 'Audit Time',
operation: 'Operation',
// Supplement Fields for Refund Audit
orderCode: 'Order Number',
refundType: 'Refund Type',
refundModel: 'Refund Method',
allRefund: 'Full Refund',
partialRefund: 'Partial Refund',
refundGoods: 'Refund Goods',
// Gold Recharge Audit ------------------------
rechargeAudit: 'Recharge Audit',
rechargeSGD: 'Recharge SGD',
totalGold: 'Total Gold',
// 添加支付方式翻译
payMethods: {
bankTransfer: 'Bank Transfer',
cash: 'Cash',
check: 'Check',
card: 'Card Payment',
grabpay: 'Grabpay',
nets: 'Nets',
paypal: 'PayPal',
stripe: 'Stripe - Link Payment',
ipay88: 'Ipay88 - Link Payment',
paymentAsia: 'PaymentAsia - Link Payment',
other: 'Other'
},
// Gold Refund Audit --------------------------
refundAudit: 'Refund Audit',
refundTotalGold: 'Total Refund',
},
}

32
src/components/locales/lang/th.js

@ -1,10 +1,34 @@
export default {
common: {
confirm: 'ยืนยัน',
cancel: 'ยกเลิก'
jwcode: 'jwcode',
jwcodePlaceholder: 'กรุณาใส่ jwcode',
activityName: 'ชื่อกิจกรรม',
activityNamePlaceholder: 'กรุณาใส่ชื่อกิจกรรม',
goodsName: 'ชื่อสินค้า',
goodsNamePlaceholder: 'กรุณาใส่ชื่อสินค้า',
refundType: 'ประเภทการคืนเงิน',
refundTypePlaceholder: 'กรุณาเลือกประเภทการคืนเงิน',
payModel: 'วิธีการชำระเงิน',
payModelPlaceholder: 'กรุณาเลือกวิธีการชำระเงิน',
market: 'ตลาด',
marketPlaceholder: 'กรุณาเลือกตลาด',
submitTime: 'เวลาส่ง',
auditTime: 'เวลาตรวจสอบ',
startTime: 'เวลาเริ่มต้น',
to: 'ถึง',
endTime: 'เวลาสิ้นสุด',
search: 'ค้นหา',
reset: 'รีเซ็ต',
},
audit: {
audit: {
rechargeAudit: 'การตรวจสอบการเติมเงิน',
status: 'สถานะ'
refundAudit: 'การตรวจสอบการคืนเงิน',
refundTypeOptions: {
'商品退款': 'คืนเงินสินค้า',
'金币退款': 'คืนเงินทอง',
},
waitAudit: 'รอตรวจสอบ',
passed: 'อนุมัติ',
rejected: 'ปฏิเสธ',
}
}

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

@ -1,10 +1,115 @@
export default {
// 通用组
common: {
confirm: '确定',
cancel: '取消'
// 筛选
jwcode: '精网号',
jwcodePlaceholder: '请输入精网号',
activityName: '活动名称',
activityNamePlaceholder: '请输入活动名称',
goodsName: '商品名称',
goodsNamePlaceholder: '请输入商品名称',
payModel: '支付方式',
payModelPlaceholder: '请选择支付方式',
refundType: '退款类型',
refundTypePlaceholder: '请选择退款类型',
market: '所属地区',
marketPlaceholder: '请选择所属地区',
submitTime: '提交时间',
auditTime: '审核时间',
startTime: '起始时间',
to: '至',
endTime: '结束时间',
// 按钮组
search: '查询',
reset: '重置',
edit: '编辑',
pass: '通过',
reject: '驳回',
cancel: '取消',
confirm: '确认',
// 币种类型
SGD: '新币',
goldCoin: '金币',
// 对话框标题
will: '将要',
},
// 提示信息组
elmessage : {
noPermission: '暂无权限',
checkJwcodeFormat: '请检查精网号格式',
rejectReasonPlaceholder: '请输入驳回理由',
rejectSuccess: '驳回操作成功',
rejectFailed: '驳回操作失败',
operationFailed: '操作失败',
approveSuccess: '审核通过成功',
approveFailed: '审核通过失败',
},
// 审核组
audit: { // 按照项目文件名分配
// 审核通用 ---------------------------------
refundTypeOptions: {
'商品退款': '商品退款',
'金币退款': '金币退款',
},
waitAudit: '待审核',
passed: '已通过',
rejected: '已驳回',
permanentGold: '永久金币',
freeGold: '免费金币',
taskGold: '任务金币',
// 审核通用-充值审核列表字段
id: '序号',
name: '姓名',
jwcode: '精网号',
market: '所属地区',
activityName: '活动名称',
currencyName: '货币名称',
rechargeAmount: '充值金额',
note: '备注',
payModel: '支付方式',
paymentVoucher: '支付凭证',
submitter: '提交人',
auditor: '审核人',
rejectReason: '驳回理由',
rejectReasonPlaceholder: '请输入驳回理由',
paymentTime: '交款时间',
submitTime: '提交时间',
auditTime: '审核时间',
operation: '操作',
// 审核通用-充值审核列表字段-补充退款审核列表字段
orderCode: '订单号',
refundType: '退款类型',
refundModel: '退款方式',
allRefund: '全部退款',
partialRefund: '部分退款',
refundGoods: '退款商品',
// 金币充值审核 --------------------------------
rechargeAudit: '充值审核',
rechargeSGD: '充值新币',
totalGold: '总金币数',
// 添加支付方式翻译
payMethods: {
bankTransfer: '银行转账',
cash: '现金',
check: '支票',
card: '刷卡',
grabpay: 'Grabpay',
nets: 'Nets',
paypal: 'PayPal',
stripe: 'Stripe-链接收款',
ipay88: 'Ipay88-链接收款',
paymentAsia: 'PaymentAsia-链接收款',
other: '其他'
},
// 金币退款审核 --------------------------------
refundAudit: '退款审核',
refundTotalGold: '退款总金币数',
// 对话框的标题
rejectRecord: '驳回该记录!',
passRecord: '通过该记录!',
},
audit: {
rechargeAudit: '充值审核', // 你的需求字段
status: '状态'
}
}

2
src/views/audit/gold/audit.vue

@ -16,7 +16,7 @@
@click="navigateTo('refundAudit')"
v-if="hasRefund"
>
退款审核
{{ $t('audit.refundAudit') }}
</el-button>
</el-button-group>
</div>

164
src/views/audit/gold/rechargeAudit.vue

@ -3,24 +3,24 @@
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="rechargeAudit.jwcode" placeholder="请输入精网号" clearable />
<el-text class="text" size="large">{{ $t('common.jwcode') }}</el-text>
<el-input class="selectContent" v-model="rechargeAudit.jwcode" :placeholder="$t('common.jwcodePlaceholder')" clearable />
</div>
<div class="selectRow">
<el-text class="text" size="large">活动名称</el-text>
<el-select class="selectContent" v-model="rechargeAudit.activity" placeholder="请选择活动名称" clearable>
<el-text class="text" size="large">{{ $t('common.activityName') }}</el-text>
<el-select class="selectContent" v-model="rechargeAudit.activity" :placeholder="$t('common.activityNamePlaceholder')" clearable>
<el-option v-for="item in activity" :key="item" :label="item" :value="item" />
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">支付方式</el-text>
<el-select class="selectContent" v-model="rechargeAudit.payModel" placeholder="请选择支付方式" clearable>
<el-text class="text" size="large">{{ $t('common.payModel') }}</el-text>
<el-select class="selectContent" v-model="rechargeAudit.payModel" :placeholder="$t('common.payModelPlaceholder')" clearable>
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader class="selectContent" v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区"
<el-text class="text" size="large">{{ $t('common.market') }}</el-text>
<el-cascader class="selectContent" v-model="selectedMarketPath" :options="market" :placeholder="$t('common.marketPlaceholder')"
clearable @change="handleMarketChange" />
</div>
</div>
@ -29,10 +29,10 @@
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">
{{ activeName === 'wait' ? '提交时间:' : '审核时间:' }}
{{ activeName === 'wait' ? $t('common.submitTime') : $t('common.auditTime') }}
</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" :range-separator="$t('common.to')"
:start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange" :default-time="defaultTime" :disabled-date="disabledDate" />
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
@ -42,8 +42,8 @@
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button @click="handleSearch" type="primary">查询</el-button>
<el-button @click="resetSearch" type="success">重置</el-button>
<el-button @click="handleSearch" type="primary">{{ $t('common.search') }}</el-button>
<el-button @click="resetSearch" type="success">{{ $t('common.reset') }}</el-button>
</div>
</div>
</el-col>
@ -56,7 +56,7 @@
@click="handleButtonClick('wait')"
class="custom-tab-button"
>
待审核
{{ $t('audit.waitAudit') }}
</el-button>
<el-button
v-if="hasrechargeThrough"
@ -64,7 +64,7 @@
@click="handleButtonClick('pass')"
class="custom-tab-button"
>
已通过
{{ $t('audit.passed') }}
</el-button>
<el-button
v-if="hasrechargeReject"
@ -72,62 +72,62 @@
@click="handleButtonClick('reject')"
class="custom-tab-button"
>
已驳回
{{ $t('audit.rejected') }}
</el-button>
</div>
<div class="goldStatistics">
<!-- 总条数{{ format3(stats.totalNum) }}&nbsp;&nbsp;&nbsp;&nbsp;-->
充值新币{{ format3(stats.permanentGolds) }}新币&nbsp;&nbsp;&nbsp;&nbsp;
总金币数{{ format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
}}金币&nbsp;&nbsp;&nbsp;&nbsp;
永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.rechargeSGD') }}{{ format3(stats.permanentGolds) }} {{ $t('common.SGD') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.totalGold') }}{{ format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
}}{{ $t('common.goldCoin') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.permanentGold') }}{{ format3(stats.permanentGolds.toFixed(2)) }}{{ $t('common.goldCoin') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.freeGold') }}{{ format3(stats.freeGolds.toFixed(2)) }}{{ $t('common.goldCoin') }}&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<el-table :data="tableData" style="width: 82vw;height:61vh" @sort-change="handleSortChange"
:row-style="{ height: '50px' }">
<el-table-column type="index" label="序号" width="100px" fixed="left">
<el-table-column type="index" :label="$t('audit.id')" width="100px" fixed="left">
<template #default="scope">
<span>{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }}</span>
</template>
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" width="150px" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px" />
<el-table-column prop="market" label="所属地区" width="100px" />
<el-table-column prop="activity" label="活动名称" width="100px" show-overflow-tooltip />
<el-table-column prop="rateName" label="货币名称" width="110px" />
<el-table-column prop="money" label="充值金额" sortable="custom" width="110px">
<el-table-column fixed="left" prop="name" :label="$t('audit.name')" width="150px" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" :label="$t('audit.jwcode')" width="110px" />
<el-table-column prop="market" :label="$t('audit.market')" width="100px" />
<el-table-column prop="activity" :label="$t('audit.activityName')" width="100px" show-overflow-tooltip />
<el-table-column prop="rateName" :label="$t('audit.currencyName')" width="110px" />
<el-table-column prop="money" :label="$t('audit.rechargeAmount')" sortable="custom" width="110px">
<template #default="scope">{{ scope.row.money / 100 }}</template>
</el-table-column>
<el-table-column prop="permanentGold" label="永久金币" width="110px" sortable="custom">
<el-table-column prop="permanentGold" :label="$t('audit.permanentGold')" width="130px" sortable="custom">
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template>
</el-table-column>
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px">
<el-table-column prop="freeGold" :label="$t('audit.freeGold')" sortable="custom" width="110px">
<template #default="scope">{{ (scope.row.freeGold) / 100 }}</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="180px" show-overflow-tooltip />
<el-table-column prop="payModel" label="支付方式" width="130px" />
<el-table-column prop="voucher" label="支付凭证" width="110px">
<el-table-column prop="remark" :label="$t('audit.note')" width="180px" show-overflow-tooltip />
<el-table-column prop="payModel" :label="$t('audit.payModel')" width="130px" />
<el-table-column prop="voucher" :label="$t('audit.paymentVoucher')" width="110px">
<template #default="scope">
<div v-if="scope.row.voucher"
style="display: flex; justify-content: center; align-items: center; cursor: pointer;"
@click="previewImage(scope.row.voucher)">
<img :src="scope.row.voucher" alt="支付凭证" style="width: auto; height: 40px;">
<img :src="scope.row.voucher" :alt="$t('audit.paymentVoucher')" style="width: auto; height: 40px;">
</div>
<div v-else style="display: flex; justify-content: center; align-items: center; height: 40px;">--</div>
</template>
</el-table-column>
<el-table-column prop="adminName" label="提交人" width="100px" />
<el-table-column prop="rejectReason" v-if="activeName === 'reject'" label="驳回理由" width="200px"
<el-table-column prop="adminName" :label="$t('audit.submitter')" width="100px" />
<el-table-column prop="rejectReason" v-if="activeName === 'reject'" :label="$t('audit.rejectReason')" width="200px"
show-overflow-tooltip />
<el-table-column v-if="activeName !== 'wait'" prop="auditName" label="审核人" width="100px" />
<el-table-column prop="payTime" sortable="custom" label="交款时间" width="200px">
<el-table-column v-if="activeName !== 'wait'" prop="auditName" :label="$t('audit.auditor')" width="100px" />
<el-table-column prop="payTime" sortable="custom" :label="$t('audit.paymentTime')" width="200px">
<template #default="scope">
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column prop="createTime" sortable="custom" label="提交时间" width="200px">
<el-table-column prop="createTime" sortable="custom" :label="$t('audit.submitTime')" width="200px">
<template #default="scope">
<!-- {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}-->
{{
@ -137,23 +137,23 @@
}}
</template>
</el-table-column>
<el-table-column v-if="activeName !== 'wait'" prop="auditTime" label="审核时间" width="200px">
<el-table-column v-if="activeName !== 'wait'" prop="auditTime" sortable="custom" :label="$t('audit.auditTime')" width="200px">
<template #default="scope">
{{ moment(scope.row.auditTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column v-if="activeName === 'wait'&&(hasrechargeWaitThough||hasrechargeWaitReject)&&hasrechargeWaitShow" fixed="right" prop="operation" label="操作" width="150px">
<el-table-column v-if="activeName === 'wait'&&(hasrechargeWaitThough||hasrechargeWaitReject)&&hasrechargeWaitShow" fixed="right" prop="operation" :label="$t('audit.operation')" width="150px">
<template #default="scope">
<div class="operation">
<el-link :underline="false" class="pass-btn" v-if="hasrechargeWaitThough"
:disabled="clicked || cancelClicked" type="primary"
@click="showApproveDialog(scope.row)">
通过
{{ $t('common.pass') }}
</el-link>
<el-link :underline="false" class="reject-btn" v-if="hasrechargeWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回
{{ $t('common.reject') }}
</el-link>
</div>
</template>
@ -166,23 +166,23 @@
</div>
</el-card>
<el-dialog v-model="rejectReasonDialogVisible" title="驳回理由" width="500px">
<el-dialog v-model="rejectReasonDialogVisible" :title="$t('audit.rejectReason')" width="400px" @close="handleRejectReasonCancel">
<el-form>
<el-form-item label="驳回理由" required>
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200"
<el-form-item :label="$t('audit.rejectReason')" required>
<el-input v-model="rejectReason" type="textarea" :rows="4" :placeholder="$t('audit.rejectReason')" maxlength="200"
show-word-limit />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="rejectReasonDialogVisible = false">取消</el-button>
<el-button :disabled="cancelClicked" 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>
</template>
</el-dialog>
<ConfirmDialog
v-model="rejectDialogVisible"
message="驳回该记录!"
:message="$t('audit.rejectRecord')"
@confirm="showRejectReasonInput"
@cancel="handleRejectCancel"
@close="handleRejectClose"
@ -191,7 +191,7 @@
<!-- 新增使用ConfirmDialog组件 -->
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
:message="$t('audit.passRecord')"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
@ -216,6 +216,9 @@ const { adminData, menuTree, flag } = storeToRefs(adminStore);
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import dayjs from "dayjs";
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
// flag
watch(flag, (newFlag, oldFlag) => {
// flag
@ -301,47 +304,47 @@ const getObj = ref({
const payModel = [
{
value: '银行转账',
label: '银行转账'
label: t('audit.payMethods.bankTransfer')
},
{
value: '现金',
label: '现金'
label: t('audit.payMethods.cash')
},
{
value: '支票',
label: '支票'
label: t('audit.payMethods.check')
},
{
value: '刷卡',
label: '刷卡'
label: t('audit.payMethods.card')
},
{
value: 'Grabpay',
label: 'Grabpay'
label: t('audit.payMethods.grabpay')
},
{
value: 'Nets',
label: 'Nets'
label: t('audit.payMethods.nets')
},
{
value: 'PayPal',
label: 'PayPal'
label: t('audit.payMethods.paypal')
},
{
value: 'Stripe-链接收款',
label: 'Stripe-链接收款'
label: t('audit.payMethods.stripe')
},
{
value: 'Ipay88-链接收款',
label: 'Ipay88-链接收款'
label: t('audit.payMethods.ipay88')
},
{
value: 'PaymentAsia-链接收款',
label: 'PaymentAsia-链接收款'
label: t('audit.payMethods.paymentAsia')
},
{
value: '其他',
label: '其他'
label: t('audit.payMethods.other')
}
]
//
@ -354,13 +357,13 @@ const stats = ref({
})
//
const rules = reactive({
rejectReason: [{ required: true, message: '请输入驳回理由', trigger: 'blur' }]
rejectReason: [{ required: true, message: t('audit.rejectReasonPlaceholder'), trigger: 'blur' }]
})
//
const getRecharge = async function (val) {
if (!hasrechargeWaitShow) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
try {
@ -380,7 +383,7 @@ const getRecharge = async function (val) {
const numberRegex = /^\d{1,9}$/;
//
if (!numberRegex.test(rechargeAudit.value.jwcode)) {
ElMessage.error('请检查精网号格式')
ElMessage.error(t('common.checkJwcodeFormat'))
return
}
}
@ -538,7 +541,7 @@ const handleButtonClick = function (name) {
activeName.value = name
if (name === 'wait') {
if(!hasrechargeWait){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
if(hasrechargeWaitShow){
@ -546,13 +549,13 @@ const handleButtonClick = function (name) {
}
} else if (name === 'pass') {
if(!hasrechargeThrough){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
adminPass()
} else if (name === 'reject') {
if(!hasrechargeReject){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
adminReject()
@ -610,7 +613,7 @@ const clicked = ref(false);
//
const showApproveDialog = (row) => {
if(!hasrechargeWaitThough){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
currentRecord.value = row
@ -628,14 +631,14 @@ const handleApproveConfirm = async () => {
rejectReason: ''
}
await request({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功')
ElMessage.success(t('elmessage.approveSuccess'))
approveDialogVisible.value = false
await getRecharge()
clicked.value = false
await getStats()
} catch (error) {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.approveFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
clicked.value = false
}
}
@ -675,7 +678,7 @@ const handleApproveClose = () => {
// }
const showRejectDialog = (row) => {
if(!hasrechargeWaitReject){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
currentRecord.value = row
@ -688,13 +691,13 @@ const cancelClicked = ref(false)
const handleReject = async () => {
// showRejectDialog
if(!hasrechargeWaitReject){
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
cancelClicked.value = true
if (!rejectReason.value.trim()) {
ElMessage.warning('请输入驳回理由')
ElMessage.warning(t('elmessage.rejectReasonPlaceholder'))
return
}
try {
@ -706,14 +709,14 @@ const handleReject = async () => {
}
await request({ url: '/audit/audit', data: params })
ElMessage.success('驳回操作成功')
ElMessage.success(t('elmessage.rejectSuccess'))
rejectReasonDialogVisible.value = false
await getRecharge()
cancelClicked.value = false
await getStats()
} catch (error) {
console.error('驳回操作失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.rejectFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
}
}
//
@ -729,6 +732,13 @@ const handleRejectCancel = () => {
const handleRejectClose = () => {
rejectDialogVisible.value = false
}
// /
const handleRejectReasonCancel = () => {
rejectReasonDialogVisible.value = false
cancelClicked.value = false //
rejectReason.value = '' //
}
//
const handleSortChange = (column) => {
console.log('排序字段:', column.prop)

193
src/views/audit/gold/refundAudit.vue

@ -3,26 +3,29 @@
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="searchForm.jwcode" placeholder="请输入精网号" clearable />
<el-text class="text" size="large">{{ $t('common.jwcode') }}</el-text>
<el-input class="selectContent" v-model="searchForm.jwcode" :placeholder="$t('common.jwcodePlaceholder')"
clearable />
</div>
<div class="selectRow">
<el-text class="text" size="large">商品名称</el-text>
<el-select class="selectContent" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable>
<el-text class="text" size="large">{{ $t('common.goodsName') }}</el-text>
<el-select class="selectContent" v-model="searchForm.goodsName"
:placeholder="$t('common.goodsNamePlaceholder')" clearable>
<el-option v-for="item in refundGoodsOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">退款类型</el-text>
<el-select class="selectContent" v-model="searchForm.refundType" placeholder="请选择退款类型" clearable>
<el-option label="商品退款" value="商品退款" />
<el-option label="金币退款" value="金币退款" />
<el-text class="text" size="large">{{ $t('common.refundType') }}</el-text>
<el-select class="selectContent" v-model="searchForm.refundType"
:placeholder="$t('common.refundTypePlaceholder')" clearable>
<el-option :label="$t('audit.refundTypeOptions.商品退款')" value="商品退款" />
<el-option :label="$t('audit.refundTypeOptions.金币退款')" value="金币退款" />
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-text class="text" size="large">{{ $t('common.market') }}</el-text>
<el-cascader class="selectContent" style="width: 12vw;" v-model="selectedMarketPath" :options="market"
placeholder="请选择所属地区" clearable @change="handleMarketChange" />
:placeholder="$t('common.marketPlaceholder')" clearable @change="handleMarketChange" />
</div>
</div>
</el-col>
@ -30,11 +33,12 @@
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">
{{ activeName === 'wait' ? '提交时间:' : '审核时间:' }}
{{ activeName === 'wait' ? $t('common.submitTime') : $t('common.auditTime') }}
</el-text>
<el-date-picker class="selectContent" v-model="dateRange" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange" :default-time="defaultTime" :disabled-date="disabledDate" />
<el-date-picker class="selectContent" v-model="dateRange" type="datetimerange"
:range-separator="$t('common.to')" :start-placeholder="$t('common.startTime')"
:end-placeholder="$t('common.endTime')" style="margin-right:1vw;width:25vw" @change="handleDatePickerChange"
:default-time="defaultTime" :disabled-date="disabledDate" />
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
@ -42,8 +46,8 @@
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button @click="handleSearch" type="primary">查询</el-button>
<el-button @click="resetSearch" type="success">重置</el-button>
<el-button @click="handleSearch" type="primary">{{ $t('common.search') }}</el-button>
<el-button @click="resetSearch" type="success">{{ $t('common.reset') }}</el-button>
</div>
</div>
</el-col>
@ -53,68 +57,70 @@
<div class="custom-button-group">
<el-button v-if="hasrefundWait && hasrefundWaitShow" :type="activeName === 'wait' ? 'primary' : 'default'"
@click="handleButtonClick('wait')" class="custom-tab-button">
待审核
{{ $t('audit.waitAudit') }}
</el-button>
<el-button v-if="hasrefundThrough" :type="activeName === 'pass' ? 'primary' : 'default'"
@click="handleButtonClick('pass')" class="custom-tab-button">
已通过
{{ $t('audit.passed') }}
</el-button>
<el-button v-if="hasrefundReject" :type="activeName === 'reject' ? 'primary' : 'default'"
@click="handleButtonClick('reject')" class="custom-tab-button">
已驳回
{{ $t('audit.rejected') }}
</el-button>
</div>
<div class="goldStatistics">
退款总金币数{{
{{ $t('audit.refundTotalGold') }}{{
format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
}}金币&nbsp;&nbsp;&nbsp;&nbsp;
永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
任务金币{{ format3(stats.taskGolds.toFixed(2)) }}金币
}}{{ $t('common.goldCoin') }}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.permanentGold') }}{{ format3(stats.permanentGolds.toFixed(2)) }}{{ $t('common.goldCoin')
}}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.freeGold') }}{{ format3(stats.freeGolds.toFixed(2)) }}{{ $t('common.goldCoin')
}}&nbsp;&nbsp;&nbsp;&nbsp;
{{ $t('audit.taskGold') }}{{ format3(stats.taskGolds.toFixed(2)) }}{{ $t('common.goldCoin') }}
</div>
<el-table :data="tableData" style="height:61vh;width:82vw" @sort-change="handleSortChange"
:row-style="{ height: '50px' }">
<el-table-column fixed="left" type="index" label="序号" width="60" />
<el-table-column fixed="left" prop="name" label="姓名" width="120" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" label="精网号" width="120" />
<el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip />
<el-table-column prop="refundType" label="退款类型" width="120" />
<el-table-column prop="refundModel" label="退款方式" width="120">
<el-table-column fixed="left" type="index" :label="$t('audit.id')" width="60" />
<el-table-column fixed="left" prop="name" :label="$t('audit.name')" width="120" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" :label="$t('audit.jwcode')" width="120" />
<el-table-column prop="market" :label="$t('audit.market')" width="120" />
<el-table-column prop="orderCode" :label="$t('audit.orderCode')" width="260px" show-overflow-tooltip />
<el-table-column prop="refundType" :label="$t('audit.refundType')" width="120" />
<el-table-column prop="refundModel" :label="$t('audit.refundModel')" width="120">
<template #default="{ row }">
{{ row.refundModel === 0 ? '全部退款' : '部分退款' }}
{{ row.refundModel === 0 ? $t('audit.allRefund') : $t('audit.partialRefund') }}
</template>
</el-table-column>
<el-table-column prop="goodsName" label="退款商品" width="120" show-overflow-tooltip />
<el-table-column prop="sumGold" label="退款金币总数" width="160" sortable="custom">
<el-table-column prop="goodsName" :label="$t('audit.refundGoods')" width="120" show-overflow-tooltip />
<el-table-column prop="sumGold" :label="$t('audit.refundTotalGold')" width="160" sortable="custom">
<template #default="{ row }">
{{ row.sumGold / 100 }}
</template>
</el-table-column>
<el-table-column prop="permanentGold" label="永久金币" width="120" sortable="custom">
<el-table-column prop="permanentGold" :label="$t('audit.permanentGold')" width="130" sortable="custom">
<template #default="{ row }">
{{ row.permanentGold / 100 }}
</template>
</el-table-column>
<el-table-column prop="freeGold" label="免费金币" width="120" sortable="custom">
<el-table-column prop="freeGold" :label="$t('audit.freeGold')" width="120" sortable="custom">
<template #default="{ row }">
{{ (row.freeJune + row.freeDecember) / 100 }}
</template>
</el-table-column>
<el-table-column prop="taskGold" label="任务金币" width="120" sortable="custom">
<el-table-column prop="taskGold" :label="$t('audit.taskGold')" width="120" sortable="custom">
<template #default="{ row }">
{{ row.taskGold / 100 }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="adminName" label="提交人" width="120" />
<el-table-column v-if="checkTab === 'reject'" prop="rejectReason" label="驳回理由" width="150"
<el-table-column prop="remark" :label="$t('audit.note')" width="150" show-overflow-tooltip />
<el-table-column prop="adminName" :label="$t('audit.submitter')" width="120" />
<el-table-column v-if="checkTab === 'reject'" prop="rejectReason" :label="$t('audit.rejectReason')" width="150"
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 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 }">
{{
checkTab === 'pending'
@ -124,25 +130,23 @@
</template>
</el-table-column>
<el-table-column v-if="checkTab !== 'pending'" prop="auditTime" label="审核时间" width="180">
<el-table-column v-if="checkTab !== 'pending'" prop="auditTime" :label="$t('audit.auditTime')" width="180">
<template #default="{ row }">
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }}
</template>
</el-table-column>
<el-table-column
v-if="checkTab === 'pending' && (hasrefundWaitThough || hasrefundWaitReject) && hasrefundWaitShow" fixed="right"
prop="operation" label="操作" width="150px">
prop="operation" :label="$t('audit.operation')" width="150px">
<template #default="scope">
<div class="operation">
<el-link :underline="false" class="pass-btn" v-if="hasrefundWaitThough"
:disabled="clicked || cancelClicked"type="primary"
@click="showApproveDialog(scope.row)">
通过
<el-link :underline="false" class="pass-btn" v-if="hasrefundWaitThough" :disabled="clicked || cancelClicked"
type="primary" @click="showApproveDialog(scope.row)">
{{ $t('common.pass') }}
</el-link>
<el-link :underline="false" class="reject-btn" v-if="hasrefundWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回
<el-link :underline="false" class="reject-btn" v-if="hasrefundWaitReject"
:disabled="clicked || cancelClicked" type="primary" @click="showRejectDialog(scope.row)">
{{ $t('common.reject') }}
</el-link>
</div>
</template>
@ -153,38 +157,29 @@
@current-change="handleCurrentChange"></el-pagination>
</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-item label="驳回理由" required>
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200"
show-word-limit />
<el-form-item :label="$t('audit.rejectReason')" required>
<el-input v-model="rejectReason" type="textarea" :rows="4" :placeholder="$t('audit.rejectReasonPlaceholder')"
maxlength="200" show-word-limit />
</el-form-item>
</el-form>
<template #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>
</template>
</el-dialog>
<ConfirmDialog
v-model="rejectDialogVisible"
message="驳回该记录!"
@confirm="showRejectReasonInput"
@cancel="handleRejectCancel"
@close="handleRejectClose"
/>
<ConfirmDialog v-model="rejectDialogVisible" :message="$t('audit.rejectRecord')" @confirm="showRejectReasonInput"
@cancel="handleRejectCancel" @close="handleRejectClose" />
<!-- 新增使用ConfirmDialog组件 -->
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
/>
<ConfirmDialog v-model="approveDialogVisible" :message="$t('audit.passRecord')" @confirm="handleApproveConfirm"
@cancel="handleApproveCancel" @close="handleApproveClose" />
</template>
@ -198,16 +193,18 @@ import { storeToRefs } from "pinia";
import dayjs from "dayjs";
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const adminStore = useAdminStore();
const { adminData, menuTree, flag } = storeToRefs(adminStore);
// flag
watch(flag, (newFlag, oldFlag) => {
watch(flag, (newFlag, oldFlag) => {
// flag
if (newFlag !== oldFlag) {
get()
getStats()
}
})
@ -219,7 +216,7 @@ const defaultTime = [
const activeTimeRange = ref('')
const currentRecord = ref(null) //
const rejectDialogVisible = ref(false)
const rejectReasonDialogVisible = ref(false)
const rejectReasonDialogVisible = ref(false)
const rejectReason = ref('')
const approveDialogVisible = ref(false)
@ -330,7 +327,7 @@ const getRefundGoods = async () => {
//
const get = async function (val) {
if (!hasrefundWaitShow) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
try {
@ -365,7 +362,7 @@ const get = async function (val) {
//
if (!numberRegex.test(searchForm.value.jwcode)) {
ElMessage.error('请检查精网号格式')
ElMessage.error(t('elmessage.checkJwcodeFormat'))
//
return
}
@ -381,10 +378,10 @@ const get = async function (val) {
const clicked = ref(false);
//
const showApproveDialog = (row) => {
if(!hasrefundWaitThough){
ElMessage.error('暂无权限')
return
}
if (!hasrefundWaitThough) {
ElMessage.error(t('elmessage.noPermission'))
return
}
currentRecord.value = row
approveDialogVisible.value = true
}
@ -399,14 +396,14 @@ const handleApproveConfirm = async () => {
rejectReason: ''
}
await API({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功')
ElMessage.success(t('elmessage.approveSuccess'))
approveDialogVisible.value = false
await get()
clicked.value = false
await getStats()
} catch (error) {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.approveFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
}
}
//
@ -420,7 +417,7 @@ const handleApproveClose = () => {
//
const showRejectDialog = (row) => {
if (!hasrefundWaitReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
currentRecord.value = row
@ -432,13 +429,13 @@ const cancelClicked = ref(false)
//
const handleReject = async () => {
if (!hasrefundWaitReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
cancelClicked.value = true
if (!rejectReason.value.trim()) {
ElMessage.warning('请输入驳回理由')
ElMessage.warning(t('elmessage.rejectReasonPlaceholder'))
return
}
try {
@ -449,15 +446,15 @@ const handleReject = async () => {
rejectReason: rejectReason.value
}
await API({ url: '/audit/audit', data: params })
ElMessage.success('驳回成功')
ElMessage.success(t('elmessage.rejectSuccess'))
rejectReasonDialogVisible.value = false
await get()
cancelClicked.value = false
await getStats()
console.log('看看驳回参数', params)
} catch (error) {
console.error('驳回失败', error)
ElMessage.error('操作失败')
console.error(t('elmessage.rejectFailed'), error)
ElMessage.error(t('elmessage.operationFailed'))
}
}
//
@ -474,6 +471,12 @@ const handleRejectClose = () => {
rejectDialogVisible.value = false
}
//
const handleRejectReasonCancel = () => {
rejectReasonDialogVisible.value = false
cancelClicked.value = false //
rejectReason.value = '' //
}
const getStats = async () => {
if (!hasrefundWaitShow) {
return
@ -578,7 +581,7 @@ const handleButtonClick = function (name) {
activeName.value = name
if (name === 'wait') {
if (!hasrefundWait) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
if (hasrefundWaitShow) {
@ -586,13 +589,13 @@ const handleButtonClick = function (name) {
}
} else if (name === 'pass') {
if (!hasrefundThrough) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
adminPass()
} else if (name === 'reject') {
if (!hasrefundReject) {
ElMessage.error('暂无权限')
ElMessage.error(t('elmessage.noPermission'))
return
}
adminReject()

Loading…
Cancel
Save