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
黄庭坚
jinfa-platform
Commits
93e2bbef
Commit
93e2bbef
authored
Dec 08, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理新增/编辑采购订单只能在物流方式下使用到付,处理销售订单改运费没有更新订单数据,处理待新建入库单单号无法跳转
parent
007661b7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
21 deletions
+48
-21
constant.ts
src/pages/transaction/_public/order/constant.ts
+1
-1
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+6
-11
useSelfTable.tsx
...aseOrder/addPurchaseWarehouseOrder/model/useSelfTable.tsx
+7
-1
index.tsx
...eOrder/orderCollect/components/memberModalTable/index.tsx
+0
-1
index.tsx
...eOrder/orderCollect/components/payInfoTableCell/index.tsx
+1
-2
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+10
-2
usePaymentInfo.tsx
...ction/purchaseOrder/orderCollect/model/usePaymentInfo.tsx
+16
-1
useProductTable.tsx
...tion/purchaseOrder/orderCollect/model/useProductTable.tsx
+0
-1
useSelfTable.tsx
...on/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
+7
-1
No files found.
src/pages/transaction/_public/order/constant.ts
View file @
93e2bbef
...
...
@@ -60,7 +60,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
93e2bbef
...
...
@@ -98,29 +98,24 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
}
const
[
amountMoney
,
setAmountMoney
]
=
useState
<
number
>
(
sumPrice
||
sum
+
freePrice
)
const
[
changeTotal
,
setChangeTotal
]
=
useState
<
boolean
>
(
false
)
// 是否改变总价
// 总计金额
useEffect
(()
=>
{
setAmountMoney
(()
=>
sumPrice
||
(
sum
*
1000
+
freePrice
*
1000
)
/
1000
)
// setAmountMoney(() => (sum*1000 + freePrice*1000)/1000)
},
[
sum
,
freePrice
])
useEffect
(()
=>
{
if
(
changeTotal
){
const
handleConfirm
=
()
=>
{
let
free
=
modalPriceActions
.
getFieldValue
(
'freePrice'
)
setFreePrice
(
Number
(
free
||
0
))
// 执行修改订单运费
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
freePric
e
,
type
:
2
}).
then
(
res
=>
{
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
fre
e
,
type
:
2
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
modelRef
.
current
.
setVisible
(
false
)
reloadFormData
()
}
})
}
},
[
amountMoney
])
const
handleConfirm
=
()
=>
{
setFreePrice
(
Number
(
modalPriceActions
.
getFieldValue
(
'freePrice'
)
||
0
))
modelRef
.
current
.
setVisible
(
false
)
setChangeTotal
(
true
)
}
useEffect
(()
=>
{
// 存在商品 并且有选择收货地址,则开始计算运费
...
...
src/pages/transaction/purchaseOrder/addPurchaseWarehouseOrder/model/useSelfTable.tsx
View file @
93e2bbef
...
...
@@ -53,7 +53,13 @@ export const useSelfTable = () => {
},
{
title
:
'发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
text
,
record
)
=>
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`
}
>
{
text
}
</
Link
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/memberModalTable/index.tsx
View file @
93e2bbef
...
...
@@ -28,7 +28,6 @@ const MemberModalTable:React.FC<MemberModalTableProps> = (props) => {
const
handleConfirm
=
()
=>
{
const
rowItem
=
rowSelectionCtl
.
selectRow
[
0
]
console
.
log
(
rowItem
,
'看会员item有没有member信息'
)
if
(
rowItem
)
{
schemaAction
.
setFieldValue
(
'supplyMembersName'
,
rowItem
.
name
)
schemaAction
.
setFieldValue
(
'supplyMembersId'
,
rowItem
.
memberId
)
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/payInfoTableCell/index.tsx
View file @
93e2bbef
...
...
@@ -65,7 +65,6 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
})
=>
{
const
formItemRef
=
useRef
<
any
>
();
const
{
form
,
childOptions
,
setChildOptions
,
originOptions
}
=
useContext
(
EditableContext
);
const
save
=
async
e
=>
{
try
{
const
values
=
await
form
.
validateFields
();
...
...
@@ -90,7 +89,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
// 支付方式
if
(
dataIndex
===
'payWay'
)
{
return
<
Select
ref=
{
formItemRef
}
options=
{
originOptions
.
map
(
v
=>
({
label
:
v
.
payVal
,
value
:
v
.
payType
}))
}
options=
{
originOptions
.
map
(
v
=>
({
label
:
v
.
payVal
,
value
:
v
.
payType
,
disabled
:
v
?.
disabled
}))
}
// ?? 仅限线下支付下面只有一种方式
onChange=
{
e
=>
{
const
result
=
originOptions
.
find
(
v
=>
e
===
v
.
payType
)
setChildOptions
(
result
.
payList
.
map
(
v
=>
({
label
:
v
.
way
,
value
:
v
.
id
})))
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
93e2bbef
...
...
@@ -129,7 +129,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
return
resultState
})
const
[
paymentColumns
,
paymentComponents
,
paymentSave
]
=
usePaymentInfo
(
addSchemaAction
,
addSchemaAction
.
getFieldValue
(
'supplyMembersId'
))
const
[
paymentColumns
,
paymentComponents
,
paymentSave
]
=
usePaymentInfo
(
addSchemaAction
,
addSchemaAction
.
getFieldValue
(
'supplyMembersId'
),
pageStatus
===
PageStatus
.
ADD
?
addSchemaAction
.
getFieldValue
(
'orderProductRequests'
)
:
initFormValue
.
orderProductRequests
)
const
{
productAddButton
,
productRef
,
productColumns
,
productComponents
,
...
sectionProps
}
=
useProductTable
(
addSchemaAction
)
// 页面进入时, 当前所处的下单模式
...
...
@@ -240,10 +244,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
break
;
}
}
console
.
log
(
fnResult
,
'fnResult'
)
if
(
fnResult
.
code
===
1000
)
{
// 跳转至待新增列表
window
.
sessionStorage
.
removeItem
(
spam_id
)
history
.
replace
(
'/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder'
)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
// history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder')
}
setBtnLoading
(
false
)
}
catch
(
error
)
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/usePaymentInfo.tsx
View file @
93e2bbef
...
...
@@ -6,7 +6,7 @@ import { PublicApi } from '@/services/api'
import
{
ReadyAddOrderDetailContext
}
from
'../../context'
import
{
message
}
from
'antd'
export
const
usePaymentInfo
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
memberId
:
any
):
any
=>
{
export
const
usePaymentInfo
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
memberId
:
any
,
orderProducts
:
any
):
any
=>
{
const
paywayData
=
useRef
<
any
>
({})
const
[
columns
,
setColumns
]
=
useState
<
any
[]
>
(
paymentInformationColumns
)
const
{
productSumPrice
}
=
useContext
(
ReadyAddOrderDetailContext
)
...
...
@@ -75,6 +75,21 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
},
[
memberId
])
useEffect
(()
=>
{
// 当有商品数据传入的时 判断商品只有是物流的才能使用到付
if
(
orderProducts
?.
length
)
{
const
newColumns
=
[...
columns
]
let
options
=
newColumns
[
5
].
formItemProps
.
options
if
(
orderProducts
.
filter
(
item
=>
item
.
deliveryType
===
1
).
length
!==
orderProducts
.
length
)
{
if
(
options
.
filter
(
_item
=>
_item
.
payType
===
4
).
length
)
options
.
filter
(
_item
=>
_item
.
payType
===
4
)[
0
].
disabled
=
true
}
else
{
if
(
options
.
filter
(
_item
=>
_item
.
payType
===
4
).
length
)
options
.
filter
(
_item
=>
_item
.
payType
===
4
)[
0
].
disabled
=
false
}
}
},
[
orderProducts
,
columns
])
const
getPayLists
=
(
memberId
)
=>
{
PublicApi
.
getPayPayWayList
({
memberId
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/useProductTable.tsx
View file @
93e2bbef
...
...
@@ -100,7 +100,6 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
const
handleSave
=
row
=>
{
console
.
log
(
row
,
'row'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
const
newData
=
[...
ctx
.
getFieldValue
(
'orderProductRequests'
)];
const
index
=
newData
.
findIndex
(
item
=>
row
.
id
===
item
.
id
);
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
View file @
93e2bbef
...
...
@@ -64,7 +64,13 @@ export const useSelfTable = () => {
},
{
title
:
'收货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 收货单号跳转
{
title
:
'收货单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
t
,
r
)
=>
r
.
orderDeliveryDetailsId
?
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`
}
>
{
t
}
</
Link
>
:
<
a
href=
{
`https://www.kuaidi100.com/chaxun?nu=${t}`
}
target=
"blank"
>
{
t
}
</
a
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
...
...
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