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
26d75d3f
Commit
26d75d3f
authored
Sep 17, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
90041bc7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
33 deletions
+60
-33
index.ts
src/module/channelProductModule/index.ts
+3
-0
selectProduct.tsx
...pages/commodity/products/addChannelItem/selectProduct.tsx
+5
-1
setPrice.tsx
src/pages/commodity/products/addChannelItem/setPrice.tsx
+2
-1
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+8
-8
viewDirectChannel.tsx
src/pages/commodity/products/viewDirectChannel.tsx
+23
-8
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+1
-1
addRule.tsx
src/pages/transaction/transactionRules/addRule.tsx
+6
-1
index.tsx
src/pages/transaction/transactionRules/schema/index.tsx
+6
-6
index.ts
src/store/channelProduct/index.ts
+6
-7
No files found.
src/module/channelProductModule/index.ts
View file @
26d75d3f
...
...
@@ -19,6 +19,7 @@ export interface IChannelProductModule {
selectedRole
:
IRole
;
tableDataInSetPrice
:
GetProductChannelCommodityGetCommodityUnitPriceResponse
[];
selectChannel
:
any
[];
selectedSource
:
number
;
setProductSelectRowInStore
(
data
:
any
):
void
;
setProductSourceInStore
(
data
:
number
):
void
;
...
...
@@ -27,4 +28,5 @@ export interface IChannelProductModule {
setSelectedRole
(
data
:
IRole
):
void
;
setTableDataInSetPrice
(
data
:
GetProductChannelCommodityGetCommodityUnitPriceResponse
[]):
void
;
setSelectChannel
(
data
:
any
):
void
;
setSelectSource
(
data
:
number
):
void
;
}
\ No newline at end of file
src/pages/commodity/products/addChannelItem/selectProduct.tsx
View file @
26d75d3f
...
...
@@ -46,7 +46,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
const
[
selectProduct
,
setSelectProduct
]
=
useState
<
GetProductChannelCommodityGetCommodityListResponseDetail
[]
>
()
const
{
ChannelProudctStore
}
=
store
const
{
setProductSourceInStore
,
setProductSelectRowInStore
,
setPriceType
,
setProductName
}
=
ChannelProudctStore
const
{
setProductSourceInStore
,
setProductSelectRowInStore
,
setPriceType
,
setProductName
,
setSelectSource
}
=
ChannelProudctStore
const
productColumns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -127,6 +127,10 @@ const SelectProduct:React.FC<IProps> = (props) => {
},
[])
useEffect
(()
=>
{
setSelectSource
(
source
)
},
[
source
])
useEffect
(()
=>
{
console
.
log
(
productRowCtl
.
selectRow
[
0
])
if
(
productRowCtl
.
selectRow
.
length
>
0
){
setPriceType
(
productRowCtl
.
selectRow
[
0
].
priceType
)
...
...
src/pages/commodity/products/addChannelItem/setPrice.tsx
View file @
26d75d3f
...
...
@@ -67,6 +67,7 @@ const SetPrice:React.FC<IProps> = (props) => {
priceType
,
productName
,
productSelectRowInStore
,
selectedSource
,
setTableDataInSetPrice
}
=
ChannelProudctStore
...
...
@@ -86,7 +87,7 @@ const SetPrice:React.FC<IProps> = (props) => {
// 获取商品规格列表
const
fetchSpecData
=
(
params
?:
any
)
=>
{
PublicApi
.
getProductChannelCommodityGetCommodityUnitPrice
({
id
:
productSelectRowInStore
.
id
+
''
}).
then
(
res
=>
{
PublicApi
.
getProductChannelCommodityGetCommodityUnitPrice
({
id
:
productSelectRowInStore
.
id
+
''
,
source
:
selectedSource
}).
then
(
res
=>
{
const
{
data
}
=
res
setOriginTableData
(
data
)
if
(
data
.
length
>
0
)
...
...
src/pages/commodity/products/directChannel.tsx
View file @
26d75d3f
...
...
@@ -91,12 +91,12 @@ const DirectChannel: React.FC<{}> = () => {
},
{
title
:
'价格'
,
dataIndex
:
[
'channelCommodity'
,
'commodity'
,
'min'
]
,
dataIndex
:
'min'
,
key
:
'id'
,
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
let
min
=
reocrd
.
channelCommodity
.
commodity
.
min
let
min
=
reocrd
.
min
let
type
=
reocrd
.
channelCommodity
.
commodity
.
priceType
let
max
=
reocrd
.
channelCommodity
.
commodity
.
max
let
max
=
reocrd
.
max
if
(
type
===
1
){
if
(
max
===
min
)
return
<>
¥
{
min
}
</>
...
...
@@ -150,7 +150,7 @@ const DirectChannel: React.FC<{}> = () => {
},
{
title
:
'状态'
,
dataIndex
:
[
'channelCommodity'
,
'status'
]
,
dataIndex
:
'status'
,
key
:
'id'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
...
...
@@ -169,14 +169,14 @@ const DirectChannel: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
{
(
record
.
channelCommodity
.
status
===
5
)
?
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
0
,
record
.
id
)
}
>
下架
</
Button
>
:
''
}
{
(
record
.
channelCommodity
.
status
===
6
)
?
{
(
record
.
status
===
5
)
?
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
0
,
record
.
id
)
}
>
下架
</
Button
>
:
''
}
{
(
record
.
status
===
6
)
?
<>
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
1
,
record
.
id
)
}
>
上架
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
clickModify
(
record
)
}
>
修改
</
Button
>
</>
:
''
}
{
(
record
.
channelCommodity
.
status
===
7
)
&&
{
(
record
.
status
===
7
)
&&
<>
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
1
,
record
.
id
)
}
>
上架
</
Button
>
<
Dropdown
overlay=
{
...
...
@@ -247,7 +247,7 @@ const DirectChannel: React.FC<{}> = () => {
const
judgeType
=
()
=>
{
let
sourceArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
source
)))
let
priceTypeArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
commodity
.
priceType
)))
let
statusArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
channelCommodity
.
status
)))
let
statusArr
=
Array
.
from
(
new
Set
(
selectRow
.
map
((
item
:
any
)
=>
item
.
status
)))
return
{
isPassJudge
:
sourceArr
.
length
===
1
&&
priceTypeArr
.
length
===
1
&&
statusArr
.
length
===
1
,
source
:
sourceArr
,
...
...
src/pages/commodity/products/viewDirectChannel.tsx
View file @
26d75d3f
...
...
@@ -104,20 +104,35 @@ const ViewDriectChannel: React.FC<{}> = () => {
return
<
span
style=
{
{
padding
:
'2px 5px'
,
background
:
'rgba(244,245,247,1)'
,
borderRadius
:
'4px'
}
}
>
已下架
</
span
>
if
(
status
===
7
)
return
<
span
style=
{
{
color
:
'#E63F3B'
,
padding
:
'2px 5px'
,
background
:
'rgba(255,235,230,1)'
,
borderRadius
:
'4px'
}
}
>
未上架
</
span
>
else
return
null
}
const
content
=
<>
<
Descriptions
colon=
{
true
}
style=
{
{
marginTop
:
50
}
}
>
<
Descriptions
.
Item
label=
"商品状态"
>
{
renderStatus
(
channelDetails
?.
channelCommodity
?.
status
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
channelCommodity
?.
source
===
1
&&
channelDetails
?.
channelCommodity
?.
parentMemberName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"上架商城"
>
{
shopList
.
length
>
0
&&
shopList
.
map
((
item
,
index
)
=>
item
.
isCheck
&&
<
span
key=
{
index
}
>
{
item
.
name
}
</
span
>)
renderStatus
(
channelDetails
?.
status
)
&&
<
Descriptions
.
Item
label=
"商品状态"
>
{
renderStatus
(
channelDetails
?.
status
)
}
</
Descriptions
.
Item
>
}
{
channelDetails
?.
channelCommodity
?.
source
===
1
&&
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
channelCommodity
?.
parentMemberName
}
</
Descriptions
.
Item
>
}
{
channelDetails
?.
channelCommodity
?.
commodity
?.
customerCategory
?.
name
&&
<
Descriptions
.
Item
label=
"商品品类"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
customerCategory
?.
name
}
</
Descriptions
.
Item
>
}
{
shopList
.
length
>
0
&&
<
Descriptions
.
Item
label=
"上架商城"
>
{
shopList
.
map
((
item
,
index
)
=>
item
.
isCheck
&&
<
span
key=
{
index
}
><
img
width=
"24"
height=
"24"
style=
{
{
borderRadius
:
'50%'
,
marginRight
:
4
}
}
src=
{
item
.
logoUrl
}
title=
{
item
.
name
}
alt=
{
item
.
name
}
/></
span
>)
}
</
Descriptions
.
Item
>
}
{
channelDetails
?.
channelCommodity
?.
commodity
?.
brand
?.
name
&&
<
Descriptions
.
Item
label=
"商品品牌"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
brand
?.
name
}
</
Descriptions
.
Item
>
}
{
channelDetails
?.
channelCommodity
?.
commodity
?.
unitName
&&
<
Descriptions
.
Item
label=
"单位"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
unitName
}
</
Descriptions
.
Item
>
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"商品品类"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
customerCategory
?.
name
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"商品品牌"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
brand
?.
name
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"单位"
>
{
channelDetails
?.
channelCommodity
?.
commodity
?.
unitName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"商品ID"
>
{
channelDetails
?.
id
}
</
Descriptions
.
Item
>
</
Descriptions
>
</>
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
26d75d3f
...
...
@@ -210,7 +210,7 @@ const viewProducts: React.FC<{}> = () => {
productDetail
?.
commodityShopList
?.
length
>
0
&&
<
Descriptions
.
Item
label=
"上架商城"
>
{
productDetail
.
commodityShopList
.
map
((
item
,
index
)
=>
<
span
key=
{
index
}
>
{
item
.
name
}
</
span
>)
productDetail
.
commodityShopList
.
map
((
item
,
index
)
=>
<
span
key=
{
index
}
>
<
img
width=
"24"
height=
"24"
style=
{
{
borderRadius
:
'50%'
,
marginRight
:
4
}
}
src=
{
item
.
logoUrl
}
title=
{
item
.
name
}
alt=
{
item
.
name
}
/>
</
span
>)
}
</
Descriptions
.
Item
>
}
...
...
src/pages/transaction/transactionRules/addRule.tsx
View file @
26d75d3f
...
...
@@ -40,7 +40,12 @@ const AddRule:React.FC<{}> = (props) => {
title=
{
pageStatus
===
PageStatus
.
PREVIEW
?
'查看交易规则'
:
(
pageStatus
===
PageStatus
.
EDIT
?
'编辑交易规则'
:
'新增交易规则'
)
}
className=
"addRule"
extra=
{
[
<
Button
key=
"1"
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
<
Button
key=
"1"
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
disabled=
{
pageStatus
===
PageStatus
.
PREVIEW
}
>
保存
</
Button
>,
]
}
...
...
src/pages/transaction/transactionRules/schema/index.tsx
View file @
26d75d3f
...
...
@@ -35,7 +35,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
style
:
{
height
:
'400px'
}
},
properties
:
{
name
:
{
"name"
:
{
type
:
'string'
,
required
:
true
,
title
:
'规则名称'
,
...
...
@@ -49,7 +49,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
}
]
},
transactionProcesssId
:
{
"transactionProcesssId"
:
{
type
:
'string'
,
title
:
'流程选择'
,
required
:
true
,
...
...
@@ -58,7 +58,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
placeholder
:
'请选择交易流程'
,
className
:
'fixed-ant-selected-down'
,
fetchSearch
:
PublicApi
.
getOrderTradingRulesTransactionProcessList
,
}
}
,
},
MEGA_LAYOUT1_1
:
{
type
:
'object'
,
...
...
@@ -68,7 +68,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
wrapperCol
:
24
,
},
properties
:
{
isElectronicContract
:
{
"isElectronicContract"
:
{
type
:
'string'
,
"x-component-props"
:
{
children
:
"使用电子合同"
...
...
@@ -76,7 +76,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"x-component"
:
"checkboxsingle"
,
default
:
false
},
electronicContractId
:
{
"electronicContractId"
:
{
type
:
'string'
,
required
:
true
,
enum
:
[],
...
...
@@ -151,7 +151,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
}
]
},
products
:
{
"products"
:
{
type
:
'array:number'
,
"x-component"
:
'MultTable'
,
"x-component-props"
:
{
...
...
src/store/channelProduct/index.ts
View file @
26d75d3f
...
...
@@ -14,15 +14,9 @@ class ChannelProductStore implements IChannelProductModule {
@
observable
public
tableDataInSetPrice
:
any
[]
=
null
;
@
observable
public
selectedRole
:
IRole
=
null
;
@
observable
public
selectChannel
:
any
=
null
;
@
observable
public
selectedSource
:
number
=
1
;
// 加工接口返回的数据,用户编辑回显数据
// @computed
// public get getBasicFormParamsByEdit(): IBasicFormParam {
// return {
// commodityAreaList: this.productInfoByEdit?.commodityAreaList.map(item => [item.provinceCode, item.cityCode]),
// }
// }
@
action
.
bound
public
setProductSourceInStore
(
data
:
number
)
{
...
...
@@ -59,6 +53,11 @@ class ChannelProductStore implements IChannelProductModule {
this
.
selectChannel
=
data
}
@
action
.
bound
public
setSelectSource
(
data
:
number
){
this
.
selectedSource
=
data
}
}
export
default
ChannelProductStore
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