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
linweijiong
jinfa-platform
Commits
f82ed487
Commit
f82ed487
authored
Apr 19, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 采购合同下单查询用户配置的流程接口切换
parent
55c72382
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
64 deletions
+76
-64
index.ts
src/pages/procurement/tender/addBidRegister/schema/index.ts
+4
-0
index.tsx
...rder/orderCollect/components/materialModalTable/index.tsx
+42
-42
index.tsx
...transaction/purchaseOrder/orderCollect/constant/index.tsx
+2
-2
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+1
-0
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+26
-19
index.tsx
...saction/purchaseRules/components/selectProcesss/index.tsx
+1
-1
No files found.
src/pages/procurement/tender/addBidRegister/schema/index.ts
View file @
f82ed487
...
...
@@ -253,6 +253,10 @@ export const formSchema: ISchema = {
required
:
true
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请填写详细地址'
,
},
{
limitByte
:
true
,
maxByte
:
100
,
},
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/materialModalTable/index.tsx
View file @
f82ed487
...
...
@@ -96,42 +96,6 @@ export const AddressPop = (props) => {
</
Space
>
:
children
}
export
const
filterProductDataById
=
(
data
,
targetData
)
=>
{
return
targetData
.
reduce
(
async
(
prev
:
any
[],
next
)
=>
{
const
{
logistics
}
=
next
// 由于自选商品和进货单商品字段不一致,需手动同步
next
.
brand
=
next
.
brand
||
next
.
brandName
next
.
category
=
next
.
category
||
next
.
customerCategoryName
next
.
unit
=
next
.
unit
||
next
.
unitName
next
.
productName
=
next
.
productName
||
next
.
name
if
(
logistics
.
deliveryType
===
2
&&
logistics
.
sendAddress
)
{
const
{
code
,
data
}
=
await
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
logistics
.
sendAddress
},
{
ttl
:
60
*
1000
,
useCache
:
true
})
logistics
.
render
=
data
}
else
{
logistics
.
render
=
DELIVERY_TYPE
[
logistics
.
deliveryType
]
}
// 配送方式外置, 用于接口字段冗余
next
.
deliveryType
=
logistics
.
deliveryType
// id 存在集合中, 采用target中的数据, 否则采用data中的数据
const
findResult
=
data
.
find
(
v
=>
v
.
id
===
next
.
id
)
// 由于迭代时,会出现promise的 已完成状态, 需转换一下,实现异步转同步化
if
(
!
Array
.
isArray
(
prev
))
{
prev
=
await
prev
}
if
(
findResult
)
{
// 已经选中过这一项, 则需要采用原有的商品列表
prev
.
push
(
findResult
)
}
else
{
prev
.
push
(
next
)
}
return
prev
},
[])
}
const
MaterialModalTable
:
React
.
FC
<
MaterialModalTableProps
>
=
(
props
)
=>
{
const
{
type
=
'checkbox'
,
schemaAction
,
confirmModal
,
currentRef
,
sectionProps
,
...
restProps
}
=
props
const
{
visible
,
setVisible
,
rowSelection
,
rowSelectionCtl
}
=
sectionProps
...
...
@@ -146,19 +110,55 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
}
},
[])
const
addMaterialProcessField
=
(
value
,
origin
)
=>
{
if
(
Array
.
isArray
(
value
))
{
let
processData
=
value
.
map
(
v
=>
{
let
temp
:
any
=
{};
temp
.
id
=
v
.
id
;
temp
.
code
=
v
.
materielNo
;
temp
.
name
=
v
.
materielName
;
temp
.
type
=
v
.
type
;
temp
.
category
=
v
.
category
;
temp
.
brand
=
v
.
brand
;
temp
.
unit
=
v
.
unit
;
temp
.
relevanceProductId
=
v
.
associatedDataId
;
temp
.
relevanceProductName
=
v
.
associatedGoods
;
temp
.
relevanceProductNo
=
v
.
associatedMaterielNo
;
temp
.
relevanceProductType
=
v
.
associatedType
;
temp
.
relevanceProductCategory
=
v
.
associatedCategory
;
temp
.
relevanceProductBrand
=
v
.
associatedBrand
;
temp
.
price
=
v
.
price
;
temp
.
inventory
=
v
.
bidCount
;
temp
.
taxInclusive
=
v
.
isHasTax
;
temp
.
taxRate
=
v
.
taxRate
;
// @ 配送方式 默认物流
temp
.
logistics
=
1
return
temp
})
let
originIds
=
origin
.
map
(
item
=>
item
.
id
)
processData
.
map
(
item
=>
{
if
(
!
originIds
.
includes
(
item
.
id
))
{
origin
.
push
(
item
)
}
})
return
origin
}
}
const
handleConfirm
=
async
()
=>
{
// 判断所选择的商品是否属于同一个工作流
console
.
log
(
rowSelectionCtl
,
'rowSelectionCtl'
)
// @ts-ignore
const
res
=
await
PublicApi
.
postOrderIsWorkFlow
({
memberId
:
rowSelectionCtl
.
selectRow
[
0
].
memberId
,
memberRoleId
:
rowSelectionCtl
.
selectRow
[
0
].
memberRoleId
,
productIds
:
rowSelectionCtl
.
select
edRowKeys
,
memberId
:
schemaAction
.
getFieldValue
(
'supplyMembersId'
)
,
memberRoleId
:
schemaAction
.
getFieldValue
(
'supplyMembersRoleId'
)
,
productIds
:
rowSelectionCtl
.
select
Row
.
map
(
item
=>
item
.
associatedDataId
)
,
orderModel
:
schemaAction
.
getFieldValue
(
'orderModel'
)
},
{
ctlType
:
'none'
})
if
(
res
.
code
===
1000
)
{
const
productData
=
schemaAction
.
getFieldValue
(
'orderProductRequests'
)
schemaAction
.
setFieldValue
(
'orderProductRequests'
,
a
wait
filterProductDataById
(
productData
,
rowSelectionCtl
.
selectRow
))
schemaAction
.
setFieldValue
(
'orderProductRequests'
,
a
ddMaterialProcessField
(
rowSelectionCtl
.
selectRow
,
productData
))
confirmModal
&&
confirmModal
()
setVisible
(
false
)
}
else
{
...
...
@@ -172,7 +172,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
...
values
,
contractId
,
}
return
fetchOrderApi
.
get
Product
List
(
params
)
return
fetchOrderApi
.
get
ContractPurchaseMateriel
List
(
params
)
}
...
...
@@ -186,7 +186,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
cancel=
{
()
=>
setVisible
(
false
)
}
fetchTableData=
{
fetchMaterialList
}
rowSelection=
{
rowSelection
}
resetModal=
{
{
destroyOnClose
:
true
,
forceRender
:
true
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
modalType=
'none'
tableProps=
{
{
rowKey
:
'id'
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/constant/index.tsx
View file @
f82ed487
...
...
@@ -25,12 +25,12 @@ export const PriceComp = (props) => {
</
div
>
}
/
/ @采购合同下单 字段转换
/
** 采购合同下单 字段转换 */
export
const
procurementProcessField
=
(
value
)
=>
{
value
.
orderProductRequests
=
value
.
orderProductRequests
.
map
(
item
=>
{
// @todo 查询商品对应的最小起订数
// const { data, code } = await PublicApi.getProductCommodityGetCommodity({id: item.relevanceProductId})
delete
item
.
id
//
delete item.id
return
{
...
item
,
productId
:
item
.
relevanceProductId
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
f82ed487
...
...
@@ -74,6 +74,7 @@ export const useModelTypeChange = (callback) => {
const
utils
=
useLinkageUtils
()
// 下单模式发生改变时
FormEffectHooks
.
onFieldValueChange$
(
'orderModel'
).
subscribe
(
state
=>
{
console
.
log
(
state
.
value
,
'efffect'
)
callback
(
state
)
})
}
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
f82ed487
...
...
@@ -36,6 +36,7 @@ import { fetchOrderApi } from './apis'
import
MergeOrderModalTable
from
'./components/mergeOrderModalTable'
import
{
useMaterialTable
}
from
'./model/useMaterialTable'
import
ContractModalTable
from
'./components/contractModalTable'
import
MaterialModalTable
from
'./components/materialModalTable'
export
interface
PurchaseOrderDetailProps
{}
...
...
@@ -164,7 +165,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 订单商品
const
{
productAddButton
,
productRef
,
productColumns
,
productComponents
,
...
sectionProps
}
=
useProductTable
(
addSchemaAction
,
mergeRef
)
// 订单物料
const
{
materialAddButton
,
materialRef
,
materialColumns
,
materialComponents
,
...
rest
Props
}
=
useMaterialTable
(
addSchemaAction
)
const
{
materialAddButton
,
materialRef
,
materialColumns
,
materialComponents
,
...
surplus
Props
}
=
useMaterialTable
(
addSchemaAction
)
let
timerSignature
=
null
// 页面进入时, 当前所处的下单模式
...
...
@@ -618,29 +619,35 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
value
===
OrderModalType
.
CHANNEL_SPOT_MANUAL_ORDER
||
(
value
===
OrderModalType
.
CONSOLIDATED_ORDER
&&
quotationOrderValue
)
)
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
editable
?
productAddButton
:
''
,
}
})
setTimeout
(()
=>
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
editable
?
productAddButton
:
''
,
}
})
})
}
else
if
(
value
===
OrderModalType
.
PURCHASE_ENQUIRY_CONTRACT_ORDER
||
value
===
OrderModalType
.
PURCHASE_BIDDING_CONTRACT_ORDER
||
value
===
OrderModalType
.
PURCHASE_TENDER_CONTRACT_ORDER
)
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
editable
?
materialAddButton
:
''
,
}
})
setTimeout
(()
=>
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
editable
?
materialAddButton
:
''
,
}
})
},
300
)
}
else
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
''
,
}
setTimeout
(()
=>
{
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
productState
.
props
[
"x-component-props"
]
=
{
...
productState
.
props
[
"x-component-props"
],
prefix
:
''
,
}
})
})
}
// 选择某种类型时, 需显示对应的订单类型
...
...
@@ -724,7 +731,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
<
ContractModalTable
currentRef=
{
contractOrderRef
}
schemaAction=
{
addSchemaAction
}
/>
{
/* @todo 选择采购物料 */
}
{
/* <MaterialModalTable currentRef={materialRef} schemaAtion={addSchemaAction} /> */
}
<
MaterialModalTable
currentRef=
{
materialRef
}
schemaAction=
{
addSchemaAction
}
sectionProps=
{
surplusProps
}
/>
...
...
src/pages/transaction/purchaseRules/components/selectProcesss/index.tsx
View file @
f82ed487
...
...
@@ -61,7 +61,7 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const
{
value
,
mutators
,
editable
}
=
props
useEffect
(()
=>
{
PublicApi
.
get
OrderTradingRulesTransactionProcessList
().
then
(
res
=>
{
PublicApi
.
get
ManagePurchaseProcesByMember
().
then
(
res
=>
{
setFieldState
({
dataSource
:
res
.
data
,
showMore
...
...
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