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
5d7382d2
Commit
5d7382d2
authored
Aug 27, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 仓位区块添加上游供应商品相关信息
parent
43e733cf
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
185 additions
and
112 deletions
+185
-112
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+13
-6
batchPositionSetting.tsx
src/pages/repositories/components/batchPositionSetting.tsx
+75
-63
positionSetting.tsx
src/pages/repositories/components/positionSetting.tsx
+14
-0
index.tsx
src/pages/repositories/index.tsx
+16
-1
index.tsx
src/pages/repositories/schema/index.tsx
+39
-3
index.ts
...s/transaction/purchaseOrder/orderCollectB2b/apis/index.ts
+1
-1
index.tsx
...nsaction/purchaseOrder/orderCollectB2b/constant/index.tsx
+16
-23
index.tsx
...pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
+6
-10
usePaymentInfo.tsx
...on/purchaseOrder/orderCollectB2b/model/usePaymentInfo.tsx
+2
-2
index.ts
...transaction/purchaseOrder/orderCollectB2b/schema/index.ts
+1
-1
useReadyAddOrder.tsx
...on/purchaseOrder/readyAddOrder/model/useReadyAddOrder.tsx
+2
-2
No files found.
src/pages/repositories/adjustRepository.tsx
View file @
5d7382d2
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
import
{
history
,
Prompt
}
from
'umi'
import
moment
from
'moment'
import
{
Button
,
Card
,
Row
,
Tabs
,
Tag
}
from
'antd'
import
{
Button
,
Card
,
Row
,
Tabs
,
Tag
,
Col
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
SaveOutlined
,
...
...
@@ -204,11 +204,11 @@ const AddRepository:React.FC<{}> = (props) => {
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
className=
'addRepository'
title=
"仓位库存调拨"
extra=
{
[
<
Button
key=
"1"
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>,
]
}
//
extra={[
//
<Button key="1" onClick={() => addSchemaAction.submit()} type="primary" icon={<SaveOutlined />}>
//
保存
//
</Button>,
//
]}
>
<
Card
className=
''
>
<
FormProvider
>
...
...
@@ -216,6 +216,13 @@ const AddRepository:React.FC<{}> = (props) => {
<
Tabs
type=
'card'
defaultActiveKey=
'tab1'
onChange=
{
topTableChange
}
>
<
Tabs
.
TabPane
key=
'tab1'
tab=
'仓位设置'
>
<
PositionSetting
onFieldChange=
{
onPublicFieldChange
}
addSchemaAction=
{
addSchemaAction
}
schema=
{
repositTabOneSchema
}
formSubmit=
{
formSubmit
}
/>
<
Row
>
<
Col
offset=
{
6
}
style=
{
{
marginTop
:
40
}
}
>
<
Button
key=
"1"
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>
</
Col
>
</
Row
>
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
key=
'tab2'
tab=
'库存调入\调出'
>
<
Tabs
defaultActiveKey=
'tab2-1'
tabPosition=
'left'
>
...
...
src/pages/repositories/components/batchPositionSetting.tsx
View file @
5d7382d2
...
...
@@ -315,6 +315,18 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
align
:
'center'
,
key
:
'unitName'
,
},
{
title
:
'供应会员'
,
dataIndex
:
'upperMemberName'
,
align
:
'center'
,
key
:
'upperMemberName'
,
},
{
title
:
'供应库存'
,
dataIndex
:
'upperStockCount'
,
align
:
'center'
,
key
:
'upperStockCount'
,
},
]
const
formSearch
:
ISchema
=
{
...
...
@@ -513,75 +525,75 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
schema=
{
schema
}
/>
<
ModalTable
modalTitle=
'选择会员'
confirm=
{
handleOkAddMember
}
cancel=
{
handleCancelAddMember
}
visible=
{
visibleChannelMember
}
columns=
{
columnsSetMember
}
rowSelection=
{
memberRowSelection
}
fetchTableData=
{
params
=>
fetchMemberList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formSearch
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
,
Select
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
modalTitle=
'选择会员'
confirm=
{
handleOkAddMember
}
cancel=
{
handleCancelAddMember
}
visible=
{
visibleChannelMember
}
columns=
{
columnsSetMember
}
rowSelection=
{
memberRowSelection
}
fetchTableData=
{
params
=>
fetchMemberList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formSearch
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
,
Select
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'memberId'
}
}
/>
<
ModalTable
modalTitle=
'选择商品'
confirm=
{
handleOkAddProduct
}
cancel=
{
handleCancel
AddProduct
}
visible=
{
visibleChannelR
roduct
}
columns=
{
columnsSetP
roduct
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formProduct
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'memberId'
}
}
/>
<
ModalTable
modalTitle=
'选择商品'
confirm=
{
handleOk
AddProduct
}
cancel=
{
handleCancelAddP
roduct
}
visible=
{
visibleChannelR
roduct
}
columns=
{
columnsSetProduct
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formProduct
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
,
// onRow: (record) => (
{
// onClick: () =>
{
// productRowCtl.setSelectRow([record]);
// productRowCtl.setSelectedRowKeys([record.id]);
//
},
//
})
}
}
/>
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
,
// onRow: (record) => (
{
// onClick: () =>
{
// productRowCtl.setSelectRow([record]);
// productRowCtl.setSelectedRowKeys([record.id]);
//
},
//
})
}
}
/>
</>
)
...
...
src/pages/repositories/components/positionSetting.tsx
View file @
5d7382d2
...
...
@@ -220,6 +220,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
addSchemaAction
.
setFieldValue
(
'brand'
,
selectResult
.
brandName
)
addSchemaAction
.
setFieldValue
(
'unit'
,
selectResult
.
unitName
)
addSchemaAction
.
setFieldValue
(
'productId'
,
selectResult
.
id
)
addSchemaAction
.
setFieldValue
(
'upperMemberName'
,
selectResult
.
upperMemberName
)
addSchemaAction
.
setFieldValue
(
'upperStockCount'
,
selectResult
.
upperStockCount
)
addSchemaAction
.
setFieldState
(
'inventory'
,
state
=>
{
state
.
props
[
"x-props"
]
=
{
addonAfter
:
<
div
style=
{
{
marginLeft
:
4
}
}
>
{
selectResult
.
unitName
}
</
div
>
...
...
@@ -332,6 +334,18 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
align
:
'center'
,
key
:
'unitName'
,
},
{
title
:
'供应会员'
,
dataIndex
:
'upperMemberName'
,
align
:
'center'
,
key
:
'upperMemberName'
,
},
{
title
:
'供应库存'
,
dataIndex
:
'upperStockCount'
,
align
:
'center'
,
key
:
'upperStockCount'
,
}
]
const
formSearch
:
ISchema
=
{
...
...
src/pages/repositories/index.tsx
View file @
5d7382d2
...
...
@@ -85,11 +85,26 @@ const Repositories: React.FC<{}> = () => {
key
:
'unit'
,
},
{
title
:
'库存'
,
title
:
'
现有
库存'
,
dataIndex
:
'inventory'
,
key
:
'inventory'
,
},
{
title
:
'已用库存'
,
dataIndex
:
'alreadyiInventory'
,
key
:
'alreadyiInventory'
,
},
{
title
:
'供应会员'
,
dataIndex
:
'upperMemberName'
,
key
:
'upperMemberName'
,
},
{
title
:
'供应库存'
,
dataIndex
:
'upperStockCount'
,
key
:
'upperStockCount'
,
},
{
title
:
'仓位状态'
,
dataIndex
:
'status'
,
key
:
'status'
,
...
...
src/pages/repositories/schema/index.tsx
View file @
5d7382d2
...
...
@@ -295,7 +295,19 @@ export const repositMoreSchema: ISchema = padRequiredMessage({
// }
],
default
:
1
}
},
upperMemberName
:
{
type
:
'string'
,
title
:
'供应会员'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
upperStockCount
:
{
type
:
'number'
,
title
:
'供应库存'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
}
}
}
...
...
@@ -527,7 +539,19 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
// }
],
default
:
1
}
},
upperMemberName
:
{
type
:
'string'
,
title
:
'供应会员'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
upperStockCount
:
{
type
:
'number'
,
title
:
'供应库存'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
}
}
}
...
...
@@ -925,7 +949,19 @@ export const repositTabOneSchema: ISchema = padRequiredMessage({
// }
],
default
:
1
}
},
upperMemberName
:
{
type
:
'string'
,
title
:
'供应会员'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
upperStockCount
:
{
type
:
'number'
,
title
:
'供应库存'
,
"x-component"
:
'Text'
,
default
:
'暂无'
},
}
}
}
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/apis/index.ts
View file @
5d7382d2
...
...
@@ -37,7 +37,7 @@ export const fetchOrderApi = {
},
/** 获取支付信息列表 */
async
getPayInfoList
(
params
)
{
const
{
data
}
=
await
PublicApi
.
postOrderBuyerCreateB2bPaymentFind
(
params
)
const
{
data
}
=
await
PublicApi
.
postOrderBuyerCreateB2bPaymentFind
(
params
,
{
ctlType
:
'none'
}
)
return
data
},
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/constant/index.tsx
View file @
5d7382d2
...
...
@@ -23,7 +23,7 @@ export const PriceComp = (props) => {
</
div
>
}
/** 修改
合同
下单 初始值转换 */
/** 修改
b2b询价报价
下单 初始值转换 */
export
const
procurmentRenderInit
=
(
initValue
:
any
)
=>
{
return
{
...
...
@@ -42,29 +42,23 @@ export const procurmentRenderInit = (initValue: any) => {
digest
:
initValue
.
digest
,
deliverDate
:
initValue
.
consignee
.
deliverDate
,
theInvoiceId
:
initValue
.
invoice
?.
invoiceId
||
null
,
hasContract
:
initValue
.
hasContract
,
contractNo
:
initValue
.
contract
.
contractNo
,
contract
:
{...
initValue
.
contract
},
quoteNo
:
initValue
.
quoteNo
,
}
}
/** 修改
采购合同
下单 回显商品字段转换 */
/** 修改
b2b询价报价
下单 回显商品字段转换 */
export
const
procurementRenderField
=
(
data
)
=>
{
const
_orderProductRequests
=
data
.
product
.
products
return
_orderProductRequests
.
map
(
item
=>
{
return
{
...
item
,
// 此id为sukId
relevanceProductId
:
item
.
quotedSkuId
,
// relevanceSkuId: item.quotedSkuId,
relevanceProductName
:
item
.
quotedName
,
relevanceProductBrand
:
item
.
quotedBrand
,
relevanceProductCategory
:
item
.
quotedCategory
,
relevanceProductSpec
:
item
.
quotedSpec
,
productId
:
item
.
skuId
,
productName
:
item
.
name
,
logistics
:
item
.
deliverType
,
id
:
item
.
productId
,
code
:
item
.
productNo
,
type
:
item
.
spec
,
unitPrice
:
item
.
price
,
purchaseCount
:
item
.
quantity
,
taxInclusive
:
item
.
tax
,
money
:
item
.
amount
,
// 冗余memberId memberRoleId查询自提地址使用
memberId
:
data
.
vendorMemberId
,
memberRoleId
:
data
.
vendorRoleId
,
...
...
@@ -316,11 +310,10 @@ export const productInfoColumns: any[] = [
key
:
'unitPrice'
,
},
{
title
:
'
会员折扣
'
,
dataIndex
:
'
memberPrice
'
,
title
:
'
库存
'
,
dataIndex
:
'
stock
'
,
align
:
'center'
,
key
:
'memberPrice'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
&&
text
?
text
*
100
+
'%'
:
null
key
:
'stock'
,
},
{
title
:
'采购数量'
,
...
...
@@ -358,11 +351,11 @@ export const productInfoColumns: any[] = [
align
:
'center'
,
key
:
'logistics'
,
render
:
(
t
,
r
)
=>
{
if
(
r
.
logistics
?.
deliveryType
===
1
)
if
(
r
.
logistics
===
1
)
return
"物流(默认)"
else
if
(
r
.
logistics
?.
deliveryType
===
2
)
return
<
AddressPop
pickInfo=
{
t
}
>
{
DELIVERY_TYPE
[
t
.
deliveryType
]
}
</
AddressPop
>
else
if
(
r
.
logistics
?.
deliveryType
===
3
)
else
if
(
r
.
logistics
===
2
)
return
<
AddressPop
pickInfo=
{
t
}
>
{
DELIVERY_TYPE
[
t
]
}
</
AddressPop
>
else
if
(
r
.
logistics
===
3
)
return
"无需配送"
}
},
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
View file @
5d7382d2
...
...
@@ -9,7 +9,7 @@ import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import
NiceForm
from
'@/components/NiceForm'
import
{
mergeAllSchemas
}
from
'./schema'
import
{
useModelTypeChange
,
useEditHideField
,
useOrderFormInitEffect
,
useProductTableChangeForPay
,
useOrderUpdateChangeOther
}
from
'./effects'
import
{
orderCombination
,
orderTypeLabelMap
,
procurementProcessField
}
from
'./constant'
import
{
orderCombination
,
orderTypeLabelMap
,
procurementProcessField
,
procurementRenderField
,
procurmentRenderInit
}
from
'./constant'
import
{
OrderModalType
}
from
'@/constants/order'
import
ProductModalTable
from
'./components/productModalTable'
import
InquiryModalTable
from
'./components/inquiryModalTable'
...
...
@@ -143,18 +143,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
useEffect
(()
=>
{
if
(
id
)
{
setFormLoading
(
true
)
// @ts-ignore
PublicApi
.
getOrderProcurementOrderDetails
({
id
PublicApi
.
getOrderBuyerCreateDetail
({
orderId
:
id
}).
then
(
res
=>
{
const
{
data
}
=
res
setInitFormValue
({
...
data
,
products
:
[],
deliveryTime
:
formatTimeString
(
data
.
deliveryTime
)
})
const
_orderProductRequests
=
procurementRenderField
(
data
)
setInitFormValue
(()
=>
procurmentRenderInit
(
data
))
setTimeout
(()
=>
{
addSchemaAction
.
setFieldValue
(
'products'
,
data
.
orderProductRequests
)
addSchemaAction
.
setFieldValue
(
'products'
,
_
orderProductRequests
)
},
1000
)
setFormLoading
(
false
)
})
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/model/usePaymentInfo.tsx
View file @
5d7382d2
...
...
@@ -4,7 +4,7 @@ import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import
{
useEffect
,
useState
,
useRef
}
from
'react'
import
{
PublicApi
}
from
'@/services/api'
export
const
usePaymentInfo
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
memberId
:
any
,
memberRoleId
:
any
,
orderProducts
:
any
):
any
=>
{
export
const
usePaymentInfo
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
memberId
:
any
,
memberRoleId
:
any
,
orderProducts
:
any
=
[]
):
any
=>
{
const
paywayData
=
useRef
<
any
>
({})
const
[
columns
,
setColumns
]
=
useState
<
any
[]
>
(
paymentInformationColumns
)
// const { schemaActions, detailData } = useContext(ReadyAddOrderDetailContext)
...
...
@@ -58,7 +58,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const
handleSave
=
row
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'payments'
)];
const
index
=
newData
.
findIndex
(
item
=>
row
.
payCount
===
item
.
payCount
);
const
index
=
newData
.
findIndex
(
item
=>
row
.
batchNo
===
item
.
batchNo
);
const
item
=
newData
[
index
];
newData
.
splice
(
index
,
1
,
{
...
item
,
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/schema/index.ts
View file @
5d7382d2
...
...
@@ -96,7 +96,7 @@ const basicInfo: ISchema = {
"x-linkages"
:
[
{
type
:
'value:schema'
,
target
:
"
supplyMembers
Name"
,
target
:
"
vendorMember
Name"
,
condition
:
`{{$self.editable && !!$value}}`
,
schema
:
{
"x-component-props"
:
{
...
...
src/pages/transaction/purchaseOrder/readyAddOrder/model/useReadyAddOrder.tsx
View file @
5d7382d2
...
...
@@ -22,8 +22,8 @@ export const useSelfTable = () => {
}
const
handleEdit
=
(
record
:
any
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/edit?id=
${
record
.
orderId
}${
record
.
type
===
4
?
'&type=4'
:
''
}
`
)
// history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/edit?id=${record.id}${record.type === 4 ? '&type=4' : ''
}`)
const
{
orderType
}
=
record
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/
${
orderType
===
1
?
'b2b'
:
'srm'
}
/edit?id=
${
record
.
orderId
}
`
)
}
/** 参照后台数据生成 */
...
...
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