verce-vue-test 0.0.78 → 0.0.80

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.
@@ -0,0 +1,1496 @@
1
+ <script setup lang="ts">
2
+ import { computed, reactive, ref } from 'vue'
3
+ import {
4
+ ElMessage,
5
+ ElMessageBox,
6
+ type FormInstance,
7
+ type FormRules,
8
+ type UploadProps,
9
+ } from 'element-plus'
10
+ import {
11
+ ArrowDown,
12
+ ArrowUp,
13
+ CopyDocument,
14
+ Delete,
15
+ Document,
16
+ Download,
17
+ EditPen,
18
+ Plus,
19
+ RefreshLeft,
20
+ Search,
21
+ Tickets,
22
+ UploadFilled,
23
+ } from '@element-plus/icons-vue'
24
+ import {
25
+ businessTypeOptions,
26
+ clientTypeOptions,
27
+ deleteStatusOptions,
28
+ forecastStatusOptions,
29
+ payChannelOptions,
30
+ payDirectionOptions,
31
+ sortRuleOptions,
32
+ verifyStatusOptions,
33
+ type SelectOption,
34
+ } from './options'
35
+ import {
36
+ createRmbPositionForecastMockRows,
37
+ getLocalDateString,
38
+ } from './mock'
39
+ import type {
40
+ RmbPositionForecastFilter,
41
+ RmbPositionForecastRow,
42
+ } from './types'
43
+
44
+ type EditorMode = 'add' | 'edit' | 'copy'
45
+
46
+ type EditorForm = {
47
+ tradeDate: string
48
+ payDirection: string
49
+ payChannel: string
50
+ predAmount: number
51
+ groundBranch: string
52
+ clientType: string
53
+ clientName: string
54
+ counterpartyName: string
55
+ counterpartyAccount: string
56
+ standardName: string
57
+ businessType: string
58
+ }
59
+
60
+ /**
61
+ * JSP 由权限接口返回的页面上下文。
62
+ * 当前使用演示参数,接入 checkauthority 接口后可直接替换此对象。
63
+ */
64
+ const businessContext = {
65
+ roles: new Set(['006', '007']),
66
+ preCheckAmount: 300_000_000,
67
+ verifyUpdateStart: '00:00:00',
68
+ verifyUpdateEnd: '23:59:59',
69
+ sysRunDate: getLocalDateString(),
70
+ sysWorkDate: getLocalDateString(),
71
+ }
72
+
73
+ const createInitialFilter = (): RmbPositionForecastFilter => ({
74
+ tradeDate: businessContext.sysRunDate,
75
+ payDirection: '',
76
+ payChannel: '',
77
+ groundBranch: '',
78
+ deleteStatus: '',
79
+ verifyStatuses: [],
80
+ sortRule: '1',
81
+ clientName: '',
82
+ counterpartyName: '',
83
+ businessType: '',
84
+ minAmountWan: null,
85
+ maxAmountWan: null,
86
+ })
87
+
88
+ const createResetFilter = (): RmbPositionForecastFilter => ({
89
+ ...createInitialFilter(),
90
+ tradeDate: '',
91
+ sortRule: '',
92
+ })
93
+
94
+ const cloneFilter = (source: RmbPositionForecastFilter): RmbPositionForecastFilter => ({
95
+ ...source,
96
+ verifyStatuses: [...source.verifyStatuses],
97
+ })
98
+
99
+ const createEditorForm = (): EditorForm => ({
100
+ tradeDate: businessContext.sysWorkDate,
101
+ payDirection: '',
102
+ payChannel: '',
103
+ predAmount: 0,
104
+ groundBranch: '',
105
+ clientType: '1',
106
+ clientName: '',
107
+ counterpartyName: '',
108
+ counterpartyAccount: '',
109
+ standardName: '',
110
+ businessType: '',
111
+ })
112
+
113
+ const filterForm = reactive<RmbPositionForecastFilter>(createInitialFilter())
114
+ const appliedFilters = ref<RmbPositionForecastFilter>(cloneFilter(filterForm))
115
+ const records = ref<RmbPositionForecastRow[]>(createRmbPositionForecastMockRows())
116
+ const selectedRows = ref<RmbPositionForecastRow[]>([])
117
+ const currentPage = ref(1)
118
+ const pageSize = ref(25)
119
+ const selectionResetKey = ref(0)
120
+ const filterCollapsed = ref(false)
121
+ const amountRangeValid = ref(true)
122
+ const isQuerying = ref(false)
123
+
124
+ const detailVisible = ref(false)
125
+ const transactionVisible = ref(false)
126
+ const detailRecord = ref<RmbPositionForecastRow | null>(null)
127
+ const transactionRecord = ref<RmbPositionForecastRow | null>(null)
128
+
129
+ const editorVisible = ref(false)
130
+ const editorMode = ref<EditorMode>('add')
131
+ const editingRefNo = ref('')
132
+ const editorFormRef = ref<FormInstance>()
133
+ const editorForm = reactive<EditorForm>(createEditorForm())
134
+
135
+ const importVisible = ref(false)
136
+ const importFileName = ref('')
137
+ const editorClientTypeOptions = clientTypeOptions.map((option) => (
138
+ ['3', '4'].includes(option.value) ? { ...option, label: '不适用' } : option
139
+ ))
140
+
141
+ function validateClientName(_rule: unknown, value: unknown, callback: (error?: Error) => void) {
142
+ if (!['3', '4'].includes(editorForm.clientType) && !String(value ?? '').trim()) {
143
+ callback(new Error('请输入客户名称'))
144
+ return
145
+ }
146
+ callback()
147
+ }
148
+
149
+ const editorRules: FormRules = {
150
+ tradeDate: [{ required: true, message: '请选择交易日期', trigger: 'change' }],
151
+ payDirection: [{ required: true, message: '请选择收支方向', trigger: 'change' }],
152
+ payChannel: [{ required: true, message: '请选择支付渠道', trigger: 'change' }],
153
+ predAmount: [
154
+ { required: true, message: '请输入预报金额', trigger: 'blur' },
155
+ { type: 'number', min: 0.01, message: '预报金额必须大于 0', trigger: 'blur' },
156
+ ],
157
+ groundBranch: [{ required: true, message: '请输入落地机构', trigger: 'blur' }],
158
+ clientType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
159
+ clientName: [{ validator: validateClientName, trigger: ['blur', 'change'] }],
160
+ businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }],
161
+ }
162
+
163
+ const deletedStatusCodes = new Set(['3', '4', '5'])
164
+ const operableStatusCodes = new Set(['1', '2'])
165
+
166
+ function getOptionLabel(options: SelectOption[], value: string) {
167
+ return options.find((option) => option.value === value)?.label ?? value ?? '—'
168
+ }
169
+
170
+ function isDeleted(row: RmbPositionForecastRow) {
171
+ return deletedStatusCodes.has(row.predStatus)
172
+ }
173
+
174
+ function hasAnyRole(...roles: string[]) {
175
+ return roles.some((role) => businessContext.roles.has(role))
176
+ }
177
+
178
+ function getAmountPermissionError(row: RmbPositionForecastRow) {
179
+ if (row.predAmount >= businessContext.preCheckAmount && !businessContext.roles.has('006')) {
180
+ return `预报 ${row.predRefNo} 金额超过权限分界值,当前用户无操作权限`
181
+ }
182
+ if (row.predAmount < businessContext.preCheckAmount && !hasAnyRole('006', '007')) {
183
+ return `预报 ${row.predRefNo} 当前用户无操作权限`
184
+ }
185
+ return ''
186
+ }
187
+
188
+ function isWithinVerifyUpdateWindow() {
189
+ const now = new Date()
190
+ const pad = (value: number) => String(value).padStart(2, '0')
191
+ const currentTime = `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
192
+ return currentTime > businessContext.verifyUpdateStart && currentTime < businessContext.verifyUpdateEnd
193
+ }
194
+
195
+ function containsKeyword(value: string, keyword: string) {
196
+ return value.toLocaleLowerCase('zh-CN').includes(keyword.trim().toLocaleLowerCase('zh-CN'))
197
+ }
198
+
199
+ const filteredRows = computed(() => {
200
+ const filters = appliedFilters.value
201
+ const minAmount = filters.minAmountWan === null ? null : filters.minAmountWan * 10_000
202
+ const maxAmount = filters.maxAmountWan === null ? null : filters.maxAmountWan * 10_000
203
+
204
+ const result = records.value.filter((row) => {
205
+ if (filters.tradeDate && row.tradeDate !== filters.tradeDate) return false
206
+ if (filters.payDirection && row.payDirection !== filters.payDirection) return false
207
+ if (filters.payChannel && row.payChannel !== filters.payChannel) return false
208
+ if (filters.groundBranch && !containsKeyword(row.groundBranch, filters.groundBranch)) return false
209
+ if (filters.deleteStatus === '1' && !isDeleted(row)) return false
210
+ if (filters.deleteStatus === '2' && isDeleted(row)) return false
211
+ if (filters.verifyStatuses.length && !filters.verifyStatuses.includes(row.verifyStatus)) return false
212
+ if (filters.clientName && !containsKeyword(row.clientName, filters.clientName)) return false
213
+ if (filters.counterpartyName && !containsKeyword(row.counterpartyName, filters.counterpartyName)) return false
214
+ if (filters.businessType && row.businessType !== filters.businessType) return false
215
+ if (minAmount !== null && row.predAmount < minAmount) return false
216
+ if (maxAmount !== null && row.predAmount > maxAmount) return false
217
+ return true
218
+ })
219
+
220
+ if (filters.sortRule === '2') {
221
+ return [...result].sort((a, b) => b.predAmount - a.predAmount)
222
+ }
223
+ if (filters.sortRule === '1') {
224
+ return [...result].sort((a, b) => b.forecastDate.localeCompare(a.forecastDate))
225
+ }
226
+ return result
227
+ })
228
+
229
+ const pagedRows = computed(() => {
230
+ const start = (currentPage.value - 1) * pageSize.value
231
+ return filteredRows.value.slice(start, start + pageSize.value)
232
+ })
233
+
234
+ const summary = computed(() => {
235
+ const income = filteredRows.value
236
+ .filter((row) => row.payDirection === '1')
237
+ .reduce((total, row) => total + row.predAmount, 0)
238
+ const expense = filteredRows.value
239
+ .filter((row) => row.payDirection === '2')
240
+ .reduce((total, row) => total + row.predAmount, 0)
241
+
242
+ return {
243
+ count: filteredRows.value.length,
244
+ income,
245
+ expense,
246
+ net: income - expense,
247
+ }
248
+ })
249
+
250
+ const editorTitle = computed(() => {
251
+ if (editorMode.value === 'edit') return '修改人民币头寸预报'
252
+ if (editorMode.value === 'copy') return '复制人民币头寸预报'
253
+ return '新增人民币头寸预报'
254
+ })
255
+
256
+ function formatMoney(value: number) {
257
+ return Number(value || 0).toLocaleString('zh-CN', {
258
+ minimumFractionDigits: 2,
259
+ maximumFractionDigits: 2,
260
+ })
261
+ }
262
+
263
+ function formatCompactDate(value: string) {
264
+ if (!/^\d{8}$/.test(value)) return value || '—'
265
+ return `${value.slice(0, 4)}-${value.slice(4, 6)}-${value.slice(6, 8)}`
266
+ }
267
+
268
+ function formatSignedMoney(value: number) {
269
+ const sign = value > 0 ? '+' : ''
270
+ return `${sign}${formatMoney(value)}`
271
+ }
272
+
273
+ function forecastStatusTagType(status: string) {
274
+ if (status === '1' || status === '2') return 'success'
275
+ if (status === '7') return 'warning'
276
+ if (status === '8' || deletedStatusCodes.has(status)) return 'danger'
277
+ return 'info'
278
+ }
279
+
280
+ function verifyStatusTagType(status: string) {
281
+ if (status === '2') return 'success'
282
+ if (status === '3') return 'warning'
283
+ return 'info'
284
+ }
285
+
286
+ function clearSelection() {
287
+ selectedRows.value = []
288
+ selectionResetKey.value += 1
289
+ }
290
+
291
+ function handleSelectionChange(rows: RmbPositionForecastRow[]) {
292
+ selectedRows.value = rows
293
+ }
294
+
295
+ function requireSingle(actionName: string) {
296
+ if (selectedRows.value.length === 0) {
297
+ ElMessage.warning(`请选择一条需要${actionName}的记录`)
298
+ return null
299
+ }
300
+ if (selectedRows.value.length > 1) {
301
+ ElMessage.warning(`${actionName}操作不能选择多行`)
302
+ return null
303
+ }
304
+ return selectedRows.value[0] ?? null
305
+ }
306
+
307
+ async function handleQuery() {
308
+ if (!amountRangeValid.value) {
309
+ ElMessage.warning('输入的金额范围开始值不能大于结束值')
310
+ return
311
+ }
312
+ if (
313
+ (filterForm.minAmountWan !== null && filterForm.minAmountWan < 0)
314
+ || (filterForm.maxAmountWan !== null && filterForm.maxAmountWan < 0)
315
+ ) {
316
+ ElMessage.warning('金额范围不能小于 0')
317
+ return
318
+ }
319
+ if (
320
+ filterForm.minAmountWan !== null
321
+ && filterForm.maxAmountWan !== null
322
+ && filterForm.minAmountWan > filterForm.maxAmountWan
323
+ ) {
324
+ ElMessage.warning('输入的金额范围开始值不能大于结束值')
325
+ return
326
+ }
327
+
328
+ isQuerying.value = true
329
+ try {
330
+ appliedFilters.value = cloneFilter(filterForm)
331
+ currentPage.value = 1
332
+ clearSelection()
333
+ } finally {
334
+ window.setTimeout(() => {
335
+ isQuerying.value = false
336
+ }, 180)
337
+ }
338
+ }
339
+
340
+ function handleReset() {
341
+ Object.assign(filterForm, createResetFilter())
342
+ amountRangeValid.value = true
343
+ }
344
+
345
+ function handlePaginationChange() {
346
+ clearSelection()
347
+ }
348
+
349
+ function openDetail() {
350
+ const row = requireSingle('查看')
351
+ if (!row) return
352
+ detailRecord.value = row
353
+ detailVisible.value = true
354
+ }
355
+
356
+ function openDetailFromRow(row: RmbPositionForecastRow) {
357
+ detailRecord.value = row
358
+ detailVisible.value = true
359
+ }
360
+
361
+ function openTransactionStatus() {
362
+ const row = requireSingle('查看对应交易状态')
363
+ if (!row) return
364
+ if (!operableStatusCodes.has(row.predStatus)) {
365
+ ElMessage.warning('已删除或未同步的预报无法查看对应交易状态')
366
+ return
367
+ }
368
+ transactionRecord.value = row
369
+ transactionVisible.value = true
370
+ }
371
+
372
+ function assignEditorForm(row?: RmbPositionForecastRow) {
373
+ const next = createEditorForm()
374
+ if (row) {
375
+ Object.assign(next, {
376
+ tradeDate: row.tradeDate,
377
+ payDirection: row.payDirection,
378
+ payChannel: row.payChannel,
379
+ predAmount: row.predAmount,
380
+ groundBranch: row.groundBranch,
381
+ clientType: row.clientType,
382
+ clientName: row.clientName,
383
+ counterpartyName: row.counterpartyName,
384
+ counterpartyAccount: row.counterpartyAccount,
385
+ standardName: row.standardName,
386
+ businessType: row.businessType,
387
+ })
388
+ }
389
+ Object.assign(editorForm, next)
390
+ }
391
+
392
+ function openAddEditor() {
393
+ editorMode.value = 'add'
394
+ editingRefNo.value = ''
395
+ assignEditorForm()
396
+ editorVisible.value = true
397
+ }
398
+
399
+ function openEditEditor() {
400
+ const row = requireSingle('修改')
401
+ if (!row) return
402
+ if (!operableStatusCodes.has(row.predStatus)) {
403
+ ElMessage.warning('该预报不是可操作状态,无法修改')
404
+ return
405
+ }
406
+ if (row.verifyStatus === '1') {
407
+ const permissionError = getAmountPermissionError(row)
408
+ if (permissionError) {
409
+ ElMessage.warning(permissionError)
410
+ return
411
+ }
412
+ } else {
413
+ if (!hasAnyRole('006', '007')) {
414
+ ElMessage.warning('当前用户无权修改已核销或部分核销预报')
415
+ return
416
+ }
417
+ if (!isWithinVerifyUpdateWindow()) {
418
+ ElMessage.warning('当前不在已核销预报的可修改时间范围内')
419
+ return
420
+ }
421
+ }
422
+ editorMode.value = 'edit'
423
+ editingRefNo.value = row.predRefNo
424
+ assignEditorForm(row)
425
+ editorVisible.value = true
426
+ }
427
+
428
+ function openCopyEditor() {
429
+ const row = requireSingle('复制')
430
+ if (!row) return
431
+ if (!operableStatusCodes.has(row.predStatus)) {
432
+ ElMessage.warning('该预报不是可操作状态,无法复制')
433
+ return
434
+ }
435
+ if (row.tradeDate < businessContext.sysWorkDate) {
436
+ ElMessage.warning('只能对交易日期大于等于当前系统日期的预报进行复制')
437
+ return
438
+ }
439
+ editorMode.value = 'copy'
440
+ editingRefNo.value = row.predRefNo
441
+ assignEditorForm(row)
442
+ editorVisible.value = true
443
+ }
444
+
445
+ function createReferenceNo() {
446
+ const datePart = getLocalDateString().replaceAll('-', '')
447
+ return `RMB${datePart}${String(Date.now()).slice(-7)}`
448
+ }
449
+
450
+ function getLocalDateTimeString() {
451
+ const now = new Date()
452
+ const pad = (value: number) => String(value).padStart(2, '0')
453
+ return `${formatCompactDate(getLocalDateString())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
454
+ }
455
+
456
+ async function submitEditor() {
457
+ try {
458
+ await editorFormRef.value?.validate()
459
+ } catch {
460
+ return
461
+ }
462
+
463
+ const existing = records.value.find((row) => row.predRefNo === editingRefNo.value)
464
+ const nextRow: RmbPositionForecastRow = {
465
+ predRefNo: editorMode.value === 'edit' ? editingRefNo.value : createReferenceNo(),
466
+ predStatus: editorMode.value === 'edit' && existing ? existing.predStatus : '1',
467
+ tradeDate: editorForm.tradeDate,
468
+ payDirection: editorForm.payDirection as RmbPositionForecastRow['payDirection'],
469
+ payChannel: editorForm.payChannel as RmbPositionForecastRow['payChannel'],
470
+ verifyStatus: editorMode.value === 'edit' && existing ? existing.verifyStatus : '1',
471
+ predAmount: editorForm.predAmount,
472
+ verifyAmount: editorMode.value === 'edit' && existing ? existing.verifyAmount : 0,
473
+ groundBranch: editorForm.groundBranch.trim(),
474
+ groundBranchCode: existing?.groundBranchCode ?? 'ORG-TEMP',
475
+ clientType: editorForm.clientType as RmbPositionForecastRow['clientType'],
476
+ clientName: editorForm.clientName.trim(),
477
+ counterpartyName: editorForm.counterpartyName.trim(),
478
+ standardName: editorForm.standardName.trim(),
479
+ counterpartyAccount: editorForm.counterpartyAccount.trim(),
480
+ businessType: editorForm.businessType as RmbPositionForecastRow['businessType'],
481
+ forecastDate: getLocalDateTimeString(),
482
+ }
483
+
484
+ if (editorMode.value === 'edit') {
485
+ records.value = records.value.map((row) => (
486
+ row.predRefNo === editingRefNo.value ? nextRow : row
487
+ ))
488
+ ElMessage.success('预报修改成功')
489
+ } else {
490
+ records.value = [nextRow, ...records.value]
491
+ ElMessage.success(editorMode.value === 'copy' ? '预报复制成功' : '预报新增成功')
492
+ }
493
+
494
+ editorVisible.value = false
495
+ currentPage.value = 1
496
+ clearSelection()
497
+ }
498
+
499
+ async function handleDelete() {
500
+ if (selectedRows.value.length === 0) {
501
+ ElMessage.warning('请选择需要删除的记录')
502
+ return
503
+ }
504
+
505
+ const nonOperableRow = selectedRows.value.find((row) => !operableStatusCodes.has(row.predStatus))
506
+ if (nonOperableRow) {
507
+ ElMessage.warning(`预报 ${nonOperableRow.predRefNo} 不是可操作状态,无法删除`)
508
+ return
509
+ }
510
+
511
+ const verifiedRow = selectedRows.value.find((row) => row.verifyStatus !== '1')
512
+ if (verifiedRow) {
513
+ ElMessage.warning(`预报 ${verifiedRow.predRefNo} 已核销或部分核销,无法删除`)
514
+ return
515
+ }
516
+
517
+ const permissionError = selectedRows.value
518
+ .map((row) => getAmountPermissionError(row))
519
+ .find(Boolean)
520
+ if (permissionError) {
521
+ ElMessage.warning(permissionError)
522
+ return
523
+ }
524
+
525
+ try {
526
+ await ElMessageBox.confirm(
527
+ `是否确定删除已选择的 ${selectedRows.value.length} 条预报记录?`,
528
+ '删除确认',
529
+ { type: 'warning', confirmButtonText: '确定', cancelButtonText: '取消' },
530
+ )
531
+ } catch {
532
+ return
533
+ }
534
+
535
+ const selectedKeys = new Set(selectedRows.value.map((row) => row.predRefNo))
536
+ records.value = records.value.map((row) => (
537
+ selectedKeys.has(row.predRefNo)
538
+ ? { ...row, predStatus: '3' as RmbPositionForecastRow['predStatus'] }
539
+ : row
540
+ ))
541
+ const maxPage = Math.max(1, Math.ceil(filteredRows.value.length / pageSize.value))
542
+ currentPage.value = Math.min(currentPage.value, maxPage)
543
+ clearSelection()
544
+ ElMessage.success('删除操作成功')
545
+ }
546
+
547
+ const handleUploadChange: UploadProps['onChange'] = (file) => {
548
+ importFileName.value = file.name
549
+ }
550
+
551
+ const handleUploadRemove: UploadProps['onRemove'] = () => {
552
+ importFileName.value = ''
553
+ }
554
+
555
+ function openImportDialog() {
556
+ importFileName.value = ''
557
+ importVisible.value = true
558
+ }
559
+
560
+ function confirmImport() {
561
+ if (!importFileName.value) {
562
+ ElMessage.warning('请选择需要导入的文件')
563
+ return
564
+ }
565
+ importVisible.value = false
566
+ ElMessage.success(`文件 ${importFileName.value} 已进入导入队列`)
567
+ }
568
+
569
+ async function handleEndOfDayCommand(command: string) {
570
+ if (!hasAnyRole('006', '007')) {
571
+ ElMessage.warning('您不具有日终操作权限')
572
+ return
573
+ }
574
+ const isOverride = command === 'override'
575
+ const actionName = isOverride ? '覆盖日终' : '日终文件'
576
+ const question = isOverride ? '是否确定进行手工覆盖日终操作?' : '是否确定进行手工日终操作?'
577
+
578
+ try {
579
+ await ElMessageBox.confirm(question, actionName, {
580
+ type: 'warning',
581
+ confirmButtonText: '确定',
582
+ cancelButtonText: '取消',
583
+ })
584
+ } catch {
585
+ return
586
+ }
587
+ ElMessage.success(`${actionName}操作已提交`)
588
+ }
589
+
590
+ function escapeCsvCell(value: string | number) {
591
+ const raw = String(value ?? '')
592
+ const safe = /^[=+\-@]/.test(raw) ? `'${raw}` : raw
593
+ return `"${safe.replaceAll('"', '""')}"`
594
+ }
595
+
596
+ async function exportCsv() {
597
+ try {
598
+ await ElMessageBox.confirm('您是否确定导出当前查询结果?', '导出确认', {
599
+ type: 'info',
600
+ confirmButtonText: '导出',
601
+ cancelButtonText: '取消',
602
+ })
603
+ } catch {
604
+ return
605
+ }
606
+
607
+ const headers = [
608
+ '预报流水号', '预报状态', '交易日期', '收支方向', '支付渠道', '核销状态',
609
+ '预报金额(元)', '已核销金额(元)', '落地机构', '客户类型', '客户名称',
610
+ '交易对手名称', '标准名称', '交易对手账号', '业务类型', '预报日期',
611
+ ]
612
+ const lines = filteredRows.value.map((row) => [
613
+ row.predRefNo,
614
+ getOptionLabel(forecastStatusOptions, row.predStatus),
615
+ row.tradeDate,
616
+ getOptionLabel(payDirectionOptions, row.payDirection),
617
+ getOptionLabel(payChannelOptions, row.payChannel),
618
+ getOptionLabel(verifyStatusOptions, row.verifyStatus),
619
+ row.predAmount.toFixed(2),
620
+ row.verifyAmount.toFixed(2),
621
+ row.groundBranch,
622
+ getOptionLabel(clientTypeOptions, row.clientType),
623
+ row.clientName,
624
+ row.counterpartyName,
625
+ row.standardName,
626
+ row.counterpartyAccount,
627
+ getOptionLabel(businessTypeOptions, row.businessType),
628
+ row.forecastDate,
629
+ ])
630
+ const csv = [headers, ...lines].map((line) => line.map(escapeCsvCell).join(',')).join('\n')
631
+ const blob = new Blob([`\uFEFF${csv}`], { type: 'text/csv;charset=utf-8' })
632
+ const url = URL.createObjectURL(blob)
633
+ const anchor = document.createElement('a')
634
+ anchor.href = url
635
+ anchor.download = `人民币头寸预报_${getLocalDateString().replaceAll('-', '')}.csv`
636
+ document.body.appendChild(anchor)
637
+ anchor.click()
638
+ window.setTimeout(() => {
639
+ anchor.remove()
640
+ URL.revokeObjectURL(url)
641
+ }, 0)
642
+ ElMessage.success(`已导出 ${filteredRows.value.length} 条记录`)
643
+ }
644
+ </script>
645
+
646
+ <template>
647
+ <main class="rmb-position-page">
648
+ <header class="page-heading">
649
+ <div class="heading-copy">
650
+ <span class="heading-mark" aria-hidden="true">¥</span>
651
+ <div>
652
+ <div class="heading-title-line">
653
+ <h1>人民币头寸预报</h1>
654
+ <span>RMB POSITION FORECAST</span>
655
+ </div>
656
+ <p>统一查询、维护及跟踪人民币收支头寸预报</p>
657
+ </div>
658
+ </div>
659
+ <div class="heading-date">
660
+ <span>数据日期</span>
661
+ <strong>{{ appliedFilters.tradeDate ? formatCompactDate(appliedFilters.tradeDate) : '全部日期' }}</strong>
662
+ </div>
663
+ </header>
664
+
665
+ <section class="query-panel" aria-label="人民币头寸预报查询条件">
666
+ <el-form :model="filterForm" label-position="top" size="small" class="query-form" @submit.prevent="handleQuery">
667
+ <div class="query-grid" :class="{ 'is-collapsed': filterCollapsed }">
668
+ <el-form-item label="交易日期">
669
+ <el-date-picker
670
+ v-model="filterForm.tradeDate"
671
+ type="date"
672
+ value-format="YYYYMMDD"
673
+ format="YYYY-MM-DD"
674
+ placeholder="请选择"
675
+ clearable
676
+ />
677
+ </el-form-item>
678
+
679
+ <el-form-item label="收支方向">
680
+ <el-select v-model="filterForm.payDirection" placeholder="请选择" clearable>
681
+ <el-option v-for="option in payDirectionOptions" :key="option.value" v-bind="option" />
682
+ </el-select>
683
+ </el-form-item>
684
+
685
+ <el-form-item label="支付渠道">
686
+ <el-select v-model="filterForm.payChannel" placeholder="请选择" clearable>
687
+ <el-option v-for="option in payChannelOptions" :key="option.value" v-bind="option" />
688
+ </el-select>
689
+ </el-form-item>
690
+
691
+ <el-form-item label="落地机构">
692
+ <el-input v-model="filterForm.groundBranch" placeholder="请输入机构名称" clearable />
693
+ </el-form-item>
694
+
695
+ <el-form-item label="预报状态">
696
+ <el-select v-model="filterForm.deleteStatus" placeholder="请选择" clearable>
697
+ <el-option v-for="option in deleteStatusOptions" :key="option.value" v-bind="option" />
698
+ </el-select>
699
+ </el-form-item>
700
+
701
+ <el-form-item label="核销状态">
702
+ <el-select
703
+ v-model="filterForm.verifyStatuses"
704
+ multiple
705
+ collapse-tags
706
+ collapse-tags-tooltip
707
+ placeholder="请选择"
708
+ clearable
709
+ >
710
+ <el-option v-for="option in verifyStatusOptions" :key="option.value" v-bind="option" />
711
+ </el-select>
712
+ </el-form-item>
713
+
714
+ <el-form-item label="客户名称" class="filter-secondary">
715
+ <el-input v-model="filterForm.clientName" placeholder="请输入客户名称" clearable />
716
+ </el-form-item>
717
+
718
+ <el-form-item label="交易对手名称" class="filter-secondary">
719
+ <el-input v-model="filterForm.counterpartyName" placeholder="请输入交易对手" clearable />
720
+ </el-form-item>
721
+
722
+ <el-form-item label="业务类型" class="filter-secondary">
723
+ <el-select v-model="filterForm.businessType" placeholder="请选择" clearable>
724
+ <el-option v-for="option in businessTypeOptions" :key="option.value" v-bind="option" />
725
+ </el-select>
726
+ </el-form-item>
727
+
728
+ <el-form-item label="金额范围(万)" class="amount-range-item filter-secondary">
729
+ <NumberRange
730
+ v-model:start="filterForm.minAmountWan"
731
+ v-model:end="filterForm.maxAmountWan"
732
+ separator="—"
733
+ min-placeholder="起始金额"
734
+ max-placeholder="结束金额"
735
+ error-message="开始金额不能大于结束金额"
736
+ :precision="2"
737
+ size="small"
738
+ @validate="amountRangeValid = $event"
739
+ />
740
+ </el-form-item>
741
+
742
+ <el-form-item label="排序" class="filter-secondary">
743
+ <el-select v-model="filterForm.sortRule" placeholder="请选择" clearable>
744
+ <el-option v-for="option in sortRuleOptions" :key="option.value" v-bind="option" />
745
+ </el-select>
746
+ </el-form-item>
747
+ </div>
748
+
749
+ <div class="query-actions">
750
+ <el-button
751
+ text
752
+ type="primary"
753
+ :icon="filterCollapsed ? ArrowDown : ArrowUp"
754
+ :aria-expanded="!filterCollapsed"
755
+ @click="filterCollapsed = !filterCollapsed"
756
+ >
757
+ {{ filterCollapsed ? '展开筛选' : '收起筛选' }}
758
+ </el-button>
759
+ <el-button :icon="RefreshLeft" @click="handleReset">重置</el-button>
760
+ <el-button native-type="submit" type="primary" :icon="Search" :loading="isQuerying">查询</el-button>
761
+ </div>
762
+ </el-form>
763
+ </section>
764
+
765
+ <section class="summary-strip" aria-label="查询结果汇总">
766
+ <div class="summary-item summary-count">
767
+ <span>查询结果</span>
768
+ <strong>{{ summary.count }}</strong>
769
+ <small>笔</small>
770
+ </div>
771
+ <div class="summary-item is-income">
772
+ <span>收入总额(元)</span>
773
+ <strong>{{ formatMoney(summary.income) }}</strong>
774
+ </div>
775
+ <div class="summary-item is-expense">
776
+ <span>支出总额(元)</span>
777
+ <strong>{{ formatMoney(summary.expense) }}</strong>
778
+ </div>
779
+ <div class="summary-item" :class="summary.net >= 0 ? 'is-net-positive' : 'is-net-negative'">
780
+ <span>收支轧差(元)</span>
781
+ <strong>{{ formatSignedMoney(summary.net) }}</strong>
782
+ </div>
783
+ </section>
784
+
785
+ <section class="table-panel" aria-label="人民币头寸预报列表">
786
+ <ElTablePro
787
+ v-model:page="currentPage"
788
+ v-model:page-size="pageSize"
789
+ :data="pagedRows"
790
+ :total="filteredRows.length"
791
+ :page-sizes="[10, 25, 50, 100]"
792
+ :selection-reset-key="selectionResetKey"
793
+ table-key="rmb-position-forecast"
794
+ row-key="predRefNo"
795
+ border
796
+ stripe
797
+ height="430"
798
+ empty-text="暂无人民币头寸预报记录"
799
+ class="forecast-table"
800
+ layout="total, sizes, prev, pager, next, jumper"
801
+ pagination-size="small"
802
+ @selection-change="handleSelectionChange"
803
+ @pagination-change="handlePaginationChange"
804
+ @row-dblclick="openDetailFromRow"
805
+ >
806
+ <template #toolbar>
807
+ <div class="table-toolbar-actions">
808
+ <el-button size="small" :icon="Document" @click="openDetail()">详细信息</el-button>
809
+ <el-button size="small" :icon="Tickets" @click="openTransactionStatus">对应交易状态</el-button>
810
+ <span class="operation-divider" aria-hidden="true"></span>
811
+ <el-button size="small" type="primary" :icon="Plus" @click="openAddEditor">新增</el-button>
812
+ <el-button size="small" :icon="EditPen" @click="openEditEditor">修改</el-button>
813
+ <el-button size="small" type="danger" plain :icon="Delete" @click="handleDelete">删除</el-button>
814
+ <el-button size="small" :icon="CopyDocument" @click="openCopyEditor">复制</el-button>
815
+ <span class="operation-divider" aria-hidden="true"></span>
816
+ <el-button size="small" :icon="UploadFilled" @click="openImportDialog">导入</el-button>
817
+ <el-dropdown trigger="click" @command="handleEndOfDayCommand">
818
+ <el-button size="small">
819
+ 日终操作<el-icon class="el-icon--right"><ArrowDown /></el-icon>
820
+ </el-button>
821
+ <template #dropdown>
822
+ <el-dropdown-menu>
823
+ <el-dropdown-item command="file">日终文件</el-dropdown-item>
824
+ <el-dropdown-item command="override" divided>覆盖日终</el-dropdown-item>
825
+ </el-dropdown-menu>
826
+ </template>
827
+ </el-dropdown>
828
+ </div>
829
+ </template>
830
+
831
+ <template #toolbar-right>
832
+ <div class="table-toolbar-actions toolbar-right">
833
+ <span class="selection-count">已选 <strong>{{ selectedRows.length }}</strong> 笔</span>
834
+ <el-button size="small" :icon="Download" @click="exportCsv">导出</el-button>
835
+ </div>
836
+ </template>
837
+
838
+ <el-table-column type="selection" column-key="selection" width="48" fixed="left" reserve-selection disabled />
839
+ <el-table-column
840
+ type="index"
841
+ column-key="sequence"
842
+ label="序号"
843
+ width="62"
844
+ fixed="left"
845
+ :index="(index: number) => (currentPage - 1) * pageSize + index + 1"
846
+ disabled
847
+ />
848
+ <el-table-column prop="predRefNo" label="预报流水号" width="190" fixed="left" show-overflow-tooltip />
849
+ <el-table-column label="预报状态" width="118">
850
+ <template #default="{ row }">
851
+ <el-tag :type="forecastStatusTagType(row.predStatus)" size="small" effect="light">
852
+ {{ getOptionLabel(forecastStatusOptions, row.predStatus) }}
853
+ </el-tag>
854
+ </template>
855
+ </el-table-column>
856
+ <el-table-column prop="tradeDate" label="交易日期" width="112">
857
+ <template #default="{ row }">{{ formatCompactDate(row.tradeDate) }}</template>
858
+ </el-table-column>
859
+ <el-table-column label="收支方向" width="88" align="center">
860
+ <template #default="{ row }">
861
+ <span class="direction-text" :class="row.payDirection === '1' ? 'is-income' : 'is-expense'">
862
+ {{ getOptionLabel(payDirectionOptions, row.payDirection) }}
863
+ </span>
864
+ </template>
865
+ </el-table-column>
866
+ <el-table-column label="支付渠道" width="118">
867
+ <template #default="{ row }">{{ getOptionLabel(payChannelOptions, row.payChannel) }}</template>
868
+ </el-table-column>
869
+ <el-table-column label="核销状态" width="104">
870
+ <template #default="{ row }">
871
+ <el-tag :type="verifyStatusTagType(row.verifyStatus)" size="small" effect="plain">
872
+ {{ getOptionLabel(verifyStatusOptions, row.verifyStatus) }}
873
+ </el-tag>
874
+ </template>
875
+ </el-table-column>
876
+ <el-table-column prop="predAmount" label="预报金额(元)" width="154" align="right">
877
+ <template #default="{ row }"><span class="money-cell">{{ formatMoney(row.predAmount) }}</span></template>
878
+ </el-table-column>
879
+ <el-table-column prop="verifyAmount" label="已核销金额(元)" width="158" align="right">
880
+ <template #default="{ row }"><span class="money-cell is-muted">{{ formatMoney(row.verifyAmount) }}</span></template>
881
+ </el-table-column>
882
+ <el-table-column prop="groundBranch" label="落地机构" width="164" show-overflow-tooltip />
883
+ <el-table-column label="客户类型" width="102">
884
+ <template #default="{ row }">{{ getOptionLabel(clientTypeOptions, row.clientType) }}</template>
885
+ </el-table-column>
886
+ <el-table-column prop="clientName" label="客户名称" width="220" show-overflow-tooltip />
887
+ <el-table-column prop="counterpartyName" label="交易对手名称" width="220" show-overflow-tooltip />
888
+ <el-table-column prop="standardName" label="标准名称" width="190" show-overflow-tooltip />
889
+ <el-table-column prop="counterpartyAccount" label="交易对手账号" width="190" show-overflow-tooltip />
890
+ <el-table-column label="业务类型" width="164">
891
+ <template #default="{ row }">{{ getOptionLabel(businessTypeOptions, row.businessType) }}</template>
892
+ </el-table-column>
893
+ <el-table-column prop="forecastDate" label="预报日期" width="168" show-overflow-tooltip />
894
+ </ElTablePro>
895
+ </section>
896
+
897
+ <el-dialog v-model="detailVisible" title="人民币头寸预报详细信息" width="860px" destroy-on-close>
898
+ <el-descriptions v-if="detailRecord" :column="3" border class="detail-descriptions">
899
+ <el-descriptions-item label="预报流水号" :span="2">{{ detailRecord.predRefNo }}</el-descriptions-item>
900
+ <el-descriptions-item label="预报状态">
901
+ {{ getOptionLabel(forecastStatusOptions, detailRecord.predStatus) }}
902
+ </el-descriptions-item>
903
+ <el-descriptions-item label="交易日期">{{ formatCompactDate(detailRecord.tradeDate) }}</el-descriptions-item>
904
+ <el-descriptions-item label="收支方向">{{ getOptionLabel(payDirectionOptions, detailRecord.payDirection) }}</el-descriptions-item>
905
+ <el-descriptions-item label="支付渠道">{{ getOptionLabel(payChannelOptions, detailRecord.payChannel) }}</el-descriptions-item>
906
+ <el-descriptions-item label="预报金额">{{ formatMoney(detailRecord.predAmount) }} 元</el-descriptions-item>
907
+ <el-descriptions-item label="已核销金额">{{ formatMoney(detailRecord.verifyAmount) }} 元</el-descriptions-item>
908
+ <el-descriptions-item label="核销状态">{{ getOptionLabel(verifyStatusOptions, detailRecord.verifyStatus) }}</el-descriptions-item>
909
+ <el-descriptions-item label="落地机构" :span="2">{{ detailRecord.groundBranch }}</el-descriptions-item>
910
+ <el-descriptions-item label="机构代码">{{ detailRecord.groundBranchCode }}</el-descriptions-item>
911
+ <el-descriptions-item label="客户类型">{{ getOptionLabel(clientTypeOptions, detailRecord.clientType) }}</el-descriptions-item>
912
+ <el-descriptions-item label="客户名称" :span="2">{{ detailRecord.clientName }}</el-descriptions-item>
913
+ <el-descriptions-item label="交易对手名称" :span="2">{{ detailRecord.counterpartyName || '—' }}</el-descriptions-item>
914
+ <el-descriptions-item label="交易对手账号">{{ detailRecord.counterpartyAccount || '—' }}</el-descriptions-item>
915
+ <el-descriptions-item label="标准名称" :span="2">{{ detailRecord.standardName || '—' }}</el-descriptions-item>
916
+ <el-descriptions-item label="业务类型">{{ getOptionLabel(businessTypeOptions, detailRecord.businessType) }}</el-descriptions-item>
917
+ <el-descriptions-item label="预报日期" :span="3">{{ detailRecord.forecastDate }}</el-descriptions-item>
918
+ </el-descriptions>
919
+ <template #footer>
920
+ <el-button @click="detailVisible = false">关闭</el-button>
921
+ </template>
922
+ </el-dialog>
923
+
924
+ <el-dialog v-model="transactionVisible" title="对应交易状态" width="620px" destroy-on-close>
925
+ <div v-if="transactionRecord" class="transaction-status-card">
926
+ <div class="transaction-number">
927
+ <span>预报流水号</span>
928
+ <strong>{{ transactionRecord.predRefNo }}</strong>
929
+ </div>
930
+ <el-timeline>
931
+ <el-timeline-item :timestamp="transactionRecord.forecastDate" placement="top" type="primary">
932
+ <strong>头寸预报已提交</strong>
933
+ <p>{{ transactionRecord.groundBranch }} 提交了一笔{{ getOptionLabel(payDirectionOptions, transactionRecord.payDirection) }}预报</p>
934
+ </el-timeline-item>
935
+ <el-timeline-item
936
+ :timestamp="formatCompactDate(transactionRecord.tradeDate)"
937
+ placement="top"
938
+ :type="transactionRecord.verifyStatus === '2' ? 'success' : 'warning'"
939
+ >
940
+ <strong>{{ getOptionLabel(verifyStatusOptions, transactionRecord.verifyStatus) }}</strong>
941
+ <p>已核销 {{ formatMoney(transactionRecord.verifyAmount) }} 元,预报金额 {{ formatMoney(transactionRecord.predAmount) }} 元</p>
942
+ </el-timeline-item>
943
+ </el-timeline>
944
+ </div>
945
+ <template #footer>
946
+ <el-button @click="transactionVisible = false">关闭</el-button>
947
+ </template>
948
+ </el-dialog>
949
+
950
+ <el-dialog v-model="editorVisible" :title="editorTitle" width="760px" destroy-on-close>
951
+ <el-form
952
+ ref="editorFormRef"
953
+ :model="editorForm"
954
+ :rules="editorRules"
955
+ label-width="118px"
956
+ class="editor-form"
957
+ @submit.prevent="submitEditor"
958
+ >
959
+ <div class="editor-grid">
960
+ <el-form-item label="交易日期" prop="tradeDate">
961
+ <el-date-picker v-model="editorForm.tradeDate" type="date" value-format="YYYYMMDD" format="YYYY-MM-DD" />
962
+ </el-form-item>
963
+ <el-form-item label="收支方向" prop="payDirection">
964
+ <el-select v-model="editorForm.payDirection" placeholder="请选择">
965
+ <el-option v-for="option in payDirectionOptions" :key="option.value" v-bind="option" />
966
+ </el-select>
967
+ </el-form-item>
968
+ <el-form-item label="支付渠道" prop="payChannel">
969
+ <el-select v-model="editorForm.payChannel" placeholder="请选择">
970
+ <el-option v-for="option in payChannelOptions" :key="option.value" v-bind="option" />
971
+ </el-select>
972
+ </el-form-item>
973
+ <el-form-item label="预报金额(元)" prop="predAmount">
974
+ <el-input-number v-model="editorForm.predAmount" :min="0" :precision="2" :controls="false" />
975
+ </el-form-item>
976
+ <el-form-item label="落地机构" prop="groundBranch">
977
+ <el-input v-model="editorForm.groundBranch" maxlength="80" placeholder="请输入" />
978
+ </el-form-item>
979
+ <el-form-item label="客户类型" prop="clientType">
980
+ <el-select v-model="editorForm.clientType" placeholder="请选择">
981
+ <el-option v-for="option in editorClientTypeOptions" :key="option.value" v-bind="option" />
982
+ </el-select>
983
+ </el-form-item>
984
+ <el-form-item label="客户名称" prop="clientName">
985
+ <el-input v-model="editorForm.clientName" maxlength="120" placeholder="请输入" />
986
+ </el-form-item>
987
+ <el-form-item label="业务类型" prop="businessType">
988
+ <el-select v-model="editorForm.businessType" placeholder="请选择">
989
+ <el-option v-for="option in businessTypeOptions" :key="option.value" v-bind="option" />
990
+ </el-select>
991
+ </el-form-item>
992
+ <el-form-item label="交易对手名称">
993
+ <el-input v-model="editorForm.counterpartyName" maxlength="120" placeholder="请输入" />
994
+ </el-form-item>
995
+ <el-form-item label="交易对手账号">
996
+ <el-input v-model="editorForm.counterpartyAccount" maxlength="40" placeholder="请输入" />
997
+ </el-form-item>
998
+ <el-form-item label="标准名称" class="editor-full-row">
999
+ <el-input v-model="editorForm.standardName" maxlength="120" placeholder="请输入" />
1000
+ </el-form-item>
1001
+ </div>
1002
+ </el-form>
1003
+ <template #footer>
1004
+ <el-button @click="editorVisible = false">取消</el-button>
1005
+ <el-button type="primary" @click="submitEditor">保存</el-button>
1006
+ </template>
1007
+ </el-dialog>
1008
+
1009
+ <el-dialog v-model="importVisible" title="批量导入" width="560px" destroy-on-close>
1010
+ <el-upload
1011
+ drag
1012
+ action="#"
1013
+ accept=".xls,.xlsx,.csv"
1014
+ :auto-upload="false"
1015
+ :limit="1"
1016
+ :on-change="handleUploadChange"
1017
+ :on-remove="handleUploadRemove"
1018
+ class="forecast-upload"
1019
+ >
1020
+ <el-icon class="upload-icon"><UploadFilled /></el-icon>
1021
+ <div class="upload-title">将文件拖到此处,或<span>点击选择</span></div>
1022
+ <p>支持 xls、xlsx 或 csv 文件,每次上传 1 个文件</p>
1023
+ </el-upload>
1024
+ <template #footer>
1025
+ <el-button @click="importVisible = false">关闭</el-button>
1026
+ <el-button type="primary" @click="confirmImport">导入</el-button>
1027
+ </template>
1028
+ </el-dialog>
1029
+ </main>
1030
+ </template>
1031
+
1032
+ <style scoped>
1033
+ .rmb-position-page {
1034
+ --page-blue: #1f62d6;
1035
+ --page-ink: #172033;
1036
+ --page-muted: #667085;
1037
+ --page-line: #dce3ec;
1038
+ min-width: 0;
1039
+ min-height: 100%;
1040
+ color: var(--page-ink);
1041
+ font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
1042
+ }
1043
+
1044
+ .page-heading {
1045
+ display: flex;
1046
+ align-items: center;
1047
+ justify-content: space-between;
1048
+ gap: 24px;
1049
+ margin-bottom: 10px;
1050
+ padding: 14px 18px;
1051
+ overflow: hidden;
1052
+ border: 1px solid #e2e7ef;
1053
+ border-radius: 7px;
1054
+ background:
1055
+ linear-gradient(90deg, rgba(165, 37, 52, .055), transparent 38%),
1056
+ #fff;
1057
+ box-shadow: 0 3px 12px rgba(30, 55, 90, .04);
1058
+ }
1059
+
1060
+ .heading-copy,
1061
+ .heading-title-line,
1062
+ .heading-date {
1063
+ display: flex;
1064
+ align-items: center;
1065
+ }
1066
+
1067
+ .heading-copy {
1068
+ min-width: 0;
1069
+ gap: 13px;
1070
+ }
1071
+
1072
+ .heading-mark {
1073
+ display: grid;
1074
+ flex: 0 0 auto;
1075
+ width: 38px;
1076
+ height: 38px;
1077
+ border-radius: 8px;
1078
+ place-items: center;
1079
+ color: #fff;
1080
+ background: #a52939;
1081
+ box-shadow: 0 7px 16px rgba(165, 41, 57, .18);
1082
+ font-family: Georgia, serif;
1083
+ font-size: 22px;
1084
+ }
1085
+
1086
+ .heading-title-line {
1087
+ gap: 12px;
1088
+ }
1089
+
1090
+ .heading-title-line h1 {
1091
+ margin: 0;
1092
+ color: #172033;
1093
+ font-size: 19px;
1094
+ font-weight: 750;
1095
+ line-height: 1.3;
1096
+ }
1097
+
1098
+ .heading-title-line span {
1099
+ color: #a52939;
1100
+ font-size: 10px;
1101
+ font-weight: 700;
1102
+ letter-spacing: .12em;
1103
+ }
1104
+
1105
+ .heading-copy p {
1106
+ margin: 4px 0 0;
1107
+ color: #778195;
1108
+ font-size: 12px;
1109
+ }
1110
+
1111
+ .heading-date {
1112
+ flex: 0 0 auto;
1113
+ gap: 10px;
1114
+ padding: 7px 10px;
1115
+ border: 1px solid #e5e9f0;
1116
+ border-radius: 6px;
1117
+ background: rgba(248, 250, 252, .86);
1118
+ }
1119
+
1120
+ .heading-date span {
1121
+ color: #7b8495;
1122
+ font-size: 11px;
1123
+ }
1124
+
1125
+ .heading-date strong {
1126
+ color: #344054;
1127
+ font-size: 12px;
1128
+ font-variant-numeric: tabular-nums;
1129
+ }
1130
+
1131
+ .query-panel,
1132
+ .table-panel,
1133
+ .summary-strip {
1134
+ border: 1px solid var(--page-line);
1135
+ background: #fff;
1136
+ box-shadow: 0 3px 12px rgba(30, 55, 90, .045);
1137
+ }
1138
+
1139
+ .query-panel {
1140
+ margin-bottom: 10px;
1141
+ padding: 12px 16px 10px;
1142
+ border-radius: 7px;
1143
+ }
1144
+
1145
+ .query-grid {
1146
+ display: grid;
1147
+ grid-template-columns: repeat(6, minmax(0, 1fr));
1148
+ gap: 8px 12px;
1149
+ }
1150
+
1151
+ .query-grid.is-collapsed .filter-secondary {
1152
+ display: none;
1153
+ }
1154
+
1155
+ .query-form :deep(.el-form-item) {
1156
+ min-width: 0;
1157
+ margin-bottom: 0;
1158
+ }
1159
+
1160
+ .query-form :deep(.el-form-item__label) {
1161
+ height: 24px;
1162
+ padding: 0;
1163
+ color: #475467;
1164
+ font-size: 12px;
1165
+ font-weight: 600;
1166
+ line-height: 24px;
1167
+ }
1168
+
1169
+ .query-form :deep(.el-input),
1170
+ .query-form :deep(.el-select),
1171
+ .query-form :deep(.el-date-editor) {
1172
+ width: 100%;
1173
+ }
1174
+
1175
+ .query-form :deep(.el-input__wrapper),
1176
+ .query-form :deep(.el-select__wrapper) {
1177
+ min-height: var(--el-component-size-small, 24px);
1178
+ border-radius: 5px;
1179
+ box-shadow: 0 0 0 1px #d6dee9 inset;
1180
+ }
1181
+
1182
+ .amount-range-item {
1183
+ grid-column: span 2;
1184
+ }
1185
+
1186
+ .amount-range-item :deep(.number-range__separator) {
1187
+ color: #98a2b3;
1188
+ font-size: 12px;
1189
+ }
1190
+
1191
+ .query-actions {
1192
+ display: flex;
1193
+ justify-content: flex-end;
1194
+ gap: 8px;
1195
+ margin-top: 10px;
1196
+ padding-top: 10px;
1197
+ border-top: 1px dashed #e2e8f0;
1198
+ }
1199
+
1200
+ .query-actions .el-button {
1201
+ min-width: 84px;
1202
+ }
1203
+
1204
+ .summary-strip {
1205
+ display: grid;
1206
+ grid-template-columns: .66fr repeat(3, 1fr);
1207
+ margin-bottom: 10px;
1208
+ overflow: hidden;
1209
+ border-radius: 7px;
1210
+ }
1211
+
1212
+ .summary-item {
1213
+ display: flex;
1214
+ align-items: baseline;
1215
+ justify-content: space-between;
1216
+ min-width: 0;
1217
+ gap: 10px;
1218
+ padding: 10px 14px;
1219
+ border-right: 1px solid #edf0f5;
1220
+ }
1221
+
1222
+ .summary-item:last-child {
1223
+ border-right: 0;
1224
+ }
1225
+
1226
+ .summary-item span {
1227
+ color: #667085;
1228
+ font-size: 11px;
1229
+ white-space: nowrap;
1230
+ }
1231
+
1232
+ .summary-item strong {
1233
+ overflow: hidden;
1234
+ color: #27364f;
1235
+ font-size: 15px;
1236
+ font-variant-numeric: tabular-nums;
1237
+ text-overflow: ellipsis;
1238
+ white-space: nowrap;
1239
+ }
1240
+
1241
+ .summary-item small {
1242
+ margin-left: -6px;
1243
+ color: #98a2b3;
1244
+ font-size: 11px;
1245
+ }
1246
+
1247
+ .summary-count {
1248
+ justify-content: flex-start;
1249
+ background: #f7f9fc;
1250
+ }
1251
+
1252
+ .summary-count strong {
1253
+ margin-left: auto;
1254
+ color: #1d5dbf;
1255
+ font-size: 18px;
1256
+ }
1257
+
1258
+ .summary-item.is-income strong,
1259
+ .summary-item.is-net-positive strong {
1260
+ color: #12805c;
1261
+ }
1262
+
1263
+ .summary-item.is-expense strong,
1264
+ .summary-item.is-net-negative strong {
1265
+ color: #d14343;
1266
+ }
1267
+
1268
+ .table-panel {
1269
+ overflow: hidden;
1270
+ border-radius: 7px;
1271
+ }
1272
+
1273
+ .forecast-table {
1274
+ width: 100%;
1275
+ --el-table-header-bg-color: #f3f6fa;
1276
+ --el-table-header-text-color: #344054;
1277
+ --el-table-row-hover-bg-color: #f1f6ff;
1278
+ --el-table-border-color: #e1e6ed;
1279
+ }
1280
+
1281
+ .table-panel :deep(.el-table-plus__toolbar) {
1282
+ flex-wrap: wrap;
1283
+ gap: 8px;
1284
+ min-height: 44px;
1285
+ margin: 0;
1286
+ padding: 7px 12px;
1287
+ border-bottom: 1px solid #e5eaf1;
1288
+ background: #fbfcfe;
1289
+ }
1290
+
1291
+ .table-panel :deep(.el-table-plus__toolbar-left) {
1292
+ flex: 1;
1293
+ min-width: 0;
1294
+ flex-wrap: wrap;
1295
+ }
1296
+
1297
+ .table-panel :deep(.el-table-plus__pagination) {
1298
+ min-height: 50px;
1299
+ margin: 0;
1300
+ padding: 8px 14px;
1301
+ border-top: 1px solid #e5eaf1;
1302
+ }
1303
+
1304
+ .table-toolbar-actions {
1305
+ display: flex;
1306
+ align-items: center;
1307
+ flex-wrap: wrap;
1308
+ gap: 7px;
1309
+ }
1310
+
1311
+ .table-toolbar-actions .el-button + .el-button {
1312
+ margin-left: 0;
1313
+ }
1314
+
1315
+ .operation-divider {
1316
+ width: 1px;
1317
+ height: 22px;
1318
+ margin-inline: 2px;
1319
+ background: #d9e1eb;
1320
+ }
1321
+
1322
+ .selection-count {
1323
+ margin-right: 2px;
1324
+ color: #667085;
1325
+ font-size: 12px;
1326
+ white-space: nowrap;
1327
+ }
1328
+
1329
+ .selection-count strong {
1330
+ color: #1f62d6;
1331
+ }
1332
+
1333
+ .forecast-table :deep(.el-table__header th) {
1334
+ height: 40px;
1335
+ padding: 0;
1336
+ font-size: 12px;
1337
+ font-weight: 700;
1338
+ }
1339
+
1340
+ .forecast-table :deep(.el-table__cell) {
1341
+ padding: 6px 0;
1342
+ font-size: 12px;
1343
+ }
1344
+
1345
+ .forecast-table :deep(.el-table__row) {
1346
+ height: 42px;
1347
+ }
1348
+
1349
+ .money-cell {
1350
+ color: #27364f;
1351
+ font-weight: 650;
1352
+ font-variant-numeric: tabular-nums;
1353
+ }
1354
+
1355
+ .money-cell.is-muted {
1356
+ color: #667085;
1357
+ }
1358
+
1359
+ .direction-text {
1360
+ font-weight: 700;
1361
+ }
1362
+
1363
+ .direction-text.is-income {
1364
+ color: #12805c;
1365
+ }
1366
+
1367
+ .direction-text.is-expense {
1368
+ color: #d14343;
1369
+ }
1370
+
1371
+ .detail-descriptions :deep(.el-descriptions__label) {
1372
+ width: 126px;
1373
+ color: #667085;
1374
+ }
1375
+
1376
+ .transaction-status-card {
1377
+ padding: 4px 10px 0;
1378
+ }
1379
+
1380
+ .transaction-number {
1381
+ display: flex;
1382
+ align-items: center;
1383
+ justify-content: space-between;
1384
+ margin-bottom: 24px;
1385
+ padding: 12px 14px;
1386
+ border: 1px solid #e2e8f0;
1387
+ border-radius: 7px;
1388
+ background: #f8fafc;
1389
+ }
1390
+
1391
+ .transaction-number span,
1392
+ .transaction-status-card p {
1393
+ color: #667085;
1394
+ font-size: 12px;
1395
+ }
1396
+
1397
+ .transaction-number strong {
1398
+ color: #1f62d6;
1399
+ font-variant-numeric: tabular-nums;
1400
+ }
1401
+
1402
+ .transaction-status-card p {
1403
+ margin: 6px 0 0;
1404
+ }
1405
+
1406
+ .editor-grid {
1407
+ display: grid;
1408
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1409
+ gap: 0 18px;
1410
+ }
1411
+
1412
+ .editor-grid :deep(.el-form-item) {
1413
+ min-width: 0;
1414
+ }
1415
+
1416
+ .editor-grid :deep(.el-select),
1417
+ .editor-grid :deep(.el-date-editor),
1418
+ .editor-grid :deep(.el-input-number) {
1419
+ width: 100%;
1420
+ }
1421
+
1422
+ .editor-full-row {
1423
+ grid-column: 1 / -1;
1424
+ }
1425
+
1426
+ .forecast-upload :deep(.el-upload-dragger) {
1427
+ padding: 34px 20px;
1428
+ border-color: #cdd7e5;
1429
+ border-radius: 8px;
1430
+ background: #fbfcfe;
1431
+ }
1432
+
1433
+ .upload-icon {
1434
+ color: #1f62d6;
1435
+ font-size: 40px;
1436
+ }
1437
+
1438
+ .upload-title {
1439
+ margin-top: 10px;
1440
+ color: #344054;
1441
+ font-size: 14px;
1442
+ }
1443
+
1444
+ .upload-title span {
1445
+ color: #1f62d6;
1446
+ }
1447
+
1448
+ .forecast-upload p {
1449
+ margin: 7px 0 0;
1450
+ color: #98a2b3;
1451
+ font-size: 12px;
1452
+ }
1453
+
1454
+ @media (max-width: 1380px) {
1455
+ .query-grid:not(.is-collapsed) {
1456
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1457
+ }
1458
+
1459
+ .summary-strip {
1460
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1461
+ }
1462
+
1463
+ .summary-item:nth-child(2) {
1464
+ border-right: 0;
1465
+ }
1466
+
1467
+ .summary-item:nth-child(-n + 2) {
1468
+ border-bottom: 1px solid #edf0f5;
1469
+ }
1470
+ }
1471
+
1472
+ @media (max-width: 900px) {
1473
+ .page-heading {
1474
+ align-items: flex-start;
1475
+ flex-direction: column;
1476
+ }
1477
+
1478
+ .heading-date {
1479
+ align-self: stretch;
1480
+ justify-content: space-between;
1481
+ }
1482
+
1483
+ .query-grid,
1484
+ .query-grid.is-collapsed {
1485
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1486
+ }
1487
+
1488
+ .editor-grid {
1489
+ grid-template-columns: 1fr;
1490
+ }
1491
+
1492
+ .editor-full-row {
1493
+ grid-column: auto;
1494
+ }
1495
+ }
1496
+ </style>