|
|
|
@ -3,13 +3,13 @@ |
|
|
|
<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="请输入精网号" |
|
|
|
<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 /> |
|
|
|
</div> |
|
|
|
<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" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -17,18 +17,18 @@ |
|
|
|
<el-col> |
|
|
|
<div class="select"> |
|
|
|
<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" /> |
|
|
|
<!-- <el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今</el-button>--> |
|
|
|
<!-- <el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''">昨</el-button>--> |
|
|
|
<!-- <el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>--> |
|
|
|
</div> |
|
|
|
<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> |
|
|
|
@ -40,62 +40,62 @@ |
|
|
|
<div class="custom-button-group"> |
|
|
|
<el-button v-if="hasbeanWait && hasbeanWaitShow" :type="checkTab === 'pending' ? 'primary' : 'default'" |
|
|
|
class="custom-tab-button" @click="adminWait"> |
|
|
|
待审核 |
|
|
|
{{ $t('audit.waitAudit') }} |
|
|
|
</el-button> |
|
|
|
<el-button v-if="hasbeanThrough" :type="checkTab === 'pass' ? 'primary' : 'default'" class="custom-tab-button" |
|
|
|
@click="adminPass"> |
|
|
|
已通过 |
|
|
|
{{ $t('audit.passed') }} |
|
|
|
</el-button> |
|
|
|
<el-button v-if="hasbeanReject" :type="checkTab === 'reject' ? 'primary' : 'default'" class="custom-tab-button" |
|
|
|
@click="adminReject"> |
|
|
|
已驳回 |
|
|
|
{{ $t('audit.rejected') }} |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="goldStatistics"> |
|
|
|
总条数:{{ format3(stats.num) }}条 |
|
|
|
总金豆数:{{ format3(stats.beanNum) }}金豆 |
|
|
|
付费金豆:{{ format3(stats.permanentBean) }}金豆 |
|
|
|
免费金豆:{{ format3(stats.freeBean) }}金豆 |
|
|
|
{{ $t('audit.totalNum') }}:{{ format3(stats.num) }}{{ $t('common.条') }} |
|
|
|
{{ $t('audit.totalBean') }}:{{ format3(stats.beanNum) }}{{ $t('common.goldBean') }} |
|
|
|
{{ $t('audit.permanentBean') }}:{{ format3(stats.permanentBean) }}{{ $t('common.goldBean') }} |
|
|
|
{{ $t('audit.freeBean') }}:{{ format3(stats.freeBean) }}{{ $t('common.goldBean') }} |
|
|
|
</div> |
|
|
|
|
|
|
|
<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"> |
|
|
|
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }} |
|
|
|
</template> |
|
|
|
</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 }"> |
|
|
|
{{ moment(row.createTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
|
</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 }"> |
|
|
|
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<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"> |
|
|
|
<div class="operation"> |
|
|
|
|
|
|
|
<el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked" |
|
|
|
type="primary" @click="showApproveDialog(scope.row)"> |
|
|
|
通过 |
|
|
|
{{ $t('common.pass') }} |
|
|
|
</el-link> |
|
|
|
<el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked" |
|
|
|
type="primary" @click="showRejectDialog(scope.row)"> |
|
|
|
驳回 |
|
|
|
{{ $t('common.reject') }} |
|
|
|
</el-link> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -109,23 +109,23 @@ |
|
|
|
</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="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> |
|
|
|
<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="驳回该记录!" |
|
|
|
:message="$t('audit.rejectRecord')" |
|
|
|
@confirm="showRejectReasonInput" |
|
|
|
@cancel="handleRejectCancel" |
|
|
|
@close="handleRejectClose" |
|
|
|
@ -133,7 +133,7 @@ |
|
|
|
|
|
|
|
<ConfirmDialog |
|
|
|
v-model="approveDialogVisible" |
|
|
|
message="通过该记录!" |
|
|
|
:message="$t('audit.passRecord')" |
|
|
|
@confirm="handleApproveConfirm" |
|
|
|
@cancel="handleApproveCancel" |
|
|
|
@close="handleApproveClose" |
|
|
|
@ -151,6 +151,9 @@ import { storeToRefs } from "pinia"; |
|
|
|
import _ from 'lodash' |
|
|
|
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" |
|
|
|
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'; |
|
|
|
// i18n国际化包 |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
const defaultTime = [ |
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
@ -263,7 +266,7 @@ const handleSearch = async function () { |
|
|
|
if (searchForm.value.jwcode) { |
|
|
|
const numRef = /^\d{1,9}$/; |
|
|
|
if (!numRef.test(searchForm.value.jwcode)) { |
|
|
|
ElMessage.error('请检查精网号格式') |
|
|
|
ElMessage.error(t('elmessage.checkJwcodeFormat')) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
@ -272,7 +275,7 @@ const handleSearch = async function () { |
|
|
|
} |
|
|
|
const get = async function () { |
|
|
|
if (!hasbeanWaitShow) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
@ -320,7 +323,7 @@ const get = async function () { |
|
|
|
} |
|
|
|
const getStats = async () => { |
|
|
|
if (!hasbeanWaitShow) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
@ -353,7 +356,7 @@ const getStats = async () => { |
|
|
|
// 显示通过对话框 |
|
|
|
const showApproveDialog = (row) => { |
|
|
|
if (!hasbeanWaitThough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
passRow.value.id = row.id |
|
|
|
@ -365,7 +368,7 @@ const showApproveDialog = (row) => { |
|
|
|
// (发现问题:加了防抖,名称为handleApprove,修改名称一致即可) |
|
|
|
const handleApproveConfirm = async function() {// 不要再传row了!哪有row!!! |
|
|
|
if (!hasbeanWaitThough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
clicked.value = true |
|
|
|
@ -375,14 +378,14 @@ const handleApproveConfirm = async function() {// 不要再传row了!哪有row |
|
|
|
auditName: adminData.value.adminName |
|
|
|
} |
|
|
|
await API({ url: '/beanAudit/status1', 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')) |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理通过取消操作 |
|
|
|
@ -396,12 +399,12 @@ const handleApproveClose = () => { |
|
|
|
// 处理驳回操作 |
|
|
|
const handleReject = async () => { |
|
|
|
if (!hasbeanWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
cancelClicked.value = true |
|
|
|
if (!reason.value.trim()) { |
|
|
|
ElMessage.warning('请输入驳回理由') |
|
|
|
ElMessage.warning(t('elmessage.rejectReasonPlaceholder')) |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
@ -411,14 +414,14 @@ const handleReject = async () => { |
|
|
|
reason: reason.value |
|
|
|
} |
|
|
|
await API({ url: '/beanAudit/status2', data: params }) |
|
|
|
ElMessage.success('驳回成功') |
|
|
|
ElMessage.success(t('elmessage.rejectSuccess')) |
|
|
|
rejectReasonDialogVisible.value = false |
|
|
|
await get() |
|
|
|
cancelClicked.value = false |
|
|
|
await getStats() |
|
|
|
} 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 = () => { |
|
|
|
rejectDialogVisible.value = false |
|
|
|
} |
|
|
|
// 处理驳回理由对话框关闭和取消操作 |
|
|
|
const handleRejectReasonCancel = () => { |
|
|
|
rejectReasonDialogVisible.value = false |
|
|
|
cancelClicked.value = false // 重置禁用状态 |
|
|
|
reason.value = '' // 清空驳回理由 |
|
|
|
} |
|
|
|
// 这个防抖好像还不能放在定义之前(handleApproveConfirm) |
|
|
|
const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, { |
|
|
|
trailing: false |
|
|
|
@ -441,7 +450,7 @@ const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, { |
|
|
|
// 显示驳回对话框 |
|
|
|
const showRejectDialog = (row) => { |
|
|
|
if (!hasbeanWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
rejectRow.value.id = row.id |
|
|
|
@ -505,19 +514,19 @@ const handleClick = async function (tab) { |
|
|
|
checkTab.value = tab.props.name |
|
|
|
if (tab.props.name === 'pending') { |
|
|
|
if (!hasbeanWait) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
adminWait() |
|
|
|
} else if (tab.props.name === 'pass') { |
|
|
|
if (!hasbeanThrough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
adminPass() |
|
|
|
} else if (tab.props.name === 'reject') { |
|
|
|
if (!hasbeanReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
adminReject() |
|
|
|
|