verce-vue-test 0.0.162 → 0.0.163
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/env.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/element-rewrite/ElInputThousandthChinese.vue +77 -0
- package/src/components/index.ts +8 -0
- package/src/utils/chinese-currency.ts +85 -0
- package/src/views/ForecastInfo/RmbPositionSettlement.vue +19 -37
- package/src/views/ForecastInfo/forecast-info.css +47 -7
- package/src/views/foreign-currency-position-forecast/currency.ts +1 -66
- package/src/views/foreign-currency-settlement/index.vue +18 -5
package/env.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare module 'vue' {
|
|
|
28
28
|
ElButtonPro: typeof import('./src/components/element-rewrite/ElButtonPro.vue')['default']
|
|
29
29
|
ElFormDialog: typeof import('./src/components/element-rewrite/ElFormDialog.vue')['default']
|
|
30
30
|
ElInputThousandth: typeof import('./src/components/element-rewrite/ElInputThousandth.vue')['default']
|
|
31
|
+
ElInputThousandthChinese: typeof import('./src/components/element-rewrite/ElInputThousandthChinese.vue')['default']
|
|
31
32
|
ElTablePro: typeof import('./src/components/element-rewrite/ElTablePro.vue')['default']
|
|
32
33
|
ElUploadButton: typeof import('./src/components/element-rewrite/ElUploadButton.vue')['default']
|
|
33
34
|
LoginSuccessNotification: typeof import('./src/components/LoginSuccessNotification.vue')['default']
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
import { formatChineseCurrency } from '@/utils/chinese-currency'
|
|
5
|
+
import ElInputThousandth from './ElInputThousandth.vue'
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
name: 'ElInputThousandthChinese',
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<{
|
|
14
|
+
modelValue?: number | string
|
|
15
|
+
placeholder?: string
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
decimalPlaces?: number
|
|
18
|
+
}>(),
|
|
19
|
+
{
|
|
20
|
+
modelValue: undefined,
|
|
21
|
+
placeholder: '',
|
|
22
|
+
disabled: false,
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
const emit = defineEmits<{
|
|
27
|
+
'update:modelValue': [value: number | undefined]
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
/** 绑定值始终沿用 ElInputThousandth 的普通数值输出,中文大写仅作为展示文本。 */
|
|
31
|
+
const chineseAmount = computed(() => formatChineseCurrency(props.modelValue).replace(/^人民币/, ''))
|
|
32
|
+
|
|
33
|
+
function handleModelValueUpdate(value: number | string | undefined) {
|
|
34
|
+
if (value === undefined || value === '') {
|
|
35
|
+
emit('update:modelValue', undefined)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const numericValue = typeof value === 'number' ? value : Number(value)
|
|
40
|
+
emit('update:modelValue', Number.isFinite(numericValue) ? numericValue : undefined)
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div class="el-input-thousandth-chinese">
|
|
46
|
+
<ElInputThousandth
|
|
47
|
+
v-bind="$attrs"
|
|
48
|
+
:model-value="modelValue"
|
|
49
|
+
:placeholder="placeholder"
|
|
50
|
+
:disabled="disabled"
|
|
51
|
+
:decimal-places="decimalPlaces"
|
|
52
|
+
@update:model-value="handleModelValueUpdate"
|
|
53
|
+
/>
|
|
54
|
+
<span
|
|
55
|
+
v-if="chineseAmount"
|
|
56
|
+
class="el-input-thousandth-chinese__hint"
|
|
57
|
+
aria-live="polite"
|
|
58
|
+
>
|
|
59
|
+
大写金额:{{ chineseAmount }}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style scoped>
|
|
65
|
+
.el-input-thousandth-chinese {
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.el-input-thousandth-chinese__hint {
|
|
70
|
+
display: block;
|
|
71
|
+
margin-top: 4px;
|
|
72
|
+
color: var(--el-text-color-secondary);
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
line-height: 18px;
|
|
75
|
+
word-break: break-all;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
package/src/components/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import DateRange from './element-rewrite/DateRange.vue'
|
|
|
7
7
|
import ElButtonPro from './element-rewrite/ElButtonPro.vue'
|
|
8
8
|
import ElFormDialog from './element-rewrite/ElFormDialog.vue'
|
|
9
9
|
import ElInputThousandth from './element-rewrite/ElInputThousandth.vue'
|
|
10
|
+
import ElInputThousandthChinese from './element-rewrite/ElInputThousandthChinese.vue'
|
|
10
11
|
import NumberRange from './element-rewrite/NumberRange.vue'
|
|
11
12
|
import ElTablePro from './element-rewrite/ElTablePro.vue'
|
|
12
13
|
import ElUploadButton from './element-rewrite/ElUploadButton.vue'
|
|
@@ -71,6 +72,13 @@ const globalComponentDefinitions: GlobalComponentDefinition[] = [
|
|
|
71
72
|
description: '支持千分位展示和数字输入格式化的金额输入框。',
|
|
72
73
|
filePath: 'src/components/element-rewrite/ElInputThousandth.vue',
|
|
73
74
|
},
|
|
75
|
+
{
|
|
76
|
+
name: 'ElInputThousandthChinese',
|
|
77
|
+
component: ElInputThousandthChinese,
|
|
78
|
+
category: '表单组件',
|
|
79
|
+
description: '在千分位金额输入框下方实时展示中文大写金额,绑定值保持为普通数值。',
|
|
80
|
+
filePath: 'src/components/element-rewrite/ElInputThousandthChinese.vue',
|
|
81
|
+
},
|
|
74
82
|
{
|
|
75
83
|
name: 'ElTablePro',
|
|
76
84
|
component: ElTablePro,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const chineseDigits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'] as const
|
|
2
|
+
const chineseGroupUnits = ['', '万', '亿', '兆'] as const
|
|
3
|
+
const chineseWithinGroupUnits = ['仟', '佰', '拾', ''] as const
|
|
4
|
+
|
|
5
|
+
export type ChineseCurrencyValue = number | string | null | undefined
|
|
6
|
+
|
|
7
|
+
/** 将四位数字分组转换为中文大写金额片段。 */
|
|
8
|
+
function formatChineseFourDigitGroup(value: number) {
|
|
9
|
+
const digits = String(value).padStart(4, '0')
|
|
10
|
+
let result = ''
|
|
11
|
+
let pendingZero = false
|
|
12
|
+
|
|
13
|
+
for (let index = 0; index < digits.length; index += 1) {
|
|
14
|
+
const digit = Number(digits[index])
|
|
15
|
+
if (digit === 0) {
|
|
16
|
+
if (result) pendingZero = true
|
|
17
|
+
continue
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (pendingZero) result += chineseDigits[0]
|
|
21
|
+
result += `${chineseDigits[digit] ?? ''}${chineseWithinGroupUnits[index] ?? ''}`
|
|
22
|
+
pendingZero = false
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 将整数按万、亿、兆分组转换为中文大写。 */
|
|
29
|
+
function formatChineseInteger(value: number) {
|
|
30
|
+
const groups: number[] = []
|
|
31
|
+
let remaining = Math.trunc(value)
|
|
32
|
+
while (remaining > 0) {
|
|
33
|
+
groups.push(remaining % 10_000)
|
|
34
|
+
remaining = Math.floor(remaining / 10_000)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let result = ''
|
|
38
|
+
let pendingZero = false
|
|
39
|
+
for (let index = groups.length - 1; index >= 0; index -= 1) {
|
|
40
|
+
const group = groups[index] ?? 0
|
|
41
|
+
if (group === 0) {
|
|
42
|
+
if (result) pendingZero = true
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (result && (pendingZero || group < 1_000)) result += chineseDigits[0]
|
|
47
|
+
result += `${formatChineseFourDigitGroup(group)}${chineseGroupUnits[index] ?? ''}`
|
|
48
|
+
pendingZero = false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return result
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function toAmountNumber(value: ChineseCurrencyValue) {
|
|
55
|
+
if (value === null || value === undefined) return null
|
|
56
|
+
|
|
57
|
+
const normalizedValue = typeof value === 'string'
|
|
58
|
+
? value.replace(/,/g, '').trim()
|
|
59
|
+
: value
|
|
60
|
+
|
|
61
|
+
if (normalizedValue === '') return null
|
|
62
|
+
|
|
63
|
+
const amount = typeof normalizedValue === 'number'
|
|
64
|
+
? normalizedValue
|
|
65
|
+
: Number(normalizedValue)
|
|
66
|
+
|
|
67
|
+
return Number.isFinite(amount) && amount >= 0 ? amount : null
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 将金额转换为人民币大写文本,精确到角和分。 */
|
|
71
|
+
export function formatChineseCurrency(value: ChineseCurrencyValue) {
|
|
72
|
+
const amount = toAmountNumber(value)
|
|
73
|
+
if (amount === null) return ''
|
|
74
|
+
|
|
75
|
+
const roundedFen = Math.round(amount * 100)
|
|
76
|
+
const yuan = Math.floor(roundedFen / 100)
|
|
77
|
+
const jiao = Math.floor((roundedFen % 100) / 10)
|
|
78
|
+
const fen = roundedFen % 10
|
|
79
|
+
const integerPart = yuan === 0 ? '零' : formatChineseInteger(yuan)
|
|
80
|
+
const decimalPart = jiao === 0 && fen === 0
|
|
81
|
+
? '整'
|
|
82
|
+
: `${jiao > 0 ? `${chineseDigits[jiao]}角` : fen > 0 ? '零' : ''}${fen > 0 ? `${chineseDigits[fen]}分` : ''}`
|
|
83
|
+
|
|
84
|
+
return `人民币${integerPart}元${decimalPart}`
|
|
85
|
+
}
|
|
@@ -167,8 +167,8 @@ const amountColumnProps = new Set(['predAmt', 'verifyAmt'])
|
|
|
167
167
|
const forecastColumns: TableColumn[] = [
|
|
168
168
|
{ prop: 'predStatus', label: '预报状态', minWidth: 90 },
|
|
169
169
|
{ prop: 'payDirec', label: '收支方向', minWidth: 90 },
|
|
170
|
-
{ prop: 'predAmt', label: '
|
|
171
|
-
{ prop: 'verifyAmt', label: '
|
|
170
|
+
{ prop: 'predAmt', label: '预报金额(元)', minWidth: 126 },
|
|
171
|
+
{ prop: 'verifyAmt', label: '已核销金额(元)', minWidth: 134 },
|
|
172
172
|
{ prop: 'verifyStatus', label: '核销状态', minWidth: 90 },
|
|
173
173
|
{ prop: 'relsFlag', label: '释放状态', minWidth: 90 },
|
|
174
174
|
{ prop: 'payChannel', label: '支付渠道', minWidth: 96 },
|
|
@@ -189,7 +189,7 @@ const forecastColumns: TableColumn[] = [
|
|
|
189
189
|
]
|
|
190
190
|
|
|
191
191
|
const flowColumns: TableColumn[] = [
|
|
192
|
-
{ prop: 'amt', label: '
|
|
192
|
+
{ prop: 'amt', label: '金额(元)', minWidth: 108 },
|
|
193
193
|
{ prop: 'billDate', label: '出票日期', minWidth: 96 },
|
|
194
194
|
{ prop: 'billNo', label: '票号', minWidth: 82 },
|
|
195
195
|
{ prop: 'busiType', label: '支付系统业务类型', minWidth: 138 },
|
|
@@ -1205,7 +1205,7 @@ onBeforeUnmount(() => {
|
|
|
1205
1205
|
</div>
|
|
1206
1206
|
</header>
|
|
1207
1207
|
|
|
1208
|
-
<!--
|
|
1208
|
+
<!-- 左右布局显示三个常用筛选条件;上下布局隐藏支付渠道,追加核销状态、预报金额和客户名。 -->
|
|
1209
1209
|
<div class="forecast-info-filter" :class="{ 'forecast-info-filter--horizontal': cardLayout === 'horizontal' }">
|
|
1210
1210
|
<div class="forecast-info-filter__grid">
|
|
1211
1211
|
<label class="forecast-info-filter__item">
|
|
@@ -1277,7 +1277,7 @@ onBeforeUnmount(() => {
|
|
|
1277
1277
|
</label>
|
|
1278
1278
|
|
|
1279
1279
|
<label v-if="cardLayout === 'vertical'" class="forecast-info-filter__item forecast-info-filter__item--range">
|
|
1280
|
-
<span
|
|
1280
|
+
<span>预报金额(万元)</span>
|
|
1281
1281
|
<NumberRange
|
|
1282
1282
|
v-model="forecastForm.amountRange"
|
|
1283
1283
|
class="forecast-info-filter__number-range"
|
|
@@ -1286,28 +1286,10 @@ onBeforeUnmount(() => {
|
|
|
1286
1286
|
max-placeholder="最大值"
|
|
1287
1287
|
:precision="2"
|
|
1288
1288
|
size="small"
|
|
1289
|
-
unit="
|
|
1289
|
+
unit="万"
|
|
1290
1290
|
/>
|
|
1291
1291
|
</label>
|
|
1292
1292
|
|
|
1293
|
-
<label v-if="cardLayout === 'vertical'" class="forecast-info-filter__item">
|
|
1294
|
-
<span>支付渠道</span>
|
|
1295
|
-
<el-select
|
|
1296
|
-
v-model="forecastForm.channel"
|
|
1297
|
-
:append-to="overlayContainer || undefined"
|
|
1298
|
-
size="small"
|
|
1299
|
-
placeholder="请选择"
|
|
1300
|
-
clearable
|
|
1301
|
-
>
|
|
1302
|
-
<el-option
|
|
1303
|
-
v-for="option in channelOptions"
|
|
1304
|
-
:key="option.value"
|
|
1305
|
-
:label="option.label"
|
|
1306
|
-
:value="option.value"
|
|
1307
|
-
/>
|
|
1308
|
-
</el-select>
|
|
1309
|
-
</label>
|
|
1310
|
-
|
|
1311
1293
|
<label v-if="cardLayout === 'vertical'" class="forecast-info-filter__item">
|
|
1312
1294
|
<span>客户名</span>
|
|
1313
1295
|
<el-input v-model="forecastForm.clientName" size="small" placeholder="请输入" clearable />
|
|
@@ -1325,27 +1307,27 @@ onBeforeUnmount(() => {
|
|
|
1325
1307
|
<section class="forecast-info-table-area" aria-label="预报信息列表">
|
|
1326
1308
|
<div v-if="forecastSelectedRows.length" class="forecast-info-forecast-summary" aria-live="polite">
|
|
1327
1309
|
<div class="forecast-info-forecast-summary__item">
|
|
1328
|
-
<span
|
|
1310
|
+
<span>预报收入总金额(元)</span>
|
|
1329
1311
|
<strong>{{ forecastSelectionSummary.predIncome }}</strong>
|
|
1330
1312
|
</div>
|
|
1331
1313
|
<div class="forecast-info-forecast-summary__item">
|
|
1332
|
-
<span
|
|
1314
|
+
<span>预报支出总金额(元)</span>
|
|
1333
1315
|
<strong>{{ forecastSelectionSummary.predExpense }}</strong>
|
|
1334
1316
|
</div>
|
|
1335
1317
|
<div class="forecast-info-forecast-summary__item">
|
|
1336
|
-
<span
|
|
1318
|
+
<span>预报轧差金额(元)</span>
|
|
1337
1319
|
<strong>{{ forecastSelectionSummary.predNet }}</strong>
|
|
1338
1320
|
</div>
|
|
1339
1321
|
<div class="forecast-info-forecast-summary__item">
|
|
1340
|
-
<span
|
|
1322
|
+
<span>核销收入总金额(元)</span>
|
|
1341
1323
|
<strong>{{ forecastSelectionSummary.verifiedIncome }}</strong>
|
|
1342
1324
|
</div>
|
|
1343
1325
|
<div class="forecast-info-forecast-summary__item">
|
|
1344
|
-
<span
|
|
1326
|
+
<span>核销支出总金额(元)</span>
|
|
1345
1327
|
<strong>{{ forecastSelectionSummary.verifiedExpense }}</strong>
|
|
1346
1328
|
</div>
|
|
1347
1329
|
<div class="forecast-info-forecast-summary__item">
|
|
1348
|
-
<span
|
|
1330
|
+
<span>核销轧差金额(元)</span>
|
|
1349
1331
|
<strong>{{ forecastSelectionSummary.verifiedNet }}</strong>
|
|
1350
1332
|
</div>
|
|
1351
1333
|
</div>
|
|
@@ -1678,7 +1660,7 @@ onBeforeUnmount(() => {
|
|
|
1678
1660
|
max-placeholder="最大值"
|
|
1679
1661
|
:precision="2"
|
|
1680
1662
|
size="small"
|
|
1681
|
-
unit="
|
|
1663
|
+
unit="万"
|
|
1682
1664
|
/>
|
|
1683
1665
|
</label>
|
|
1684
1666
|
|
|
@@ -1815,7 +1797,7 @@ onBeforeUnmount(() => {
|
|
|
1815
1797
|
</div>
|
|
1816
1798
|
</header>
|
|
1817
1799
|
|
|
1818
|
-
<!--
|
|
1800
|
+
<!-- 左右布局显示交易日期、收支方向和支付渠道;上下布局隐藏支付渠道,追加核销状态、金额范围和户名条件。 -->
|
|
1819
1801
|
<div class="forecast-info-filter" :class="{ 'forecast-info-filter--horizontal': cardLayout === 'horizontal' }">
|
|
1820
1802
|
<div class="forecast-info-filter__grid">
|
|
1821
1803
|
<label class="forecast-info-filter__item">
|
|
@@ -1850,7 +1832,7 @@ onBeforeUnmount(() => {
|
|
|
1850
1832
|
</el-select>
|
|
1851
1833
|
</label>
|
|
1852
1834
|
|
|
1853
|
-
<label class="forecast-info-filter__item">
|
|
1835
|
+
<label v-if="cardLayout === 'horizontal'" class="forecast-info-filter__item">
|
|
1854
1836
|
<span>支付渠道</span>
|
|
1855
1837
|
<el-input v-model="flowForm.payChannel" size="small" placeholder="请输入" clearable />
|
|
1856
1838
|
</label>
|
|
@@ -1874,7 +1856,7 @@ onBeforeUnmount(() => {
|
|
|
1874
1856
|
</label>
|
|
1875
1857
|
|
|
1876
1858
|
<label v-if="cardLayout === 'vertical'" class="forecast-info-filter__item forecast-info-filter__item--range">
|
|
1877
|
-
<span
|
|
1859
|
+
<span>金额范围(万元)</span>
|
|
1878
1860
|
<NumberRange
|
|
1879
1861
|
v-model="flowForm.transAmtRange"
|
|
1880
1862
|
class="forecast-info-filter__number-range"
|
|
@@ -1883,7 +1865,7 @@ onBeforeUnmount(() => {
|
|
|
1883
1865
|
max-placeholder="最大值"
|
|
1884
1866
|
:precision="2"
|
|
1885
1867
|
size="small"
|
|
1886
|
-
unit="
|
|
1868
|
+
unit="万"
|
|
1887
1869
|
/>
|
|
1888
1870
|
</label>
|
|
1889
1871
|
|
|
@@ -1934,7 +1916,7 @@ onBeforeUnmount(() => {
|
|
|
1934
1916
|
<!-- 有选中流水时,在列配置同一行展示实时轧差金额。 -->
|
|
1935
1917
|
<template v-if="flowSelectedRows.length" #toolbar>
|
|
1936
1918
|
<div class="forecast-info-flow-net-amount" aria-live="polite">
|
|
1937
|
-
<span
|
|
1919
|
+
<span>轧差金额(元):</span>
|
|
1938
1920
|
<strong>{{ flowNetAmount }}</strong>
|
|
1939
1921
|
</div>
|
|
1940
1922
|
</template>
|
|
@@ -2044,7 +2026,7 @@ onBeforeUnmount(() => {
|
|
|
2044
2026
|
max-placeholder="最大值"
|
|
2045
2027
|
:precision="2"
|
|
2046
2028
|
size="small"
|
|
2047
|
-
unit="
|
|
2029
|
+
unit="万"
|
|
2048
2030
|
/>
|
|
2049
2031
|
</label>
|
|
2050
2032
|
|
|
@@ -193,10 +193,11 @@
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__grid {
|
|
196
|
-
|
|
196
|
+
display: flex;
|
|
197
|
+
flex: 0 1 auto;
|
|
197
198
|
max-width: none;
|
|
198
|
-
|
|
199
|
-
column-gap:
|
|
199
|
+
align-items: center;
|
|
200
|
+
column-gap: 14px;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter__item {
|
|
@@ -208,8 +209,9 @@
|
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item {
|
|
212
|
+
flex: 0 0 auto;
|
|
211
213
|
grid-template-columns: 48px minmax(0, 1fr);
|
|
212
|
-
gap:
|
|
214
|
+
gap: 8px;
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item > span {
|
|
@@ -277,6 +279,21 @@
|
|
|
277
279
|
min-width: 0;
|
|
278
280
|
}
|
|
279
281
|
|
|
282
|
+
/* 上下布局保留金额范围的紧凑宽度,让金额与客户/户名条件保持相邻。 */
|
|
283
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item--range {
|
|
284
|
+
grid-column: auto;
|
|
285
|
+
width: 250px;
|
|
286
|
+
min-width: 250px;
|
|
287
|
+
max-width: 250px;
|
|
288
|
+
flex: 0 0 250px;
|
|
289
|
+
justify-self: start;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item--range .forecast-info-filter__number-range {
|
|
293
|
+
width: 100%;
|
|
294
|
+
min-width: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
280
297
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter__number-range .number-range__separator {
|
|
281
298
|
width: 38px;
|
|
282
299
|
color: #25354b;
|
|
@@ -294,6 +311,16 @@
|
|
|
294
311
|
margin-left: auto;
|
|
295
312
|
}
|
|
296
313
|
|
|
314
|
+
/* 上下布局将筛选条件与操作按钮分成左右两组,保持金额与客户/户名条件相邻。 */
|
|
315
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) {
|
|
316
|
+
justify-content: space-between;
|
|
317
|
+
gap: 24px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__actions {
|
|
321
|
+
margin-left: 0;
|
|
322
|
+
}
|
|
323
|
+
|
|
297
324
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter__actions .el-button + .el-button {
|
|
298
325
|
margin-left: 0;
|
|
299
326
|
}
|
|
@@ -825,8 +852,7 @@
|
|
|
825
852
|
}
|
|
826
853
|
|
|
827
854
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__grid {
|
|
828
|
-
|
|
829
|
-
column-gap: 8px;
|
|
855
|
+
column-gap: 12px;
|
|
830
856
|
max-width: none;
|
|
831
857
|
}
|
|
832
858
|
|
|
@@ -859,7 +885,21 @@
|
|
|
859
885
|
}
|
|
860
886
|
|
|
861
887
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__grid {
|
|
862
|
-
|
|
888
|
+
flex-basis: 100%;
|
|
889
|
+
flex-wrap: wrap;
|
|
890
|
+
column-gap: 8px;
|
|
891
|
+
row-gap: 12px;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item {
|
|
895
|
+
flex: 1 1 calc(33.333% - 8px);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter:not(.forecast-info-filter--horizontal) .forecast-info-filter__item--range {
|
|
899
|
+
width: auto;
|
|
900
|
+
min-width: 0;
|
|
901
|
+
max-width: none;
|
|
902
|
+
flex: 1 1 calc(33.333% - 8px);
|
|
863
903
|
}
|
|
864
904
|
|
|
865
905
|
.forecast-info-page[data-page-scope="rmb-position-settlement-forecast-info"] .forecast-info-filter__item {
|
|
@@ -1,66 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const chineseGroupUnits = ['', '万', '亿', '兆'] as const
|
|
3
|
-
const chineseWithinGroupUnits = ['仟', '佰', '拾', ''] as const
|
|
4
|
-
|
|
5
|
-
/** 将四位数字分组转换为中文大写金额片段。 */
|
|
6
|
-
function formatChineseFourDigitGroup(value: number) {
|
|
7
|
-
const digits = String(value).padStart(4, '0')
|
|
8
|
-
let result = ''
|
|
9
|
-
let pendingZero = false
|
|
10
|
-
|
|
11
|
-
for (let index = 0; index < digits.length; index += 1) {
|
|
12
|
-
const digit = Number(digits[index])
|
|
13
|
-
if (digit === 0) {
|
|
14
|
-
if (result) pendingZero = true
|
|
15
|
-
continue
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (pendingZero) result += chineseDigits[0]
|
|
19
|
-
result += `${chineseDigits[digit] ?? ''}${chineseWithinGroupUnits[index] ?? ''}`
|
|
20
|
-
pendingZero = false
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return result
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** 将整数按万、亿、兆分组转换为中文大写。 */
|
|
27
|
-
function formatChineseInteger(value: number) {
|
|
28
|
-
const groups: number[] = []
|
|
29
|
-
let remaining = Math.trunc(value)
|
|
30
|
-
while (remaining > 0) {
|
|
31
|
-
groups.push(remaining % 10_000)
|
|
32
|
-
remaining = Math.floor(remaining / 10_000)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let result = ''
|
|
36
|
-
let pendingZero = false
|
|
37
|
-
for (let index = groups.length - 1; index >= 0; index -= 1) {
|
|
38
|
-
const group = groups[index] ?? 0
|
|
39
|
-
if (group === 0) {
|
|
40
|
-
if (result) pendingZero = true
|
|
41
|
-
continue
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (result && (pendingZero || group < 1_000)) result += chineseDigits[0]
|
|
45
|
-
result += `${formatChineseFourDigitGroup(group)}${chineseGroupUnits[index] ?? ''}`
|
|
46
|
-
pendingZero = false
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return result
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** 将金额转换为人民币大写文本。 */
|
|
53
|
-
export function formatChineseCurrency(value: any) {
|
|
54
|
-
if (!Number.isFinite(value) || Number(value) < 0) return ''
|
|
55
|
-
|
|
56
|
-
const roundedFen = Math.round(Number(value) * 100)
|
|
57
|
-
const yuan = Math.floor(roundedFen / 100)
|
|
58
|
-
const jiao = Math.floor((roundedFen % 100) / 10)
|
|
59
|
-
const fen = roundedFen % 10
|
|
60
|
-
const integerPart = yuan === 0 ? '零' : formatChineseInteger(yuan)
|
|
61
|
-
const decimalPart = jiao === 0 && fen === 0
|
|
62
|
-
? '整'
|
|
63
|
-
: `${jiao > 0 ? `${chineseDigits[jiao]}角` : fen > 0 ? '零' : ''}${fen > 0 ? `${chineseDigits[fen]}分` : ''}`
|
|
64
|
-
|
|
65
|
-
return `人民币${integerPart}元${decimalPart}`
|
|
66
|
-
}
|
|
1
|
+
export { formatChineseCurrency } from '@/utils/chinese-currency'
|
|
@@ -506,11 +506,12 @@ function parseSelectionSummaryAmount(value: unknown) {
|
|
|
506
506
|
return Number.isFinite(amount) ? amount : 0
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
//
|
|
509
|
+
// 换算为万元后保留两位小数,补齐 0 并使用千分位格式化勾选汇总金额。
|
|
510
510
|
function formatSelectionSummaryAmount(value: number) {
|
|
511
511
|
const amountInTenThousands = value / 10000
|
|
512
512
|
const roundedValue = Math.round((amountInTenThousands + Number.EPSILON) * 100) / 100
|
|
513
|
-
|
|
513
|
+
const normalizedValue = Object.is(roundedValue, -0) ? 0 : roundedValue
|
|
514
|
+
return formatThousands(normalizedValue.toFixed(2), '0.00')
|
|
514
515
|
}
|
|
515
516
|
|
|
516
517
|
/**
|
|
@@ -3049,6 +3050,7 @@ onBeforeUnmount(() => {
|
|
|
3049
3050
|
|
|
3050
3051
|
/* 币种多选保持单行固定高度,选中多个币种时不再撑高输入框。 */
|
|
3051
3052
|
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter,
|
|
3053
|
+
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-input__wrapper,
|
|
3052
3054
|
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-select__wrapper {
|
|
3053
3055
|
height: 24px;
|
|
3054
3056
|
min-height: 24px;
|
|
@@ -3056,20 +3058,31 @@ onBeforeUnmount(() => {
|
|
|
3056
3058
|
overflow: hidden;
|
|
3057
3059
|
}
|
|
3058
3060
|
|
|
3059
|
-
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-
|
|
3061
|
+
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-select__tags {
|
|
3062
|
+
display: flex;
|
|
3063
|
+
align-items: center;
|
|
3060
3064
|
min-width: 0;
|
|
3065
|
+
max-width: 100%;
|
|
3061
3066
|
flex-wrap: nowrap;
|
|
3067
|
+
white-space: nowrap;
|
|
3062
3068
|
overflow: hidden;
|
|
3063
3069
|
}
|
|
3064
3070
|
|
|
3065
|
-
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-
|
|
3071
|
+
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-select__tags .el-select-tags-wrapper {
|
|
3072
|
+
display: flex;
|
|
3073
|
+
align-items: center;
|
|
3066
3074
|
min-width: 0;
|
|
3067
3075
|
max-width: 100%;
|
|
3076
|
+
flex-wrap: nowrap;
|
|
3068
3077
|
overflow: hidden;
|
|
3069
|
-
text-overflow: ellipsis;
|
|
3070
3078
|
white-space: nowrap;
|
|
3071
3079
|
}
|
|
3072
3080
|
|
|
3081
|
+
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .foreign-currency-settlement-currency-filter .el-select__tags .el-tag {
|
|
3082
|
+
flex: 0 0 auto;
|
|
3083
|
+
max-width: 100%;
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3073
3086
|
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .forecast-info-filter__item .el-input__inner,
|
|
3074
3087
|
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .forecast-info-filter__item .el-range-input,
|
|
3075
3088
|
.forecast-info-page[data-page-scope="foreign-currency-settlement"] .forecast-info-filter__item .el-select__placeholder {
|