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
247e07d0
Commit
247e07d0
authored
Apr 11, 2022
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改物料上传校验,部分字段校验
parent
ffb5919d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
17 deletions
+61
-17
index.ts
config/routes/index.ts
+1
-1
UploadFiles.tsx
src/components/UploadFiles/UploadFiles.tsx
+5
-1
index.tsx
...ialAuditProcessConfig/components/selectMaterial/index.tsx
+6
-1
schema.ts
src/pages/commodity/material/materialGroup/schema.ts
+2
-2
index.tsx
src/pages/commodity/material/materialPendingAdd/index.tsx
+2
-2
add.tsx
...ages/commodity/material/materialPendingAdd/schema/add.tsx
+19
-1
purchase.tsx
...commodity/material/materialPendingAdd/schema/purchase.tsx
+8
-1
index.tsx
src/pages/commodity/material/materialQuery/index.tsx
+1
-1
sourceListSchema.tsx
...modity/material/materialQuery/schema/sourceListSchema.tsx
+17
-7
No files found.
config/routes/index.ts
View file @
247e07d0
...
...
@@ -26,7 +26,7 @@ import ProcurementRoute from './procurementRoute'; // todo wuting
// import contracRoute from './contracRoute';
// export const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute, HandlingRoute, BalaceRoute]
const
isDev
=
process
.
env
.
NODE_ENV
===
"development"
;
const
isDev
=
false
;
const
homeRoute
=
{
path
:
`/memberCenter/home`
,
name
:
'home'
,
...
...
src/components/UploadFiles/UploadFiles.tsx
View file @
247e07d0
...
...
@@ -34,6 +34,7 @@ interface PickUploadProps extends Pick<UploadProps, PickProps> {
* 自定义渲染child
*/
renderUploadChild
?:
(
fileList
:
any
[])
=>
React
.
ReactNode
,
multiple
?:
boolean
,
}
const
UploadFiles
:
React
.
FC
<
PickUploadProps
>
=
(
props
:
PickUploadProps
)
=>
{
...
...
@@ -55,6 +56,7 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
showFiles
,
renderUploadChild
,
maxCount
,
multiple
,
}
=
props
;
const
hasFileListProps
=
"fileList"
in
props
;
const
hasMaxCount
=
typeof
maxCount
!==
'undefined'
?
{
maxCount
}
:
{};
...
...
@@ -82,6 +84,7 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
data
:
{
fileType
:
UPLOAD_TYPE
},
multiple
:
multiple
,
// disabled: loading || disabled,
showUploadList
:
false
,
onChange
(
info
:
UploadChangeParam
)
{
...
...
@@ -220,7 +223,8 @@ UploadFiles.defaultProps = {
mode
:
'default'
,
buttonText
:
intl
.
formatMessage
({
id
:
'components.shangchuanwenjian'
}),
fileContainerClassName
:
''
,
showFiles
:
true
showFiles
:
true
,
multiple
:
false
,
// fileList: []
};
...
...
src/pages/commodity/material/materialAuditProcessConfig/components/selectMaterial/index.tsx
View file @
247e07d0
...
...
@@ -48,7 +48,12 @@ const SelectMaterial: React.FC<Iprops> & { isFieldComponent: boolean} = (props:
},
{
title
:
'物料组'
,
dataIndex
:
'materialGroup'
dataIndex
:
'materialGroup'
,
render
:
(
text
,
record
)
=>
{
return
(
<
div
>
{
record
.
materialGroup
?.
name
}
</
div
>
)
}
},
{
title
:
'规格型号'
,
...
...
src/pages/commodity/material/materialGroup/schema.ts
View file @
247e07d0
...
...
@@ -23,7 +23,7 @@ export const schema: ISchema = {
},
{
limitByte
:
true
,
maxByte
:
24
,
maxByte
:
12
,
}
]
},
...
...
@@ -33,7 +33,7 @@ export const schema: ISchema = {
'x-rules'
:
[
{
required
:
true
,
message
:
'请输入物料组
代码
'
message
:
'请输入物料组
名称
'
},
{
limitByte
:
true
,
...
...
src/pages/commodity/material/materialPendingAdd/index.tsx
View file @
247e07d0
...
...
@@ -88,7 +88,7 @@ const MaterialQuery = () => {
const
supplierColumns
=
[
{
title
:
'供应商'
,
dataIndex
:
'
id
'
,
dataIndex
:
'
memberName
'
,
},
{
title
:
'物料名称'
,
...
...
@@ -250,7 +250,7 @@ const MaterialQuery = () => {
modalType=
'Drawer'
visible=
{
visible
}
onClose=
{
()
=>
setVisible
(
false
)
}
title=
{
"选择供应商"
}
title=
{
"选择供应商
物料
"
}
columns=
{
supplierColumns
}
schema=
{
purchaseSchema
}
onOk=
{
handleOnOk
}
...
...
src/pages/commodity/material/materialPendingAdd/schema/add.tsx
View file @
247e07d0
import
{
ISchema
,
Schema
}
from
'@formily/antd'
import
{
message
,
Upload
}
from
'antd'
;
/**
* 新增物料
...
...
@@ -155,7 +156,24 @@ export const getSchema = (schema: ISchema): ISchema => {
flexDirection
:
'row'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
,
}
},
multiple
:
true
,
beforeUpload
:
(
file
)
=>
{
const
isJpgOrPng
=
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/jpg'
||
file
.
type
===
'image/png'
;
console
.
log
(
file
,
isJpgOrPng
);
if
(
!
isJpgOrPng
)
{
message
.
error
(
"仅支持JPG/PNG/JPEG格式"
)
return
Upload
.
LIST_IGNORE
;
// message.error(intl.formatMessage({ id: 'commodity.products.addProductsItem.productDescFormDefault.error.1' }));
}
const
isLessThan
=
file
.
size
/
1024
<
600
;
if
(
!
isLessThan
)
{
message
.
error
(
'Image must smaller than 600KB!'
);
return
Upload
.
LIST_IGNORE
}
return
true
;
},
}
},
tips
:
{
...
...
src/pages/commodity/material/materialPendingAdd/schema/purchase.tsx
View file @
247e07d0
...
...
@@ -14,7 +14,7 @@ export const purchaseSchema: ISchema = {
'x-component-props'
:
{
placeholder
:
'供应商'
,
align
:
'flex-left'
,
advanced
:
false
//
advanced: false
},
},
[
FORM_FILTER_PATH
]:
{
...
...
@@ -57,6 +57,13 @@ export const purchaseSchema: ISchema = {
fieldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
},
},
type
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'规格型号'
,
allowClear
:
true
,
}
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
...
...
src/pages/commodity/material/materialQuery/index.tsx
View file @
247e07d0
...
...
@@ -88,7 +88,7 @@ const MaterialQuery = () => {
)
}
<
Menu
.
Item
>
<
Link
to=
{
`/memberCenter/commodityAbility/priceManage/price
Strateg
y?code=${record.code}`
}
>
<
Link
to=
{
`/memberCenter/commodityAbility/priceManage/price
Librar
y?code=${record.code}`
}
>
价格库
</
Link
>
</
Menu
.
Item
>
...
...
src/pages/commodity/material/materialQuery/schema/sourceListSchema.tsx
View file @
247e07d0
...
...
@@ -54,6 +54,16 @@ export const schema: ISchema = {
title
:
'供应商物料编号'
,
type
:
'string'
,
editable
:
false
,
"x-rules"
:
[
{
limitByte
:
true
,
maxByte
:
'最长20个字符'
},
{
pattern
:
/
(?=
.*
[
0-9
])(?=
.*
[
~!@#$%^&*()_+`
\-
={}:";'<>?,.
\/])(?=
.*
[
a-zA-Z
])
/
,
message
:
'编号由英文(不分大小写)、数字、特殊字符组成'
}
]
},
userName
:
{
title
:
'联系人'
,
...
...
@@ -61,8 +71,8 @@ export const schema: ISchema = {
editable
:
false
,
"x-rules"
:
[
{
limitByte
:
24
,
m
essage
:
'最长24个字符'
limitByte
:
true
,
m
axByte
:
24
,
}
]
},
...
...
@@ -73,7 +83,7 @@ export const schema: ISchema = {
"x-rules"
:
[
{
limitByte
:
40
,
m
essag
e
:
'最长40个字符'
m
axByt
e
:
'最长40个字符'
}
]
},
...
...
@@ -84,7 +94,7 @@ export const schema: ISchema = {
"x-rules"
:
[
{
limitByte
:
40
,
m
essag
e
:
'最长40个字符'
m
axByt
e
:
'最长40个字符'
}
]
},
...
...
@@ -95,7 +105,7 @@ export const schema: ISchema = {
"x-rules"
:
[
{
limitByte
:
24
,
m
essag
e
:
'最长24个字符'
m
axByt
e
:
'最长24个字符'
}
]
},
...
...
@@ -106,7 +116,7 @@ export const schema: ISchema = {
"x-rules"
:
[
{
limitByte
:
40
,
m
essag
e
:
'最长40个字符'
m
axByt
e
:
'最长40个字符'
}
]
},
...
...
@@ -117,7 +127,7 @@ export const schema: ISchema = {
"x-rules"
:
[
{
limitByte
:
40
,
m
essag
e
:
'最长40个字符'
m
axByt
e
:
'最长40个字符'
}
]
},
...
...
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