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
5b017c0d
Commit
5b017c0d
authored
Mar 29, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix0218' into fix418
parents
c3aa0556
add545db
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
285 additions
and
57 deletions
+285
-57
Jenkinsfile
Jenkinsfile
+0
-1
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+0
-0
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+4
-3
logisticsForm.tsx
...ages/commodity/products/addProductsItem/logisticsForm.tsx
+2
-2
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+2
-6
index.tsx
src/pages/commodity/products/constant/index.tsx
+75
-0
index.tsx
src/pages/commodity/products/index.tsx
+192
-36
index.ts
src/store/product/index.ts
+10
-9
No files found.
Jenkinsfile
View file @
5b017c0d
#
!
groovy
// http://183.3.136.70:33973/project/linkseeks-design/platform/v2-220318
// http://183.3.136.70:33973/project/linkseeks-design/platform/v2
pipeline
{
...
...
src/pages/commodity/products/addProducts.tsx
View file @
5b017c0d
This diff is collapsed.
Click to expand it.
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
5b017c0d
...
...
@@ -108,8 +108,8 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
},
[])
useEffect
(()
=>
{
const
{
id
}
=
history
.
location
.
query
if
(
id
&&
getBasicFormParamsByEdit
?.
name
)
{
const
{
id
,
draftId
}
=
history
.
location
.
query
if
(
(
id
||
draftId
)
&&
getBasicFormParamsByEdit
?.
name
)
{
handleBrandSearch
(
getBasicFormParamsByEdit
.
brandName
)
onCustomerCategoryChange
(
getBasicFormParamsByEdit
.
customerCategoryId
)
// 赋[]初值 显示一行区域选择
...
...
@@ -157,7 +157,8 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
setSelectCategoryId
(
seletCategoryId
)
setSendCycle
(
data
?.
sendCycle
||
0
)
})
}
else
{
}
else
{
setShowCategory
(
null
)
}
}
...
...
src/pages/commodity/products/addProductsItem/logisticsForm.tsx
View file @
5b017c0d
...
...
@@ -33,7 +33,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const
[
banCarriageType
,
setBanCarriageType
]
=
useState
(
false
)
const
[
template
,
setTemplate
]
=
useState
(
false
)
// 是否必填运费模板
const
{
productInfoByEdit
,
selectCategoryId
,
productPriceType
,
isCrossBorder
,
sendCycle
}
=
ProductStore
const
{
productInfoByEdit
,
selectCategoryId
,
productPriceType
,
isCrossBorder
,
sendCycle
,
isCrossBorder
}
=
ProductStore
useEffect
(()
=>
{
//传入ref给父级
...
...
@@ -89,13 +89,13 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
}
},
[
productPriceType
])
useEffect
(()
=>
{
logisticsForm
.
setFieldsValue
({
sendCycle
:
sendCycle
})
},
[
sendCycle
])
useEffect
(()
=>
{
if
(
isCrossBorder
)
{
logisticsForm
.
setFieldsValue
({
deliveryType
:
1
})
changeDeliveryType
({
target
:
{
value
:
1
}})
}
},
[
isCrossBorder
])
useEffect
(()
=>
{
logisticsForm
.
setFieldsValue
({
sendCycle
:
sendCycle
})
},
[
sendCycle
])
const
changeDeliveryType
=
(
e
)
=>
{
setDeliveryType
(
e
.
target
.
value
)
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
5b017c0d
...
...
@@ -67,7 +67,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
productName
,
selectedGoods
,
productSelectAttribute
,
setProductSelectAttribute
,
tableDataSource
,
setTableDataSource
,
clearData
,
...
...
@@ -75,8 +74,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
productInfoByEdit
,
getPriceAttributeFormParamsByEdit
,
selectCategoryId
,
productAttributeAndImageParams
,
tabClickItem
,
setProductPriceType
,
isRecombination
,
isCrossBorder
,
...
...
@@ -304,8 +301,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
return
(
<>
<
Button
type=
'link'
onClick=
{
()
=>
clickSetPrice
(
record
)
}
>
{
planPrice
===
3
?
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.button.1'
})
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.button.2'
})
}
</
Button
>
{
/* @todo 删除一行 */
}
{
/* <Button type='link' onClick={() => deleteSetPrice(record)}>{intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.button.3' })}</Button> */
}
<
Button
type=
'link'
onClick=
{
()
=>
deleteSetPrice
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.button.3'
})
}
</
Button
>
</>
)
}
...
...
@@ -333,7 +329,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
:
_tempObj
[
_attributeNameArr
[
i
]
||
_attributeNameArr
[
0
]]
=
_rowArr
// 当一项变动的时候 找_attributeNameArr可能会找不到 找不到的情况下置为索引0的那项
if
(
history
.
location
.
query
?.
id
)
{
if
(
history
.
location
.
query
?.
id
||
history
.
location
.
query
?.
draftId
)
{
// 编辑的时候,先指定数据中的货品id,如果是重新组合的不存在id就使用选择的货品中的第一个,如果没有置为0;同理,不存在单价就置为{}
if
(
isRecombination
)
{
_tempObj
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
})]
=
selectedGoods
.
length
>
0
?
selectedGoods
[
0
].
id
:
0
...
...
src/pages/commodity/products/constant/index.tsx
View file @
5b017c0d
...
...
@@ -318,3 +318,78 @@ export const upperCommoditySchema: ISchema = {
}
}
}
export
const
filterUsefulData
=
(
data
)
=>
{
// 仅获取表单所需要的字段数据
return
{
name
:
data
.
name
,
brand
:
data
.
brand
,
customerCategory
:
data
.
customerCategory
,
slogan
:
data
.
slogan
,
sellingPoint
:
data
.
sellingPoint
||
[],
commodityAreaList
:
data
.
commodityAreaList
,
isUpdateAttribute
:
data
.
isUpdateAttribute
,
unitId
:
data
.
unitId
,
unitName
:
data
.
unitName
,
subUnitId
:
data
.
subUnitId
,
subUnitName
:
data
.
subUnitName
,
minOrder
:
data
.
minOrder
,
isMemberPrice
:
data
.
isMemberPrice
,
priceType
:
data
.
priceType
,
commodityAttributeList
:
data
.
commodityAttributeList
,
unitPriceAndPicList
:
data
.
unitPriceAndPicList
,
isAllAttributePic
:
data
.
isAllAttributePic
,
commodityRemark
:
data
.
commodityRemark
,
logistics
:
data
.
logistics
,
isInvoice
:
data
.
isInvoice
,
marks
:
data
.
marks
,
packing
:
data
.
packing
,
afterService
:
data
.
afterService
,
isTax
:
true
,
taxRate
:
data
.
taxRate
,
title
:
data
.
title
,
keywords
:
data
.
keywords
,
description
:
data
.
description
,
type
:
data
.
type
,
createTime
:
data
.
createTime
,
}
}
export
const
filterUsefulDraftData
=
(
data
)
=>
{
console
.
log
(
data
,
'data'
)
return
{
name
:
data
.
name
,
brandId
:
data
.
brandId
,
customerCategoryId
:
data
.
customerCategoryId
,
slogan
:
data
.
slogan
,
sellingPoint
:
data
.
sellingPoint
||
[],
commodityAreaList
:
data
.
commodityAreaList
||
[],
isUpdateAttribute
:
data
.
isUpdateAttribute
,
unitId
:
data
.
unitId
,
unitName
:
data
.
unitName
,
subUnitId
:
data
.
subUnitId
,
subUnitName
:
data
.
subUnitName
,
minOrder
:
data
.
minOrder
,
isMemberPrice
:
data
.
isMemberPrice
,
priceType
:
data
.
priceType
,
commodityAttributeList
:
data
.
commodityAttributeList
||
[],
unitPriceAndPicList
:
data
.
unitPriceAndPicList
||
[],
isAllAttributePic
:
data
.
isAllAttributePic
,
commodityRemark
:
data
.
commodityRemark
,
logistics
:
data
.
logistics
,
isInvoice
:
data
.
isInvoice
,
marks
:
data
.
marks
,
packing
:
data
.
packing
,
afterService
:
data
.
afterService
,
isTax
:
true
,
taxRate
:
data
.
taxRate
,
title
:
data
.
title
,
keywords
:
data
.
keywords
,
description
:
data
.
description
,
type
:
data
.
type
,
createTime
:
data
.
createTime
,
// 是否草稿
draft
:
data
.
draft
,
}
}
src/pages/commodity/products/index.tsx
View file @
5b017c0d
This diff is collapsed.
Click to expand it.
src/store/product/index.ts
View file @
5b017c0d
...
...
@@ -39,14 +39,15 @@ class ProductStore implements IProductModule {
@
computed
public
get
getBasicFormParamsByEdit
():
IBasicFormParam
{
return
{
brandId
:
this
.
productInfoByEdit
?.
brand
?.
i
d
,
brandId
:
this
.
productInfoByEdit
?.
brand
I
d
,
brandName
:
this
.
productInfoByEdit
?.
brand
?.
name
,
name
:
this
.
productInfoByEdit
?.
name
,
slogan
:
this
.
productInfoByEdit
?.
slogan
,
sellingPoint
:
this
.
productInfoByEdit
?.
sellingPoint
,
commodityAreaList
:
this
.
productInfoByEdit
?.
commodityAreaList
.
map
(
item
=>
[
item
.
provinceCode
,
item
.
cityCode
,
item
.
regionCode
]),
customerCategoryId
:
this
.
productInfoByEdit
?.
customerCategory
.
fullId
.
split
(
'.'
).
map
(
item
=>
Number
(
item
)
+
''
),
customerCategoryName
:
this
.
productInfoByEdit
?.
customerCategory
.
fullName
commodityAreaList
:
this
.
productInfoByEdit
?.
commodityAreaList
.
map
(
item
=>
[
item
.
provinceCode
,
item
.
cityCode
]),
// 兼容草稿
customerCategoryId
:
this
.
productInfoByEdit
?.
draft
?
this
.
productInfoByEdit
?.
customerCategoryId
:
this
.
productInfoByEdit
?.
customerCategory
.
fullId
.
split
(
'.'
).
map
(
item
=>
Number
(
item
)
+
''
),
customerCategoryName
:
this
.
productInfoByEdit
?.
customerCategory
?.
fullName
}
}
...
...
@@ -163,6 +164,7 @@ class ProductStore implements IProductModule {
this
.
selectBrandId
=
null
;
this
.
productPriceType
=
null
;
this
.
isRecombination
=
false
;
this
.
sendCycle
=
null
;
this
.
isCrossBorder
=
false
;
}
...
...
@@ -237,17 +239,16 @@ class ProductStore implements IProductModule {
this
.
isRecombination
=
data
}
@
action
.
bound
public
setSendCycle
(
data
:
number
)
{
this
.
sendCycle
=
data
}
// 是否跨境商品
@
action
.
bound
public
setIsCrossBorder
(
data
:
boolean
)
{
this
.
isCrossBorder
=
data
}
@
action
.
bound
public
setSendCycle
(
data
:
number
)
{
this
.
sendCycle
=
data
}
}
export
default
ProductStore
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