优化落库功能
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
title="按当前筛选分页查询上游订单并逐单同步计费,避免一次性加载全量。"
|
||||
title="按当前筛选分页查询上游订单并逐单覆盖本地字段(不计费;计费请到订单列表重新计费)。"
|
||||
/>
|
||||
</el-form>
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
/ 失败 {{ progress.fail || 0 }}
|
||||
</div>
|
||||
<div v-if="progress.error" class="filter-retry-progress__error">{{ progress.error }}</div>
|
||||
<p v-if="loading" class="filter-retry-progress__hint">请勿关闭页面,大量订单同步计费可能需要一些时间</p>
|
||||
<p v-if="loading" class="filter-retry-progress__hint">请勿关闭页面,大量订单同步落库可能需要一些时间</p>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<template v-if="!loading && !finished">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">开始同步计费</el-button>
|
||||
<el-button type="primary" @click="submit">开始同步落库</el-button>
|
||||
</template>
|
||||
<template v-else-if="finished">
|
||||
<el-button type="primary" @click="visible = false">关闭</el-button>
|
||||
@@ -101,9 +101,9 @@ const filterText = computed(() => {
|
||||
})
|
||||
|
||||
const dialogTitle = computed(() => {
|
||||
if (loading.value) return '异步同步计费进行中'
|
||||
if (finished.value) return '异步同步计费完成'
|
||||
return '条件批量同步计费'
|
||||
if (loading.value) return '异步同步落库进行中'
|
||||
if (finished.value) return '异步同步落库完成'
|
||||
return '条件批量同步落库'
|
||||
})
|
||||
|
||||
const progressPercent = computed(() => Math.min(100, Math.max(0, Number(progress.value?.percent) || 0)))
|
||||
@@ -124,7 +124,7 @@ function mapProgressMessage(message, data) {
|
||||
if (m === 'no tasks') return '无匹配订单'
|
||||
if (m === 'failed') return '执行失败'
|
||||
if (m.startsWith('processing ')) {
|
||||
return '正在同步计费 ' + m.slice('processing '.length)
|
||||
return '正在同步落库 ' + m.slice('processing '.length)
|
||||
}
|
||||
if (m.startsWith('done ')) {
|
||||
return '完成:成功 ' + (data?.ok || 0) + ' / 失败 ' + (data?.fail || 0)
|
||||
@@ -236,7 +236,7 @@ function submit(skipConfirm) {
|
||||
status: 'FAIL',
|
||||
percent: 100,
|
||||
message: 'failed',
|
||||
error: progress.value?.error || '批量同步计费失败'
|
||||
error: progress.value?.error || '批量同步落库失败'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ function submit(skipConfirm) {
|
||||
return
|
||||
}
|
||||
proxy.$modal.confirm(
|
||||
'确认按当前筛选分页查询并异步同步计费?',
|
||||
'确认按当前筛选分页查询并异步同步落库?',
|
||||
'二次确认'
|
||||
).then(() => start()).catch(() => {})
|
||||
}
|
||||
@@ -278,7 +278,7 @@ function poll(asyncTaskId) {
|
||||
return
|
||||
}
|
||||
if (st === 'FAIL') {
|
||||
proxy.$modal.msgError(data.error || data.message || '批量同步计费失败')
|
||||
proxy.$modal.msgError(data.error || data.message || '批量同步落库失败')
|
||||
reject(new Error(data.error || 'fail'))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
icon="Refresh"
|
||||
v-hasPermi="['monitor:orderSource:sync']"
|
||||
@click="openFilterSync()"
|
||||
>同步计费</el-button>
|
||||
>同步落库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -128,7 +128,7 @@
|
||||
:loading="syncingKey === rowKey(row)"
|
||||
v-hasPermi="['monitor:orderSource:sync']"
|
||||
@click="handleSyncOne(row)"
|
||||
>同步计费</el-button>
|
||||
>同步落库</el-button>
|
||||
</template> -->
|
||||
</basic-table>
|
||||
|
||||
@@ -273,10 +273,10 @@ const syncProgressDegree = computed(() => Math.round(((syncFloat.value?.percent
|
||||
const syncProgressText = computed(() => (syncFloat.value?.percent || 0) + '%')
|
||||
const syncFloatTitle = computed(() => {
|
||||
const st = (syncFloat.value?.status || '').toUpperCase()
|
||||
if (syncFloat.value?.loading) return '异步同步计费中'
|
||||
if (st === 'SUCCESS') return '同步计费完成'
|
||||
if (st === 'FAIL') return '同步计费失败'
|
||||
return '异步同步计费'
|
||||
if (syncFloat.value?.loading) return '异步同步落库中'
|
||||
if (st === 'SUCCESS') return '同步落库完成'
|
||||
if (st === 'FAIL') return '同步落库失败'
|
||||
return '异步同步落库'
|
||||
})
|
||||
const syncFloatSummary = computed(() => {
|
||||
const p = syncFloat.value || {}
|
||||
@@ -466,7 +466,7 @@ function openFilterSync() {
|
||||
const hasTime = !!q.beginTime && !!q.endTime
|
||||
// 与查询同口径:有单号即可同步;无单号时必须客户+提货时间
|
||||
if (!hasIdentifier && !(hasCustomer && hasTime)) {
|
||||
ElMessage.warning('请输入单号,或选择客户和提货时间后再同步计费')
|
||||
ElMessage.warning('请输入单号,或选择客户和提货时间后再同步落库')
|
||||
return
|
||||
}
|
||||
if (identifierCount > MAX_ORDER_IDENTIFIERS) {
|
||||
@@ -474,8 +474,8 @@ function openFilterSync() {
|
||||
return
|
||||
}
|
||||
const tip = hasIdentifier && !(hasCustomer && hasTime)
|
||||
? `将按 ${identifierCount} 个单号查询匹配订单并异步同步计费,确认继续?`
|
||||
: '确认按当前筛选分页查询并异步同步计费?'
|
||||
? `将按 ${identifierCount} 个单号查询匹配订单并异步覆盖上游字段(不计费),确认继续?`
|
||||
: '确认按当前筛选分页查询并异步覆盖上游字段(不计费)?'
|
||||
proxy.$modal.confirm(tip, '二次确认').then(() => {
|
||||
syncDialogRef.value?.open(q, true)
|
||||
}).catch(() => {})
|
||||
@@ -509,7 +509,7 @@ function toSyncRow(row) {
|
||||
|
||||
|
||||
function handleSyncOne(row) {
|
||||
proxy.$modal.confirm('确认同步计费该订单?', '二次确认').then(() => {
|
||||
proxy.$modal.confirm('确认同步落库该订单(仅覆盖上游字段,不计费)?', '二次确认').then(() => {
|
||||
syncingKey.value = rowKey(row)
|
||||
return syncOrderSourceSelected([toSyncRow(row)])
|
||||
}).then(res => {
|
||||
@@ -544,7 +544,7 @@ function handleCheckProducts() {
|
||||
|
||||
function handleBatchSync(selection) {
|
||||
if (!selection || !selection.length) return
|
||||
proxy.$modal.confirm('确认同步选中的 ' + selection.length + ' 条订单?', '二次确认').then(() => {
|
||||
proxy.$modal.confirm('确认同步选中的 ' + selection.length + ' 条订单(仅覆盖上游字段,不计费)?', '二次确认').then(() => {
|
||||
batchLoading.value = true
|
||||
return syncOrderSourceSelected(selection.map(toSyncRow))
|
||||
}).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user