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
869f9342
Commit
869f9342
authored
Nov 25, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理销售订单待审核订单修改价格异常,处理商品修改价格后切换到图片标签异常
parent
701fc12b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+1
-1
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+12
-7
No files found.
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
869f9342
...
...
@@ -111,7 +111,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
setIsAllAttributePic
(
setImageType
)
_priceAttributeParams
=
priceAttributeParams
.
map
((
_item
,
_index
)
=>
{
let
_obj
=
{...
_item
,
goodsId
:
_item
.
goods
.
i
d
}
let
_obj
=
{...
_item
,
goodsId
:
_item
?.
goods
?.
id
||
_item
.
goodsI
d
}
_obj
.
commodityPic
=
maintainImageData
[
_index
]
||
[]
return
_obj
})
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
869f9342
...
...
@@ -95,20 +95,24 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
}
const
[
amountMoney
,
setAmountMoney
]
=
useState
<
number
>
(
amount
||
sum
+
freePrice
)
// useEffect(() => {
// const _sum = orderProductRequests.reduce((prev, next) => prev + Number((next.money || 0)), 0)
// setSum(_sum)
// }, [])
const
[
changeTotal
,
setChangeTotal
]
=
useState
<
boolean
>
(
false
)
// 是否改变总价
// 总计金额
useEffect
(()
=>
{
setAmountMoney
(()
=>
(
sum
*
1000
+
freePrice
*
1000
)
/
1000
)
},
[
sum
,
freePrice
])
useEffect
(()
=>
{
if
(
changeTotal
){
// 执行修改订单运费
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
freePrice
,
type
:
2
})
}
},
[
amountMoney
])
const
handleConfirm
=
()
=>
{
setFreePrice
(
Number
(
modalPriceActions
.
getFieldValue
(
'freePrice'
)
||
0
))
modelRef
.
current
.
setVisible
(
false
)
setChangeTotal
(
true
)
}
useEffect
(()
=>
{
...
...
@@ -294,7 +298,6 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
warehouseRef
=
useRef
<
any
>
({})
// 判断是否可操作当前表格
console
.
log
(
SaleOrderInsideWorkStateTexts
[
data
.
purchaseOrderInteriorState
],
data
,
'data'
)
const
isEditData
=
SaleOrderInsideWorkStateTexts
[
data
.
purchaseOrderInteriorState
]
===
'待审核订单'
const
productComponents
=
{
body
:
{
...
...
@@ -338,12 +341,14 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
handleSave
=
row
=>
{
const
newData
=
[...
orderProductRequests
];
const
index
=
newData
.
findIndex
(
item
=>
row
.
key
===
item
.
key
);
const
index
=
newData
.
findIndex
(
item
=>
row
.
id
===
item
.
id
);
const
item
=
newData
[
index
];
newData
.
splice
(
index
,
1
,
{
...
item
,
...
row
,
});
// 执行修改订单价格
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
data
.
id
,
orderDetailsId
:
row
.
id
,
price
:
row
.
price
,
type
:
1
})
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
...
...
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