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
shenshaokai
jinfa-platform
Commits
c7f7d8c8
Commit
c7f7d8c8
authored
Jan 13, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理新增商品无属性异常,处理品类属性弹框清空筛选数据
parent
9256e33b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
8 deletions
+37
-8
index.tsx
src/pages/classAndProperty/attribute/index.tsx
+8
-1
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+16
-5
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+2
-2
index.tsx
...transaction/purchaseOrder/orderCollect/constant/index.tsx
+0
-0
index.tsx
src/utils/index.tsx
+11
-0
No files found.
src/pages/classAndProperty/attribute/index.tsx
View file @
c7f7d8c8
...
...
@@ -23,6 +23,7 @@ import Search from '@/components/NiceForm/components/Search'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
ModalTable
from
'@/components/ModalTable'
import
{
clearModalParams
}
from
'@/utils'
// import styles from './index.less'
const
formActions
=
createFormActions
();
...
...
@@ -220,6 +221,7 @@ const Attribute: React.FC<{}> = () => {
}
setSyncVisible
(
false
)
setSyncLoading
(
false
)
clearModalParams
()
})
}
else
{
message
.
error
(
'请选择需要同步的属性'
)
...
...
@@ -227,6 +229,11 @@ const Attribute: React.FC<{}> = () => {
}
}
const
handleAsyncCancel
=
()
=>
{
setSyncVisible
(
false
)
clearModalParams
()
}
const
Actions
=
(
<
Space
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
{
history
.
push
(
'/memberCenter/commodityAbility/classAndProperty/attribute/add'
)
}
}
>
...
...
@@ -295,7 +302,7 @@ const Attribute: React.FC<{}> = () => {
<
ModalTable
modalTitle=
'同步平台属性'
confirm=
{
handleAsyncOk
}
cancel=
{
()
=>
setSyncVisible
(
false
)
}
cancel=
{
handleAsyncCancel
}
visible=
{
syncVisible
}
columns=
{
columns
}
rowSelection=
{
rowSelection
}
...
...
src/pages/classAndProperty/propertyValue/index.tsx
View file @
c7f7d8c8
...
...
@@ -20,6 +20,7 @@ import Search from '@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
ISchema
}
from
'@formily/antd'
;
import
{
clearModalParams
}
from
'@/utils'
;
const
treeActions
=
createTreeActions
()
...
...
@@ -36,7 +37,7 @@ const syncSchema: ISchema = {
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'属性组名
称
'
,
placeholder
:
'属性组名'
,
align
:
'flex-left'
,
},
},
...
...
@@ -93,7 +94,6 @@ const PropertyValue: React.FC<{}> = () => {
const
[
selectRow
,
setSelectRow
]
=
useState
<
any
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
const
{
treeData
,
resetMenu
...
...
@@ -102,7 +102,6 @@ const PropertyValue: React.FC<{}> = () => {
fetchMenuData
:
fetchAttributeTreeData
,
})
useEffect
(()
=>
{
let
prefix
=
sessionStorage
.
getItem
(
'beforeKeyPrefix'
)
let
beforeKey
=
history
.
location
.
query
.
attrId
...
...
@@ -306,6 +305,7 @@ const PropertyValue: React.FC<{}> = () => {
}
setSyncVisible
(
false
)
setSyncLoading
(
false
)
clearModalParams
()
})
}
else
{
message
.
error
(
'请选择需要同步的属性值'
)
...
...
@@ -313,6 +313,17 @@ const PropertyValue: React.FC<{}> = () => {
}
}
const
handleAsyncCancel
=
()
=>
{
clearModalParams
()
setSyncVisible
(
false
)
}
// const clearModalParams = () => {
// let currentState = JSON.parse(sessionStorage.getItem("currentState"))
// let result = {...currentState, queryParams: {}, current: 1}
// sessionStorage.setItem("currentState", JSON.stringify(result))
// }
return
<
PageHeaderWrapper
>
<
Row
gutter=
{
[
24
,
36
]
}
>
<
Col
span=
{
8
}
>
...
...
@@ -395,9 +406,9 @@ const PropertyValue: React.FC<{}> = () => {
</
Row
>
<
ModalTable
modalTitle=
'同步平台属性'
modalTitle=
'同步平台属性
值
'
confirm=
{
handleAsyncOk
}
cancel=
{
()
=>
setSyncVisible
(
false
)
}
cancel=
{
handleAsyncCancel
}
visible=
{
syncVisible
}
columns=
{
syncColumns
}
rowSelection=
{
rowSelection
}
...
...
src/pages/commodity/products/addProducts.tsx
View file @
c7f7d8c8
...
...
@@ -288,13 +288,13 @@ const AddProducts: React.FC<{}> = (props) => {
// 校验属性单位重量是否提供发票
try
{
if
(
!
_params
.
commodityAttributeList
.
length
||
!
_params
?.
unitId
||
typeof
(
_params
.
isInvoice
)
!==
'boolean'
||
!
_params
?.
logistics
?.
weight
){
// if(!_params.commodityAttributeList.length || !_params?.unitId || typeof(_params.isInvoice) !== 'boolean' || !_params?.logistics?.weight){
if
(
!
_params
?.
unitId
||
typeof
(
_params
.
isInvoice
)
!==
'boolean'
||
(
_params
.
logistics
.
deliveryType
===
1
&&
!
_params
.
logistics
?.
weight
)){
throw
new
Error
(
'请完善商品其他信息!'
)
}
}
catch
(
e
)
{
return
e
}
console
.
log
(
!
_params
.
commodityAttributeList
.
length
&&
!
_params
?.
unitId
&&
typeof
(
_params
.
isInvoice
)
!==
'boolean'
&&
!
_params
?.
logistics
?.
weight
,
_params
,
'123456'
)
// 校验价格
try
{
if
(
_params
.
unitPriceAndPicList
){
...
...
src/pages/transaction/purchaseOrder/orderCollect/constant/index.tsx
View file @
c7f7d8c8
This diff is collapsed.
Click to expand it.
src/utils/index.tsx
View file @
c7f7d8c8
...
...
@@ -526,6 +526,17 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
return
index
;
};
/**
* 清空当前存储在 sessionStorage 中的筛选参数
* 适用于重置 模态框筛选数据
*/
export
const
clearModalParams
=
()
=>
{
let
currentState
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"currentState"
))
let
result
=
{...
currentState
,
queryParams
:
{},
current
:
1
}
sessionStorage
.
setItem
(
"currentState"
,
JSON
.
stringify
(
result
))
}
export
default
{
isArray
,
isObject
,
...
...
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