feat(finance): 增加线下结算实际操作人
This commit is contained in:
@@ -155,6 +155,7 @@ export interface FinanceDisbursementItem {
|
||||
paid_at?: string
|
||||
operator_id?: number
|
||||
operator_name: string
|
||||
actual_operator_name: string
|
||||
remark: string
|
||||
category: string
|
||||
custom_category_name: string
|
||||
@@ -204,6 +205,7 @@ export interface FinanceDisbursementQuery extends FinanceDateQuery {
|
||||
operator?: string
|
||||
operator_name?: string
|
||||
operator_id?: string
|
||||
actual_operator?: string
|
||||
user_id?: string
|
||||
page?: number
|
||||
page_size?: number
|
||||
|
||||
@@ -2,8 +2,8 @@ import { apiClient } from '@/shared/api/client'
|
||||
|
||||
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
||||
|
||||
/** 录单可选项类型:平台 / 操作人 */
|
||||
export type ManualEntryOptionType = 'platform' | 'operator'
|
||||
/** 可选项类型:平台 / 录单操作人 / 出款实际操作人 */
|
||||
export type ManualEntryOptionType = 'platform' | 'operator' | 'disbursement_operator'
|
||||
|
||||
/** 录单组别:收号 / 出号 */
|
||||
export type ManualEntryGroup = 'collect' | 'sell'
|
||||
@@ -34,6 +34,7 @@ export interface ManualEntryOption {
|
||||
export interface ManualEntryOptions {
|
||||
platforms: ManualEntryOption[]
|
||||
operators: ManualEntryOption[]
|
||||
disbursement_operators: ManualEntryOption[]
|
||||
}
|
||||
|
||||
export interface ManualEntryAgentStats {
|
||||
@@ -121,6 +122,14 @@ export async function fetchManualEntryOptions() {
|
||||
return data.data
|
||||
}
|
||||
|
||||
/** 获取线下结算实际操作人选项。 */
|
||||
export async function fetchDisbursementOperators() {
|
||||
const { data } = await apiClient.get<ApiResponse<ManualEntryOption[]>>(
|
||||
'/admin/manual-entries/options/disbursement-operators'
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function createManualEntryOption(payload: {
|
||||
type: ManualEntryOptionType
|
||||
name: string
|
||||
|
||||
@@ -45,6 +45,7 @@ export interface AdminPickup {
|
||||
status: string
|
||||
offline_settlement_status: PickupOfflineSettlementStatus
|
||||
offline_settlement_remark: string
|
||||
offline_settlement_actual_operator: string
|
||||
offline_settled_by?: number
|
||||
offline_settled_at?: string
|
||||
remark: string
|
||||
@@ -140,6 +141,7 @@ export interface AdminPickupThirdPartyOrderNoUpdateRequest {
|
||||
}
|
||||
|
||||
export interface AdminPickupOfflineSettlementRequest {
|
||||
actual_operator: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
@@ -347,7 +349,7 @@ export async function completeAdminPickup(id: number, req: AdminPickupCompleteRe
|
||||
|
||||
export async function confirmAdminPickupOfflineSettlement(
|
||||
id: number,
|
||||
req: AdminPickupOfflineSettlementRequest = {}
|
||||
req: AdminPickupOfflineSettlementRequest
|
||||
) {
|
||||
const { data } = await apiClient.post<ApiResponse<AdminPickup>>(
|
||||
`/admin/pickups/${id}/offline-settlement`,
|
||||
|
||||
@@ -156,6 +156,7 @@ const filters = reactive({
|
||||
business_no: '',
|
||||
keyword: '',
|
||||
operator: '',
|
||||
actual_operator: '',
|
||||
user_id: '',
|
||||
})
|
||||
|
||||
@@ -196,6 +197,7 @@ function resetFilters() {
|
||||
filters.business_no = ''
|
||||
filters.keyword = ''
|
||||
filters.operator = ''
|
||||
filters.actual_operator = ''
|
||||
filters.user_id = ''
|
||||
currentPage.value = 1
|
||||
void loadItems()
|
||||
@@ -600,10 +602,18 @@ function accountTypeLabel(type: string) {
|
||||
<el-input v-model="filters.keyword" clearable placeholder="姓名、手机号或账号" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="操作人">
|
||||
<el-form-item label="管理员操作人">
|
||||
<el-input v-model="filters.operator" clearable placeholder="姓名、用户名或管理员 ID" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="实际操作人">
|
||||
<el-input
|
||||
v-model="filters.actual_operator"
|
||||
clearable
|
||||
placeholder="按出款实际操作人筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="用户 ID">
|
||||
<el-input v-model="filters.user_id" clearable placeholder="按用户 ID 检索" />
|
||||
</el-form-item>
|
||||
@@ -722,12 +732,18 @@ function accountTypeLabel(type: string) {
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作人" min-width="110">
|
||||
<el-table-column label="管理员操作人" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="operator-name">{{ row.operator_name || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="实际操作人" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="operator-name">{{ row.actual_operator_name || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" min-width="160" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span class="remark-text">{{ row.remark || '-' }}</span>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
.option-config-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,11 @@ const filters = reactive({
|
||||
dateRange: null as string[] | null,
|
||||
})
|
||||
|
||||
const options = ref<ManualEntryOptions>({ platforms: [], operators: [] })
|
||||
const options = ref<ManualEntryOptions>({
|
||||
platforms: [],
|
||||
operators: [],
|
||||
disbursement_operators: [],
|
||||
})
|
||||
const optionsLoading = ref(false)
|
||||
|
||||
const entryForm = reactive({
|
||||
@@ -273,16 +277,26 @@ const optionSubmitting = ref(false)
|
||||
const newPlatformName = ref('')
|
||||
const newOperatorName = ref('')
|
||||
const newOperatorGroupTag = ref<ManualEntryGroup | ''>('')
|
||||
const newDisbursementOperatorName = ref('')
|
||||
|
||||
function openConfig() {
|
||||
configVisible.value = true
|
||||
if (!options.value.platforms.length && !options.value.operators.length) {
|
||||
if (
|
||||
!options.value.platforms.length &&
|
||||
!options.value.operators.length &&
|
||||
!options.value.disbursement_operators.length
|
||||
) {
|
||||
void loadOptions()
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAddOption(type: ManualEntryOptionType) {
|
||||
const name = (type === 'platform' ? newPlatformName.value : newOperatorName.value).trim()
|
||||
const name =
|
||||
type === 'platform'
|
||||
? newPlatformName.value.trim()
|
||||
: type === 'operator'
|
||||
? newOperatorName.value.trim()
|
||||
: newDisbursementOperatorName.value.trim()
|
||||
if (!name) {
|
||||
ElMessage.warning('请输入名称')
|
||||
return
|
||||
@@ -294,10 +308,13 @@ async function handleAddOption(type: ManualEntryOptionType) {
|
||||
name,
|
||||
group_tag: type === 'operator' ? newOperatorGroupTag.value || undefined : undefined,
|
||||
})
|
||||
if (type === 'platform') newPlatformName.value = ''
|
||||
else {
|
||||
if (type === 'platform') {
|
||||
newPlatformName.value = ''
|
||||
} else if (type === 'operator') {
|
||||
newOperatorName.value = ''
|
||||
newOperatorGroupTag.value = ''
|
||||
} else {
|
||||
newDisbursementOperatorName.value = ''
|
||||
}
|
||||
ElMessage.success('已添加')
|
||||
await loadOptions()
|
||||
@@ -326,7 +343,10 @@ async function handleRenameOption(item: ManualEntryOption) {
|
||||
if (!name || name === item.name) return
|
||||
optionSubmitting.value = true
|
||||
try {
|
||||
await updateManualEntryOption(item.id, { name, group_tag: item.group_tag })
|
||||
await updateManualEntryOption(item.id, {
|
||||
name,
|
||||
group_tag: item.type === 'operator' ? item.group_tag : '',
|
||||
})
|
||||
ElMessage.success('已重命名')
|
||||
await loadOptions()
|
||||
} catch (error) {
|
||||
@@ -358,9 +378,11 @@ async function handleOperatorGroupChange(item: ManualEntryOption, groupTag: Manu
|
||||
}
|
||||
|
||||
async function handleRemoveOption(item: ManualEntryOption) {
|
||||
const typeLabel =
|
||||
item.type === 'platform' ? '平台' : item.type === 'operator' ? '录单操作人' : '出款实际操作人'
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定删除${item.type === 'platform' ? '平台' : '操作人'}【${item.name}】吗?历史录单记录不受影响。`,
|
||||
`确定删除${typeLabel}【${item.name}】吗?历史记录不受影响。`,
|
||||
'删除确认',
|
||||
{ confirmButtonText: '确认删除', cancelButtonText: '取消', type: 'warning' }
|
||||
)
|
||||
@@ -391,7 +413,7 @@ async function handleRemoveOption(item: ManualEntryOption) {
|
||||
</div>
|
||||
<div class="page-header-actions">
|
||||
<el-button v-if="canManageOptions" :loading="optionsLoading" @click="openConfig">
|
||||
配置平台/操作人
|
||||
配置平台/操作人/出款人
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -626,17 +648,17 @@ async function handleRemoveOption(item: ManualEntryOption) {
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 平台 / 操作人配置弹窗 -->
|
||||
<!-- 平台 / 操作人 / 出款实际操作人配置弹窗 -->
|
||||
<el-dialog
|
||||
v-model="configVisible"
|
||||
title="配置平台与操作人"
|
||||
width="720px"
|
||||
title="配置平台、操作人与出款实际操作人"
|
||||
width="980px"
|
||||
destroy-on-close
|
||||
class="manual-entry-config-dialog"
|
||||
>
|
||||
<p class="option-config-tip">
|
||||
这里维护的可选项会出现在录单表单的下拉中;删除选项不会影响已登记的历史记录。
|
||||
操作人可设置组别标记(收号/出号),录单选中后自动带出对应组别。
|
||||
录单操作人与出款实际操作人是两套独立配置。出款实际操作人用于平台代管订单和提号确认线下结算;
|
||||
删除选项不会影响已保存的历史记录。
|
||||
</p>
|
||||
<div class="option-config-grid">
|
||||
<section class="option-config-panel">
|
||||
@@ -726,6 +748,42 @@ async function handleRemoveOption(item: ManualEntryOption) {
|
||||
</ul>
|
||||
<p v-if="!options.operators.length" class="option-config-empty">暂无操作人,请先添加</p>
|
||||
</section>
|
||||
|
||||
<section class="option-config-panel">
|
||||
<header class="option-config-title">出款实际操作人</header>
|
||||
<div class="option-config-add">
|
||||
<el-input
|
||||
v-model="newDisbursementOperatorName"
|
||||
placeholder="新增出款实际操作人"
|
||||
maxlength="64"
|
||||
clearable
|
||||
@keyup.enter="handleAddOption('disbursement_operator')"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="optionSubmitting"
|
||||
@click="handleAddOption('disbursement_operator')"
|
||||
>
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
<ul class="option-config-list">
|
||||
<li v-for="item in options.disbursement_operators" :key="item.id">
|
||||
<span class="option-config-name">{{ item.name }}</span>
|
||||
<span class="option-config-actions">
|
||||
<el-button link type="primary" size="small" @click="handleRenameOption(item)">
|
||||
重命名
|
||||
</el-button>
|
||||
<el-button link type="danger" size="small" @click="handleRemoveOption(item)">
|
||||
删除
|
||||
</el-button>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<p v-if="!options.disbursement_operators.length" class="option-config-empty">
|
||||
暂无可选实际出款人,请先添加
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="configVisible = false">关闭</el-button>
|
||||
|
||||
@@ -29,6 +29,10 @@ import {
|
||||
} from '@/features/orders'
|
||||
import { adminCreateOrderDispute } from '@/features/disputes'
|
||||
import { fetchAdminPayments, type AdminPayment } from '@/features/admin/api/adminPayments'
|
||||
import {
|
||||
fetchDisbursementOperators,
|
||||
type ManualEntryOption,
|
||||
} from '@/features/admin/api/adminManualEntry'
|
||||
import CheckoutSystemDetail from '@/features/orders/components/CheckoutSystemDetail.vue'
|
||||
import {
|
||||
getSnapshotHafCoinM,
|
||||
@@ -95,6 +99,9 @@ const platformCheckoutCounterForm = ref({
|
||||
})
|
||||
const offlineSettlementVisible = ref(false)
|
||||
const offlineSettlementRemark = ref('')
|
||||
const offlineSettlementOperator = ref('')
|
||||
const disbursementOperators = ref<ManualEntryOption[]>([])
|
||||
const disbursementOperatorsLoading = ref(false)
|
||||
const platformSubmitting = ref(false)
|
||||
const adminDisputeVisible = ref(false)
|
||||
const adminDisputeSubmitting = ref(false)
|
||||
@@ -756,16 +763,42 @@ async function submitAdminDispute() {
|
||||
}
|
||||
}
|
||||
|
||||
function loadDisbursementOperators() {
|
||||
if (disbursementOperatorsLoading.value) return
|
||||
disbursementOperatorsLoading.value = true
|
||||
fetchDisbursementOperators()
|
||||
.then(items => {
|
||||
disbursementOperators.value = Array.isArray(items) ? items : []
|
||||
})
|
||||
.catch(error => {
|
||||
ElMessage.error(readError(error, '获取出款实际操作人失败'))
|
||||
})
|
||||
.finally(() => {
|
||||
disbursementOperatorsLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function openOfflineSettlement() {
|
||||
offlineSettlementRemark.value = ''
|
||||
offlineSettlementOperator.value = ''
|
||||
offlineSettlementVisible.value = true
|
||||
if (!disbursementOperators.value.length) loadDisbursementOperators()
|
||||
}
|
||||
|
||||
async function submitOfflineSettlement() {
|
||||
if (!order.value) return
|
||||
const actualOperator = offlineSettlementOperator.value.trim()
|
||||
if (!actualOperator) {
|
||||
ElMessage.warning('请选择出款实际操作人')
|
||||
return
|
||||
}
|
||||
platformSubmitting.value = true
|
||||
try {
|
||||
await adminMarkOfflineSettlement(order.value.id, offlineSettlementRemark.value.trim())
|
||||
await adminMarkOfflineSettlement(
|
||||
order.value.id,
|
||||
actualOperator,
|
||||
offlineSettlementRemark.value.trim()
|
||||
)
|
||||
ElMessage.success('线下结算已确认')
|
||||
offlineSettlementVisible.value = false
|
||||
await loadOrder()
|
||||
@@ -1236,6 +1269,10 @@ function formatRatioNumber(value: number) {
|
||||
<dt>确认客服</dt>
|
||||
<dd>ID {{ order.offline_settled_by }}</dd>
|
||||
</div>
|
||||
<div v-if="order.offline_settlement_actual_operator">
|
||||
<dt>实际操作人</dt>
|
||||
<dd>{{ order.offline_settlement_actual_operator }}</dd>
|
||||
</div>
|
||||
<div v-if="order.offline_settled_at">
|
||||
<dt>确认时间</dt>
|
||||
<dd>{{ formatDateTime(order.offline_settled_at) }}</dd>
|
||||
@@ -1735,12 +1772,34 @@ function formatRatioNumber(value: number) {
|
||||
待打款金额
|
||||
<strong>{{ moneyCent(order.offline_settlement_amount_cent) }}</strong>
|
||||
</p>
|
||||
<el-input
|
||||
v-model="offlineSettlementRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="填写线下转账备注,可留空"
|
||||
/>
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="实际操作人" required>
|
||||
<el-select
|
||||
v-model="offlineSettlementOperator"
|
||||
filterable
|
||||
clearable
|
||||
class="full-control"
|
||||
:loading="disbursementOperatorsLoading"
|
||||
placeholder="请选择实际完成出款的人员"
|
||||
no-data-text="暂无可选项,请先在客服手动录单的配置中添加"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in disbursementOperators"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注">
|
||||
<el-input
|
||||
v-model="offlineSettlementRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="填写线下转账备注,可留空"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="offlineSettlementVisible = false">取消</el-button>
|
||||
|
||||
@@ -499,6 +499,10 @@ function readSnapshotResources(summary: Record<string, unknown> | null): Snapsho
|
||||
<dt>线下结算时间</dt>
|
||||
<dd>{{ formatDateTime(pickup.offline_settled_at, '待确认') }}</dd>
|
||||
</div>
|
||||
<div v-if="pickup.settlement_mode === 'platform_managed'">
|
||||
<dt>实际操作人</dt>
|
||||
<dd>{{ pickup.offline_settlement_actual_operator || '-' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>交易渠道</dt>
|
||||
<dd>{{ pickup.platform || '-' }}</dd>
|
||||
|
||||
@@ -20,12 +20,17 @@ import {
|
||||
type PickupAccountSource,
|
||||
type PickupOfflineSettlementStatus,
|
||||
} from '@/features/admin/api/adminPickup'
|
||||
import {
|
||||
fetchDisbursementOperators,
|
||||
type ManualEntryOption,
|
||||
} from '@/features/admin/api/adminManualEntry'
|
||||
import PickupShopDialog from '@/features/admin/components/PickupShopDialog.vue'
|
||||
import { useAdminSessionStore } from '@/stores/adminSession'
|
||||
import { centToYuan, formatCentWithSymbol, yuanToCent } from '@/shared/utils/money'
|
||||
import { formatDateTime } from '@/shared/utils/time'
|
||||
import { pickupStatusLabel } from '@/shared/utils/statusLabels'
|
||||
import { adminPath } from '@/shared/utils/adminPath'
|
||||
import { readError } from '@/shared/utils/error'
|
||||
|
||||
const adminSession = useAdminSessionStore()
|
||||
const currentAdminName = computed(() => adminSession.nickname || adminSession.username || '')
|
||||
@@ -62,12 +67,14 @@ const completeDialogVisible = ref(false)
|
||||
const profitDialogVisible = ref(false)
|
||||
const financialAdjustmentDialogVisible = ref(false)
|
||||
const thirdPartyOrderNoDialogVisible = ref(false)
|
||||
const offlineSettlementDialogVisible = ref(false)
|
||||
const shopMgrVisible = ref(false)
|
||||
const activePickupId = ref(0)
|
||||
const activePickup = ref<AdminPickup | null>(null)
|
||||
const profitSaving = ref(false)
|
||||
const financialAdjustmentSaving = ref(false)
|
||||
const thirdPartyOrderNoSaving = ref(false)
|
||||
const offlineSettlementSaving = ref(false)
|
||||
const thirdPartyOrderNoForm = reactive({ third_party_order_no: '' })
|
||||
|
||||
const createForm = reactive({
|
||||
@@ -84,6 +91,9 @@ const createForm = reactive({
|
||||
const completeForm = reactive({ settle_amount: 0, profit_amount: 0, complete_remark: '' })
|
||||
const profitForm = reactive({ profit_amount: 0, reason: '' })
|
||||
const financialAdjustmentForm = reactive({ profit_amount: 0, settle_amount: 0, reason: '' })
|
||||
const offlineSettlementForm = reactive({ actual_operator: '', remark: '' })
|
||||
const disbursementOperators = ref<ManualEntryOption[]>([])
|
||||
const disbursementOperatorsLoading = ref(false)
|
||||
|
||||
const listingOptions = ref<AvailableListing[]>([])
|
||||
const listingLoading = ref(false)
|
||||
@@ -310,31 +320,54 @@ function openCompleteDialog(row: AdminPickup) {
|
||||
completeDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function handleConfirmOfflineSettlement(row: AdminPickup) {
|
||||
function loadDisbursementOperators() {
|
||||
if (disbursementOperatorsLoading.value) return
|
||||
disbursementOperatorsLoading.value = true
|
||||
fetchDisbursementOperators()
|
||||
.then(items => {
|
||||
disbursementOperators.value = Array.isArray(items) ? items : []
|
||||
})
|
||||
.catch(error => {
|
||||
ElMessage.error(readError(error, '获取出款实际操作人失败'))
|
||||
})
|
||||
.finally(() => {
|
||||
disbursementOperatorsLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function openOfflineSettlementDialog(row: AdminPickup) {
|
||||
activePickupId.value = row.id
|
||||
activePickup.value = row
|
||||
offlineSettlementForm.actual_operator = ''
|
||||
offlineSettlementForm.remark = ''
|
||||
offlineSettlementDialogVisible.value = true
|
||||
if (!disbursementOperators.value.length) loadDisbursementOperators()
|
||||
}
|
||||
|
||||
async function submitOfflineSettlement() {
|
||||
if (!activePickupId.value) return
|
||||
const actualOperator = offlineSettlementForm.actual_operator.trim()
|
||||
if (!actualOperator) {
|
||||
ElMessage.warning('请选择出款实际操作人')
|
||||
return
|
||||
}
|
||||
if (offlineSettlementForm.remark.length > 255) {
|
||||
ElMessage.warning('结算备注不能超过 255 个字符')
|
||||
return
|
||||
}
|
||||
offlineSettlementSaving.value = true
|
||||
try {
|
||||
const { value } = await ElMessageBox.prompt(
|
||||
`确认已向卖家线下支付 ${formatCentWithSymbol(effectiveSettleCent(row))}?`,
|
||||
'确认线下结算',
|
||||
{
|
||||
confirmButtonText: '确认已打款',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPlaceholder: '结算备注(可选)',
|
||||
inputValidator: input => input.length <= 255 || '备注不能超过 255 个字符',
|
||||
}
|
||||
)
|
||||
loading.value = true
|
||||
try {
|
||||
await confirmAdminPickupOfflineSettlement(row.id, { remark: value })
|
||||
ElMessage.success('已确认线下结算')
|
||||
loadList()
|
||||
} catch (e: unknown) {
|
||||
ElMessage.error(errorMessage(e) || '确认失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
} catch {
|
||||
/* 用户放弃 */
|
||||
await confirmAdminPickupOfflineSettlement(activePickupId.value, {
|
||||
actual_operator: actualOperator,
|
||||
remark: offlineSettlementForm.remark.trim(),
|
||||
})
|
||||
ElMessage.success('已确认线下结算')
|
||||
offlineSettlementDialogVisible.value = false
|
||||
loadList()
|
||||
} catch (error) {
|
||||
ElMessage.error(errorMessage(error) || '确认失败')
|
||||
} finally {
|
||||
offlineSettlementSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -803,7 +836,7 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
@click="handleConfirmOfflineSettlement(row)"
|
||||
@click="openOfflineSettlementDialog(row)"
|
||||
>
|
||||
确认线下结算
|
||||
</el-button>
|
||||
@@ -1180,6 +1213,63 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 确认线下结算 -->
|
||||
<el-dialog
|
||||
v-model="offlineSettlementDialogVisible"
|
||||
title="确认线下结算"
|
||||
width="520px"
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="提号单号">
|
||||
<span>{{ activePickup?.pickup_no || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认打款金额">
|
||||
<strong>{{
|
||||
activePickup ? formatCentWithSymbol(effectiveSettleCent(activePickup)) : '-'
|
||||
}}</strong>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际操作人" required>
|
||||
<el-select
|
||||
v-model="offlineSettlementForm.actual_operator"
|
||||
filterable
|
||||
clearable
|
||||
class="full-control"
|
||||
:loading="disbursementOperatorsLoading"
|
||||
placeholder="请选择实际完成出款的人员"
|
||||
no-data-text="暂无可选项,请先在客服手动录单的配置中添加"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in disbursementOperators"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注">
|
||||
<el-input
|
||||
v-model="offlineSettlementForm.remark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="填写线下转账备注,可留空"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="offlineSettlementDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="offlineSettlementSaving"
|
||||
@click="submitOfflineSettlement"
|
||||
>
|
||||
确认已打款
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 补录/修改第三方单号 -->
|
||||
<el-dialog
|
||||
v-model="thirdPartyOrderNoDialogVisible"
|
||||
|
||||
@@ -72,6 +72,7 @@ export interface Order {
|
||||
offline_settlement_status?: string
|
||||
offline_settlement_amount_cent?: number
|
||||
offline_settlement_remark?: string
|
||||
offline_settlement_actual_operator?: string
|
||||
offline_settled_by?: number
|
||||
offline_settled_at?: string
|
||||
refund_status?: string
|
||||
@@ -609,10 +610,14 @@ export async function adminPlatformCheckoutDispute(id: number, reason: string) {
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminMarkOfflineSettlement(id: number, remark: string) {
|
||||
export async function adminMarkOfflineSettlement(
|
||||
id: number,
|
||||
actualOperator: string,
|
||||
remark: string
|
||||
) {
|
||||
const { data } = await apiClient.post<ApiResponse<{ settled: boolean }>>(
|
||||
`/admin/orders/${id}/offline-settlement`,
|
||||
{ remark }
|
||||
{ actual_operator: actualOperator, remark }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user