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
黄庭坚
jinfa-platform
Commits
ba50fcad
Commit
ba50fcad
authored
Apr 21, 2022
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-v2-220418' into 'v2-220418'
fix: 修复物料相关bug See merge request linkseeks-design/pro-platform!464
parents
ba334fe8
3dd0d89b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
2 deletions
+65
-2
columns.tsx
src/pages/commodity/material/common/columns.tsx
+3
-0
constants.tsx
src/pages/commodity/material/common/constants.tsx
+33
-0
add.tsx
...ages/commodity/material/materialPendingAdd/schema/add.tsx
+1
-1
index.tsx
...ity/material/materialQuery/components/operation/index.tsx
+16
-0
sourceListSchema.tsx
...modity/material/materialQuery/schema/sourceListSchema.tsx
+4
-1
sourceList.tsx
src/pages/commodity/material/materialQuery/sourceList.tsx
+8
-0
No files found.
src/pages/commodity/material/common/columns.tsx
View file @
ba50fcad
import
{
Badge
}
from
"antd"
import
{
Link
,
getIntl
}
from
"umi"
import
{
MATERIAL_INNER_STATUS_BADGE_COLOR
}
from
"./constants"
type
Params
=
{
detailUrl
:
string
,
...
...
@@ -75,6 +77,7 @@ export function getColumn(params: Params) {
{
title
:
intl
.
formatMessage
({
id
:
'material.interiorStateName'
,
defaultMessage
:
'内部状态'
}),
dataIndex
:
'interiorStateName'
,
render
:
(
text
,
record
)
=>
<
Badge
color=
{
MATERIAL_INNER_STATUS_BADGE_COLOR
[
record
.
interiorState
]
}
text=
{
text
}
/>,
}
]
return
columns
.
concat
(
params
?.
extraColumn
||
[]);
...
...
src/pages/commodity/material/common/constants.tsx
0 → 100644
View file @
ba50fcad
import
{
FROZEN
,
PENDING_ADD_MATERIAL
,
PENDING_EXAM_I
,
EXAM_I_FAIL
,
PENDING_EXAM_II
,
EXAM_II_FAIL
,
PENDING_SUBMIT_EXAM
,
PENDING_EXAM_CHANGE_I
,
PENDING_EXAM_CHANGE_I_FAIL
,
PENDING_EXAM_CHANGE_II
,
PENDING_EXAM_CHANGE_II_FAIL
,
HAS_CONFIRM
,
}
from
'@/constants/material'
;
/**
* 物料内部状态 Tag badge map
*/
export
const
MATERIAL_INNER_STATUS_BADGE_COLOR
=
{
[
FROZEN
]:
'grey'
,
[
PENDING_ADD_MATERIAL
]:
'blue'
,
[
PENDING_EXAM_I
]:
'orange'
,
[
EXAM_I_FAIL
]:
'red'
,
[
PENDING_EXAM_II
]:
'orange'
,
[
EXAM_II_FAIL
]:
'red'
,
[
PENDING_SUBMIT_EXAM
]:
'orange'
,
[
PENDING_EXAM_CHANGE_I
]:
'orange'
,
[
PENDING_EXAM_CHANGE_I_FAIL
]:
'red'
,
[
PENDING_EXAM_CHANGE_II
]:
'orange'
,
[
PENDING_EXAM_CHANGE_II_FAIL
]:
'red'
,
[
HAS_CONFIRM
]:
'green'
,
};
\ No newline at end of file
src/pages/commodity/material/materialPendingAdd/schema/add.tsx
View file @
ba50fcad
...
...
@@ -290,7 +290,7 @@ export const getSchema = (schema: ISchema | null): ISchema => {
type
:
'object'
,
"x-component"
:
'MellowCard'
,
"x-component-props"
:
{
id
:
'source
List
'
,
id
:
'source'
,
title
:
intl
.
formatMessage
({
id
:
'material.sourceList'
,
defaultMessage
:
'货源清单'
})
},
visible
:
false
,
...
...
src/pages/commodity/material/materialQuery/components/operation/index.tsx
View file @
ba50fcad
...
...
@@ -2,7 +2,21 @@ import { FormPath } from '@formily/antd';
import
{
Space
}
from
'antd'
;
import
React
from
'react'
;
interface
OperationProps
{
/**
* 删除之后触发事件
*/
onDeleteAfter
?:
()
=>
void
,
/**
* 保存之后触发事件
*/
onSaveAfter
?:
()
=>
void
,
}
const
Operation
=
(
props
)
=>
{
const
xComponentProps
:
OperationProps
=
props
.
props
[
'x-component-props'
]
||
{};
const
{
onDeleteAfter
,
onSaveAfter
}
=
xComponentProps
;
/** 这里用index 做值貌似有点问题 */
const
[,
index
]
=
props
.
name
.
split
(
"."
)
const
id
=
props
.
form
.
getFieldValue
(
`datas.
${
index
}
.id`
);
...
...
@@ -42,6 +56,7 @@ const Operation = (props) => {
props
.
form
.
setFieldValue
(
`datas`
,
newDataSource
.
filter
((
_item
)
=>
_item
.
status
===
1
))
props
.
form
.
setFieldValue
(
`cacheData`
,
newDataSource
)
onDeleteAfter
?.();
}
const
handleSave
=
()
=>
{
...
...
@@ -74,6 +89,7 @@ const Operation = (props) => {
});
props
.
form
.
setFieldValue
(
`cacheData`
,
newDataSource
)
onSaveAfter
?.();
}
if
(
editable
)
{
...
...
src/pages/commodity/material/materialQuery/schema/sourceListSchema.tsx
View file @
ba50fcad
...
...
@@ -142,7 +142,10 @@ export const schema: ISchema = {
operations
:
{
title
:
'操作'
,
'x-component'
:
'Operation'
,
editable
:
false
editable
:
false
,
'x-component-props'
:
{
onDeleteAfter
:
'{{handleActionsAfter}}'
,
},
}
}
}
...
...
src/pages/commodity/material/materialQuery/sourceList.tsx
View file @
ba50fcad
...
...
@@ -198,6 +198,13 @@ const SourceList = () => {
}
}
/**
* 处理删除操作、确认操作没有触发 onFormInputChange 的问题
*/
const
handleActionsAfter
=
()
=>
{
setUnsaved
(
true
)
};
return
(
<
AnchorPage
title=
{
intl
.
formatMessage
({
id
:
'material.sourceList'
,
defaultMessage
:
'货源清单'
})
}
...
...
@@ -218,6 +225,7 @@ const SourceList = () => {
previewPlaceholder=
' '
expressionScope=
{
{
renderAddition
:
renderAddition
(),
handleActionsAfter
:
handleActionsAfter
,
}
}
initialValues=
{
initialValue
}
onSubmit=
{
handleSubmit
}
...
...
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