verce-vue-test 0.0.91 → 0.0.92

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.
@@ -9156,7 +9156,183 @@ POST /TAM/0001/140206018
9156
9156
  > 200 Response
9157
9157
 
9158
9158
  ```
9159
- {"body":{"resultInfos":[{"bankAcct":"string","bankName":"string"}]},"head":{"adminUserId":"string","agentBranchId":"string","apprUserId":"string","areaCode":"string","batch":true,"branchId":"string","consumerId":"string","consumerSeqNo":"string","ctrlBits":"string","digitalSign":"string","extra":{},"fileFlag":"string","filePath":"string","isBatch":true,"msgId":"string","origSender":"string","pageIndex":"string","pageSize":"string","retCode":"string","retMsg":"string","retMsg2":"string","retStatus":"string","spanId":"string","traceId":"string","tranCode":"string","tranDate":"string","tranTimestamp":"string","userId":"string","verifyUserId":"string","versionId":"string"}}
9159
+ {
9160
+ "head": {
9161
+ "consumerId": "TAM001",
9162
+ "tranCode": "/TAM/0001/140206018",
9163
+ "versionId": "0001",
9164
+ "ctrlBits": "00004000",
9165
+ "tranDate": "20260720",
9166
+ "consumerSeqNo": "superuser62026072028072858",
9167
+ "tranTimestamp": "141432",
9168
+ "pageSize": "10",
9169
+ "pageIndex": "1",
9170
+ "traceId": "",
9171
+ "spanId": "",
9172
+ "userId": "superuser6",
9173
+ "verifyUserId": "",
9174
+ "adminUserId": "",
9175
+ "apprUserId": "",
9176
+ "branchId": "25001",
9177
+ "areaCode": "0000",
9178
+ "digitalSign": "",
9179
+ "fileFlag": "N",
9180
+ "filePath": "",
9181
+ "isBatch": false,
9182
+ "extra": {},
9183
+ "retStatus": "S",
9184
+ "retCode": "00000",
9185
+ "retMsg": "交易成功"
9186
+ },
9187
+ "body": {
9188
+ "resultInfos": [
9189
+ {
9190
+ "bankAcct": "4445",
9191
+ "bankName": "4445-1323"
9192
+ },
9193
+ {
9194
+ "bankAcct": "3214",
9195
+ "bankName": "3214-323"
9196
+ },
9197
+ {
9198
+ "bankAcct": "ICBKKZKX",
9199
+ "bankName": "ICBKKZKX-中国工商银行(阿拉木图)股份公司"
9200
+ },
9201
+ {
9202
+ "bankAcct": "ICBKCNBJXXX",
9203
+ "bankName": "ICBKCNBJXXX-丹麦克朗主账户行"
9204
+ },
9205
+ {
9206
+ "bankAcct": "BOFMCAM2XXX",
9207
+ "bankName": "BOFMCAM2XXX-加拿大元主账户行"
9208
+ },
9209
+ {
9210
+ "bankAcct": "SPDBCNSHXXX",
9211
+ "bankName": "SPDBCNSHXXX-加拿大元账户行"
9212
+ },
9213
+ {
9214
+ "bankAcct": "ICBKCNBJXXX",
9215
+ "bankName": "ICBKCNBJXXX-挪威克朗主账户行"
9216
+ },
9217
+ {
9218
+ "bankAcct": "OCBCSGSGXXX",
9219
+ "bankName": "OCBCSGSGXXX-新加坡元主账户行"
9220
+ },
9221
+ {
9222
+ "bankAcct": "SMBCJPJTXXX",
9223
+ "bankName": "SMBCJPJTXXX-日元主账户行"
9224
+ },
9225
+ {
9226
+ "bankAcct": "ICBKCNBJBJM",
9227
+ "bankName": "ICBKCNBJBJM-日元账户行"
9228
+ },
9229
+ {
9230
+ "bankAcct": "BBRUBEBB010",
9231
+ "bankName": "BBRUBEBB010-欧元账户行"
9232
+ },
9233
+ {
9234
+ "bankAcct": "CEDELULLXXX",
9235
+ "bankName": "CEDELULLXXX-欧元账户行"
9236
+ },
9237
+ {
9238
+ "bankAcct": "DEUTDEFFXXX",
9239
+ "bankName": "DEUTDEFFXXX-欧元账户行"
9240
+ },
9241
+ {
9242
+ "bankAcct": "ICBKCNBJBJM",
9243
+ "bankName": "ICBKCNBJBJM-欧元账户行"
9244
+ },
9245
+ {
9246
+ "bankAcct": "ICBKDEFFXXX",
9247
+ "bankName": "ICBKDEFFXXX-欧元账户行"
9248
+ },
9249
+ {
9250
+ "bankAcct": "HSBCHKHHHKH",
9251
+ "bankName": "HSBCHKHHHKH-港元主账户行"
9252
+ },
9253
+ {
9254
+ "bankAcct": "CEDELULLXXX",
9255
+ "bankName": "CEDELULLXXX-港元账户行"
9256
+ },
9257
+ {
9258
+ "bankAcct": "PCBCCNBJXXX",
9259
+ "bankName": "PCBCCNBJXXX-港元账户行"
9260
+ },
9261
+ {
9262
+ "bankAcct": "SCBLHKHHXXX",
9263
+ "bankName": "SCBLHKHHXXX-港元账户行"
9264
+ },
9265
+ {
9266
+ "bankAcct": "ANZBAU3MXXX",
9267
+ "bankName": "ANZBAU3MXXX-澳元主帐户行"
9268
+ },
9269
+ {
9270
+ "bankAcct": "SPDBCNSHXXX",
9271
+ "bankName": "SPDBCNSHXXX-澳大利亚元账户行"
9272
+ },
9273
+ {
9274
+ "bankAcct": "ICBKCNBJXXX",
9275
+ "bankName": "ICBKCNBJXXX-瑞典克朗主账户行"
9276
+ },
9277
+ {
9278
+ "bankAcct": "ICBKCNBJXXX",
9279
+ "bankName": "ICBKCNBJXXX-瑞士法郎主账户行"
9280
+ },
9281
+ {
9282
+ "bankAcct": "SPDBCNSHXXX",
9283
+ "bankName": "SPDBCNSHXXX-瑞士法郎账户行"
9284
+ },
9285
+ {
9286
+ "bankAcct": "CITIUS33XXX",
9287
+ "bankName": "CITIUS33XXX-美元主账户行"
9288
+ },
9289
+ {
9290
+ "bankAcct": "BKCHCNBJ110",
9291
+ "bankName": "BKCHCNBJ110-美元账户行"
9292
+ },
9293
+ {
9294
+ "bankAcct": "BKCHHKHHXXX",
9295
+ "bankName": "BKCHHKHHXXX-美元账户行"
9296
+ },
9297
+ {
9298
+ "bankAcct": "BKTRUS33XXX",
9299
+ "bankName": "BKTRUS33XXX-美元账户行"
9300
+ },
9301
+ {
9302
+ "bankAcct": "CEDELULLXXX",
9303
+ "bankName": "CEDELULLXXX-美元账户行"
9304
+ },
9305
+ {
9306
+ "bankAcct": "MRMDUS33XXX",
9307
+ "bankName": "MRMDUS33XXX-美元账户行"
9308
+ },
9309
+ {
9310
+ "bankAcct": "PNBPUS3NNYC",
9311
+ "bankName": "PNBPUS3NNYC-美元账户行"
9312
+ },
9313
+ {
9314
+ "bankAcct": "BARCGB22XXX",
9315
+ "bankName": "BARCGB22XXX-英镑主账户行"
9316
+ },
9317
+ {
9318
+ "bankAcct": "SPDBCNSHXXX",
9319
+ "bankName": "SPDBCNSHXXX-英镑账户行"
9320
+ },
9321
+ {
9322
+ "bankAcct": "CS0101",
9323
+ "bankName": "CS0101-账户行行名"
9324
+ },
9325
+ {
9326
+ "bankAcct": "ZHHHH11",
9327
+ "bankName": "ZHHHH11-账户行行名"
9328
+ },
9329
+ {
9330
+ "bankAcct": "1234",
9331
+ "bankName": "1234-驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器二无群二驱蚊器"
9332
+ }
9333
+ ]
9334
+ }
9335
+ }
9160
9336
  ```
