verce-vue-test 0.0.126 → 0.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -94,6 +94,13 @@ type TamDetailResponse = {
|
|
|
94
94
|
body?: TamResultInfo
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
type TamAccountBankResponse = {
|
|
98
|
+
head?: TamResponse['head']
|
|
99
|
+
body?: {
|
|
100
|
+
bankAcctList?: unknown[]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
97
104
|
type ForeignPositionForecastOperationResponse = {
|
|
98
105
|
success: boolean
|
|
99
106
|
message: string
|
|
@@ -263,6 +270,46 @@ export function queryForeignPositionOrganizationTree(signal?: AbortSignal) {
|
|
|
263
270
|
return baseHttpClient.get<{ data?: unknown }>('/uaa/org/tree', { signal })
|
|
264
271
|
}
|
|
265
272
|
|
|
273
|
+
export type ForeignPositionAccountBankOption = {
|
|
274
|
+
bankAcct: string
|
|
275
|
+
bankName: string
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** 根据币种、汇款路径和业务类型查询外币预报可用的我方账户行。 */
|
|
279
|
+
export async function queryForeignPositionAccountBanks(
|
|
280
|
+
params: {
|
|
281
|
+
ccy: string
|
|
282
|
+
paymentRoute: string
|
|
283
|
+
tranType: string
|
|
284
|
+
},
|
|
285
|
+
signal?: AbortSignal,
|
|
286
|
+
) {
|
|
287
|
+
const payload = await baseHttpClient.post<TamAccountBankResponse>(
|
|
288
|
+
'/TAM/0001/140201002',
|
|
289
|
+
{
|
|
290
|
+
ccy: params.ccy.trim(),
|
|
291
|
+
paymentRoute: params.paymentRoute.trim(),
|
|
292
|
+
tranType: params.tranType.trim(),
|
|
293
|
+
},
|
|
294
|
+
{ signal },
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
const bankAcctList = payload.body?.bankAcctList
|
|
298
|
+
if (!Array.isArray(bankAcctList)) {
|
|
299
|
+
throw new Error('我方账户行接口返回结构不正确')
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const seen = new Set<string>()
|
|
303
|
+
return bankAcctList.reduce<ForeignPositionAccountBankOption[]>((result, item) => {
|
|
304
|
+
const bankAcct = String(item ?? '').trim()
|
|
305
|
+
if (!bankAcct || seen.has(bankAcct)) return result
|
|
306
|
+
|
|
307
|
+
seen.add(bankAcct)
|
|
308
|
+
result.push({ bankAcct, bankName: bankAcct })
|
|
309
|
+
return result
|
|
310
|
+
}, [])
|
|
311
|
+
}
|
|
312
|
+
|
|
266
313
|
/** 将前端日期转换为 TAM 报文日期。 */
|
|
267
314
|
function toMutationDate(value: string) {
|
|
268
315
|
return value.trim().slice(0, 10).replaceAll('-', '')
|
package/src/views/foreign-currency-position-forecast/components/ForeignPositionForecastEditor.vue
CHANGED
|
@@ -3,10 +3,10 @@ import dayjs from 'dayjs'
|
|
|
3
3
|
import { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'
|
|
4
4
|
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
queryForeignPositionAccountBanks,
|
|
7
|
+
queryForeignPositionOrganizationTree,
|
|
8
|
+
type ForeignPositionAccountBankOption,
|
|
9
|
+
} from '../api'
|
|
10
10
|
import { formatChineseCurrency } from '../currency'
|
|
11
11
|
import type { ForecastEditorMode, ForecastEditorValue } from '../editor'
|
|
12
12
|
import {
|
|
@@ -107,7 +107,7 @@ const emit = defineEmits<{
|
|
|
107
107
|
}>()
|
|
108
108
|
|
|
109
109
|
const formRef = ref<FormInstance>()
|
|
110
|
-
const accountBankOptions = ref<
|
|
110
|
+
const accountBankOptions = ref<ForeignPositionAccountBankOption[]>([])
|
|
111
111
|
const accountBankLoading = ref(false)
|
|
112
112
|
let accountBankRequestController: AbortController | null = null
|
|
113
113
|
const organizationOptions = ref<ForeignPositionOrganizationOption[]>([])
|
|
@@ -433,9 +433,13 @@ async function loadAccountBanks() {
|
|
|
433
433
|
accountBankLoading.value = true
|
|
434
434
|
|
|
435
435
|
try {
|
|
436
|
-
const result = await
|
|
437
|
-
{
|
|
438
|
-
|
|
436
|
+
const result = await queryForeignPositionAccountBanks(
|
|
437
|
+
{
|
|
438
|
+
ccy: form.currency,
|
|
439
|
+
paymentRoute: form.paymentRoute,
|
|
440
|
+
tranType: form.businessType,
|
|
441
|
+
},
|
|
442
|
+
controller.signal,
|
|
439
443
|
)
|
|
440
444
|
if (controller.signal.aborted || accountBankRequestController !== controller) return
|
|
441
445
|
accountBankOptions.value = result
|
|
@@ -463,7 +467,8 @@ async function handlePaymentRouteChange(value: PaymentRoute) {
|
|
|
463
467
|
: ''
|
|
464
468
|
|
|
465
469
|
if (missingMessage) {
|
|
466
|
-
//
|
|
470
|
+
// 前置条件不足时不保留本次无效选择,并清空关联的数据源。
|
|
471
|
+
form.paymentRoute = ''
|
|
467
472
|
form.receivingBankSwiftCode = ''
|
|
468
473
|
ElMessage.warning(missingMessage)
|
|
469
474
|
} else {
|
|
@@ -78,7 +78,7 @@ export const clientTypeOptions = [
|
|
|
78
78
|
] satisfies SelectOption[]
|
|
79
79
|
|
|
80
80
|
export const paymentRouteOptions = [
|
|
81
|
-
{ value: '01', label: '
|
|
82
|
-
{ value: '02', label: '
|
|
83
|
-
{ value: '03', label: '
|
|
81
|
+
{ value: '01', label: '人行境内外币支付' },
|
|
82
|
+
{ value: '02', label: '境外汇款' },
|
|
83
|
+
{ value: '03', label: '境内汇款走境外汇路' },
|
|
84
84
|
] satisfies SelectOption[]
|