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
3a2ec3ac
Commit
3a2ec3ac
authored
Oct 25, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对接现货采购下单新增修改
parent
111dc7e4
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
80 additions
and
70 deletions
+80
-70
index.tsx
src/pages/commodity/products/index.tsx
+2
-1
index.tsx
src/pages/transaction/components/orderMergeInfo/index.tsx
+2
-3
index.ts
.../transaction/purchaseOrder/orderCollectCash/apis/index.ts
+2
-2
index.tsx
...eOrder/orderCollectCash/components/addressModal/index.tsx
+2
-2
index.tsx
...er/orderCollectCash/components/productTableCell/index.tsx
+3
-14
index.tsx
...rder/orderCollectCash/components/theInvoiceList/index.tsx
+2
-7
index.tsx
...saction/purchaseOrder/orderCollectCash/constant/index.tsx
+17
-5
index.ts
...ansaction/purchaseOrder/orderCollectCash/effects/index.ts
+5
-0
index.tsx
...ages/transaction/purchaseOrder/orderCollectCash/index.tsx
+29
-26
usePaymentInfo.tsx
...n/purchaseOrder/orderCollectCash/model/usePaymentInfo.tsx
+5
-2
useProductTable.tsx
.../purchaseOrder/orderCollectCash/model/useProductTable.tsx
+8
-3
index.tsx
...ges/transaction/purchaseOrder/readyAddCashOrder/index.tsx
+2
-2
useReadyAddOrder.tsx
...urchaseOrder/readyAddCashOrder/model/useReadyAddOrder.tsx
+1
-3
No files found.
src/pages/commodity/products/index.tsx
View file @
3a2ec3ac
...
...
@@ -376,6 +376,7 @@ const Products: React.FC<{}> = () => {
const
{
data
}
=
await
PublicApi
.
getTemplateWebMemberShopWebFindCurrMemberShop
({
memberId
:
getAuth
().
memberId
,
memberRoleId
:
getAuth
().
memberRoleId
})
if
(
data
?.
id
)
{
setShopId
(
data
)
console
.
log
(
data
,
'data'
)
setCheckedValues
(
values
)
}
else
{
message
.
error
(
'您还还未创建店铺,请先创建店铺!'
)
...
...
@@ -411,7 +412,7 @@ const Products: React.FC<{}> = () => {
if
(
checkedValues
.
length
>
0
){
const
fn
=
isBatch
?
PublicApi
.
postProductCommodityPublishCommodityBatch
:
PublicApi
.
postProductCommodityPublishCommodity
// @ts-ignore
fn
(
isBatch
?
{
storeId
:
shopId
[
'id'
],
storeName
:
shopId
[
'name'
],
s
hopList
:
checkedValues
,
idList
:
currentRef
.
current
}
:
{
storeId
:
shopId
?.
id
||
null
,
storeName
:
shopId
?.
name
||
null
,
...
params
}).
then
(()
=>
{
fn
(
isBatch
?
{
storeId
:
shopId
[
'id'
],
storeName
:
shopId
[
'name'
],
s
toreLogo
:
shopId
[
'logo'
],
shopList
:
checkedValues
,
idList
:
currentRef
.
current
}
:
{
storeId
:
shopId
?.
id
||
null
,
storeName
:
shopId
?.
name
||
null
,
storeLogo
:
shopId
?.
logo
||
null
,
...
params
}).
then
(()
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
...
...
src/pages/transaction/components/orderMergeInfo/index.tsx
View file @
3a2ec3ac
...
...
@@ -2,15 +2,14 @@ import React, { useContext, useState } from 'react'
import
{
Row
,
Col
,
Tag
,
Modal
}
from
'antd'
import
MellowCard
from
'@/components/MellowCard'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
formatTimeString
}
from
'@/utils'
import
{
DELIVERY_TYPE
,
OrderKindType
}
from
'@/constants/order'
import
{
OrderKindType
}
from
'@/constants/order'
import
style
from
'./index.less'
import
ContractList
from
'../contractList'
import
cx
from
'classnames'
export
interface
OrderMergeInfoProps
{
}
const
payInfo
=
[
{
title
:
'交付日期:'
,
name
:
'deliverDate'
,
render
:
(
text
)
=>
formatTimeString
(
text
,
'YYYY-MM-DD'
)
},
{
title
:
'交付日期:'
,
name
:
'deliverDate'
},
{
title
:
'交付地址:'
,
name
:
'areaName'
,
render
:
(
_
,
record
)
=>
<
div
>
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/apis/index.ts
View file @
3a2ec3ac
...
...
@@ -37,7 +37,7 @@ export const fetchOrderApi = {
},
/** 获取支付信息列表 */
async
getPayInfoList
(
params
)
{
const
{
data
}
=
await
PublicApi
.
postOrder
VendorCreateAgent
PaymentFind
(
params
,
{
ctlType
:
'none'
})
const
{
data
}
=
await
PublicApi
.
postOrder
BuyerCreateB2b
PaymentFind
(
params
,
{
ctlType
:
'none'
})
return
data
},
...
...
@@ -55,7 +55,7 @@ export const fetchOrderApi = {
/** 根据商城类型 获取下单模式和类型 */
async
getOrderModeOrderType
(
params
)
{
const
{
data
}
=
await
PublicApi
.
getOrder
VendorGetOrderMode
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrder
BuyerCreatePurchaseTypes
(
params
)
return
data
}
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/components/addressModal/index.tsx
View file @
3a2ec3ac
import
React
,
{
useRef
,
use
Effect
,
use
Memo
}
from
'react'
import
React
,
{
useRef
,
useMemo
}
from
'react'
import
ModalForm
from
'@/components/ModalForm'
import
{
createFormActions
,
useValueLinkageEffect
,
ISchemaFormActions
}
from
'@formily/antd'
import
{
createFormActions
}
from
'@formily/antd'
import
addressSchema
from
'./schema'
import
'./index.less'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/components/productTableCell/index.tsx
View file @
3a2ec3ac
import
React
,
{
useState
,
useRef
,
useContext
,
useEffect
}
from
'react'
import
{
Form
,
Input
,
Select
}
from
'antd'
;
import
{
has
}
from
'lodash'
;
import
React
,
{
useRef
,
useContext
}
from
'react'
import
{
Form
,
Input
}
from
'antd'
;
export
interface
ProductTableCellProps
{
title
:
React
.
ReactNode
;
editable
:
boolean
;
...
...
@@ -32,7 +30,6 @@ export const ProductEditableRow: React.FC<any> = ({...props }) => {
};
export
const
ProductTableCell
:
React
.
FC
<
ProductTableCellProps
>
=
({
title
,
editable
,
...
...
@@ -47,6 +44,7 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
})
=>
{
const
formItemRef
=
useRef
<
any
>
();
const
{
form
}
=
useContext
(
EditableContext
);
const
save
=
async
e
=>
{
try
{
const
values
=
await
form
.
validateFields
();
...
...
@@ -61,15 +59,6 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
switch
(
type
)
{
case
'input'
:
{
// 用于判断是否是合并下单
let
hasSelectMergeBtn
=
document
.
getElementsByClassName
(
"selectMerge"
)
// 用于合并订单采购数量回显
if
(
hasSelectMergeBtn
.
length
)
{
let
keyValue
=
{}
keyValue
[
dataIndex
]
=
v
form
.
setFieldsValue
(
keyValue
)
}
return
<
Input
style=
{
{
width
:
140
}
}
type=
'number'
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/components/theInvoiceList/index.tsx
View file @
3a2ec3ac
import
React
,
{
useState
,
useRef
,
useMemo
}
from
'react'
import
{
ISchemaFieldComponentProps
,
useFieldState
,
FormEffectHooks
,
createFormActions
}
from
'@formily/antd'
import
React
,
{
useState
,
useRef
}
from
'react'
import
{
ISchemaFieldComponentProps
,
useFieldState
}
from
'@formily/antd'
import
{
Button
,
Radio
}
from
'antd'
import
{
PlusOutlined
,
CaretUpOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
...
...
@@ -37,7 +37,6 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
})
}
}
else
if
(
pageStatus
===
PageStatus
.
EDIT
){
// @bug todo 编辑情况下 默认显示有问题 固定第一个
// console.log(value, mode, dataSource, 'EDIT')
if
(
typeof
value
===
'object'
)
{
// let target = (mode === 'add' || mode === 'delete') ? dataSource[0] : value
...
...
@@ -52,7 +51,6 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
showMore
,
useValue
:
target
})
// console.log('isObject', target)
mutators
.
change
(
target
)
}
else
{
let
target
=
dataSource
.
length
?
dataSource
.
find
(
v
=>
v
.
id
===
value
)
:
value
...
...
@@ -61,7 +59,6 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
showMore
,
useValue
:
target
})
// console.log('notObject', target)
mutators
.
change
(
target
)
}
}
...
...
@@ -149,10 +146,8 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
reload
()
}
// @tofix bug 添加或删除发票后 useValue Radio默认值是操作的数据 导致无法选中
// console.log(useValue, 'useValue', dataSource, 'dataSource', mode, value, 'value')
return
(
<
div
style=
{
{
width
:
'100%'
}
}
className=
{
styles
.
invoice
}
>
{
editable
&&
<
Button
block
onClick=
{
handleAdd
}
icon=
{
<
PlusOutlined
/>
}
>
新增发票
</
Button
>
}
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/constant/index.tsx
View file @
3a2ec3ac
import
React
from
'react'
import
{
formatTimeString
}
from
'@/utils'
import
{
Row
}
from
'antd'
import
{
DELIVERY_TYPE
,
OrderModalType
}
from
'@/constants/order'
import
{
OrderModalType
}
from
'@/constants/order'
import
{
AddressPop
}
from
'@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
...
...
@@ -23,10 +23,10 @@ export const PriceComp = (props) => {
</
div
>
}
/** 修改
b2b询价报价
下单 初始值转换 */
/** 修改
现货采购
下单 初始值转换 */
export
const
procurmentRenderInit
=
(
initValue
:
any
)
=>
{
return
{
let
fields
=
{
...
initValue
.
requirement
.
detail
,
vendorMemberId
:
initValue
.
vendorMemberId
,
vendorMemberName
:
initValue
.
vendorMemberName
,
...
...
@@ -47,15 +47,24 @@ export const procurmentRenderInit = (initValue: any) => {
shopId
:
initValue
.
shopId
,
payments
:
initValue
.
payments
,
}
if
(
initValue
.
consignee
.
deliverDate
.
length
>
20
)
{
// 有配置时间段
const
timeArray
=
initValue
.
consignee
.
deliverDate
.
split
(
' '
)
fields
.
deliverDate
=
timeArray
[
0
]
fields
.
timeLine
=
timeArray
[
1
]
}
return
{
...
fields
}
}
/** 修改
b2b询价报价
下单 回显商品字段转换 */
/** 修改
现货采购
下单 回显商品字段转换 */
export
const
procurementRenderField
=
(
data
)
=>
{
const
_orderProductRequests
=
data
.
product
.
products
return
_orderProductRequests
.
map
(
item
=>
{
return
{
...
item
,
commodityId
:
item
.
productId
,
id
:
item
.
skuId
,
productId
:
item
.
skuId
,
productName
:
item
.
name
,
logistics
:
item
.
deliverType
,
...
...
@@ -82,7 +91,7 @@ export const procurementRenderField = (data) => {
})
}
/**
代客
下单提交 字段转换 */
/**
现货采购
下单提交 字段转换 */
export
const
procurementProcessField
=
(
value
)
=>
{
value
.
products
=
value
.
products
.
map
(
item
=>
{
return
{
...
...
@@ -94,6 +103,9 @@ export const procurementProcessField = (value) => {
logisticsTemplateId
:
item
.
logistics
.
templateId
,
weight
:
item
.
logistics
.
weight
,
stock
:
item
.
stockCount
,
discount
:
item
.
memberPrice
,
price
:
item
.
money
/
item
.
purchaseCount
/
item
.
memberPrice
,
tax
:
item
.
taxRate
>
0
,
vendorMemberId
:
item
.
memberId
,
vendorRoleId
:
item
.
memberRoleId
,
vendorMemberName
:
item
.
memberName
,
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/effects/index.ts
View file @
3a2ec3ac
...
...
@@ -66,8 +66,10 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
const
{
value
}
=
state
// 强制渲染一次, 用于触发金额总数
update
()
const
orderMode
=
ctx
.
getFieldValue
(
'orderMode'
)
if
(
value
&&
value
.
length
>
0
&&
!
state
.
loading
){
// 添加loading判断避免二次调用
// 请求一次并复制给支付信息
const
productItem
=
value
[
0
]
if
(
pageStatus
===
PageStatus
.
ADD
)
{
// 新增下 需要支付信息生成支付次数
ctx
.
setFieldValue
(
'payments'
,
[])
// 变动后先 清空支付信息
const
shopId
=
ctx
.
getFieldValue
(
'shopId'
)
...
...
@@ -81,6 +83,9 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
}
fetchOrderApi
.
getPayInfoList
({
products
:
products
,
memberId
:
productItem
?.
memberId
,
roleId
:
productItem
?.
memberRoleId
,
orderMode
:
orderMode
,
shopId
:
shopId
}).
then
(
data
=>
{
ctx
.
setFieldValue
(
'payments'
,
data
.
map
(
item
=>
({
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/index.tsx
View file @
3a2ec3ac
...
...
@@ -149,9 +149,13 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
const
{
data
}
=
res
const
_orderProductRequests
=
procurementRenderField
(
data
)
setProducts
(
_orderProductRequests
)
setInitFormValue
(()
=>
procurmentRenderInit
(
data
))
const
renderFiels
=
procurmentRenderInit
(
data
)
setInitFormValue
({...
renderFiels
})
setTimeout
(()
=>
{
addSchemaAction
.
setFieldValue
(
'products'
,
_orderProductRequests
)
if
(
renderFiels
?.
timeLine
)
{
addSchemaAction
.
setFieldValue
(
'timeLine'
,
renderFiels
.
timeLine
)
}
},
1000
)
setFormLoading
(
false
)
})
...
...
@@ -254,7 +258,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
id
:
params
.
deliveryAddresId
?.
id
||
params
.
deliveryAddresId
})
params
.
consignee
=
{
deliverDate
:
params
.
deliverDate
,
//
deliverDate: params.deliverDate,
consigneeId
:
addressDetail
.
id
,
consignee
:
addressDetail
.
receiverName
,
provinceCode
:
addressDetail
.
provinceCode
,
...
...
@@ -267,9 +271,11 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
telephone
:
addressDetail
.
tel
,
defaultConsignee
:
!!
addressDetail
.
isDefault
,
}
// 组合配送时间字段
if
(
params
?.
timeLine
)
{
params
.
consignee
.
startTime
=
params
.
timeLine
.
split
(
'-'
)[
0
]
params
.
consignee
.
endTime
=
params
.
timeLine
.
split
(
'-'
)[
1
]
params
.
deliverDate
=
`
${
params
.
deliverDate
}
${
params
.
timeLine
}
`
}
else
{
params
.
deliverDate
=
params
.
deliverDate
}
}
...
...
@@ -290,13 +296,13 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
params
.
shopName
=
shop
[
'label'
]
if
(
id
)
{
// fnResult = await PublicApi.postOrderBuyerCreateB2b
Update({..._params, orderId: id})
fnResult
=
await
PublicApi
.
postOrderBuyerCreate
Update
({...
_params
,
orderId
:
id
})
}
else
{
fnResult
=
await
PublicApi
.
postOrder
VendorCreateAgentOrder
(
_params
)
fnResult
=
await
PublicApi
.
postOrder
BuyerCreatePurchase
(
_params
)
}
if
(
fnResult
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
push
(
"/memberCenter/tranactionAbility/
saleOrder/orderList
"
)
history
.
push
(
"/memberCenter/tranactionAbility/
purchaseOrder/readyAddCashOrder
"
)
},
1000
)
}
else
{
setBtnLoading
(
false
)
...
...
@@ -313,7 +319,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
memberRef
.
current
.
setVisible
(
true
)
}
const
orderMember
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
<
div
className=
'connectBtn'
onClick=
{
handleOrderMember
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
const
orderMember
=
pageStatus
===
PageStatus
.
ADD
?
<
div
className=
'connectBtn'
onClick=
{
handleOrderMember
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
:
null
// @todo 未实现金额合计
const
couponAddButton
=
<
Button
onClick=
{
()
=>
productRef
.
current
.
setVisible
(
true
)
}
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择优惠券
</
Button
>
...
...
@@ -382,16 +388,11 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
}
}
effects=
{
(
$
,
ctx
)
=>
{
$
(
'onFormMount'
).
subscribe
(()
=>
{
// if (id || modelType)
{
// ctx.setFieldState('orderMode', state =>
{
// state.editable = false
//
})
//
}
// if (id)
{
// ctx.setFieldState('shopId', state =>
{
// state.editable = false
//
})
//
}
if
(
id
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
state
.
editable
=
false
})
}
})
useOrderFormInitEffect
(
ctx
)
useEditHideField
()
...
...
@@ -429,14 +430,16 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
console
.
log
(
state
,
'shop'
)
// 初始化 配送时间段处理
useOrderDeliverTimeEffect
(
ctx
,
state
.
value
)
const
data
=
await
fetchOrderApi
.
getOrderModeOrderType
({
shopType
:
state
.
values
[
1
][
'type'
]})
ctx
.
setFieldValue
(
'orderMode'
,
data
.
orderMode
)
ctx
.
setFieldValue
(
'orderModeName'
,
data
.
orderModeName
)
ctx
.
setFieldValue
(
'type'
,
data
.
orderTypeName
)
ctx
.
reset
({
validate
:
false
,
selector
:
'*(products,payments)'
})
if
(
!
id
)
{
const
data
=
await
fetchOrderApi
.
getOrderModeOrderType
({
shopType
:
state
.
values
[
1
][
'type'
]})
ctx
.
setFieldValue
(
'orderMode'
,
data
.
orderMode
)
ctx
.
setFieldValue
(
'orderModeName'
,
data
.
orderModeName
)
ctx
.
setFieldValue
(
'type'
,
data
.
orderTypeName
)
ctx
.
reset
({
validate
:
false
,
selector
:
'*(products,payments)'
})
}
})
}
}
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/model/usePaymentInfo.tsx
View file @
3a2ec3ac
...
...
@@ -26,7 +26,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const
initPayWayList
=
(
memberId
,
memberRoleId
)
=>
{
let
result
=
[]
PublicApi
.
getOrder
VendorCreateAgent
PayTypes
({
vendorMemberId
:
memberId
,
vendorRoleId
:
memberRoleId
}).
then
(
res
=>
{
PublicApi
.
getOrder
BuyerCreateB2b
PayTypes
({
vendorMemberId
:
memberId
,
vendorRoleId
:
memberRoleId
}).
then
(
res
=>
{
const
{
data
=
[],
code
}
=
res
for
(
let
item
of
data
)
{
result
.
push
({
...
...
@@ -40,8 +40,11 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const
getPayLists
=
(
memberId
,
memberRoleId
)
=>
{
PublicApi
.
postOrderVendorCreateAgentPaymentFind
({
PublicApi
.
postOrderBuyerCreateB2bPaymentFind
({
memberId
,
roleId
:
memberRoleId
,
shopId
:
products
[
0
][
'shopId'
],
orderMode
:
products
[
0
][
'orderMode'
],
products
:
products
.
map
(
item
=>
({
productId
:
item
.
commodityId
,
skuId
:
item
.
id
}))
},
{
ctlType
:
'none'
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/model/useProductTable.tsx
View file @
3a2ec3ac
...
...
@@ -7,8 +7,6 @@ import { useModalTable } from './useModalTable';
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
OrderModalType
}
from
'@/constants/order'
;
const
{
pageStatus
}
=
usePageStatus
()
let
orderMode
=
null
;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
...
...
@@ -22,6 +20,7 @@ export const sortByKey = (params) => {
}
export
const
getUnitPriceTotal
=
(
record
)
=>
{
const
{
pageStatus
}
=
usePageStatus
()
const
purchaseCount
=
Number
(
record
[
'purchaseCount'
])
||
0
// fix 当没有传递unitPrice字段时 自动容错, 单价显示为0
// fix 编辑订单取price
...
...
@@ -71,6 +70,7 @@ export const getUnitPriceTotal = (record) => {
export
const
useProductTable
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
const
productRef
=
useRef
<
any
>
({})
const
{
visible
,
setVisible
,
rowSelection
,
rowSelectionCtl
}
=
useModalTable
({
type
:
'checkbox'
})
const
{
pageStatus
}
=
usePageStatus
()
orderMode
=
ctx
.
getFieldValue
(
'orderMode'
)
...
...
@@ -113,6 +113,8 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
// }
}
productInfoColumns
[
7
].
formItemProps
=
{
disabled
:
false
}
}
else
{
// 渲染单价
productInfoColumns
[
5
].
render
=
(
t
,
r
)
=>
<
span
style=
{
{
color
:
'red'
}
}
>
¥
{
r
.
price
}
</
span
>
...
...
@@ -120,6 +122,9 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
// 渲染商品ID
productInfoColumns
[
0
].
render
=
(
t
,
r
)
=>
r
.
productId
// 禁用编辑
productInfoColumns
[
7
].
formItemProps
=
{
disabled
:
true
}
return
[...
productInfoColumns
].
slice
(
0
,
productInfoColumns
.
length
-
1
)
}
...
...
@@ -134,7 +139,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
}
const
productAddButton
=
<
Button
onClick=
{
handleShowProduct
}
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
const
productAddButton
=
pageStatus
===
PageStatus
.
ADD
?
<
Button
onClick=
{
handleShowProduct
}
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
:
null
const
productComponents
=
{
body
:
{
row
:
ProductEditableRow
,
...
...
src/pages/transaction/purchaseOrder/readyAddCashOrder/index.tsx
View file @
3a2ec3ac
...
...
@@ -18,11 +18,11 @@ import '../index.less'
export
interface
ReadyAddCashOrderProps
{}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrderBuyerCreatePage
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrderBuyerCreateP
urchaseP
age
(
params
)
return
data
}
const
ReadyAddCashOrder
:
React
.
FC
<
ReadyAddCashOrderProps
>
=
(
props
)
=>
{
const
ReadyAddCashOrder
:
React
.
FC
<
ReadyAddCashOrderProps
>
=
()
=>
{
const
{
run
:
deleteRun
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCreateDeleteBatch
)
const
{
loading
:
submitLoading
,
run
:
submitRun
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCreateSubmitBatch
)
const
{
columns
,
ref
,
rowSelection
,
rowSelectionCtl
}
=
useSelfTable
()
...
...
src/pages/transaction/purchaseOrder/readyAddCashOrder/model/useReadyAddOrder.tsx
View file @
3a2ec3ac
...
...
@@ -21,9 +21,7 @@ export const useSelfTable = () => {
}
const
handleEdit
=
(
record
:
any
)
=>
{
const
{
orderType
}
=
record
// orderType 询价报价/现货采购跳转b2b修改
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/
${(
orderType
===
1
||
orderType
===
3
)
?
'b2b'
:
'srm'
}
/edit?id=
${
record
.
orderId
}
`
)
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyAddCashOrder/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