Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
7a41a347
Commit
7a41a347
authored
May 10, 2022
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 物料信息提示问题
parent
a98d83ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
24 deletions
+34
-24
index.tsx
...ncreaseRequisition/components/materialTableCell/index.tsx
+34
-24
No files found.
src/pages/transaction/purchaseRequisition/increaseRequisition/components/materialTableCell/index.tsx
View file @
7a41a347
...
...
@@ -149,18 +149,10 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
}
}
let
childNode
=
children
;
if
(
editable
)
{
console
.
log
(
dataIndex
)
childNode
=
<>
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
||
''
}
rules=
{
dataIndex
===
'quantity'
?
[
const
switchValidator
=
()
=>
{
switch
(
dataIndex
)
{
case
'quantity'
:
{
return
[
{
required
:
true
,
message
:
`
${
title
}${
intl
.
formatMessage
({
id
:
'purchaseRequisition.bixutianxie'
,
defaultMessage
:
'必须填写'
})}
`
,
...
...
@@ -172,18 +164,11 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
{
validator
:
validatorNumber
},
]
:
(
dataIndex
===
'remark'
?
[
{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'purchaseRequisition.neirongbuneng1weikong'
,
defaultMessage
:
'内容不能为空'
}),
},
{
validator
:
(
r
,
v
,
c
)
=>
validatorByte
(
r
,
v
,
c
,
200
)
}
]
:
[
}
case
'price'
:
{
return
[
{
pattern
:
/^
\d
+
(\.\d{1,4})?
$/
,
message
:
intl
.
formatMessage
({
id
:
'purchaseRequisition.danjiajinxiansi'
,
defaultMessage
:
'单价仅限四位小数'
}),
...
...
@@ -191,8 +176,33 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
{
validator
:
validatorNumber
}
])
]
}
case
'remark'
:
{
return
[
{
validator
:
(
r
,
v
,
c
)
=>
validatorByte
(
r
,
v
,
c
,
200
)
}
]
}
default
:
{
return
[]
}
}
}
let
childNode
=
children
;
if
(
editable
)
{
childNode
=
<>
<
Form
.
Item
style=
{
{
margin
:
0
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
||
''
}
rules=
{
switchValidator
()
}
>
{
chooseFormItem
(
formItem
,
record
[
dataIndex
]
||
''
)
}
</
Form
.
Item
>
...
...
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