This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
<ElButton v-if="canDownload" type="success" link @click="downloadExport">
|
||||
下载
|
||||
</ElButton>
|
||||
<ElButton type="primary" :loading="exporting" @click="handleExport">导出</ElButton>
|
||||
<ElButton v-if="canExport" type="primary" :loading="exporting" @click="handleExport">
|
||||
导出
|
||||
</ElButton>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
|
||||
@@ -72,11 +74,15 @@
|
||||
import { useAsyncTaskPolling } from '@/composables/useAsyncTaskPolling'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
|
||||
defineOptions({ name: 'ExpiringAssets' })
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { hasAuth } = useAuth()
|
||||
const canExport = computed(() => hasAuth(AUGUST_PERMISSIONS.expiringAsset.export))
|
||||
const tableRef = ref()
|
||||
const loading = ref(false)
|
||||
const exporting = ref(false)
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
<!-- 佣金明细 Tab -->
|
||||
<ElTabPane label="佣金明细" name="commission">
|
||||
<div class="commission-export-actions">
|
||||
<ElButton
|
||||
v-if="hasAuth('commission_record:export')"
|
||||
<ElButton
|
||||
v-if="hasAuth(AUGUST_PERMISSIONS.agentFundOverview.commissionExport)"
|
||||
@click="commissionExportDialogVisible = true"
|
||||
>
|
||||
导出
|
||||
@@ -511,6 +511,7 @@
|
||||
import ExportTaskCreateDialog from '@/components/business/ExportTaskCreateDialog.vue'
|
||||
import CommissionRecordDetailDialog from '@/components/business/CommissionRecordDetailDialog.vue'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
import { resolveFinanceAuditTarget } from '@/utils/business/auditNavigation'
|
||||
import { openAuditInvestigation } from '@/components/business/audit/investigationController'
|
||||
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
重新申请
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="refund && canRecoverApproval(refund) && hasAuth('refund:detail')"
|
||||
v-if="
|
||||
refund &&
|
||||
canRecoverApproval(refund) &&
|
||||
hasAuth(AUGUST_PERMISSIONS.refund.recoverApproval)
|
||||
"
|
||||
type="warning"
|
||||
:loading="recoverApprovalLoading"
|
||||
@click="handleRecoverApproval"
|
||||
@@ -182,7 +186,7 @@
|
||||
import { ref, onMounted, computed, h, reactive } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElButton, ElCard, ElIcon, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type { FormRules } from 'element-plus'
|
||||
import { ArrowLeft, Loading } from '@element-plus/icons-vue'
|
||||
import DetailPage from '@/components/common/DetailPage.vue'
|
||||
import type { DetailSection } from '@/components/common/DetailPage.vue'
|
||||
@@ -206,6 +210,7 @@
|
||||
import RefundApprovalDialog from '@/components/business/RefundApprovalDialog.vue'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
|
||||
defineOptions({ name: 'RefundDetail' })
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@
|
||||
import { getErrorMessage, toVoucherKeyList } from '@/utils/business'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
import {
|
||||
resolveAuditResourceTarget,
|
||||
resolveFinanceAuditTarget
|
||||
@@ -1112,7 +1113,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (canRecoverApproval(row) && hasAuth('refund:detail')) {
|
||||
if (canRecoverApproval(row) && hasAuth(AUGUST_PERMISSIONS.refund.recoverApproval)) {
|
||||
actions.push({
|
||||
label: '恢复审批',
|
||||
handler: () => handleRecoverApproval(row),
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton type="primary" :loading="exporting" @click="handleExport">导出</ElButton>
|
||||
<ElButton v-if="canExport" type="primary" :loading="exporting" @click="handleExport">
|
||||
导出
|
||||
</ElButton>
|
||||
<span v-if="snapshotText" class="report-snapshot">{{ snapshotText }}</span>
|
||||
<ElTag v-if="exportTask" :type="exportStatusType" class="report-export-tag">
|
||||
{{ exportTask.status_name || '处理中' }}
|
||||
@@ -50,6 +52,8 @@
|
||||
import type { ActivationSummaryData, ActivationSummaryItem } from '@/types/api'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { ACTIVATION_GROUP_OPTIONS, ACTIVATION_METRIC_COLUMNS, formatMetric } from '../constants'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
|
||||
defineOptions({ name: 'OperationsActivationReport' })
|
||||
|
||||
@@ -80,6 +84,8 @@
|
||||
|
||||
const loading = ref(false)
|
||||
const exporting = ref(false)
|
||||
const { hasAuth } = useAuth()
|
||||
const canExport = computed(() => hasAuth(AUGUST_PERMISSIONS.operationsReports.activationExport))
|
||||
const summary = ref<ActivationSummaryData | null>(null)
|
||||
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton type="primary" :loading="exporting" @click="handleExport">导出</ElButton>
|
||||
<ElButton v-if="canExport" type="primary" :loading="exporting" @click="handleExport">
|
||||
导出
|
||||
</ElButton>
|
||||
<span v-if="snapshotText" class="report-snapshot">{{ snapshotText }}</span>
|
||||
<ElTag v-if="exportTask" :type="exportStatusType" class="report-export-tag">
|
||||
{{ exportTask.status_name || '处理中' }}
|
||||
@@ -50,6 +52,8 @@
|
||||
import type { RenewalSummaryData, RenewalSummaryItem } from '@/types/api'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { RENEWAL_GROUP_OPTIONS, RENEWAL_METRIC_COLUMNS, formatMetric } from '../constants'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
|
||||
defineOptions({ name: 'OperationsRenewalReport' })
|
||||
|
||||
@@ -80,6 +84,8 @@
|
||||
|
||||
const loading = ref(false)
|
||||
const exporting = ref(false)
|
||||
const { hasAuth } = useAuth()
|
||||
const canExport = computed(() => hasAuth(AUGUST_PERMISSIONS.operationsReports.renewalExport))
|
||||
const summary = ref<RenewalSummaryData | null>(null)
|
||||
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
|
||||
@@ -127,7 +127,6 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import type {
|
||||
@@ -143,6 +142,8 @@
|
||||
|
||||
const canCreate = computed(() => hasAuth(perms.ruleCreate))
|
||||
const canUpdate = computed(() => hasAuth(perms.ruleUpdate))
|
||||
const canEnable = computed(() => hasAuth(perms.ruleEnable))
|
||||
const canDisable = computed(() => hasAuth(perms.ruleDisable))
|
||||
|
||||
// ========== 列表数据 ==========
|
||||
|
||||
@@ -333,15 +334,16 @@
|
||||
handler: () => void
|
||||
type?: 'primary' | 'danger'
|
||||
}> = []
|
||||
if (!canUpdate.value) return actions
|
||||
actions.push({ label: '编辑', handler: () => openFormDialog('edit', row) })
|
||||
if (row.enabled) {
|
||||
if (canUpdate.value) {
|
||||
actions.push({ label: '编辑', handler: () => openFormDialog('edit', row) })
|
||||
}
|
||||
if (row.enabled && canDisable.value) {
|
||||
actions.push({
|
||||
label: '停用',
|
||||
handler: () => handleToggleEnabled(row, false),
|
||||
type: 'danger' as const
|
||||
})
|
||||
} else {
|
||||
} else if (!row.enabled && canEnable.value) {
|
||||
actions.push({
|
||||
label: '启用',
|
||||
handler: () => handleToggleEnabled(row, true),
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<el-button type="primary" @click="showCreateDialog">人工优先入队</el-button>
|
||||
<el-button v-if="canCreate" type="primary" @click="showCreateDialog">
|
||||
人工优先入队
|
||||
</el-button>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
|
||||
@@ -187,9 +189,15 @@
|
||||
POLLING_PRIORITY_TRIGGER_TYPE_OPTIONS,
|
||||
getPollingPriorityResultName
|
||||
} from '@/config/constants'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
defineOptions({ name: 'PollingPriorityQueue' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const canCreate = computed(() => hasAuth(AUGUST_PERMISSIONS.pollingPriorityQueue.create))
|
||||
const canDetail = computed(() => hasAuth(AUGUST_PERMISSIONS.pollingPriorityQueue.detail))
|
||||
|
||||
const loading = ref(false)
|
||||
const tableData = ref<PollingPriorityItem[]>([])
|
||||
const tableRef = ref()
|
||||
@@ -329,7 +337,8 @@
|
||||
}))
|
||||
)
|
||||
|
||||
const getActions = () => [{ label: '详情', handler: showDetail, type: 'primary' as const }]
|
||||
const getActions = () =>
|
||||
canDetail.value ? [{ label: '详情', handler: showDetail, type: 'primary' as const }] : []
|
||||
|
||||
const loadData = async () => {
|
||||
loading.value = true
|
||||
|
||||
@@ -74,7 +74,9 @@
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<ElButton type="primary" :loading="saving" @click="handleSave">保存配置</ElButton>
|
||||
<ElButton v-if="canUpdate" type="primary" :loading="saving" @click="handleSave">
|
||||
保存配置
|
||||
</ElButton>
|
||||
<ElButton :disabled="saving" @click="loadConfig">重新加载</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
@@ -84,7 +86,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { AssetWalletService, PackageManageService } from '@/api/modules'
|
||||
import type {
|
||||
@@ -94,10 +96,14 @@
|
||||
} from '@/types/api'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { usePermission } from '@/composables/usePermission'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
|
||||
defineOptions({ name: 'AssetWalletAutoRenewal' })
|
||||
|
||||
const { isPlatformAccount } = usePermission()
|
||||
const { hasAuth } = useAuth()
|
||||
const canUpdate = computed(() => hasAuth(AUGUST_PERMISSIONS.assetWalletAutoRenewal.update))
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div class="registration-detail-page">
|
||||
<ElCard shadow="never">
|
||||
<div class="detail-header">
|
||||
<ElButton @click="router.back()">返回</ElButton>
|
||||
<h2>代理注册申请详情</h2>
|
||||
<ElButton
|
||||
v-if="
|
||||
application?.recoverable &&
|
||||
hasAuth(AUGUST_PERMISSIONS.agentDistributionRegistration.recoverApproval)
|
||||
"
|
||||
type="warning"
|
||||
:loading="recovering"
|
||||
@click="recoverApproval"
|
||||
>
|
||||
恢复审批
|
||||
</ElButton>
|
||||
</div>
|
||||
|
||||
<ElDescriptions v-if="application" :column="2" border>
|
||||
<ElDescriptionsItem label="申请ID">{{ application.id }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="业务状态">{{
|
||||
application.status_name || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="审批状态">{{
|
||||
application.approval_status_name || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="企微提交状态">{{
|
||||
application.submission_status_name || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="手机号">{{ application.phone }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="用户名">{{ application.username }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="店铺名称">{{ application.shop_name }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="店铺编号">{{ application.shop_code }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="上级店铺">{{
|
||||
application.parent_shop_name || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="联系人">{{
|
||||
application.contact_name || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="分销码">{{
|
||||
application.distribution_code || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="申请时间">{{
|
||||
formatDateTime(application.created_at)
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="省市区" :span="2">
|
||||
{{
|
||||
[application.province, application.city, application.district]
|
||||
.filter(Boolean)
|
||||
.join(' / ') || '-'
|
||||
}}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="详细地址" :span="2">{{
|
||||
application.address || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="驳回原因" :span="2">{{
|
||||
application.reject_reason || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="提交失败摘要" :span="2">{{
|
||||
application.failure_summary || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="最近恢复时间">{{
|
||||
application.last_recovery_at ? formatDateTime(application.last_recovery_at) : '-'
|
||||
}}</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
<ElEmpty v-else-if="!loading" description="暂无详情" />
|
||||
<div v-if="loading" class="loading">加载中...</div>
|
||||
</ElCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { AgentDistributionService } from '@/api/modules'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { AgentDistributionRegistrationItem } from '@/types/api'
|
||||
|
||||
defineOptions({ name: 'AgentDistributionRegistrationDetail' })
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const recovering = ref(false)
|
||||
const application = ref<AgentDistributionRegistrationItem | null>(null)
|
||||
const id = Number(route.params.id)
|
||||
|
||||
const loadDetail = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AgentDistributionService.getRegistrationApplicationDetail(id)
|
||||
if (res.code === 0) application.value = res.data
|
||||
else ElMessage.error(res.msg || '获取代理注册申请详情失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const recoverApproval = async () => {
|
||||
if (!application.value?.recoverable || recovering.value) return
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要恢复该代理注册申请的原审批提交吗?', '恢复审批', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
recovering.value = true
|
||||
try {
|
||||
const res = await AgentDistributionService.recoverRegistrationApproval(id)
|
||||
if (res.code === 0) {
|
||||
ElMessage.success(res.msg || '恢复审批成功')
|
||||
await loadDetail()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '恢复审批失败')
|
||||
await loadDetail()
|
||||
}
|
||||
} finally {
|
||||
recovering.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(loadDetail)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.registration-detail-page {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.detail-header h2 {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.loading {
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<ArtTableFullScreen>
|
||||
<div class="agent-registration-page" id="table-full-screen">
|
||||
<ArtSearchBar
|
||||
v-model:filter="searchForm"
|
||||
:items="searchFormItems"
|
||||
show-expand
|
||||
label-width="100px"
|
||||
@reset="handleReset"
|
||||
@search="handleSearch"
|
||||
/>
|
||||
|
||||
<ElCard shadow="never" class="art-table-card">
|
||||
<ArtTableHeader
|
||||
:columnList="columnOptions"
|
||||
v-model:columns="columnChecks"
|
||||
@refresh="handleRefresh"
|
||||
/>
|
||||
|
||||
<ArtTable
|
||||
:loading="loading"
|
||||
:data="items"
|
||||
:currentPage="pagination.page"
|
||||
:pageSize="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:marginTop="10"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<template #default>
|
||||
<ElTableColumn v-for="col in columns" :key="col.prop || col.type" v-bind="col" />
|
||||
</template>
|
||||
</ArtTable>
|
||||
</ElCard>
|
||||
</div>
|
||||
</ArtTableFullScreen>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { h, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElTag } from 'element-plus'
|
||||
import { AgentDistributionService } from '@/api/modules'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants/augustIteration'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import type {
|
||||
AgentDistributionRegistrationItem,
|
||||
AgentDistributionRegistrationQueryParams
|
||||
} from '@/types/api'
|
||||
|
||||
defineOptions({ name: 'AgentDistributionRegistrations' })
|
||||
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const items = ref<AgentDistributionRegistrationItem[]>([])
|
||||
const pagination = reactive({ page: 1, pageSize: 20, total: 0 })
|
||||
const searchForm = reactive({
|
||||
status: undefined as 0 | 1 | 2 | undefined,
|
||||
phone: '',
|
||||
keyword: '',
|
||||
dateRange: [] as string[],
|
||||
submission_anomaly: undefined as number | undefined
|
||||
})
|
||||
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
{
|
||||
label: '业务状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '待审批', value: 0 },
|
||||
{ label: '已通过', value: 1 },
|
||||
{ label: '已驳回', value: 2 }
|
||||
],
|
||||
config: { clearable: true, placeholder: '请选择业务状态' }
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
prop: 'phone',
|
||||
type: 'input',
|
||||
config: { clearable: true, placeholder: '请输入手机号' }
|
||||
},
|
||||
{
|
||||
label: '关键字',
|
||||
prop: 'keyword',
|
||||
type: 'input',
|
||||
config: { clearable: true, placeholder: '店铺/用户名/联系人' }
|
||||
},
|
||||
{
|
||||
label: '申请时间',
|
||||
prop: 'dateRange',
|
||||
type: 'datetimerange',
|
||||
config: {
|
||||
type: 'datetimerange',
|
||||
valueFormat: 'YYYY-MM-DDTHH:mm:ssZ',
|
||||
rangeSeparator: '至',
|
||||
startPlaceholder: '申请开始',
|
||||
endPlaceholder: '申请结束'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '提交异常',
|
||||
prop: 'submission_anomaly',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '仅异常', value: 1 },
|
||||
{ label: '非异常', value: 0 }
|
||||
],
|
||||
config: { clearable: true, placeholder: '全部' }
|
||||
}
|
||||
]
|
||||
|
||||
const columnOptions = [
|
||||
{ label: '申请店铺', prop: 'shop_name' },
|
||||
{ label: '用户名', prop: 'username' },
|
||||
{ label: '手机号', prop: 'phone' },
|
||||
{ label: '上级店铺', prop: 'parent_shop_name' },
|
||||
{ label: '业务状态', prop: 'status_name' },
|
||||
{ label: '审批状态', prop: 'approval_status_name' },
|
||||
{ label: '企微提交状态', prop: 'submission_status_name' },
|
||||
{ label: '可恢复', prop: 'recoverable' },
|
||||
{ label: '申请时间', prop: 'created_at' }
|
||||
]
|
||||
|
||||
const formatStatus = (row: AgentDistributionRegistrationItem) =>
|
||||
h(
|
||||
ElTag,
|
||||
{ type: row.status === 1 ? 'success' : row.status === 2 ? 'danger' : 'warning' },
|
||||
() => row.status_name || '-'
|
||||
)
|
||||
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
prop: 'shop_name',
|
||||
label: '申请店铺',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: AgentDistributionRegistrationItem) =>
|
||||
h(
|
||||
'span',
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: () => openDetail(row)
|
||||
},
|
||||
row.shop_name
|
||||
)
|
||||
},
|
||||
{ prop: 'username', label: '用户名', width: 140 },
|
||||
{ prop: 'phone', label: '手机号', width: 140 },
|
||||
{
|
||||
prop: 'parent_shop_name',
|
||||
label: '上级店铺',
|
||||
width: 150,
|
||||
formatter: (row: AgentDistributionRegistrationItem) => row.parent_shop_name || '-'
|
||||
},
|
||||
{ prop: 'status_name', label: '业务状态', width: 110, formatter: formatStatus },
|
||||
{
|
||||
prop: 'approval_status_name',
|
||||
label: '审批状态',
|
||||
width: 130,
|
||||
formatter: (row: AgentDistributionRegistrationItem) => row.approval_status_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'submission_status_name',
|
||||
label: '企微提交状态',
|
||||
width: 140,
|
||||
formatter: (row: AgentDistributionRegistrationItem) => row.submission_status_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'recoverable',
|
||||
label: '可恢复',
|
||||
width: 90,
|
||||
formatter: (row: AgentDistributionRegistrationItem) =>
|
||||
h(ElTag, { type: row.recoverable ? 'warning' : 'info' }, () =>
|
||||
row.recoverable ? '是' : '否'
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '申请时间',
|
||||
width: 180,
|
||||
formatter: (row: AgentDistributionRegistrationItem) => formatDateTime(row.created_at)
|
||||
}
|
||||
])
|
||||
|
||||
const getParams = (): AgentDistributionRegistrationQueryParams => ({
|
||||
page: pagination.page,
|
||||
page_size: pagination.pageSize,
|
||||
status: searchForm.status,
|
||||
phone: searchForm.phone.trim() || undefined,
|
||||
keyword: searchForm.keyword.trim() || undefined,
|
||||
start_time: searchForm.dateRange[0] || undefined,
|
||||
end_time: searchForm.dateRange[1] || undefined,
|
||||
submission_anomaly:
|
||||
searchForm.submission_anomaly === undefined ? undefined : searchForm.submission_anomaly === 1
|
||||
})
|
||||
|
||||
const loadData = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await AgentDistributionService.getRegistrationApplications(getParams())
|
||||
if (res.code === 0 && res.data) {
|
||||
items.value = res.data.items || []
|
||||
pagination.total = res.data.total || 0
|
||||
} else {
|
||||
ElMessage.error(res.msg || '获取代理注册申请失败')
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
searchForm.status = undefined
|
||||
searchForm.phone = ''
|
||||
searchForm.keyword = ''
|
||||
searchForm.dateRange = []
|
||||
searchForm.submission_anomaly = undefined
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
const handleRefresh = () => loadData()
|
||||
|
||||
const handleSizeChange = (size: number) => {
|
||||
pagination.pageSize = size
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
const handleCurrentChange = (page: number) => {
|
||||
pagination.page = page
|
||||
loadData()
|
||||
}
|
||||
|
||||
const openDetail = (row: AgentDistributionRegistrationItem) => {
|
||||
if (!hasAuth(AUGUST_PERMISSIONS.agentDistributionRegistration.detail)) {
|
||||
ElMessage.warning('您没有查看代理注册申请详情的权限')
|
||||
return
|
||||
}
|
||||
router.push(`${RoutesAlias.AgentDistributionRegistrationDetail}/${row.id}`)
|
||||
}
|
||||
|
||||
onMounted(loadData)
|
||||
</script>
|
||||
@@ -45,6 +45,8 @@
|
||||
:pageSize="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:marginTop="10"
|
||||
:actions="getActions"
|
||||
:actionsWidth="90"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
@@ -199,9 +201,13 @@
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { SHOP_BUSINESS_OWNER_PERMISSIONS } from '@/config/constants'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
defineOptions({ name: 'BusinessOwnerImport' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const canImportDetail = computed(() => hasAuth(SHOP_BUSINESS_OWNER_PERMISSIONS.importDetail))
|
||||
|
||||
const importStatusOptions = [
|
||||
{ label: '待处理', value: 1 },
|
||||
{ label: '处理中', value: 2 },
|
||||
@@ -251,6 +257,7 @@
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: (event: MouseEvent) => {
|
||||
if (!canImportDetail.value) return
|
||||
event.stopPropagation()
|
||||
openDetail(row)
|
||||
}
|
||||
@@ -349,6 +356,11 @@
|
||||
getList()
|
||||
}
|
||||
|
||||
const getActions = (row: BusinessOwnerImportDetail) =>
|
||||
canImportDetail.value
|
||||
? [{ label: '详情', handler: () => openDetail(row), type: 'primary' as const }]
|
||||
: []
|
||||
|
||||
// ==================== 模板下载 ====================
|
||||
const handleDownloadTemplate = () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user