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
b58802fb
Commit
b58802fb
authored
Dec 04, 2020
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改加工选择加工订单回显问题
parent
76efb002
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
59 deletions
+31
-59
index.tsx
src/pages/handling/assign/add/index.tsx
+4
-31
schema.tsx
src/pages/handling/assign/add/schema.tsx
+7
-7
index.tsx
src/pages/handling/components/EnterPrise/index.tsx
+3
-4
index.tsx
src/pages/handling/components/ProcessOrder/index.tsx
+17
-17
No files found.
src/pages/handling/assign/add/index.tsx
View file @
b58802fb
import
React
,
{
useState
,
useCallback
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
}
from
'react'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
Button
,
Card
,
Select
,
DatePicker
,
Radio
,
Table
,
Space
,
message
}
from
'antd'
;
...
...
@@ -222,36 +222,11 @@ const Add: React.FC<{}> = () => {
formActions
.
setFieldValue
(
'Tabs.tab-1.layout.processRoleId'
,
roleId
);
}
const
getChangeRows
=
(
rows
,
primaryKey
:
string
)
=>
{
const
{
selectedRowKeys
,
selectRow
}
=
rows
;
const
currentList
=
formActions
.
getFieldValue
(
'Tabs.tab-2.layout.someLists'
);
// 首先去除掉没有在selectedRowkeys 的那些数据
const
inKeys
=
[];
const
hasRemovedList
=
currentList
.
filter
(
(
item
)
=>
{
const
flag
=
selectedRowKeys
.
includes
(
item
[
primaryKey
])
if
(
flag
)
{
inKeys
.
push
(
item
[
primaryKey
]);
}
return
flag
}
);
// 找到没有在数组中的key,即新增加的key
const
newAddKeys
=
selectedRowKeys
.
filter
((
item
)
=>
{
return
!
inKeys
.
includes
(
item
)});
const
appendRow
=
selectRow
.
filter
((
item
)
=>
newAddKeys
.
includes
(
item
[
primaryKey
]));
const
newRows
=
hasRemovedList
.
concat
(
appendRow
);
// 最新的数组
return
newRows
}
/**
* 加工商品Modal框 行勾选回调
* @param rows
*/
const
processProductSelected
=
()
=>
{
console
.
log
(
productSelectRowCtl
);
// const newRows = getChangeRows(productSelectRowCtl, "id");
// console.log("newRows", newRows)
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
productSelectRowCtl
.
selectRow
)
}
...
...
@@ -260,10 +235,8 @@ const Add: React.FC<{}> = () => {
* @param row
*/
const
processOrderOnok
=
()
=>
{
console
.
log
(
selectRowCtl
);
const
newRows
=
getChangeRows
(
selectRowCtl
,
"fullId"
)
console
.
log
(
newRows
);
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
newRows
)
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
selectRowCtl
.
selectRow
)
}
/**
...
...
@@ -378,7 +351,7 @@ const Add: React.FC<{}> = () => {
const
primaryKey
=
activeSource
===
'加工订单'
?
'fullId'
:
'id'
const
newList
=
currentList
.
filter
((
item
)
=>
item
[
primaryKey
]
!==
id
);
formActions
.
setFieldValue
(
'Tabs.tab-2.layout.someLists'
,
newList
)
const
newSelectedKeys
=
newList
.
map
((
item
)
=>
item
.
id
);
const
newSelectedKeys
=
newList
.
map
((
item
)
=>
item
[
primaryKey
]
);
const
newSelectedRows
=
newList
;
if
(
activeSource
===
'加工订单'
)
{
selectRowCtl
.
setSelectedRowKeys
(
newSelectedKeys
);
...
...
src/pages/handling/assign/add/schema.tsx
View file @
b58802fb
...
...
@@ -92,7 +92,7 @@ const basicTab = {
],
default
:
1
},
deliveryDate
:
{
type
:
'string'
,
title
:
'交期'
,
...
...
@@ -126,7 +126,7 @@ const basicTab = {
target
:
'*(receivefullAddress, receiveAddressID, receiveAddress,receiveUserName,receiveUserTel)'
,
condition
:
'{{$value == 1}}'
},
],
],
},
receivefullAddress
:
{
type
:
'string'
,
...
...
@@ -191,7 +191,7 @@ const basicTab = {
/**
* 通知单明细
*/
*/
const
detailTab
=
{
'tab-2'
:
{
type
:
'object'
,
...
...
@@ -223,7 +223,7 @@ const detailTab = {
},
'x-component'
:
'MultTable'
,
'x-component-props'
:
{
rowKey
:
'id'
,
rowKey
:
(
record
)
=>
record
.
id
+
"_"
+
record
.
fullId
,
prefix
:
"{{tableAddButton}}"
,
columns
:
"{{noticesDetailColumn}}"
// columns: "{{tableColumns}}",
...
...
@@ -277,7 +277,7 @@ const otherRequired = {
'x-component-props'
:
{
placeholder
:
'最长100个字符,50个汉字'
,
rows
:
5
}
},
taxDesc
:
{
...
...
@@ -381,7 +381,7 @@ const historyRecord = {
controller
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{RadioBtnGroup}}'
}
...
...
@@ -389,7 +389,7 @@ const historyRecord = {
historyTable
:
{
type
:
'object'
,
'x-component'
:
'Table'
,
'x-component-props'
:
{
columns
:
historyColumn
}
...
...
src/pages/handling/components/EnterPrise/index.tsx
View file @
b58802fb
...
...
@@ -38,7 +38,7 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
return
(
<
Modal
title=
"选择加工
商品
"
title=
"选择加工
企业
"
width=
{
704
}
visible=
{
visible
}
onCancel=
{
cancel
}
...
...
@@ -51,10 +51,10 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
effects=
{
effects
}
expressionScope=
{
{
rowSelection
:
selectRow
}
}
></
SearchForm
>
</
Modal
>
)
}
export
default
EnterPrise
\ No newline at end of file
export
default
EnterPrise
src/pages/handling/components/ProcessOrder/index.tsx
View file @
b58802fb
...
...
@@ -24,11 +24,11 @@ const expandRowColumn = [
const
ProcessProducts
=
({
visible
,
cancel
,
rowSelection
,
...
restProps
})
=>
{
// const [mainTableSelectRow, mainTableSelectRowCtl] = useRowSelectionTable({customKey: 'id'});
const
[
selectRow
,
selectRowCtl
]
=
useRowSelectionTable
({
customKey
:
'fullId'
,
const
[
selectRow
,
selectRowCtl
]
=
useRowSelectionTable
({
customKey
:
'fullId'
,
extendsSelection
:
{
getCheckboxProps
:
record
=>
({
disabled
:
record
.
purchaseCount
-
(
record
.
processNum
||
0
)
<=
0
,
disabled
:
record
.
purchaseCount
-
(
record
.
processNum
||
0
)
<=
0
,
}),
}
});
...
...
@@ -36,7 +36,7 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
const
fetchData
=
useCallback
(
async
(
params
:
any
)
=>
{
const
{
orderTime
,
...
rest
}
=
params
const
{
st
,
et
}
=
timeRange
(
orderTime
);
let
postData
=
{
startCreateTime
:
st
,
endCreateTime
:
et
,
...
...
@@ -44,8 +44,8 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
}
let
res
=
await
PublicApi
.
getOrderProcessingOrderList
(
postData
);
return
res
;
},
[])
},
[])
const
expandable
=
{
expandedRowRender
:
record
=>
{
const
renderData
=
record
.
productDateilss
&&
record
.
productDateilss
.
map
(
...
...
@@ -70,20 +70,21 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
}
)
return
(
<
Table
columns=
{
expandRowColumn
}
rowKey=
{
(
row
)
=>
row
.
fullId
}
<
Table
columns=
{
expandRowColumn
}
rowKey=
{
(
row
)
=>
row
.
fullId
}
// rowSelection={selectRow}
rowSelection=
{
rowSelection
}
dataSource=
{
renderData
}
pagination=
{
false
}
rowSelection=
{
rowSelection
}
dataSource=
{
renderData
}
pagination=
{
false
}
/>
)
},
// defaultExpandAllRows: true
}
}
// console.log("rowSelection",rowSelection);
const
handleSubmit
=
()
=>
{
// console.log(selectRowCtl, mainTableSelectRowCtl);
// console.log(selectRowCtl)
...
...
@@ -129,4 +130,4 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
}
export
default
ProcessProducts
\ No newline at end of file
export
default
ProcessProducts
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