Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yuzhenWang
yd-csf-front
Commits
32c1235b
Commit
32c1235b
authored
Apr 20, 2026
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小数点后面不加千分位符号,入账检核时,新增入账检核记录时,入账金额支持负数
parent
8bd1b7ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
src/components/SearchForm/SearchForm.vue
+13
-4
src/views/financialCenter/financialIncome.vue
+2
-2
No files found.
src/components/SearchForm/SearchForm.vue
View file @
32c1235b
...
...
@@ -24,10 +24,19 @@
:disabled="item.disabled"
@input="val => handleNumberInput(val, item)"
@change="val => handleModelChange(val, item)"
:formatter="
value => (item.inputType ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',') : value)
"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
:formatter="value => {
if (!item.inputType || !value) return value;
const str = String(value);
// 如果包含小数点
if (str.indexOf('.') > -1) {
const [int, dec] = str.split('.');
// 只格式化整数部分,保留小数部分原样
return int.replace(/\B(?=(\d{3})+(?!\d))/g, ',') + '.' + dec;
}
// 如果没有小数点,直接格式化
return str.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
/>
<!-- Select (支持 dictType / api / options) -->
...
...
src/views/financialCenter/financialIncome.vue
View file @
32c1235b
...
...
@@ -534,11 +534,11 @@ const addCheckRecordConfig = ref([
type
:
'input'
,
prop
:
'amount'
,
label
:
'入账金额'
,
inputType
:
'decimal'
,
inputType
:
'decimal
Number
'
,
decimalDigits
:
4
,
rules
:
[
{
required
:
true
,
message
:
'请输入金额'
,
trigger
:
'blur'
},
{
pattern
:
/^
\d
+
(\.\d{1,4})?
$/
,
message
:
'最多四位小数
'
,
trigger
:
'blur'
}
{
pattern
:
/^
-
?\d
+
(\.\d
+
)?
$/
,
message
:
'请输入有效的数字
'
,
trigger
:
'blur'
}
]
},
{
type
:
'select'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment