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
b9d07be6
Commit
b9d07be6
authored
Jan 19, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理商品编辑已选择的货品回显异常
parent
f7e929cd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
41 deletions
+15
-41
classAndProperty.ts
src/locales/zh-CN/classAndProperty.ts
+1
-1
index.tsx
src/pages/classAndProperty/attribute/index.tsx
+1
-2
index.tsx
src/pages/classAndProperty/class/index.tsx
+2
-2
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+1
-3
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+8
-32
index.tsx
...ges/transaction/purchaseOrder/readyDelevedOrder/index.tsx
+1
-1
index.ts
src/store/product/index.ts
+1
-0
No files found.
src/locales/zh-CN/classAndProperty.ts
View file @
b9d07be6
...
...
@@ -157,7 +157,7 @@ export default {
'classAndProperty.class.connectCategory'
:
'关联'
,
'classAndProperty.class.title'
:
'品类'
,
'classAndProperty.class.h3'
:
'选择要编辑的品类'
,
'classAndProperty.class.h3.button'
:
'
平台
品类同步'
,
'classAndProperty.class.h3.button'
:
'品类同步'
,
'classAndProperty.class.h3.tooltip'
:
'同步平台维护的品类,同步时按品类结构进行同步。'
,
'classAndProperty.class.h3.none'
:
'暂无菜单, 开始新增'
,
...
...
src/pages/classAndProperty/attribute/index.tsx
View file @
b9d07be6
...
...
@@ -245,9 +245,8 @@ const Attribute: React.FC<{}> = () => {
{
intl
.
formatMessage
({
id
:
'classAndProperty.attribute.actions.button.1'
})
}
</
Button
>
<
span
>
<
Button
type=
"default"
style=
{
{
marginLeft
:
16
}
}
onClick=
{
syncAttribute
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.attribute.actions.button.2'
})
}
</
Button
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'classAndProperty.attribute.actions.tooltip'
})
}
>
<
QuestionCircleOutlined
/
>
<
Button
type=
"default"
style=
{
{
marginLeft
:
16
}
}
onClick=
{
syncAttribute
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.attribute.actions.button.2'
})
}
</
Button
>
</
Tooltip
>
</
span
>
</
Space
>
...
...
src/pages/classAndProperty/class/index.tsx
View file @
b9d07be6
...
...
@@ -4,6 +4,7 @@ import { Row, Col, Tooltip, Popconfirm, Button, Card, message, Modal } from 'ant
import
{
LinkOutlined
,
QuestionCircleOutlined
,
SyncOutlined
,
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
TabTree
,
{
useTreeActions
,
createTreeActions
}
from
'@/components/TabTree'
;
...
...
@@ -195,9 +196,8 @@ const ClassProperty: React.FC<{}> = () => {
<
p
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
}
}
>
<
h3
className=
"mb-30"
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.class.h3'
})
}
</
h3
>
<
p
>
<
Button
type=
"default"
onClick=
{
asyncClass
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.class.h3.button'
})
}
</
Button
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'classAndProperty.class.h3.tooltip'
})
}
>
<
QuestionCircleOutlined
/
>
<
Button
type=
"default"
icon=
{
<
SyncOutlined
/>
}
onClick=
{
asyncClass
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.class.h3.button'
})
}
</
Button
>
</
Tooltip
>
</
p
>
</
p
>
...
...
src/pages/classAndProperty/propertyValue/index.tsx
View file @
b9d07be6
...
...
@@ -115,7 +115,6 @@ const PropertyValue: React.FC<{}> = () => {
treeActions
.
setExpandedKeys
([
evilKey
])
setCustomExpandkeys
([
evilKey
])
treeActions
.
setSelectKeys
([
evilKey
])
console
.
log
(
evilKey
,
'展开的key'
)
}
},
[])
...
...
@@ -337,9 +336,8 @@ const PropertyValue: React.FC<{}> = () => {
<
p
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
}
}
>
<
h3
className=
"mb-30"
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.propertyValue.h3'
})
}
</
h3
>
<
p
>
<
Button
type=
"default"
onClick=
{
asyncClass
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.propertyValue.h3.button'
})
}
</
Button
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'classAndProperty.propertyValue.h3.tooltip'
})
}
>
<
QuestionCircleOutlined
/
>
<
Button
type=
"default"
onClick=
{
asyncClass
}
>
{
intl
.
formatMessage
({
id
:
'classAndProperty.propertyValue.h3.button'
})
}
</
Button
>
</
Tooltip
>
</
p
>
</
p
>
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
b9d07be6
...
...
@@ -80,26 +80,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
isRecombination
}
=
ProductStore
// const memoizedValue = useMemo(() => {
// let len = combineAttributeArray.length
// console.log(len, combineAttributeChangeFatories)
// // 第一次构建先和编辑数据比对
// // if(updateFlag){
// // if(len === productInfoByEdit?.unitPriceAndPicList.length){
// // return false
// // } else {
// // return true
// // }
// // }
// if(len === combineAttributeChangeFatories){
// return false
// }else{
// setCombineAttributeChangeFatories(len)
// return true
// }
// } , [combineAttributeArray.length]) // 监听属性组合是否有变动(由属性组合引发数据构建清空价格)
// // *todo* 不点击本页面之前就变更了价格属性 这里的属性组合监听就失效了
useEffect
(()
=>
{
let
len
=
combineAttributeArray
?.
length
if
(
len
)
{
...
...
@@ -118,7 +98,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
clearPrice
.
current
=
true
}
}
// console.log(len, combineAttributeChangeFatories, `是否初次构建|${updateFlag.current}`, clearPrice.current, '监听前后属性条目的变动')
},
[
combineAttributeArray
?.
length
])
_tableDataSource
=
useMemo
(()
=>
tableDataSource
,
[
tableDataSource
])
// 保持最新值
...
...
@@ -251,20 +230,17 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
dataIndex
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
}),
key
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
}),
width
:
360
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
<
Select
style=
{
{
width
:
'100%'
}
}
defaultValue=
{
text
}
value=
{
text
}
onChange=
{
(
v
)
=>
{
tableSelelctChange
(
v
,
record
)
}
}
>
{
selectedGoods
.
length
>
0
&&
selectedGoods
.
map
(
_item
=>
(
<
Option
key=
{
_item
.
id
}
value=
{
_item
.
id
}
>
{
_item
.
code
}
/
{
_item
.
name
}
/
{
_item
.
type
}
/¥
{
_item
.
costPrice
}
</
Option
>
))
}
</
Select
>
</>
render
:
(
text
,
record
)
=>
<
Select
style=
{
{
width
:
'100%'
}
}
defaultValue=
{
text
}
value=
{
text
}
onChange=
{
(
v
)
=>
{
tableSelelctChange
(
v
,
record
)
}
}
>
{
selectedGoods
.
length
>
0
&&
selectedGoods
.
map
(
_item
=>
(
<
Option
key=
{
_item
.
id
}
value=
{
_item
.
id
}
>
{
_item
.
code
}
/
{
_item
.
name
}
/
{
_item
.
type
}
/¥
{
_item
.
costPrice
}
</
Option
>
))
}
</
Select
>
})
}
if
(
_attributeNameArr
?.
length
>
0
)
{
console
.
log
(
_attributeNameArr
,
_tableDataSource
,
'_attributeNameArr'
,
_attributeValueArr
)
_attributeNameArr
.
map
((
_attr
,
_i
)
=>
{
// 同索引下 属性值为空表示前面属性组合值为空
// _attributeValueArr[_i][0] &&
...
...
@@ -340,6 +316,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if
(
isRecombination
)
{
_tempObj
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
})]
=
selectedGoods
.
length
>
0
?
selectedGoods
[
0
].
id
:
0
}
else
{
console
.
log
(
_rowArr
,
i
,
productInfoByEdit
.
unitPriceAndPicList
,
_tableDataSource
,
'good_ID'
)
_tempObj
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
})]
=
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
goods
?.
id
?
productInfoByEdit
.
unitPriceAndPicList
[
i
].
goods
.
id
:
0
}
// 通过 isUpdateAttribute 判断是否需要携带unitPriceAndPicList的id字段
...
...
@@ -640,7 +617,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
* @param objectArray
* @param {string} property
*/
const
groupBy
=
(
objectArray
,
property
)
=>
{
return
objectArray
.
reduce
(
function
(
acc
,
obj
)
{
let
key
=
obj
[
property
];
...
...
src/pages/transaction/purchaseOrder/readyDelevedOrder/index.tsx
View file @
b9d07be6
...
...
@@ -127,7 +127,7 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
const
renderOptionButton
=
(
record
:
any
)
=>
{
const
buttonGroup
=
{
[
intl
.
formatMessage
({
id
:
'purchaseOrder.operation2'
})]:
record
.
showAfterSales
,
[
intl
.
formatMessage
({
id
:
'purchaseOrder.operation5'
})]:
record
.
showInvit
e
,
[
intl
.
formatMessage
({
id
:
'purchaseOrder.operation5'
})]:
tru
e
,
}
const
operationHandler
=
{
...
...
src/store/product/index.ts
View file @
b9d07be6
...
...
@@ -160,6 +160,7 @@ class ProductStore implements IProductModule {
this
.
selectCategoryId
=
null
;
this
.
selectBrandId
=
null
;
this
.
productPriceType
=
null
;
this
.
isRecombination
=
false
;
}
// 编辑时 品类变更 清空部分数据
...
...
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