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
a157da16
Commit
a157da16
authored
Sep 15, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加交易规则列表页
parent
7ccac348
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
383 additions
and
18 deletions
+383
-18
commodityRoute.ts
config/routes/commodityRoute.ts
+2
-2
tranactionRoute.ts
config/routes/tranactionRoute.ts
+14
-1
menu.ts
src/locales/zh-CN/menu.ts
+2
-0
selectProduct.tsx
...pages/commodity/products/addChannelItem/selectProduct.tsx
+1
-0
setPrice.tsx
src/pages/commodity/products/addChannelItem/setPrice.tsx
+2
-2
channelSchema.tsx
src/pages/commodity/products/schema/channelSchema.tsx
+6
-6
viewDirectChannel.tsx
src/pages/commodity/products/viewDirectChannel.tsx
+1
-6
index.tsx
src/pages/trademark/index.tsx
+1
-1
addRule.tsx
src/pages/transaction/transactionRules/addRule.tsx
+57
-0
RuleSetting.tsx
...s/transaction/transactionRules/components/RuleSetting.tsx
+0
-0
index.tsx
src/pages/transaction/transactionRules/effects/index.tsx
+51
-0
index.less
src/pages/transaction/transactionRules/index.less
+56
-0
index.tsx
src/pages/transaction/transactionRules/index.tsx
+190
-0
index.tsx
src/pages/transaction/transactionRules/schema/index.tsx
+0
-0
No files found.
config/routes/commodityRoute.ts
View file @
a157da16
...
...
@@ -67,7 +67,7 @@ const CommodityRoute = {
{
path
:
'/memberCenter/commodityAbility/trademark'
,
name
:
'trademark'
,
key
:
'trademark'
,
//
key: 'trademark',
icon
:
'smile'
,
component
:
'@/pages/trademark'
,
},
...
...
@@ -165,7 +165,7 @@ const CommodityRoute = {
{
path
:
'/memberCenter/commodityAbility/repositories'
,
name
:
'repositories'
,
key
:
'repositories'
,
//
key: 'repositories',
icon
:
'smile'
,
component
:
'./repositories'
,
},
...
...
config/routes/tranactionRoute.ts
View file @
a157da16
...
...
@@ -177,7 +177,20 @@ const TranactionRoute = {
component
:
'@/pages/transaction/purchaseOrder/readyAddOrder/detail'
},
]
}
},
// 交易规则
{
path
:
'/memberCenter/tranactionAbility/transactionRules'
,
name
:
'transactionRules'
,
component
:
'@/pages/transaction/transactionRules'
,
},
{
path
:
'/memberCenter/tranactionAbility/transactionRules/addRule'
,
name
:
'addRule'
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/transactionRules/addRule'
,
},
]
}
...
...
src/locales/zh-CN/menu.ts
View file @
a157da16
...
...
@@ -119,6 +119,8 @@ export default {
'menu.tranactionAbility.stockSellStorage.bills'
:
'单据'
,
'menu.tranactionAbility.stockSellStorage.addBills'
:
'新增单据'
,
'menu.tranactionAbility.stockSellStorage.inventory'
:
'库存'
,
'menu.tranactionAbility.transactionRules'
:
'交易规则'
,
'menu.tranactionAbility.addRule'
:
'新增交易规则'
,
//需求发布
'menu.tranactionAbility.enquirySubmit'
:
'需求发布'
,
...
...
src/pages/commodity/products/addChannelItem/selectProduct.tsx
View file @
a157da16
...
...
@@ -188,6 +188,7 @@ const SelectProduct:React.FC<IProps> = (props) => {
ref=
{
productFormRef
}
name=
"add-channel-origin"
labelAlign=
"left"
colon=
{
false
}
>
<
Form
.
Item
name=
"source"
...
...
src/pages/commodity/products/addChannelItem/setPrice.tsx
View file @
a157da16
...
...
@@ -8,7 +8,6 @@ import {
MinusOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
styles
from
'../index.less'
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -310,6 +309,7 @@ const SetPrice:React.FC<IProps> = (props) => {
form=
{
formPrice
}
name=
"add-channel-discount"
labelAlign=
"left"
colon=
{
false
}
initialValues=
{
{
isMemberPrice
:
true
}
}
>
<
Form
.
Item
...
...
@@ -317,7 +317,7 @@ const SetPrice:React.FC<IProps> = (props) => {
label=
{
<
span
>
会员折扣
<
Tooltip
title=
"
这是一段描述
?"
>
<
Tooltip
title=
"
是否允许会员使用会员折扣价购买当前商品
?"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>
...
...
src/pages/commodity/products/schema/channelSchema.tsx
View file @
a157da16
...
...
@@ -101,23 +101,23 @@ export const channelSchema: ISchema = {
}
],
'x-component-props'
:
{
placeholder
:
'商品
状态
'
,
placeholder
:
'商品
来源
'
,
style
:
{
width
:
'174px'
},
},
},
status
:
{
status
List
:
{
type
:
'string'
,
enum
:
[
{
label
:
'未上架'
,
value
:
4
,
value
:
7
,
},
{
label
:
'上架'
,
label
:
'
已
上架'
,
value
:
5
,
},
{
label
:
'下架'
,
label
:
'
已
下架'
,
value
:
6
,
}
],
...
...
@@ -126,7 +126,7 @@ export const channelSchema: ISchema = {
style
:
{
width
:
'174px'
},
},
},
priceType
:
{
priceType
List
:
{
type
:
'string'
,
enum
:
[
{
...
...
src/pages/commodity/products/viewDirectChannel.tsx
View file @
a157da16
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Space
,
R
adio
,
R
ow
,
Col
,
Descriptions
,
Table
,
Avatar
}
from
'antd'
import
{
Card
,
Space
,
Row
,
Col
,
Descriptions
,
Table
,
Avatar
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
EyeOutlined
,
UserOutlined
}
from
'@ant-design/icons'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
ReutrnEle
from
'@/components/ReturnEle'
import
styles
from
"./index.less"
import
{
PublicApi
}
from
'@/services/api'
...
...
src/pages/trademark/index.tsx
View file @
a157da16
...
...
@@ -126,7 +126,7 @@ const Trademark: React.FC<{}> = () => {
];
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
//
console.log('see')
history
.
push
(
`/memberCenter/commodityAbility/trademark/viewBrand?id=
${
record
.
id
}
`
)
}
...
...
src/pages/transaction/transactionRules/addRule.tsx
0 → 100644
View file @
a157da16
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Card
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
SaveOutlined
,
}
from
'@ant-design/icons'
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
'./index.less'
import
{
ruleDetailSchema
}
from
'./schema'
import
{
createFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
findItemAndDelete
,
omit
}
from
'@/utils'
import
{
PublicApi
}
from
'@/services/api'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
RuleSetting
from
'./components/RuleSetting'
const
addSchemaAction
=
createFormActions
()
const
AddRule
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
{
id
,
preview
,
pageStatus
}
=
usePageStatus
()
// 整体表单提交
const
formSubmit
=
async
(
values
)
=>
{
const
params
=
omit
(
values
,
[
'NO_SUBMIT3'
])
if
(
params
[
'applyMember'
])
{
params
[
'applyMember'
]
=
params
[
'applyMember'
].
map
(
v
=>
v
.
memberId
)
}
await
PublicApi
.
postWarehouseFreightSpaceAdd
(
params
)
setTimeout
(()
=>
{
history
.
goBack
(
-
1
)
},
1000
)
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
pageStatus
===
PageStatus
.
PREVIEW
?
'查看交易规则'
:
(
pageStatus
===
PageStatus
.
EDIT
?
'编辑交易规则'
:
'新增交易规则'
)
}
className=
"addRule"
extra=
{
[
<
Button
key=
"1"
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>,
]
}
>
<
Card
className=
''
>
<
RuleSetting
addSchemaAction=
{
addSchemaAction
}
schema=
{
ruleDetailSchema
}
formSubmit=
{
formSubmit
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
AddRule
src/pages/transaction/transactionRules/components/RuleSetting.tsx
0 → 100644
View file @
a157da16
This diff is collapsed.
Click to expand it.
src/pages/transaction/transactionRules/effects/index.tsx
0 → 100644
View file @
a157da16
import
React
,
{
useEffect
}
from
'react'
import
{
ISchemaFormActions
,
FormEffectHooks
,
IFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
const
{
onFieldValueChange$
}
=
FormEffectHooks
export
const
useWarehouseSelect
=
(
context
:
ISchemaFormActions
)
=>
{
onFieldValueChange$
(
'warehouseId'
).
subscribe
(
state
=>
{
// 货品ID
const
goodsId
=
context
.
getFieldValue
(
'productId'
)
const
warehouseId
=
state
.
value
PublicApi
.
getWarehouseInventoryByItemNo
({
warehouseId
,
itemId
:
goodsId
}).
then
(
res
=>
{
const
{
data
}
=
res
context
.
setFieldValue
(
'NO_SUBMIT3'
,
data
.
inventory
)
})
})
}
export
const
createAddRepositoryEffect
=
(
context
:
ISchemaFormActions
)
=>
{
const
fetchWarehouseAll
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getWarehouseWarehouseAll
()
context
.
setFieldState
(
'warehouseId'
,
state
=>
{
state
.
warehouseLists
=
data
})
return
data
.
map
(
v
=>
({
value
:
v
.
id
,
label
:
v
.
name
}))
}
useAsyncSelect
(
'warehouseId'
,
fetchWarehouseAll
)
useWarehouseSelect
(
context
)
}
export
const
useUnitPreview
=
(
initValue
,
context
)
=>
{
useEffect
(()
=>
{
if
(
initValue
)
{
context
.
setFieldState
(
'inventory'
,
state
=>
{
if
(
!
state
.
props
[
'x-props'
])
{
state
.
props
[
'x-props'
]
=
{}
}
state
.
props
[
'x-props'
].
addonAfter
=
<
div
style=
{
{
marginLeft
:
4
}
}
>
{
initValue
.
unit
}
</
div
>
})
context
.
setFieldValue
(
'itemNo'
,
initValue
.
itemNo
)
}
},
[
initValue
])
}
\ No newline at end of file
src/pages/transaction/transactionRules/index.less
0 → 100644
View file @
a157da16
.addRule {
.ant-input-group-addon {
padding: 0;
border: none;
}
.connectBtn {
width: 80px;
height: 32px;
line-height: 32px;
background: #6B778C;
color: #fff;
text-align: center;
cursor: pointer;
}
}
// 添加仓位
.storeItemRadio{
display: flex;
flex-wrap: wrap;
// width: 320px;
margin: 0 auto;
& label{
width: 320px !important;
height: 48px !important;
line-height: 48px !important;
margin: 8px 0;
margin-right: 24px;
}
}
//仓位调拨
.circleAmount{
width: 160px;
height: 160px;
border: 4px solid #edeef2;
background-color: #fafbfc;
border-radius: 50%;
& p{
height: 160px;
line-height: 160px;
text-align: center;
font-size: 20px;
font-weight: bold;
}
}
//查看仓位
.amount{
font-size:24px;
font-weight:bold;
color:rgba(23,43,77,1);
}
\ No newline at end of file
src/pages/transaction/transactionRules/index.tsx
0 → 100644
View file @
a157da16
import
React
,
{
ReactNode
,
useRef
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Popconfirm
,
Card
,
message
,
Dropdown
,
Menu
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PlusOutlined
,
PlayCircleOutlined
,
EyeOutlined
,
PauseCircleOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
moment
from
'moment'
import
EyePreview
from
'@/components/EyePreview'
;
import
{
PublicApi
}
from
'@/services/api'
const
TransactionRules
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
fetchData
=
(
params
:
any
)
=>
{
console
.
log
(
params
,
'params'
)
if
(
!
params
?.
name
)
delete
params
.
name
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getOrderTradingRulesList
(
params
).
then
(
res
=>
{
const
{
data
}
=
res
resolve
(
data
)
})
})
}
// id
// name
// state
// 状态:1.有效 0.无效
// transactionProcess
// operationTime
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'交易规则ID'
,
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'流程规则名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
className
:
'commonPickColor'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/transactionRules/addRule?id=${record.id}&preview=1`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'交易流程名称'
,
dataIndex
:
'transactionProcess'
,
key
:
'transactionProcess'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operationTime'
,
key
:
'operationTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
key
:
'state'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
component
=
(
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
confirm
(
record
)
}
onCancel=
{
cancel
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
style=
{
record
.
state
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
state
?
<>
有效
<
PlayCircleOutlined
/></>
:
<>
无效
<
PauseCircleOutlined
/></>
}
</
Button
>
</
Popconfirm
>
)
return
component
}
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
{
(
record
.
state
===
0
)
?
<>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handelDelete
(
record
)
}
onCancel=
{
cancel
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/transactionRules/addRule?id=${record.id}`
)
}
>
修改
</
Button
>
</>
:
''
}
</>
)
}
}
];
const
confirm
=
(
record
:
any
)
=>
{
PublicApi
.
postOrderTradingRulesUpdateState
({
id
:
record
.
id
,
state
:
record
.
state
?
0
:
1
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
const
cancel
=
()
=>
{
console
.
log
(
'cancel'
)
}
const
handelDelete
=
(
record
:
any
)
=>
{
PublicApi
.
postOrderTradingRulesDelete
({
id
:
record
.
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
})
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
formilyLayouts=
{
{
justify
:
'space-between'
}
}
formilyProps=
{
{
layouts
:
{
order
:
1
,
span
:
4
,
},
ctx
:
{
inline
:
false
,
schema
:
{
type
:
'object'
,
properties
:
{
megaLayout0
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
"x-component-props"
:
{
grid
:
true
,
columns
:
2
,
},
properties
:
{
name
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'规则名称'
,
},
'x-component'
:
'Search'
}
}
}
}
}
}
}
}
formilyChilds=
{
{
layouts
:
{
order
:
0
},
children
:
(
<>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
'/memberCenter/tranactionAbility/transactionRules/addRule'
)
}
>
新建
</
Button
>
</>
)
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
TransactionRules
src/pages/transaction/transactionRules/schema/index.tsx
0 → 100644
View file @
a157da16
This diff is collapsed.
Click to expand it.
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