9161
9337
 
9162
9338
  ### 返回结果
@@ -60579,4 +60755,3 @@ Tam142207001Out
60579
60755
  |---|---|---|---|---|---|
60580
60756
  |body|[Tam120207001Out.Body](#schematam120207001out.body)|false|none||none|
60581
60757
  |head|[HeadOut](#schemaheadout)|false|none||none|
60582
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1,61 @@
1
+ import baseHttpClient, {
2
+ type HttpRequestOptions,
3
+ type TamResponse,
4
+ } from '@/utils/baseHttpClient'
5
+
6
+ const ACCOUNT_BANK_QUERY_TRAN_CODE = '/TAM/0001/140206018'
7
+
8
+ export type AccountBankQuery = {
9
+ acctType?: string
10
+ ccy?: string
11
+ zmqFlag?: string
12
+ }
13
+
14
+ export type AccountBankOption = {
15
+ bankAcct: string
16
+ bankName: string
17
+ }
18
+
19
+ type AccountBankResponseBody = {
20
+ resultInfos?: Array<Partial<AccountBankOption>>
21
+ }
22
+
23
+ export async function queryAccountBanks(
24
+ params: AccountBankQuery = {},
25
+ options?: HttpRequestOptions,
26
+ ) {
27
+ const response = await baseHttpClient.post<TamResponse<AccountBankResponseBody>>(
28
+ ACCOUNT_BANK_QUERY_TRAN_CODE,
29
+ {
30
+ acctType: String(params.acctType ?? '').trim(),
31
+ ccy: String(params.ccy ?? '').trim(),
32
+ zmqFlag: String(params.zmqFlag ?? '').trim(),
33
+ },
34
+ options,
35
+ )
36
+
37
+ if (!Array.isArray(response.body.resultInfos)) {
38
+ throw new Error('账户行接口返回结构不正确')
39
+ }
40
+
41
+ const result: AccountBankOption[] = []
42
+ const seen = new Set<string>()
43
+
44
+ response.body.resultInfos.forEach((row) => {
45
+ const bankAcct = String(row.bankAcct ?? '').trim()
46
+ const bankName = String(row.bankName ?? '').trim()
47
+ if (!bankAcct) return
48
+
49
+ const option = {
50
+ bankAcct,
51
+ bankName: bankName || bankAcct,
52
+ }
53
+ const optionKey = `${option.bankAcct}\u0000${option.bankName}`
54
+ if (seen.has(optionKey)) return
55
+
56
+ seen.add(optionKey)
57
+ result.push(option)
58
+ })
59
+
60
+ return result
61
+ }
@@ -0,0 +1,142 @@
1
+ <script setup lang="ts">
2
+ import { computed, onBeforeUnmount, ref, watch } from 'vue'
3
+ import { ElMessage } from 'element-plus'
4
+ import {
5
+ queryAccountBanks,
6
+ type AccountBankOption,
7
+ } from '@/api/account-bank'
8
+
9
+ const props = withDefaults(
10
+ defineProps<{
11
+ modelValue: string
12
+ currency?: string
13
+ accountType?: string
14
+ mainAccountFlag?: string
15
+ disabled?: boolean
16
+ clearable?: boolean
17
+ placeholder?: string
18
+ size?: 'small' | 'default' | 'large'
19
+ appendTo?: HTMLElement
20
+ }>(),
21
+ {
22
+ currency: '',
23
+ accountType: '',
24
+ mainAccountFlag: '',
25
+ disabled: false,
26
+ clearable: true,
27
+ placeholder: '请选择账户行',
28
+ size: 'default',
29
+ appendTo: undefined,
30
+ },
31
+ )
32
+
33
+ const emit = defineEmits<{
34
+ 'update:modelValue': [value: string]
35
+ change: [value: string]
36
+ }>()
37
+
38
+ const options = ref<AccountBankOption[]>([])
39
+ const loading = ref(false)
40
+ const loadedQueryKey = ref('')
41
+ let requestController: AbortController | null = null
42
+ let requestVersion = 0
43
+
44
+ const queryKey = computed(() => [
45
+ props.accountType.trim(),
46
+ props.currency.trim(),
47
+ props.mainAccountFlag.trim(),
48
+ ].join('\u0000'))
49
+
50
+ const selectOptions = computed(() => {
51
+ const currentValue = props.modelValue.trim()
52
+ if (!currentValue || options.value.some((option) => option.bankAcct === currentValue)) {
53
+ return options.value
54
+ }
55
+
56
+ return [
57
+ {
58
+ bankAcct: currentValue,
59
+ bankName: currentValue,
60
+ },
61
+ ...options.value,
62
+ ]
63
+ })
64
+
65
+ async function loadOptions() {
66
+ if (loading.value || loadedQueryKey.value === queryKey.value) return
67
+
68
+ requestController?.abort()
69
+ const controller = new AbortController()
70
+ const currentVersion = ++requestVersion
71
+ requestController = controller
72
+ loading.value = true
73
+
74
+ try {
75
+ const result = await queryAccountBanks(
76
+ {
77
+ acctType: props.accountType,
78
+ ccy: props.currency,
79
+ zmqFlag: props.mainAccountFlag,
80
+ },
81
+ { signal: controller.signal },
82
+ )
83
+
84
+ if (controller.signal.aborted || currentVersion !== requestVersion) return
85
+ options.value = result
86
+ loadedQueryKey.value = queryKey.value
87
+ } catch (error) {
88
+ if (controller.signal.aborted || currentVersion !== requestVersion) return
89
+ ElMessage.error(error instanceof Error ? error.message : '账户行查询失败')
90
+ } finally {
91
+ if (currentVersion === requestVersion) {
92
+ requestController = null
93
+ loading.value = false
94
+ }
95
+ }
96
+ }
97
+
98
+ function handleVisibleChange(visible: boolean) {
99
+ if (visible) void loadOptions()
100
+ }
101
+
102
+ function handleChange(value: string) {
103
+ emit('update:modelValue', value)
104
+ emit('change', value)
105
+ }
106
+
107
+ watch(queryKey, () => {
108
+ requestController?.abort()
109
+ requestController = null
110
+ requestVersion += 1
111
+ loading.value = false
112
+ loadedQueryKey.value = ''
113
+ options.value = []
114
+ })
115
+
116
+ onBeforeUnmount(() => {
117
+ requestController?.abort()
118
+ })
119
+ </script>
120
+
121
+ <template>
122
+ <el-select
123
+ :model-value="modelValue"
124
+ :append-to="appendTo"
125
+ :disabled="disabled"
126
+ :loading="loading"
127
+ :clearable="clearable"
128
+ :placeholder="placeholder"
129
+ :size="size"
130
+ filterable
131
+ :persistent="false"
132
+ @update:model-value="handleChange"
133
+ @visible-change="handleVisibleChange"
134
+ >
135
+ <el-option
136
+ v-for="option in selectOptions"
137
+ :key="`${option.bankAcct}-${option.bankName}`"
138
+ :label="option.bankName"
139
+ :value="option.bankAcct"
140
+ />
141
+ </el-select>
142
+ </template>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <span
3
+ v-if="currencyCode"
4
+ class="token-tag"
5
+ :style="tagStyle"
6
+ :title="displayLabel"
7
+ :aria-label="displayLabel"
8
+ >
9
+ <span class="token-tag__code">{{ currencyCode }}</span>
10
+ <span v-if="!compact && currencyName" class="token-tag__name">
11
+ {{ currencyName }}
12
+ </span>
13
+ </span>
14
+ </template>
15
+
16
+ <script setup name="TokenTag">
17
+ import { computed } from "vue"
18
+
19
+ const DEFAULT_COLOR = "#667085"
20
+
21
+ const currencyMap = {
22
+ CNY: { name: "人民币", color: "#C7372F" },
23
+ USD: { name: "美元", color: "#277A53" },
24
+ HKD: { name: "港元", color: "#9F2147" },
25
+ EUR: { name: "欧元", color: "#1F5AA6" },
26
+ AUD: { name: "澳大利亚元", color: "#B26A00" },
27
+ CHF: { name: "瑞士法郎", color: "#D52B1E" },
28
+ GBP: { name: "英镑", color: "#243B6B" },
29
+ CAD: { name: "加拿大元", color: "#C91F37" },
30
+ NZD: { name: "新西兰元", color: "#1F365C" },
31
+ SGD: { name: "新加坡元", color: "#D0342C" },
32
+ JPY: { name: "日元", color: "#BC002D" },
33
+ SEK: { name: "瑞典克朗", color: "#006AA7" },
34
+ NOK: { name: "挪威克朗", color: "#BA0C2F" },
35
+ DKK: { name: "丹麦克朗", color: "#C8102E" },
36
+ KZT: { name: "哈萨克斯坦坚戈", color: "#0095C8" }
37
+ }
38
+
39
+ const props = defineProps({
40
+ value: {
41
+ type: [String, Number],
42
+ required: true
43
+ },
44
+ // 紧凑模式下只展示币种代码,适合空间有限的表格列。
45
+ compact: {
46
+ type: Boolean,
47
+ default: false
48
+ }
49
+ })
50
+
51
+ const currencyCode = computed(() => String(props.value ?? "").trim().toUpperCase())
52
+ const currency = computed(() => currencyMap[currencyCode.value])
53
+ const currencyName = computed(() => currency.value?.name ?? "")
54
+ const displayLabel = computed(() => {
55
+ return currencyName.value
56
+ ? `${currencyCode.value} ${currencyName.value}`
57
+ : currencyCode.value
58
+ })
59
+
60
+ const tagStyle = computed(() => {
61
+ const color = currency.value?.color ?? DEFAULT_COLOR
62
+
63
+ return {
64
+ "--token-tag-color": color,
65
+ "--token-tag-background": `${color}14`,
66
+ "--token-tag-border": `${color}2E`
67
+ }
68
+ })
69
+ </script>
70
+
71
+ <style scoped>
72
+ .token-tag {
73
+ display: inline-flex;
74
+ width: 160px;
75
+ align-items: center;
76
+ justify-content: center;
77
+ gap: 6px;
78
+ padding: 3px 9px;
79
+ color: var(--token-tag-color);
80
+ background: var(--token-tag-background);
81
+ border: 1px solid var(--token-tag-border);
82
+ border-radius: 999px;
83
+ box-sizing: border-box;
84
+ font-size: 12px;
85
+ line-height: 18px;
86
+ text-align: center;
87
+ white-space: nowrap;
88
+ vertical-align: middle;
89
+ }
90
+
91
+ .token-tag__code {
92
+ flex: none;
93
+ font-weight: 650;
94
+ letter-spacing: 0.04em;
95
+ font-variant-numeric: tabular-nums;
96
+ }
97
+
98
+ .token-tag__name {
99
+ min-width: 0;
100
+ overflow: hidden;
101
+ opacity: 0.82;
102
+ text-overflow: ellipsis;
103
+ }
104
+ </style>
@@ -1,5 +1,6 @@
1
1
  import type { App, Component } from 'vue'
2
2
 
3
+ import TokenTag from './business/Public/TokenTag.vue'
3
4
  import ElButtonPro from './element-rewrite/ElButtonPro.vue'
4
5
  import ElFormDialog from './element-rewrite/ElFormDialog.vue'
5
6
  import ElInputThousandth from './element-rewrite/ElInputThousandth.vue'
@@ -18,6 +19,13 @@ type GlobalComponentDefinition = {
18
19
  }
19
20
 
20
21
  const globalComponentDefinitions: GlobalComponentDefinition[] = [
22
+ {
23
+ name: 'TokenTag',
24
+ component: TokenTag,
25
+ category: '展示组件',
26
+ description: '根据币种代码展示对应币种名称和主题颜色标签。',
27
+ filePath: 'src/components/business/Public/TokenTag.vue',
28
+ },
21
29
  {
22
30
  name: 'ElButtonPro',
23
31
  component: ElButtonPro,
@@ -9,6 +9,7 @@ import {
9
9
  RefreshLeft,
10
10
  Search,
11
11
  } from '@element-plus/icons-vue'
12
+ import AccountBankSelect from '@/components/business/AccountBankSelect.vue'
12
13
  import API from './api'
13
14
  import { toAuthorizationRow } from './adapter'
14
15
  import {
@@ -177,7 +178,7 @@ async function handleReview(action: 'approve' | 'reject') {
177
178
  return
178
179
  }
179
180
  if (!nostro) {
180
- ElMessage.warning('请输入账户行')
181
+ ElMessage.warning('请选择账户行')
181
182
  return
182
183
  }
183
184
  if (!detailEditForm.valueDate) {
@@ -547,13 +548,12 @@ onBeforeUnmount(() => {
547
548
  {{ detailRecord.rdfibic }}
548
549
  </el-descriptions-item>
549
550
  <el-descriptions-item label="账户行" :span="3">
550
- <el-input
551
+ <AccountBankSelect
551
552
  v-model="detailEditForm.nostro"
552
553
  class="detail-edit-control"
553
- maxlength="160"
554
- placeholder="请输入账户行"
554
+ :currency="detailRecord.currency"
555
+ placeholder="请选择账户行"
555
556
  size="small"
556
- clearable
557
557
  />
558
558
  </el-descriptions-item>
559
559
  <el-descriptions-item label="是否退汇">
@@ -2,6 +2,7 @@
2
2
  import { computed, nextTick, reactive, ref } from 'vue'
3
3
  import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
4
4
  import { ArrowLeft, Check, Search } from '@element-plus/icons-vue'
5
+ import AccountBankSelect from '@/components/business/AccountBankSelect.vue'
5
6
  import { searchForeignPositionClients } from '../api'
6
7
  import type { ForecastEditorMode, ForecastEditorValue } from '../editor'
7
8
  import {
@@ -235,33 +236,6 @@ const currentForecastType = computed<ForecastType>(() => {
235
236
  return 'PT03'
236
237
  })
237
238
 
238
- const currencyClearingBanks: Record<string, string> = {
239
- USD: '中国银行纽约分行',
240
- EUR: '中国银行法兰克福分行',
241
- HKD: '中国银行香港分行',
242
- JPY: '中国银行东京分行',
243
- GBP: '中国银行伦敦分行',
244
- SGD: '中国银行新加坡分行',
245
- AUD: '中国银行悉尼分行',
246
- CAD: '中国银行多伦多分行',
247
- CHF: '中国银行苏黎世分行',
248
- }
249
-
250
- const availableBankAccounts = computed(() => {
251
- if (bankAccountDisabled.value) return []
252
-
253
- const directBank = currencyClearingBanks[form.currency] ?? `${form.currency} 境外清算行`
254
- const routeBanks: Record<PaymentRoute, string[]> = {
255
- '01': [directBank],
256
- '02': [`总行${form.currency}转汇清算账户`, directBank],
257
- '03': [`${form.groundBranch}${form.currency}内部清算账户`],
258
- }
259
- const options = [...(routeBanks[form.paymentRoute as PaymentRoute] ?? [])]
260
-
261
- if (form.bankAccount && !options.includes(form.bankAccount)) options.unshift(form.bankAccount)
262
- return options
263
- })
264
-
265
239
  const formRules = computed<FormRules>(() => ({
266
240
  businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }],
267
241
  payDirection: isLegacyFieldRequired('payDirection')
@@ -698,14 +672,12 @@ async function handleSubmit() {
698
672
  </el-form-item>
699
673
 
700
674
  <el-form-item label="我方账户行" prop="bankAccount">
701
- <el-select
675
+ <AccountBankSelect
702
676
  v-model="form.bankAccount"
703
- filterable
677
+ :currency="form.currency"
704
678
  :disabled="bankAccountDisabled"
705
679
  :placeholder="bankAccountDisabled ? '请先选择汇款路径' : '请选择'"
706
- >
707
- <el-option v-for="bank in availableBankAccounts" :key="bank" :label="bank" :value="bank" />
708
- </el-select>
680
+ />
709
681
  </el-form-item>
710
682
 
711
683
  <el-form-item label="交易对手 SwiftCode">
@@ -9,7 +9,15 @@ import {
9
9
  watch,
10
10
  } from 'vue'
11
11
  import { storeToRefs } from 'pinia'
12
- import { FullScreen, InfoFilled, Search } from '@element-plus/icons-vue'
12
+ import {
13
+ Calendar,
14
+ Download,
15
+ FullScreen,
16
+ InfoFilled,
17
+ Refresh,
18
+ Search,
19
+ } from '@element-plus/icons-vue'
20
+ import AccountBankSelect from '@/components/business/AccountBankSelect.vue'
13
21
  import { queryForeignSettlementFlows } from '../api'
14
22
  import {
15
23
  currencyOptions,
@@ -32,7 +40,7 @@ import {
32
40
  isForeignSettlementAbortError,
33
41
  toForeignSettlementAmountText,
34
42
  } from '../utils'
35
- import { useScopedMessage } from '../../ForecastInfo/useScopedMessage'
43
+ import { useScopedMessage } from '../useScopedMessage'
36
44
  import { useForeignSettlementStore } from '../store'
37
45
 
38
46
  /**
@@ -61,11 +69,14 @@ const {
61
69
  } = storeToRefs(foreignSettlementStore)
62
70
  const filterForm = reactive(createDefaultForeignSettlementFilter())
63
71
  const page = ref(1)
64
- const pageSize = ref(10)
72
+ const pageSize = ref(20)
65
73
  const loading = ref(false)
66
74
  const total = ref(0)
67
75
  const rows = ref<ForeignSettlementFlowRow[]>([])
68
76
  const filterDrawerVisible = ref(false)
77
+ const columnComponentMap: Record<string, string> = {
78
+ ccy: 'TokenTag',
79
+ }
69
80
 
70
81
  type TableOverlayController = {
71
82
  closeTransientOverlays: () => void
@@ -316,6 +327,23 @@ watch(listRefreshKey, () => {
316
327
  <el-option v-for="option in payDirectionOptions" :key="option.value" v-bind="option" />
317
328
  </el-select>
318
329
  </label>
330
+
331
+ <label v-if="layout === 'vertical'" class="forecast-info-filter__item">
332
+ <span>币种</span>
333
+ <el-select
334
+ v-model="filterForm.currency"
335
+ :append-to="overlayContainer || undefined"
336
+ :persistent="false"
337
+ size="small"
338
+ placeholder="请选择"
339
+ filterable
340
+ allow-create
341
+ default-first-option
342
+ clearable
343
+ >
344
+ <el-option v-for="option in currencyOptions" :key="option.value" v-bind="option" />
345
+ </el-select>
346
+ </label>
319
347
  </div>
320
348
 
321
349
  <div class="forecast-info-filter__actions">
@@ -351,11 +379,18 @@ watch(listRefreshKey, () => {
351
379
  @pagination-change="handlePaginationChange"
352
380
  >
353
381
  <template #toolbar>
382
+ <el-button type="primary" plain size="small" :icon="Refresh">获取流水</el-button>
383
+ <el-button type="primary" plain size="small" :icon="Calendar">获取日终流水</el-button>
384
+
354
385
  <span v-if="selectedRows.length" class="foreign-currency-settlement-selection-count">
355
386
  已选 {{ selectedRows.length }} 笔
356
387
  </span>
357
388
  </template>
358
389
 
390
+ <template #toolbar-right>
391
+ <el-button type="primary" plain size="small" :icon="Download">导出</el-button>
392
+ </template>
393
+
359
394
  <el-table-column
360
395
  type="selection"
361
396
  column-key="selection"
@@ -384,7 +419,13 @@ watch(listRefreshKey, () => {
384
419
  :align="column.format === 'amount' ? 'right' : 'center'"
385
420
  :visible="column.defaultVisible === true"
386
421
  >
387
- <template #default="{ row }">
422
+ <template v-if="column.solt" #default="{ row }">
423
+ <component
424
+ :is="columnComponentMap[column.prop]"
425
+ :value="row[column.prop]"
426
+ />
427
+ </template>
428
+ <template v-else #default="{ row }">
388
429
  <el-tag
389
430
  v-if="column.format === 'verifyStatus'"
390
431
  :type="getForeignSettlementVerifyTagType(row[column.prop])"
@@ -505,7 +546,13 @@ watch(listRefreshKey, () => {
505
546
 
506
547
  <label class="forecast-info-filter__item">
507
548
  <span>账户行</span>
508
- <el-input v-model="filterForm.bankCode" size="small" placeholder="请输入行号或 Swift Code" clearable />
549
+ <AccountBankSelect
550
+ v-model="filterForm.bankCode"
551
+ :currency="filterForm.currency"
552
+ :append-to="overlayContainer || undefined"
553
+ size="small"
554
+ placeholder="请选择账户行"
555
+ />
509
556
  </label>
510
557
 
511
558
  <label class="forecast-info-filter__item">
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import {
3
+ computed,
3
4
  onActivated,
4
5
  onBeforeUnmount,
5
6
  onDeactivated,
@@ -12,12 +13,13 @@ import { storeToRefs } from 'pinia'
12
13
  import { ElMessageBox } from 'element-plus'
13
14
  import {
14
15
  CircleCheck,
15
- DataAnalysis,
16
+ Download,
16
17
  FullScreen,
17
18
  InfoFilled,
18
19
  RefreshLeft,
19
20
  Search,
20
21
  } from '@element-plus/icons-vue'
22
+ import AccountBankSelect from '@/components/business/AccountBankSelect.vue'
21
23
  import { queryForeignSettlementForecasts } from '../api'
22
24
  import {
23
25
  businessTypeOptions,
@@ -41,7 +43,7 @@ import {
41
43
  isForeignSettlementAbortError,
42
44
  toForeignSettlementAmountText,
43
45
  } from '../utils'
44
- import { useScopedMessage } from '../../ForecastInfo/useScopedMessage'
46
+ import { useScopedMessage } from '../useScopedMessage'
45
47
  import { useForeignSettlementStore } from '../store'
46
48
 
47
49
  /**
@@ -72,11 +74,14 @@ const {
72
74
  } = storeToRefs(foreignSettlementStore)
73
75
  const filterForm = reactive(createDefaultForeignSettlementFilter())
74
76
  const page = ref(1)
75
- const pageSize = ref(10)
77
+ const pageSize = ref(20)
76
78
  const loading = ref(false)
77
79
  const total = ref(0)
78
80
  const rows = ref<ForeignSettlementForecastRow[]>([])
79
81
  const filterDrawerVisible = ref(false)
82
+ const columnComponentMap: Record<string, string> = {
83
+ ccy: 'TokenTag',
84
+ }
80
85
 
81
86
  type TableOverlayController = {
82
87
  closeTransientOverlays: () => void
@@ -100,7 +105,7 @@ function deactivatePanel() {
100
105
  closeTransientOverlays()
101
106
  }
102
107
 
103
- function buildQuery(): ForeignSettlementForecastQuery {
108
+ const queryParams = computed<ForeignSettlementForecastQuery>(() => {
104
109
  const [startAmount, endAmount] = filterForm.amountRange
105
110
 
106
111
  return {
@@ -121,7 +126,7 @@ function buildQuery(): ForeignSettlementForecastQuery {
121
126
  filter: '',
122
127
  amtOrder: '1',
123
128
  }
124
- }
129
+ })
125
130
 
126
131
  function validateFilter() {
127
132
  const [startAmount, endAmount] = filterForm.amountRange
@@ -158,7 +163,7 @@ async function loadForecasts(showSuccessMessage = false) {
158
163
 
159
164
  try {
160
165
  const result = await queryForeignSettlementForecasts(
161
- buildQuery(),
166
+ queryParams.value,
162
167
  page.value,
163
168
  pageSize.value,
164
169
  controller.signal,
@@ -191,6 +196,13 @@ function handleQuery() {
191
196
  void loadForecasts(true)
192
197
  }
193
198
 
199
+ function handleExport() {
200
+ console.log('外币预报信息导出参数:', {
201
+ ...queryParams.value,
202
+ opType: 'export',
203
+ })
204
+ }
205
+
194
206
  function handleReset() {
195
207
  Object.assign(filterForm, createDefaultForeignSettlementFilter())
196
208
  page.value = 1
@@ -390,6 +402,23 @@ watch(listRefreshKey, () => {
390
402
  <el-option v-for="option in payDirectionOptions" :key="option.value" v-bind="option" />
391
403
  </el-select>
392
404
  </label>
405
+
406
+ <label v-if="layout === 'vertical'" class="forecast-info-filter__item">
407
+ <span>币种</span>
408
+ <el-select
409
+ v-model="filterForm.currency"
410
+ :append-to="overlayContainer || undefined"
411
+ :persistent="false"
412
+ size="small"
413
+ placeholder="请选择"
414
+ filterable
415
+ allow-create
416
+ default-first-option
417
+ clearable
418
+ >
419
+ <el-option v-for="option in currencyOptions" :key="option.value" v-bind="option" />
420
+ </el-select>
421
+ </label>
393
422
  </div>
394
423
 
395
424
  <div class="forecast-info-filter__actions">
@@ -425,11 +454,6 @@ watch(listRefreshKey, () => {
425
454
  @pagination-change="handlePaginationChange"
426
455
  >
427
456
  <template #toolbar>
428
- <el-tooltip content="待提供外币匡算接口后启用" placement="top" :append-to="overlayContainer || undefined">
429
- <span class="foreign-currency-settlement-disabled-action">
430
- <el-button type="primary" plain size="small" :icon="DataAnalysis" disabled>匡算</el-button>
431
- </span>
432
- </el-tooltip>
433
457
  <el-button
434
458
  type="success"
435
459
  plain
@@ -458,6 +482,12 @@ watch(listRefreshKey, () => {
458
482
  </span>
459
483
  </template>
460
484
 
485
+ <template #toolbar-right>
486
+ <el-button type="primary" plain size="small" :icon="Download" @click="handleExport">
487
+ 导出
488
+ </el-button>
489
+ </template>
490
+
461
491
  <el-table-column
462
492
  type="selection"
463
493
  column-key="selection"
@@ -486,7 +516,13 @@ watch(listRefreshKey, () => {
486
516
  :align="column.format === 'amount' ? 'right' : 'center'"
487
517
  :visible="column.defaultVisible === true"
488
518
  >
489
- <template #default="{ row }">
519
+ <template v-if="column.solt" #default="{ row }">
520
+ <component
521
+ :is="columnComponentMap[column.prop]"
522
+ :value="row[column.prop]"
523
+ />
524
+ </template>
525
+ <template v-else #default="{ row }">
490
526
  <el-tag
491
527
  v-if="column.format === 'verifyStatus'"
492
528
  :type="getForeignSettlementVerifyTagType(row[column.prop])"
@@ -615,7 +651,13 @@ watch(listRefreshKey, () => {
615
651
 
616
652
  <label class="forecast-info-filter__item">
617
653
  <span>账户行</span>
618
- <el-input v-model="filterForm.bankCode" size="small" placeholder="请输入行号或 Swift Code" clearable />
654
+ <AccountBankSelect
655
+ v-model="filterForm.bankCode"
656
+ :currency="filterForm.currency"
657
+ :append-to="overlayContainer || undefined"
658
+ size="small"
659
+ placeholder="请选择账户行"
660
+ />
619
661
  </label>
620
662
 
621
663
  <label class="forecast-info-filter__item">
@@ -5,8 +5,10 @@
5
5
  gap: 10px;
6
6
  }
7
7
 
8
- .foreign-currency-settlement-page .foreign-currency-settlement-disabled-action {
9
- display: inline-flex;
8
+ .forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"].foreign-currency-settlement-page
9
+ .forecast-info-filter:not(.forecast-info-filter--horizontal)
10
+ .forecast-info-filter__grid {
11
+ grid-template-columns: 248px 220px 220px;
10
12
  }
11
13
 
12
14
  .foreign-currency-settlement-page .foreign-currency-settlement-selection-count {
@@ -37,6 +39,15 @@
37
39
  align-items: center;
38
40
  }
39
41
 
42
+ .foreign-currency-settlement-page .foreign-currency-settlement-table-shell .el-table-plus__toolbar-left {
43
+ width: auto;
44
+ flex: 1 1 auto;
45
+ }
46
+
47
+ .foreign-currency-settlement-page .foreign-currency-settlement-table-shell .el-table-plus__toolbar-right {
48
+ flex: 0 0 auto;
49
+ }
50
+
40
51
  .foreign-currency-settlement-page .foreign-currency-settlement-table-shell .el-table-plus__pagination {
41
52
  display: flex;
42
53
  align-items: center;
@@ -79,3 +90,11 @@
79
90
  .foreign-currency-settlement-page .foreign-currency-settlement-table .el-table__empty-block {
80
91
  min-height: 150px;
81
92
  }
93
+
94
+ @media (max-width: 900px) {
95
+ .forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"].foreign-currency-settlement-page
96
+ .forecast-info-filter:not(.forecast-info-filter--horizontal)
97
+ .forecast-info-filter__grid {
98
+ grid-template-columns: minmax(0, 1fr);
99
+ }
100
+ }
@@ -23,7 +23,7 @@ import type {
23
23
  ForeignSettlementCardLayout,
24
24
  ForeignSettlementLayoutOption,
25
25
  } from './types'
26
- import { useScopedMessage } from '../ForecastInfo/useScopedMessage'
26
+ import { useScopedMessage } from './useScopedMessage'
27
27
  import { useForeignSettlementStore } from './store'
28
28
  import '../ForecastInfo/forecast-info.css'
29
29
  import './foreign-currency-settlement.css'
@@ -65,7 +65,7 @@ export const forecastColumns: ForeignSettlementTableColumn[] = [
65
65
  { prop: 'predRefNo', label: '预报流水号', minWidth: 146, defaultVisible: true },
66
66
  { prop: 'tranDate', label: '起息日期', minWidth: 108, format: 'date', defaultVisible: true },
67
67
  { prop: 'payDirec', label: '收支方向', minWidth: 94, format: 'direction', defaultVisible: true },
68
- { prop: 'ccy', label: '币种', minWidth: 76, defaultVisible: true },
68
+ { prop: 'ccy', label: '币种', minWidth: 176, defaultVisible: true, solt: true },
69
69
  { prop: 'predAmt', label: '预报金额(原币)', minWidth: 142, format: 'amount', defaultVisible: true },
70
70
  { prop: 'verifyAmt', label: '已核销金额(原币)', minWidth: 154, format: 'amount', defaultVisible: true },
71
71
  { prop: 'unverifyAmt', label: '未核销金额(原币)', minWidth: 166, format: 'amount', defaultVisible: true },
@@ -97,7 +97,7 @@ export const flowColumns: ForeignSettlementTableColumn[] = [
97
97
  { prop: 'valueDate', label: '起息日', minWidth: 106, format: 'date', defaultVisible: true },
98
98
  { prop: 'direction', label: '往来标志', minWidth: 94, format: 'direction', defaultVisible: true },
99
99
  { prop: 'paymentType', label: '收付款类型', minWidth: 108, defaultVisible: true },
100
- { prop: 'ccy', label: '币种', minWidth: 76, defaultVisible: true },
100
+ { prop: 'ccy', label: '币种', minWidth: 176, defaultVisible: true, solt: true },
101
101
  { prop: 'tranAmt', label: '交易金额(原币)', minWidth: 146, format: 'amount', defaultVisible: true },
102
102
  { prop: 'notVerifyAmt', label: '未核销金额(原币)', minWidth: 166, format: 'amount', defaultVisible: true },
103
103
  { prop: 'verifyStatus', label: '核销状态', minWidth: 100, format: 'verifyStatus', defaultVisible: true },
@@ -106,12 +106,11 @@ export const useForeignSettlementStore = defineStore('foreign-currency-settlemen
106
106
  message: '不允许选择已核销的预报记录!',
107
107
  }
108
108
  }
109
- if (flowSelectedRows.value.length === 0) {
109
+ // 预报支持不勾选流水直接核销;撤销核销仍需通过已选流水定位原核销关系。
110
+ if (action === 'cancelVerify' && flowSelectedRows.value.length === 0) {
110
111
  return {
111
112
  success: false,
112
- message: action === 'verify'
113
- ? '请至少选择一条流水记录!'
114
- : '请勾选一条已核销流水信息后撤销!',
113
+ message: '请勾选一条已核销流水信息后撤销!',
115
114
  }
116
115
  }
117
116
  if (action === 'cancelVerify' && forecastSelectedRows.value.length !== 1) {
@@ -195,14 +194,24 @@ export const useForeignSettlementStore = defineStore('foreign-currency-settlemen
195
194
 
196
195
  return {
197
196
  predIds: forecasts.map((row) => String(row.predRefNo).trim()).join(','),
198
- tranSeqIds: flows.map((row) => String(row.tranRefNo).trim()).join(','),
199
197
  predAmts: forecasts.map((row) => toForeignSettlementOperationAmount(row.predAmt)).join(','),
200
198
  verifyAmts: forecasts.map((row) => toForeignSettlementOperationAmount(row.verifyAmt)).join(','),
201
- tranAmts: flows.map((row) => toForeignSettlementOperationAmount(row.notVerifyAmt)).join(','),
202
199
  preStatus: forecasts.map((row) => toForeignSettlementProtocolVerifyStatus(row.verifyStatus)).join(','),
203
- seqVerifyStatus: flows.map((row) => toForeignSettlementProtocolVerifyStatus(row.verifyStatus)).join(','),
204
- tranValueDates: flows.map((row) => toForeignSettlementOperationDate(row.valueDate)).join(','),
205
200
  predValueDates: forecasts.map((row) => toForeignSettlementOperationDate(row.tranDate)).join(','),
201
+ ...(flows.length > 0
202
+ ? {
203
+ tranSeqIds: flows.map((row) => String(row.tranRefNo).trim()).join(','),
204
+ tranAmts: flows
205
+ .map((row) => toForeignSettlementOperationAmount(row.notVerifyAmt))
206
+ .join(','),
207
+ seqVerifyStatus: flows
208
+ .map((row) => toForeignSettlementProtocolVerifyStatus(row.verifyStatus))
209
+ .join(','),
210
+ tranValueDates: flows
211
+ .map((row) => toForeignSettlementOperationDate(row.valueDate))
212
+ .join(','),
213
+ }
214
+ : {}),
206
215
  }
207
216
  }
208
217
 
@@ -30,6 +30,7 @@ export type ForeignSettlementTableColumn = {
30
30
  minWidth: number
31
31
  format?: ForeignSettlementColumnFormat
32
32
  defaultVisible?: boolean
33
+ solt?: boolean
33
34
  }
34
35
 
35
36
  /** 页面筛选表单使用语义化字段,提交接口前再转换成 TAM 字段名。 */
@@ -181,17 +182,17 @@ export type ForeignSettlementQueryResult<T> = {
181
182
  totalPage: number
182
183
  }
183
184
 
184
- /** 120202002 外币核销业务体:预报按流水号升序,流水按勾选顺序使用逗号拼接。 */
185
+ /** 120202002 外币核销业务体:预报按流水号升序;未选流水时不传流水平行字段。 */
185
186
  export type ForeignSettlementVerifyRequest = {
186
187
  predIds: string
187
- tranSeqIds: string
188
188
  predAmts: string
189
189
  verifyAmts: string
190
+ tranSeqIds?: string
190
191
  /** 沿用旧字段名,实际传递各流水当前未核销金额 notVerifyAmt。 */
191
- tranAmts: string
192
+ tranAmts?: string
192
193
  preStatus: string
193
- seqVerifyStatus: string
194
- tranValueDates: string
194
+ seqVerifyStatus?: string
195
+ tranValueDates?: string
195
196
  predValueDates: string
196
197
  }
197
198
 
@@ -0,0 +1,55 @@
1
+ import { ElMessage } from 'element-plus'
2
+
3
+ type ScopedMessageType = 'success' | 'warning' | 'info' | 'error'
4
+
5
+ type MessageHandle = {
6
+ close: () => void
7
+ }
8
+
9
+ /**
10
+ * 只管理外币手工核销页面创建的消息提示。
11
+ * 页面停用时逐个关闭自己的消息,不调用 ElMessage.closeAll,避免误伤其他路由的提示。
12
+ */
13
+ export function useScopedMessage(resolveAppendTo: () => HTMLElement | null) {
14
+ const activeHandles = new Set<MessageHandle>()
15
+
16
+ function show(type: ScopedMessageType, message: string) {
17
+ const appendTo = resolveAppendTo()
18
+ const pageContainer = appendTo?.closest(
19
+ '.foreign-currency-settlement-page[data-business-scope="foreign-currency-settlement"]',
20
+ )
21
+ if (!appendTo?.isConnected || !pageContainer?.getClientRects().length) return
22
+
23
+ let handle: MessageHandle | undefined
24
+
25
+ handle = ElMessage({
26
+ appendTo,
27
+ message,
28
+ type,
29
+ onClose: () => {
30
+ if (handle) activeHandles.delete(handle)
31
+ },
32
+ })
33
+
34
+ activeHandles.add(handle)
35
+ }
36
+
37
+ function closeAll() {
38
+ activeHandles.forEach((handle) => {
39
+ try {
40
+ handle.close()
41
+ } catch {
42
+ // 单条消息关闭失败不能阻断其余页面清理。
43
+ }
44
+ })
45
+ activeHandles.clear()
46
+ }
47
+
48
+ return {
49
+ success: (message: string) => show('success', message),
50
+ warning: (message: string) => show('warning', message),
51
+ info: (message: string) => show('info', message),
52
+ error: (message: string) => show('error', message),
53
+ closeAll,
54
+ }
55
+ }