1
This commit is contained in:
@@ -63,6 +63,7 @@ const createOpen = ref(false)
|
||||
const createBusy = ref(false)
|
||||
const createSourcesLoading = ref(false)
|
||||
const createSourcesError = ref<ApiErrorDetails | null>(null)
|
||||
const createError = ref<ApiErrorDetails | null>(null)
|
||||
const createSourceOptions = ref<FinanceFeeSourceSummary[]>([])
|
||||
const exportBusy = ref(false)
|
||||
const actionBusy = ref(false)
|
||||
@@ -391,6 +392,7 @@ function openCreate() {
|
||||
createForm.value = defaultCreateForm()
|
||||
createSourceOptions.value = []
|
||||
createSourcesError.value = null
|
||||
createError.value = null
|
||||
createOpen.value = true
|
||||
}
|
||||
|
||||
@@ -489,7 +491,13 @@ async function createStatement() {
|
||||
createOpen.value = false
|
||||
ElMessage.success('对账单已生成')
|
||||
await router.push({ name: 'finance-customer-statement-detail', params: { statementId: created.id } })
|
||||
} catch (cause) { error.value = getApiErrorDetails(cause, '创建对账单失败') }
|
||||
} catch (cause) {
|
||||
const details = getApiErrorDetails(cause, '创建对账单失败')
|
||||
const noEligibleSources = details.code === 'FIN_409' && /没有符合结算条件|没有可生成/.test(details.message)
|
||||
createError.value = noEligibleSources
|
||||
? { ...details, message: '当前客户在所选账期内没有可生成的应收费用,请调整账期或选择其他客户后重试' }
|
||||
: details
|
||||
}
|
||||
finally { createBusy.value = false }
|
||||
}
|
||||
|
||||
@@ -686,6 +694,7 @@ watch(detailRouteId, (statementId) => {
|
||||
</ListPageLayout>
|
||||
|
||||
<AppDialog v-model="createOpen" title="生成客户对账单" width="min(680px, 94vw)" :confirm-loading="createBusy" @confirm="createStatement">
|
||||
<el-alert v-if="createError" type="warning" :closable="true" show-icon title="暂时无法生成对账单" @close="createError = null"><p>{{ createError.message }}</p></el-alert>
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="生成方式">
|
||||
<el-radio-group v-model="createForm.generationMode">
|
||||
|
||||
Reference in New Issue
Block a user