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
af6247bc
Commit
af6247bc
authored
Jul 22, 2022
by
shenshaokai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jinfa-0518' of…
Merge branch 'jinfa-0518' of
ssh://gitlab.shushangyun.com:8122/project/jinfa-platform
into fix-jinfa-0518
parents
fcea6aba
bff81167
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
18 deletions
+47
-18
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+7
-0
index.tsx
...orderCollectSrm/components/orderMaterialsDrawer/index.tsx
+34
-15
index.tsx
...pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
+5
-3
utils.ts
src/pages/transaction/purchaseOrder/orderCollectSrm/utils.ts
+1
-0
No files found.
src/pages/transaction/purchaseOrder/index.tsx
View file @
af6247bc
...
...
@@ -65,6 +65,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
(
'orderList.chakan'
)
if
(
alreadyColumns
)
{
alreadyColumns
.
splice
(
1
,
0
,
{
title
:
'SAP订单编号'
,
dataIndex
:
'sapOrderNo'
,
key
:
'sapOrderNo'
,
ellipsis
:
true
,
width
:
COLUMNS_ACTION_WIDTH
,
})
alreadyColumns
.
splice
(
6
,
0
,
{
title
:
intl
.
formatMessage
({
id
:
'purchaseOrder.addressTitle'
}),
dataIndex
:
'deliverAddress'
,
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/components/orderMaterialsDrawer/index.tsx
View file @
af6247bc
...
...
@@ -120,10 +120,13 @@ const normalizeMaterialsList = (dataSource: GetContractManagePagePurchaseMaterie
ret
.
push
({
...
rest
,
key
:
`m_
${
rest
.
id
}
`
,
children
:
requisitionList
?.
map
((
requisition
,
index
)
=>
({
children
:
requisitionList
?.
map
((
requisition
,
index
)
=>
{
console
.
log
(
requisition
.
purchaseProductSalesManResponse
?.
userId
,
!!
requisition
.
purchaseProductSalesManResponse
?.
userId
)
return
{
...
requisition
,
key
:
`r_
${
requisition
.
detailId
}
_
${
requisition
.
purchaseProductSalesManResponse
?.
userId
||
index
}
_$
{
requisition
.
purchaseProductSalesManResponse
?.
rawNO
}
`,
})),
}
}),
});
});
return ret;
...
...
@@ -220,6 +223,28 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
if (!selected) { }
};
const defaultMaterialsList = (dataSource: MaterialsListItem[]) => {
console.log(requisitionListValue.current, 'requisitionListValue.current')
const requisitionValue: { [key: string]: string } = {};
dataSource.forEach(({ children }) => {
children.forEach(child => {
requisitionValue[child.key] = requisitionListValue.current[child.key] as string || child?.purchaseProductSalesManResponse?.purchaseRemainingQuantity + ''
})
})
if (Object.keys(requisitionValue).length) {
form.setFieldsValue({
materials: {
requisitionList: requisitionValue,
},
});
requisitionListValue.current = {
...requisitionListValue.current,
...(requisitionValue || {}),
};
}
}
const fetchMaterialsList = async (params: ExtraFetchType) => {
if (!contractId) {
return { data: [], totalCount: 0 };
...
...
@@ -243,7 +268,9 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
if (initCheckeds.current.length > 0) {
handleInitSelectRows(initCheckeds.current, true);
}
console.log(dataSource, 'dataSource')
defaultMaterialsList(dataSource)
return {
data: dataSource,
totalCount: res.data.totalCount,
...
...
@@ -331,16 +358,8 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
dataIndex: 'materielNo',
width: 372,
render: (text, record, index) => {
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0
if (requisitionListValue && isEmpty(requisitionListValue.current)) {
form.setFieldsValue({
materials: {
requisitionList: {
[record.key]: max
},
},
})
}
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0;
console.log(requisitionListValue.current)
return (
<div className={styles['member-rights-editable']}>
<Form.Item
...
...
@@ -518,11 +537,11 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
const item = normalized[i];
if (item.children && item.children.length) {
item.children.forEach((child) => {
requisitionValue[child.key] = child.orderQuantity as string;
requisitionValue[child.key] = child.orderQuantity as string
|| child?.purchaseProductSalesManResponse?.purchaseRemainingQuantity + ''
;
});
}
}
console.log(dataSource, requisitionValue, 'requisitionValue')
// 没有值的话跳过设置
if (Object.keys(requisitionValue).length) {
form.setFieldsValue({
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
View file @
af6247bc
...
...
@@ -114,10 +114,11 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
const
{
pageStatus
,
id
,
modelType
}
=
usePageStatus
()
const
[
initFormSchema
,
setInitFormSchema
]
=
useState
<
any
>
(()
=>
({
...
mergeAllSchemas
}))
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(()
=>
{
let
resultState
=
{
orderMode
:
OrderModalType
.
PURCHASE_REQUISITION_CONTRACT_ORDER
}
let
resultState
=
{
orderMode
:
OrderModalType
.
PURCHASE_REQUISITION_CONTRACT_ORDER
,
hasInvoice
:
true
}
if
(
modelType
)
{
resultState
=
{
orderMode
:
parseInt
(
modelType
)
orderMode
:
parseInt
(
modelType
),
hasInvoice
:
true
}
}
return
resultState
...
...
@@ -380,7 +381,6 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
const
productDataValue
=
addSchemaAction
.
getFieldValue
(
'products'
);
const
contractValue
=
addSchemaAction
.
getFieldValue
(
'contract'
);
let
mergeArr
=
[];
value
.
forEach
((
item
)
=>
{
const
entity
=
productDataValue
.
find
((
material
)
=>
material
.
id
===
item
.
id
);
if
(
entity
)
{
...
...
@@ -392,6 +392,8 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
mergeArr
.
push
({
...
convertOrderMaterialData
(
item
)
});
}
});
console
.
log
(
value
,
'value'
)
console
.
log
(
mergeArr
,
'mergeArr'
)
mergeArr
=
mergeArr
.
map
((
item
)
=>
({
...
item
,
// 兼容之前订单物料数据
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/utils.ts
View file @
af6247bc
...
...
@@ -35,6 +35,7 @@ export const convertOrderMaterialData = (dataSource: OrderMaterialsConfirmValue[
result
.
push
({
requisitionId
:
detailId
,
orderQuantity
:
(
rest
as
any
).
orderQuantity
||
0
,
requisitionNo
:
(
rest
as
any
).
requisitionNo
,
salesManRequests
:
[{
...
rest
.
purchaseProductSalesManResponse
,
purchaseOrderQuantity
:
(
rest
as
any
).
orderQuantity
||
0
,
...
...
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