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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
20 deletions
+49
-20
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+7
-0
index.tsx
...orderCollectSrm/components/orderMaterialsDrawer/index.tsx
+36
-17
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) => {
...
@@ -65,6 +65,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
secondColumns
=
()
=>
{
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
(
'orderList.chakan'
)
const
alreadyColumns
=
baseOrderListColumns
(
'orderList.chakan'
)
if
(
alreadyColumns
)
{
if
(
alreadyColumns
)
{
alreadyColumns
.
splice
(
1
,
0
,
{
title
:
'SAP订单编号'
,
dataIndex
:
'sapOrderNo'
,
key
:
'sapOrderNo'
,
ellipsis
:
true
,
width
:
COLUMNS_ACTION_WIDTH
,
})
alreadyColumns
.
splice
(
6
,
0
,
{
alreadyColumns
.
splice
(
6
,
0
,
{
title
:
intl
.
formatMessage
({
id
:
'purchaseOrder.addressTitle'
}),
title
:
intl
.
formatMessage
({
id
:
'purchaseOrder.addressTitle'
}),
dataIndex
:
'deliverAddress'
,
dataIndex
:
'deliverAddress'
,
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/components/orderMaterialsDrawer/index.tsx
View file @
af6247bc
...
@@ -120,10 +120,13 @@ const normalizeMaterialsList = (dataSource: GetContractManagePagePurchaseMaterie
...
@@ -120,10 +120,13 @@ const normalizeMaterialsList = (dataSource: GetContractManagePagePurchaseMaterie
ret
.
push
({
ret
.
push
({
...
rest
,
...
rest
,
key
:
`m_
${
rest
.
id
}
`
,
key
:
`m_
${
rest
.
id
}
`
,
children
:
requisitionList
?.
map
((
requisition
,
index
)
=>
({
children
:
requisitionList
?.
map
((
requisition
,
index
)
=>
{
...
requisition
,
console
.
log
(
requisition
.
purchaseProductSalesManResponse
?.
userId
,
!!
requisition
.
purchaseProductSalesManResponse
?.
userId
)
key
:
`r_
${
requisition
.
detailId
}
_
${
requisition
.
purchaseProductSalesManResponse
?.
userId
||
index
}
_$
{
requisition
.
purchaseProductSalesManResponse
?.
rawNO
}
`,
return
{
})),
...
requisition
,
key
:
`r_
${
requisition
.
detailId
}
_
${
requisition
.
purchaseProductSalesManResponse
?.
userId
||
index
}
_$
{
requisition
.
purchaseProductSalesManResponse
?.
rawNO
}
`,
}
}),
});
});
});
});
return ret;
return ret;
...
@@ -220,6 +223,28 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
...
@@ -220,6 +223,28 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
if (!selected) { }
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) => {
const fetchMaterialsList = async (params: ExtraFetchType) => {
if (!contractId) {
if (!contractId) {
return { data: [], totalCount: 0 };
return { data: [], totalCount: 0 };
...
@@ -243,7 +268,9 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
...
@@ -243,7 +268,9 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
if (initCheckeds.current.length > 0) {
if (initCheckeds.current.length > 0) {
handleInitSelectRows(initCheckeds.current, true);
handleInitSelectRows(initCheckeds.current, true);
}
}
console.log(dataSource, 'dataSource')
defaultMaterialsList(dataSource)
return {
return {
data: dataSource,
data: dataSource,
totalCount: res.data.totalCount,
totalCount: res.data.totalCount,
...
@@ -331,16 +358,8 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
...
@@ -331,16 +358,8 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
dataIndex: 'materielNo',
dataIndex: 'materielNo',
width: 372,
width: 372,
render: (text, record, index) => {
render: (text, record, index) => {
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0;
if (requisitionListValue && isEmpty(requisitionListValue.current)) {
console.log(requisitionListValue.current)
form.setFieldsValue({
materials: {
requisitionList: {
[record.key]: max
},
},
})
}
return (
return (
<div className={styles['member-rights-editable']}>
<div className={styles['member-rights-editable']}>
<Form.Item
<Form.Item
...
@@ -518,11 +537,11 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
...
@@ -518,11 +537,11 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
const item = normalized[i];
const item = normalized[i];
if (item.children && item.children.length) {
if (item.children && item.children.length) {
item.children.forEach((child) => {
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) {
if (Object.keys(requisitionValue).length) {
form.setFieldsValue({
form.setFieldsValue({
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
View file @
af6247bc
...
@@ -114,10 +114,11 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -114,10 +114,11 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
const
{
pageStatus
,
id
,
modelType
}
=
usePageStatus
()
const
{
pageStatus
,
id
,
modelType
}
=
usePageStatus
()
const
[
initFormSchema
,
setInitFormSchema
]
=
useState
<
any
>
(()
=>
({
...
mergeAllSchemas
}))
const
[
initFormSchema
,
setInitFormSchema
]
=
useState
<
any
>
(()
=>
({
...
mergeAllSchemas
}))
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(()
=>
{
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
)
{
if
(
modelType
)
{
resultState
=
{
resultState
=
{
orderMode
:
parseInt
(
modelType
)
orderMode
:
parseInt
(
modelType
),
hasInvoice
:
true
}
}
}
}
return
resultState
return
resultState
...
@@ -380,7 +381,6 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -380,7 +381,6 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
const
productDataValue
=
addSchemaAction
.
getFieldValue
(
'products'
);
const
productDataValue
=
addSchemaAction
.
getFieldValue
(
'products'
);
const
contractValue
=
addSchemaAction
.
getFieldValue
(
'contract'
);
const
contractValue
=
addSchemaAction
.
getFieldValue
(
'contract'
);
let
mergeArr
=
[];
let
mergeArr
=
[];
value
.
forEach
((
item
)
=>
{
value
.
forEach
((
item
)
=>
{
const
entity
=
productDataValue
.
find
((
material
)
=>
material
.
id
===
item
.
id
);
const
entity
=
productDataValue
.
find
((
material
)
=>
material
.
id
===
item
.
id
);
if
(
entity
)
{
if
(
entity
)
{
...
@@ -392,6 +392,8 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -392,6 +392,8 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
mergeArr
.
push
({
...
convertOrderMaterialData
(
item
)
});
mergeArr
.
push
({
...
convertOrderMaterialData
(
item
)
});
}
}
});
});
console
.
log
(
value
,
'value'
)
console
.
log
(
mergeArr
,
'mergeArr'
)
mergeArr
=
mergeArr
.
map
((
item
)
=>
({
mergeArr
=
mergeArr
.
map
((
item
)
=>
({
...
item
,
...
item
,
// 兼容之前订单物料数据
// 兼容之前订单物料数据
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/utils.ts
View file @
af6247bc
...
@@ -35,6 +35,7 @@ export const convertOrderMaterialData = (dataSource: OrderMaterialsConfirmValue[
...
@@ -35,6 +35,7 @@ export const convertOrderMaterialData = (dataSource: OrderMaterialsConfirmValue[
result
.
push
({
result
.
push
({
requisitionId
:
detailId
,
requisitionId
:
detailId
,
orderQuantity
:
(
rest
as
any
).
orderQuantity
||
0
,
orderQuantity
:
(
rest
as
any
).
orderQuantity
||
0
,
requisitionNo
:
(
rest
as
any
).
requisitionNo
,
salesManRequests
:
[{
salesManRequests
:
[{
...
rest
.
purchaseProductSalesManResponse
,
...
rest
.
purchaseProductSalesManResponse
,
purchaseOrderQuantity
:
(
rest
as
any
).
orderQuantity
||
0
,
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