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
292ad6af
Commit
292ad6af
authored
Sep 10, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'抽取公用组件,修改需求单内部状态和提交按钮判断'
parent
2864314e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
48 deletions
+95
-48
detailFormColumnType.ts
src/pages/transaction/common/detailFormColumnType.ts
+3
-5
tableStatusList.tsx
src/pages/transaction/common/tableStatusList.tsx
+1
-1
platType.tsx
src/pages/transaction/components/platType.tsx
+54
-0
detail.tsx
src/pages/transaction/enquirySubmit/components/detail.tsx
+28
-13
index.tsx
src/pages/transaction/enquirySubmit/components/index.tsx
+5
-4
detail.tsx
src/pages/transaction/enquirySubmit/toAddSubmit/detail.tsx
+4
-25
No files found.
src/pages/transaction/common/detailFormColumnType.ts
View file @
292ad6af
...
...
@@ -3,11 +3,11 @@
* @Date: 2020-08-27 16:27:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-
09 19:50:54
* @LastEditTime: 2020-09-
10 10:22:41
*/
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
moment
from
'moment'
export
const
dockingColumn
=
(
children
?
)
=>
{
export
const
dockingColumn
=
(
children
,
optionChild
)
=>
{
let
columns
:
ColumnType
<
any
>
[]
=
[]
columns
=
[
...
...
@@ -64,9 +64,7 @@ export const dockingColumn = (children?) => {
dataIndex
:
'option'
,
key
:
'option'
,
align
:
'center'
,
render
:(
text
:
any
)
=>
(
'进入店铺'
)
render
:(
text
:
any
,
records
,
index
)
=>
optionChild
?
optionChild
(
text
,
records
,
index
)
:
''
}
]
return
columns
...
...
src/pages/transaction/common/tableStatusList.tsx
View file @
292ad6af
...
...
@@ -41,7 +41,7 @@ export const enquirySearchInteriorState = (text:any) => {
text
===
1
?
component
=
<
Badge
status=
'default'
text=
"新增需求单"
/>:
text
===
2
?
component
=
<
Badge
color=
"#FFC400"
text=
"审核需求单一级"
/>:
text
===
3
?
component
=
<
Badge
color=
"#FFC400"
text=
"审核需求单二级"
/>:
text
===
4
?
component
=
<
Badge
status=
'processing'
text=
"提交需求单"
/>:
text
===
4
?
component
=
<
Badge
status=
'processing'
text=
"
待
提交需求单"
/>:
text
===
5
?
component
=
<
Badge
status=
'success'
text=
"完成"
/>:
text
===
6
?
component
=
<
Badge
status=
'error'
text=
"审核不通过"
/>:
component
=
<
Badge
status=
"default"
text=
"取消需求单"
/>
...
...
src/pages/transaction/components/platType.tsx
0 → 100644
View file @
292ad6af
/*
* @Author: LeeJiancong
* @Date: 2020-09-10 11:00:17
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:17:09
*/
/**
* @description: 需求选择
* @param {type}
* @return {type}
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Space
,
Radio
,
Tooltip
}
from
'antd'
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
export
interface
plarms
{
platType
:
number
;
//类型 1平台 2系统匹配 3会员选择
changePlatform
?:
Function
;
//事件
disabled
?:
boolean
;
}
const
PlatType
:
React
.
FC
<
plarms
>
=
(
props
)
=>
{
return
(
<
Space
size=
{
16
}
>
<
Radio
.
Group
disabled=
{
props
.
disabled
}
value=
{
props
.
platType
}
onChange=
{
(
e
)
=>
props
.
changePlatform
(
e
)
}
>
<
Radio
value=
{
1
}
>
发布至平台
<
Tooltip
title=
"需求发布至企业商城求购频"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
2
}
>
系统匹配
<
Tooltip
title=
"系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、
商品属性、归属地区进行匹配,推荐满足条件的平台会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
3
}
>
指定会员
<
Tooltip
title=
"选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),
需求只发送给指定会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
</
Radio
.
Group
>
</
Space
>
)
}
PlatType
.
defaultProps
=
{
platType
:
1
,
disabled
:
false
}
export
default
PlatType
\ No newline at end of file
src/pages/transaction/enquirySubmit/components/detail.tsx
View file @
292ad6af
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-
09 19:55:49
* @LastEditTime: 2020-09-
10 13:35:50
*/
import
React
,
{
Component
,
useEffect
,
useState
,
ReactNode
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Modal
,
Table
,
Tooltip
,
Input
,
Select
,
Switch
,
Button
,
Popconfirm
,
Card
,
Tag
,
Badge
,
Steps
,
Tabs
,
}
from
'antd'
...
...
@@ -20,8 +20,10 @@ import {PageStatus,usePageStatus} from '@/hooks/usePageStatus'
import
{
dockingColumn
,
externalColumn
,
interiorColumn
}
from
'../../common/detailFormColumnType'
import
moment
from
'moment'
import
style
from
'./index.less'
import
{
interiorState
,
interiorStateTwo
,
enquirySearchInteriorState
,
enquirySearchexternalState
}
from
'../../common/tableStatusList'
import
{
interiorState
,
interiorStateTwo
,
enquirySearchInteriorState
,
enquirySearchexternalState
}
from
'../../common/tableStatusList'
import
statuStyle
from
'../../common/colorTag'
import
PlatType
from
'../../components/platType'
const
{
Step
}
=
Steps
const
{
TabPane
}
=
Tabs
const
data
=
[
...
...
@@ -55,6 +57,7 @@ const detailInfo: React.FC<{}> = () => {
const
[
pagetype
,
setpagetype
]
=
useState
(
history
.
location
.
query
.
page_type
)
let
interiorStateList
=
[]
let
[
isextraOption
,
setIsextraOption
]
=
useState
(
false
)
const
[
platType
,
setplatType
]
=
useState
(
1
)
//需求对接类型
const
[
otherList
,
setotherList
]
=
useState
([])
//动态tab循环
const
[
productSource
,
setproductSource
]
=
useState
([])
//商品列表 新增
let
[
dataInfo
,
setdataInfo
]
=
useState
<
any
>
({
...
...
@@ -104,7 +107,7 @@ const detailInfo: React.FC<{}> = () => {
items
:
[
{
title
:
'采购员'
,
desc
:
'新
建
需求单'
,
desc
:
'新
增
需求单'
,
},
{
title
:
'采购经理'
,
...
...
@@ -112,11 +115,11 @@ const detailInfo: React.FC<{}> = () => {
},
{
title
:
'副总经理'
,
desc
:
'审核
报价
单'
,
desc
:
'审核
需求
单'
,
},
{
title
:
'采购员'
,
desc
:
'提交
报价
单'
,
desc
:
'提交
需求
单'
,
},
{
title
:
'完成'
,
...
...
@@ -220,6 +223,15 @@ const detailInfo: React.FC<{}> = () => {
}
/**
* @description: 进入店铺
* @param {type}
* @return {type}
*/
const
optionChild
=
(
text
,
record
,
index
)
=>
{
return
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
'/home'
)
}
/>
}
/**
* @description: 打开商品弹窗
* @param {type}
* @return {type}
...
...
@@ -274,17 +286,17 @@ const detailInfo: React.FC<{}> = () => {
data
.
interiorState
=
2
}
}
setplatType
(
data
.
type
)
setdataInfo
(
data
)
interiorStateList
=
[...
data
.
interiorRequisitionFormStateResponses
]
console
.
log
(
'44'
,
data
.
interiorRequisitionFormStateResponses
,
interiorStateList
)
if
(
pagetype
==
1
||
pagetype
==
2
){
if
(
data
.
interiorState
===
2
){
setIsextraOption
(
true
)
}
}
else
if
(
pagetype
==
3
){
if
(
data
Info
.
externalState
==
1
){
if
(
data
.
externalState
==
1
){
setIsextraOption
(
true
)
}
}
...
...
@@ -513,8 +525,8 @@ const detailInfo: React.FC<{}> = () => {
<
div
>
内部状态:
</
div
>
<
div
>
{
pagetype
===
1
?
interiorState
(
dataInfo
.
interiorState
)
:
pagetype
===
2
||
pagetype
==
3
?
interiorStateTwo
(
dataInfo
.
interiorState
)
:
//
pagetype === 1 ? interiorState(dataInfo.interiorState) :
//
pagetype === 2 || pagetype == 3? interiorStateTwo(dataInfo.interiorState) :
enquirySearchInteriorState
(
dataInfo
.
interiorState
)
//4
}
...
...
@@ -529,11 +541,12 @@ const detailInfo: React.FC<{}> = () => {
<
Row
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
Tabs
type=
"line"
defaultActiveKey=
'1'
>
{
/* Number(dataInfo.externalState)-1 */
}
<
TabPane
tab=
'外部流转'
key=
"1"
>
<
Steps
style=
{
{
padding
:
'34px 0'
}
}
progressDot
current=
{
dataInfo
.
externalState
}
current=
{
0
}
>
{
detailData
.
externalStateStep
.
items
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -547,10 +560,11 @@ const detailInfo: React.FC<{}> = () => {
</
Steps
>
</
TabPane
>
<
TabPane
tab=
'内部流转'
key=
"2"
>
<
Steps
style=
{
{
padding
:
'34px 0'
}
}
progressDot
current=
{
dataInfo
.
interiorState
}
current=
{
Number
(
dataInfo
.
interiorState
)
-
1
}
>
{
detailData
.
interiorStateStep
.
items
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -662,10 +676,11 @@ const detailInfo: React.FC<{}> = () => {
<
div
className=
{
style
[
'mainCol-title'
]
}
>
需求对接
</
div
>
<
PlatType
platType=
{
platType
}
disabled=
{
true
}
/>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
}
}
currentRef=
{
ref
}
columns=
{
dockingColumn
(
switchState
)
}
columns=
{
dockingColumn
(
switchState
,
optionChild
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetchDockingData
(
params
)
}
/>
...
...
src/pages/transaction/enquirySubmit/components/index.tsx
View file @
292ad6af
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-
08 17:14:00
* @LastEditTime: 2020-09-
10 11:42:28
*/
/**
* @description: 组件描述: 一级 二级 待提交需求单
...
...
@@ -34,7 +34,7 @@ import {
}
from
'god/dist/src/standard-table/TableController'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
StatusSwitch
from
'@/components/StatusSwitch'
;
import
{
interiorState
,
interiorStateTwo
}
from
'../../common/tableStatusList'
import
{
interiorState
,
interiorStateTwo
,
enquirySearchInteriorState
}
from
'../../common/tableStatusList'
import
statuStyle
from
'../../common/colorTag'
import
NiceForm
from
'@/components/NiceForm'
;
import
{
timeRange
}
from
'@/utils/index'
...
...
@@ -152,8 +152,9 @@ const List:React.FC<listParams> = (props) => {
dataIndex
:
'interiorState'
,
align
:
'center'
,
render
:(
text
:
any
)
=>
props
.
type
===
1
?
interiorState
(
text
)
:
props
.
type
===
2
||
props
.
type
==
3
?
interiorStateTwo
(
text
)
:
''
// props.type === 1 ? interiorState(text) :
// props.type === 2 || props.type == 3? interiorStateTwo(text) : ''
enquirySearchInteriorState
(
text
)
},
{
title
:
'操作'
,
...
...
src/pages/transaction/enquirySubmit/toAddSubmit/detail.tsx
View file @
292ad6af
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:29
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-
09 16:33:55
* @LastEditTime: 2020-09-
10 11:12:01
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
import
ReactDOM
from
'react-dom'
...
...
@@ -46,6 +46,7 @@ import { PageStatus, usePageStatus } from '@/hooks/usePageStatus'
import
{
externalColumn
,
interiorColumn
}
from
'../../common/detailFormColumnType'
import
statuStyle
from
'../../common/colorTag'
import
{
interiorState
}
from
'../../common/tableStatusList'
import
PlatType
from
'../../components/platType'
import
{
GetManageAreaAllResponse
}
from
'@/services'
;
...
...
@@ -772,6 +773,7 @@ const Detail: React.FC<{}> = () => {
console
.
log
(
'list'
,
[...
areaParams
,
...
list
],
'area'
)
}
const
changePlatform
=
(
e
:
any
)
=>
{
console
.
log
(
'e'
,
e
.
target
.
value
)
setplatType
(
e
.
target
.
value
)
if
(
e
.
target
.
value
==
2
)
{
//调用需求单
...
...
@@ -1278,30 +1280,7 @@ const Detail: React.FC<{}> = () => {
</
Row
>
</
TabPane
>
<
TabPane
tab=
"需求对接"
key=
'4'
>
<
Space
size=
{
16
}
>
<
Radio
.
Group
value=
{
platType
}
onChange=
{
(
e
)
=>
changePlatform
(
e
)
}
>
<
Radio
value=
{
1
}
>
发布至平台
<
Tooltip
title=
"需求发布至企业商城求购频"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
2
}
>
系统匹配
<
Tooltip
title=
"系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、
商品属性、归属地区进行匹配,推荐满足条件的平台会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
<
Radio
value=
{
3
}
>
指定会员
<
Tooltip
title=
"选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),
需求只发送给指定会员"
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Radio
>
</
Radio
.
Group
>
</
Space
>
<
PlatType
platType=
{
platType
}
changePlatform=
{
changePlatform
}
/>
{
platType
==
1
&&
<
RowStyleLayout
>
...
...
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