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
1bedef78
Commit
1bedef78
authored
Feb 16, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增商品为跨境类型可输入HS编码
parent
5a4a729e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
28 deletions
+129
-28
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+12
-11
logisticsForm.tsx
...ages/commodity/products/addProductsItem/logisticsForm.tsx
+8
-2
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+102
-15
index.ts
src/store/product/index.ts
+7
-0
No files found.
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
1bedef78
...
...
@@ -37,10 +37,10 @@ interface Iprops {
}
interface
AreaParams
{
provinceCode
:
any
;
provinceName
:
any
;
cityCode
:
any
;
cityName
:
any
;
provinceCode
:
string
;
provinceName
:
string
;
cityCode
:
string
;
cityName
:
string
;
}
const
BasicInfoForm
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
...
...
@@ -121,14 +121,14 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
},
[
getBasicFormParamsByEdit
])
const
handleBrandSearch
=
(
value
?:
any
)
=>
{
const
handleBrandSearch
=
(
value
?:
string
)
=>
{
getProductSelectGetSelectBrand
({
name
:
value
||
''
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
const
handleBrandChange
=
(
value
:
any
)
=>
{
const
handleBrandChange
=
(
value
)
=>
{
setBrandValue
(
value
)
setSelectBrandId
(
value
)
}
...
...
@@ -143,7 +143,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
)
}
const
onCustomerCategoryChange
=
(
value
:
any
)
=>
{
const
onCustomerCategoryChange
=
(
value
)
=>
{
let
seletCategoryId
=
value
[
value
.
length
-
1
]
if
(
seletCategoryId
)
{
getProductCustomerGetCustomerCategoryById
({
id
:
seletCategoryId
}).
then
(
res
=>
{
...
...
@@ -158,7 +158,8 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
setShowCategory
(
null
)
}
const
onCommodityAreaChange
=
(
value
:
any
,
selected
:
any
)
=>
{
const
onCommodityAreaChange
=
(
value
,
selected
)
=>
{
console
.
log
(
selected
,
'selected'
)
let
areaParams
:
AreaParams
=
{
provinceCode
:
null
,
provinceName
:
null
,
...
...
@@ -173,7 +174,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
}
}
const
onChangeName
=
(
value
:
any
)
=>
{
const
onChangeName
=
(
value
)
=>
{
setProductName
(
value
)
}
...
...
@@ -222,7 +223,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
},
]
}
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.basicInfoForm.form.customerCategoryName.placeholder'
})
}
disabled=
{
history
.
location
.
query
?.
id
}
defaultValue=
{
productInfoByEdit
.
customerCategory
.
fullName
}
/>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.basicInfoForm.form.customerCategoryName.placeholder'
})
}
disabled=
{
!!
history
.
location
.
query
?.
id
}
defaultValue=
{
productInfoByEdit
.
customerCategory
.
fullName
}
/>
</
Form
.
Item
>
:
<
Form
.
Item
...
...
@@ -237,7 +238,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
>
<
Cascader
allowClear=
{
false
}
disabled=
{
history
.
location
.
query
?.
id
}
disabled=
{
!!
history
.
location
.
query
?.
id
}
options=
{
customerCategoryTree
}
fieldNames=
{
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
}
}
onChange=
{
onCustomerCategoryChange
}
...
...
src/pages/commodity/products/addProductsItem/logisticsForm.tsx
View file @
1bedef78
...
...
@@ -33,7 +33,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
const
[
banCarriageType
,
setBanCarriageType
]
=
useState
(
false
)
const
[
template
,
setTemplate
]
=
useState
(
false
)
// 是否必填运费模板
const
{
productInfoByEdit
,
selectCategoryId
,
productPriceType
}
=
ProductStore
const
{
productInfoByEdit
,
selectCategoryId
,
productPriceType
,
isCrossProduct
}
=
ProductStore
useEffect
(()
=>
{
//传入ref给父级
...
...
@@ -85,6 +85,12 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
}
},
[
productPriceType
])
useEffect
(()
=>
{
if
(
isCrossProduct
)
{
logisticsForm
.
setFieldsValue
({
deliveryType
:
1
})
}
},
[
isCrossProduct
])
const
changeDeliveryType
=
(
e
)
=>
{
setDeliveryType
(
e
.
target
.
value
)
setCarriageType
(
1
)
...
...
@@ -133,7 +139,7 @@ const LogisticsForm: React.FC<Iprops> = (props) => {
},
]
}
>
<
Radio
.
Group
onChange=
{
changeDeliveryType
}
>
<
Radio
.
Group
onChange=
{
changeDeliveryType
}
disabled=
{
isCrossProduct
}
>
<
Radio
value=
{
1
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.1'
})
}
</
Radio
>
<
Radio
value=
{
2
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.2'
})
}
</
Radio
>
<
Radio
value=
{
3
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.logisticsForm.form.deliveryType.option.3'
})
}
</
Radio
>
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
1bedef78
This diff is collapsed.
Click to expand it.
src/store/product/index.ts
View file @
1bedef78
...
...
@@ -31,6 +31,7 @@ class ProductStore implements IProductModule {
@
observable
public
tabClickItem
:
any
[]
=
[];
// tab标签页点击项
@
observable
public
productPriceType
:
any
=
null
;
// 商品价格类型
@
observable
public
isRecombination
:
boolean
=
false
;
// 编辑时 是否重新属性组合
@
observable
public
isCrossProduct
:
boolean
=
false
;
// 跨境商品
/** 计算操作 **/
// 加工接口返回的数据,用户编辑回显数据
...
...
@@ -234,6 +235,12 @@ class ProductStore implements IProductModule {
this
.
isRecombination
=
data
}
// 是否跨境商品
@
action
.
bound
public
setIsCrossProduct
(
data
:
boolean
)
{
this
.
isCrossProduct
=
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