feat(pickup): 增加第三方单号补录功能并优化列表提号备注展示
- 后端支持补录/修改第三方单号接口 PUT /api/v1/admin/pickups/:id/third-party-order-no,记录流转事件与审计日志 - 前端线下提号主列表在第三方单号列后展示提号备注列 - 前端列表操作列及提号详情页增加补录/修改第三方单号操作入口与弹窗 - 通过 scripts/check.sh 全量门禁校验
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
fetchAdminPickupShopOptions,
|
||||
fetchAvailableListings,
|
||||
updateAdminPickupProfit,
|
||||
updateAdminPickupThirdPartyOrderNo,
|
||||
type AdminPickup,
|
||||
type AvailableListing,
|
||||
type AvailableListingSourceType,
|
||||
@@ -48,11 +49,14 @@ const createDialogVisible = ref(false)
|
||||
const completeDialogVisible = ref(false)
|
||||
const profitDialogVisible = ref(false)
|
||||
const financialAdjustmentDialogVisible = ref(false)
|
||||
const thirdPartyOrderNoDialogVisible = 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 thirdPartyOrderNoForm = reactive({ third_party_order_no: '' })
|
||||
|
||||
const createForm = reactive({
|
||||
listing_id: null as number | null,
|
||||
@@ -280,6 +284,41 @@ async function handleConfirmOfflineSettlement(row: AdminPickup) {
|
||||
}
|
||||
}
|
||||
|
||||
function openThirdPartyOrderNoDialog(row: AdminPickup) {
|
||||
activePickupId.value = row.id
|
||||
activePickup.value = row
|
||||
thirdPartyOrderNoForm.third_party_order_no = row.third_party_order_no || ''
|
||||
thirdPartyOrderNoDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function handleSaveThirdPartyOrderNo() {
|
||||
const orderNo = thirdPartyOrderNoForm.third_party_order_no.trim()
|
||||
if (!orderNo) {
|
||||
ElMessage.warning('请输入第三方单号')
|
||||
return
|
||||
}
|
||||
if (!activePickupId.value) return
|
||||
thirdPartyOrderNoSaving.value = true
|
||||
try {
|
||||
const updated = await updateAdminPickupThirdPartyOrderNo(activePickupId.value, {
|
||||
third_party_order_no: orderNo,
|
||||
})
|
||||
ElMessage.success('第三方单号已更新')
|
||||
thirdPartyOrderNoDialogVisible.value = false
|
||||
if (activePickup.value) {
|
||||
activePickup.value.third_party_order_no = updated.third_party_order_no
|
||||
}
|
||||
const target = items.value.find(item => item.id === activePickupId.value)
|
||||
if (target) {
|
||||
target.third_party_order_no = updated.third_party_order_no
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
ElMessage.error(errorMessage(e) || '保存失败')
|
||||
} finally {
|
||||
thirdPartyOrderNoSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openProfitDialog(row: AdminPickup) {
|
||||
activePickupId.value = row.id
|
||||
profitForm.profit_amount = centToYuan(row.profit_amount_cent)
|
||||
@@ -605,6 +644,12 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
<span v-else class="text-muted">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提号备注" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.remark">{{ row.remark }}</span>
|
||||
<span v-else class="text-muted">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺名称" min-width="130">
|
||||
<template #default="{ row }">{{ row.shop_name || '-' }}</template>
|
||||
</el-table-column>
|
||||
@@ -652,12 +697,22 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
<el-table-column label="创建时间" width="170">
|
||||
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="340" fixed="right">
|
||||
<el-table-column label="操作" width="380" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div class="action-buttons">
|
||||
<RouterLink :to="adminPath(`pickup/${row.id}`)">
|
||||
<el-button size="small">详情</el-button>
|
||||
</RouterLink>
|
||||
<el-button
|
||||
v-if="row.status !== 'cancelled'"
|
||||
:type="row.third_party_order_no ? '' : 'warning'"
|
||||
size="small"
|
||||
plain
|
||||
:icon="EditPen"
|
||||
@click="openThirdPartyOrderNoDialog(row)"
|
||||
>
|
||||
{{ row.third_party_order_no ? '改单号' : '补录单号' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.status === 'picking_up'"
|
||||
type="success"
|
||||
@@ -1057,6 +1112,41 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 补录/修改第三方单号 -->
|
||||
<el-dialog
|
||||
v-model="thirdPartyOrderNoDialogVisible"
|
||||
:title="activePickup?.third_party_order_no ? '修改第三方单号' : '补录第三方单号'"
|
||||
width="460px"
|
||||
>
|
||||
<el-form :model="thirdPartyOrderNoForm" label-width="110px">
|
||||
<el-form-item label="提号单号">
|
||||
<span class="text-muted">{{ activePickup?.pickup_no }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前单号">
|
||||
<span>{{ activePickup?.third_party_order_no || '(未录入)' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="第三方单号" required>
|
||||
<el-input
|
||||
v-model="thirdPartyOrderNoForm.third_party_order_no"
|
||||
placeholder="请输入淘宝/拼多多/外部订单号"
|
||||
maxlength="128"
|
||||
show-word-limit
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="thirdPartyOrderNoDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="thirdPartyOrderNoSaving"
|
||||
@click="handleSaveThirdPartyOrderNo"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user