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
392814eb
Commit
392814eb
authored
Jul 24, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接部分接口
parent
ce445456
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1416 additions
and
264 deletions
+1416
-264
logisticsRoutes.ts
config/routes/logisticsRoutes.ts
+41
-3
menu.ts
src/locales/zh-CN/menu.ts
+9
-2
index.less
src/pages/logistics/components/index.less
+102
-0
orderSearchDetail.tsx
src/pages/logistics/components/orderSearchDetail.tsx
+417
-0
orderSearchList.tsx
src/pages/logistics/components/orderSearchList.tsx
+129
-41
addCompany.css
src/pages/logistics/list/addCompany.css
+2
-2
addCompany.less
src/pages/logistics/list/addCompany.less
+7
-4
addCompany.tsx
src/pages/logistics/list/addCompany.tsx
+10
-7
company.tsx
src/pages/logistics/list/company.tsx
+14
-25
addressForm.tsx
src/pages/logistics/list/components/addressForm.tsx
+219
-54
addressList.tsx
src/pages/logistics/list/components/addressList.tsx
+46
-45
templateForm.tsx
src/pages/logistics/list/components/templateForm.tsx
+55
-17
template.tsx
src/pages/logistics/list/template.tsx
+51
-59
orderSearchList.tsx
src/pages/logistics/logisticsResult/orderSearchList.tsx
+9
-0
orderSearchList.tsx
src/pages/logistics/logisticsSubmit/orderSearchList.tsx
+4
-4
toOrderSumitList.tsx
src/pages/logistics/logisticsSubmit/toOrderSumitList.tsx
+293
-0
index.less
src/pages/member/components/index.less
+8
-1
index.ts
src/services/index.ts
+0
-0
No files found.
config/routes/logisticsRoutes.ts
View file @
392814eb
...
@@ -66,7 +66,7 @@ const LogisticsRoute = {
...
@@ -66,7 +66,7 @@ const LogisticsRoute = {
},
},
/**
/**
* @description: 物流单管理模块
* @description: 物流单
提交
管理模块
* @param {type}
* @param {type}
* @return:
* @return:
*/
*/
...
@@ -76,12 +76,50 @@ const LogisticsRoute = {
...
@@ -76,12 +76,50 @@ const LogisticsRoute = {
key
:
'logisticsSubmit'
,
key
:
'logisticsSubmit'
,
routes
:
[
routes
:
[
{
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/orderSearchList'
,
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/orderS
ubmitS
earchList'
,
name
:
'orderSearchList'
,
name
:
'orderS
ubmitS
earchList'
,
component
:
'@/pages/logistics/logisticsSubmit/orderSearchList'
,
component
:
'@/pages/logistics/logisticsSubmit/orderSearchList'
,
},
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil'
,
name
:
'orderSubmitDeatil'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
},
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList'
,
name
:
'toOrderSumitList'
,
component
:
'@/pages/logistics/logisticsSubmit/toOrderSumitList'
,
}
]
},
/**
* @description: 物流单处理管理模块
* @param {type}
* @return:
*/
{
path
:
'/memberCenter/logisticsAbility/logisticsResult'
,
name
:
'logisticsResult'
,
key
:
'logisticsResult'
,
routes
:
[
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/orderResultSearchList'
,
name
:
'orderResultSearchList'
,
component
:
'@/pages/logistics/logisticsResult/orderSearchList'
,
},
{
//物流结果详情处理
path
:
'/memberCenter/logisticsAbility/logisticsResult/orderResultDeatil'
,
name
:
'orderResultDeatil'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
}
}
]
]
}
}
]
]
}
}
...
...
src/locales/zh-CN/menu.ts
View file @
392814eb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-
18 16:25:18
* @LastEditTime: 2020-07-
23 14:02:07
*/
*/
export
default
{
export
default
{
...
@@ -77,5 +77,11 @@ export default {
...
@@ -77,5 +77,11 @@ export default {
'menu.logisticsAbility.logistics.templateForm'
:
'新建运费模板'
,
'menu.logisticsAbility.logistics.templateForm'
:
'新建运费模板'
,
'menu.logisticsAbility.logisticsSubmit'
:
'物流单提交'
,
'menu.logisticsAbility.logisticsSubmit'
:
'物流单提交'
,
'menu.logisticsAbility.logisticsSubmit.orderSearchList'
:
'物流单查询'
'menu.logisticsAbility.logisticsSubmit.orderSubmitSearchList'
:
'物流单查询'
,
'menu.logisticsAbility.logisticsSubmit.orderSubmitDeatil'
:
'物流单详情'
,
'menu.logisticsAbility.logisticsSubmit.toOrderSumitList'
:
'待提交物流单'
,
'menu.logisticsAbility.logisticsResult'
:
'物流单处理'
,
'menu.logisticsAbility.logisticsResult.orderResultSearchList'
:
'物流单查询'
,
'menu.logisticsAbility.logisticsResult.orderResultDeatil'
:
'物流单详情'
};
};
\ No newline at end of file
src/pages/logistics/components/index.less
0 → 100644
View file @
392814eb
@import "../../member/components/index.less";
.hidden{
display: none;
}
.block{
display: block;
}
.selectBtn {
margin: 0 16px;
}
.filter-btn{
width : 112px;
margin: 0 0 0 16px;
}
.select {
width : 160px;
margin: 0 16px 16px 0;
&:nth-last-of-type(1) {
margin-right: 0;
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #172B4D;
padding : 20px 0;
}
&:nth-last-of-type(1) {
margin: 0;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 3);
padding: 16px 0;
&-option {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
&-rows {
display : flex;
padding-bottom: 16px;
&-cols {
flex: 1;
.cols-main {
display: flex;
padding: 16px 0;
&:nth-last-of-type(1) {
padding-bottom: 0;
}
&-options {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
}
}
\ No newline at end of file
src/pages/logistics/components/orderSearchDetail.tsx
0 → 100644
View file @
392814eb
import
React
,
{
Component
,
useEffect
,
useState
,
ReactNode
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Modal
,
Tooltip
,
Input
,
Select
,
Button
,
Popconfirm
,
Card
,
Tag
,
Badge
,
Steps
,
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
EyeOutlined
,
ClockCircleOutlined
,
UpOutlined
,
DownOutlined
,
StopOutlined
,
CheckSquareOutlined
}
from
'@ant-design/icons'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
style
from
'./index.less'
const
{
Step
}
=
Steps
const
data
=
[
{
key
:
'1'
,
id
:
'1'
,
role
:
'采购商'
,
operation
:
'申请会员'
,
opTime
:
'2020-05-12 08:08'
,
suggest
:
''
,
status
:
2
,
},
];
const
detailInfo
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
({})
const
[
detailData
,
setDetailData
]
=
useState
<
any
>
({
step
:
{
current
:
0
,
title
:
'外部流转'
,
items
:
[
{
title
:
'提交物流单'
,
desc
:
'供应商'
,
},
{
title
:
'确认物流单'
,
desc
:
'物流服务商'
,
},
{
title
:
'完成'
,
desc
:
''
,
},
],
}
})
const
infoTem
=
{
base
:
{
title
:
'基本信息'
,
leftElem
:
[
{
title
:
'对应发货单号:'
,
key
:
''
},
{
title
:
'对应订单号/售后单:'
,
key
:
''
}
],
centerElem
:
[
{
title
:
'收货方:'
,
key
:
''
},
{
title
:
'收货地址:'
,
key
:
''
}
],
rightElem
:
[
{
title
:
'发货地址:'
,
key
:
''
}
],
elem
:
[
]
},
freight
:
{
title
:
'运费'
,
leftElem
:
[
{
title
:
'运费:'
,
key
:
'freight'
},
{
title
:
'结算方式:'
,
key
:
''
}
]
}
}
const
columns1
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'role'
,
align
:
'center'
,
key
:
'role'
,
width
:
240
},
{
title
:
'品类'
,
dataIndex
:
'role2'
,
align
:
'center'
,
key
:
'role3'
,
},
{
title
:
'品牌'
,
dataIndex
:
'role1'
,
align
:
'center'
,
key
:
'role2'
,
},
{
title
:
'单位'
,
dataIndex
:
'role3'
,
align
:
'center'
,
key
:
'role3'
,
},
{
title
:
'数量'
,
dataIndex
:
'role3'
,
align
:
'center'
,
key
:
'role3'
,
},
{
title
:
'箱数'
,
dataIndex
:
'role3'
,
align
:
'center'
,
key
:
'role3'
,
},
{
title
:
'重量 (KG)'
,
dataIndex
:
'role3'
,
align
:
'center'
,
key
:
'role3'
,
},
{
title
:
'体积 (M3)'
,
dataIndex
:
'role3'
,
align
:
'center'
,
key
:
'role3'
,
}
];
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'序号'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'操作角色'
,
dataIndex
:
'role'
,
align
:
'center'
,
key
:
'role'
,
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
align
:
'center'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
;
component
=
<
Badge
color=
"#FFC400"
text=
"待审核"
/>;
return
component
;
},
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
align
:
'center'
,
key
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'opTime'
,
align
:
'center'
,
key
:
'opTime'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'suggest'
,
align
:
'center'
,
key
:
'suggest'
,
width
:
300
},
];
//在这做逻辑判断 判断路由 是由哪个页面进来的
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [])
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
});
};
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
window
.
history
.
back
()
}
title=
{
<>
<
div
className=
{
style
[
'headerTop'
]
}
>
<
div
className=
{
style
[
'headerTop-prefix'
]
}
>
单
</
div
>
<
div
className=
{
style
[
'headerTop-name'
]
}
>
物流单号:WL0954548
</
div
>
<
div
className=
{
style
[
`levelIcon${'1'}`
]
}
></
div
>
</
div
>
</>
}
extra=
{
<>
<
Button
>
<
StopOutlined
/>
不接受物流单
</
Button
>
<
Button
className=
{
style
[
'saveBtn'
]
}
>
<
CheckSquareOutlined
/>
接受物流单
</
Button
>
</>
}
content=
{
<
div
className=
{
style
[
'headerMain'
]
}
>
<
div
className=
{
style
[
'headerMain-left'
]
}
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
单据摘要:
</
div
>
<
div
>
xxxx
</
div
>
</
div
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
物流服务商:
</
div
>
<
div
>
xxx
</
div
>
</
div
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
单据时间:
</
div
>
<
div
>
<
Tag
color=
"green"
>
2020-09-09 12:58:25
</
Tag
>
</
div
>
</
div
>
<
div
className=
{
style
[
'headerMain-left-option'
]
}
>
<
div
>
外部状态:
</
div
>
<
div
>
<
Tag
color=
"gold"
>
待审核
</
Tag
>
</
div
>
</
div
>
</
div
>
</
div
>
}
>
<
Row
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
div
className=
{
style
[
'mainCol-title'
]
}
>
{
detailData
.
step
.
title
}
</
div
>
<
Steps
style=
{
{
padding
:
'34px 0'
}
}
progressDot
current=
{
detailData
.
step
.
current
}
>
{
detailData
.
step
.
items
.
map
((
item
,
index
)
=>
{
return
(
<
Step
key=
{
index
}
title=
{
item
.
title
}
description=
{
item
.
desc
}
/>
);
})
}
</
Steps
>
</
Col
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
div
className=
{
style
[
'mainCol-title'
]
}
>
{
infoTem
[
'base'
].
title
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows'
]
}
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[
'base'
].
leftElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
张三
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[
'base'
].
centerElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
张三
</
div
>
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[
'base'
].
rightElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
张三
</
div
>
</
div
>
);
},
)
}
</
div
>
</
div
>
{
/* <div className={style['mainCol-row']}>
{infoTem['base'].elem.map((item: any, index: number) => {
return (
<div className={style['mainCol-row-col']} key={index}>
<div className={style['mainCol-row-col-option']}>
{item.title}
</div>
<div className={style['mainCol-row-col-option']}>
185 2929 6547
</div>
</div>
);
})}
</div> */
}
</
Col
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
div
className=
{
style
[
'mainCol-title'
]
}
>
物流单明细
</
div
>
<
StandardTable
tableProps=
{
{
pagination
:
false
,
}
}
columns=
{
columns1
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
/>
<
Row
style=
{
{
marginTop
:
'26px'
}
}
>
<
Col
span=
{
9
}
push=
{
15
}
>
<
Row
align=
'middle'
justify=
'center'
gutter=
{
[
16
,
16
]
}
>
<
Col
span=
{
8
}
>
<
div
>
总箱数(箱)
</
div
>
<
div
className=
{
style
.
count
}
>
700
</
div
>
</
Col
>
<
Col
span=
{
8
}
>
<
div
>
总重量(KG)
</
div
>
<
div
className=
{
style
.
count
}
>
700
</
div
>
</
Col
>
<
Col
span=
{
8
}
>
<
div
>
总体积(M3)
</
div
>
<
div
className=
{
style
.
count
}
>
700
</
div
>
</
Col
>
</
Row
>
</
Col
>
</
Row
>
</
Col
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
div
className=
{
style
[
'mainCol-title'
]
}
>
{
infoTem
[
'freight'
].
title
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows'
]
}
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
>
{
infoTem
[
'freight'
].
leftElem
.
map
(
(
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
{
style
[
'cols-main'
]
}
key=
{
index
}
>
<
div
className=
{
style
[
'cols-main-options'
]
}
>
{
item
.
title
}
</
div
>
{
item
.
key
===
'freight'
?
<
div
className=
{
style
[
'cols-main-options'
]
}
>
1000.00
<
Input
addonBefore=
" ¥ "
defaultValue=
"1000"
/>
</
div
>
:
<
div
className=
{
style
[
'cols-main-options'
]
}
>
张三
</
div
>
}
</
div
>
);
},
)
}
</
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
></
div
>
<
div
className=
{
style
[
'mainCol-rows-cols'
]
}
></
div
>
</
div
>
</
Col
>
<
Col
className=
{
style
[
'mainCol'
]
}
span=
{
24
}
>
<
div
className=
{
style
[
'mainCol-title'
]
}
>
外部流转记录
</
div
>
<
StandardTable
tableProps=
{
{
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
/>
</
Col
>
</
Row
>
</
PageHeaderWrapper
>
)
}
export
default
detailInfo
\ No newline at end of file
src/pages/logistics/components/orderSearchList.tsx
View file @
392814eb
import
React
,
{
useState
,
useEffect
,
useRef
,
ReactNode
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
,
ReactNode
}
from
'react'
;
import
{
Card
,
Button
,
Row
,
Col
,
Tooltip
,
Input
,
Select
}
from
'antd'
import
{
Card
,
Button
,
Row
,
Col
,
Tooltip
,
Input
,
Select
,
Tag
}
from
'antd'
import
{
UpOutlined
,
DownOutlined
}
from
'@ant-design/icons'
import
{
UpOutlined
,
DownOutlined
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
StandardTable
}
from
'god'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
ColumnType
,
TableRowSelection
}
from
'antd/lib/table/interface'
import
style
from
'./index.less'
import
{
history
}
from
'umi'
import
{
hidden
}
from
'chalk'
;
let
{
Option
}
=
Select
let
{
Option
}
=
Select
interface
listProps
{
export
interface
listProps
{
title
?:
string
,
title
?:
ReactNode
,
type
:
string
,
fromPage
?:
string
|
number
fromPage
?:
string
|
number
}
}
...
@@ -60,18 +64,66 @@ const fetchData = (params: any) => {
...
@@ -60,18 +64,66 @@ const fetchData = (params: any) => {
})
})
}
}
const
orderSearchList
:
React
.
FC
<
listProps
>
=
(
props
)
=>
{
const
orderSearchList
:
React
.
FC
<
listProps
>
=
(
props
)
=>
{
console
.
log
(
props
)
const
ref
=
useRef
({})
const
ref
=
useRef
({})
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
const
TimeList
=
[
{
label
:
'单据时间(全部)'
,
value
:
''
},
{
label
:
'今天'
,
value
:
1
},
{
label
:
'一周内'
,
value
:
2
},
{
label
:
'一个月内'
,
value
:
3
},
{
label
:
'三个月内'
,
value
:
4
},
{
label
:
'六个月内'
,
value
:
5
},
{
label
:
'一年内'
,
value
:
6
},
{
label
:
'一年前'
,
value
:
7
}
]
const
outSideStatusList
=
[
{
label
:
'外部状态(全部)'
,
value
:
''
},
{
label
:
'待提交'
,
value
:
1
},
{
label
:
'待确认'
,
value
:
2
},
{
label
:
'接受物流单'
,
value
:
3
},
{
label
:
'不接受物流单'
,
value
:
4
}
]
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
let
[
isSearch
,
setIsSearch
]
=
useState
<
boolean
>
(
false
)
let
[
isSearch
,
setIsSearch
]
=
useState
<
boolean
>
(
false
)
const
[
selectTableRow
,
setSelectTableRow
]
=
useState
<
any
>
([])
let
[
selectedTableRowKeys
,
setSelectedTableRowKeys
]
=
useState
<
Array
<
number
>>
([])
const
[
searchForm
,
setSearchForm
]
=
useState
({
const
[
searchForm
,
setSearchForm
]
=
useState
({
searName
:
''
,
searName
:
''
,
buyer
:
''
,
//收货商
dateSelect
:
''
,
dateSelect
:
''
,
outSideStatus
:
''
,
outSideStatus
:
''
,
TimeRange
:
''
TimeRange
:
''
})
})
const
handleSee
=
()
=>
{
const
handleSee
=
()
=>
{
props
.
type
===
'1'
?
history
.
push
(
`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil`
):
history
.
push
(
'/memberCenter/logisticsAbility/logisticsResult/orderResultDeatil'
)
}
}
const
columns
:
ColumnType
<
any
>
[]
=
[
const
columns
:
ColumnType
<
any
>
[]
=
[
{
{
...
@@ -87,16 +139,18 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -87,16 +139,18 @@ const orderSearchList: React.FC<listProps> = (props) => {
key
:
'key13'
key
:
'key13'
},
},
{
{
title
:
'收货方'
,
title
:
'物流服务商'
,
align
:
'left'
,
align
:
'center'
,
dataIndex
:
'key12'
,
dataIndex
:
'key13'
,
key
:
'key12'
key
:
'key13'
,
className
:
props
.
type
==
'1'
?
style
[
'hidden'
]
:
''
},
},
{
{
title
:
'
物流单号
'
,
title
:
'
收货方
'
,
align
:
'
center
'
,
align
:
'
left
'
,
dataIndex
:
'key1
1
'
,
dataIndex
:
'key1
212
'
,
key
:
'key1
1
'
key
:
'key1
212
'
},
},
{
{
title
:
'总箱数'
,
title
:
'总箱数'
,
...
@@ -130,7 +184,9 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -130,7 +184,9 @@ const orderSearchList: React.FC<listProps> = (props) => {
render
:
(
_
:
any
,
reconds
)
=>
{
render
:
(
_
:
any
,
reconds
)
=>
{
let
component
:
ReactNode
=
null
let
component
:
ReactNode
=
null
if
(
reconds
.
status
==
0
)
{
if
(
reconds
.
status
==
0
)
{
component
=
<><
span
style=
{
statuStyle
.
success
}
>
接受物流
</
span
></>
component
=
// <Tag color='success'>接受物流单</Tag>
<><
span
style=
{
statuStyle
.
success
}
>
接受物流单
</
span
></>
}
else
if
(
reconds
.
status
==
2
)
{
}
else
if
(
reconds
.
status
==
2
)
{
component
=
<><
span
style=
{
statuStyle
.
warn
}
>
不接受物流单
</
span
></>
component
=
<><
span
style=
{
statuStyle
.
warn
}
>
不接受物流单
</
span
></>
}
else
if
(
reconds
.
status
==
3
)
{
}
else
if
(
reconds
.
status
==
3
)
{
...
@@ -147,15 +203,26 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -147,15 +203,26 @@ const orderSearchList: React.FC<listProps> = (props) => {
dataIndex
:
'option'
,
dataIndex
:
'option'
,
render
:
(
_
:
any
,
reconds
)
=>
{
render
:
(
_
:
any
,
reconds
)
=>
{
return
(
return
(
<>
{
props
.
type
===
'1'
?
<
Button
type=
"link"
onClick=
{
handleSee
}
>
确认
</
Button
>:
''
}
<
Button
type=
"link"
onClick=
{
handleSee
}
>
查看
</
Button
>
<
Button
type=
"link"
onClick=
{
handleSee
}
>
查看
</
Button
>
</>
)
)
}
}
}
}
]
]
const
rowSelection
=
{
const
rowSelection
:
TableRowSelection
<
any
>
=
{
type
:
'checkbox'
,
selectedRowKeys
:
selectedTableRowKeys
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectTableRow
(
selectedRows
);
setSelectedTableRowKeys
(
selectedRowKeys
);
console
.
log
(
selectedRowKeys
,
'selected: '
,
selectedRows
);
}
}
}
const
handleSearch
=
()
=>
{
const
handleSearch
=
()
=>
{
...
@@ -180,7 +247,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -180,7 +247,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
<>
<>
<
Row
>
<
Row
>
<
Col
span=
{
12
}
>
<
Col
span=
{
12
}
>
<
Tooltip
trigger=
{
[
'focus'
]
}
placement=
'top'
title=
'输入物流单号、发货方进行搜索'
>
<
Tooltip
trigger=
{
[
'focus'
]
}
placement=
'top'
title=
{
props
.
type
===
'1'
?
'输入物流单号、订单号进行搜索'
:
'输入物流单号、发货方进行搜索'
}
>
<
Input
.
Search
<
Input
.
Search
style=
{
{
width
:
'232px'
}
}
style=
{
{
width
:
'232px'
}
}
value=
{
searchForm
.
searName
}
value=
{
searchForm
.
searName
}
...
@@ -189,47 +257,65 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -189,47 +257,65 @@ const orderSearchList: React.FC<listProps> = (props) => {
onSearch=
{
()
=>
handleSearch
}
onSearch=
{
()
=>
handleSearch
}
/>
/>
</
Tooltip
>
</
Tooltip
>
<
Button
onClick=
{
()
=>
setIsSearch
(
isSearch
=
!
isSearch
)
}
>
<
Button
className=
{
style
[
'filter-btn'
]
}
onClick=
{
()
=>
setIsSearch
(
isSearch
=
!
isSearch
)
}
>
高级筛选
{
isSearch
?
<
UpOutlined
/>
:
<
DownOutlined
/>
}
高级筛选
{
isSearch
?
<
UpOutlined
/>
:
<
DownOutlined
/>
}
</
Button
>
</
Button
>
<
Button
onClick=
{
()
=>
handleReset
()
}
>
重置
</
Button
>
<
Button
className=
{
style
.
selectBtn
}
onClick=
{
()
=>
handleReset
()
}
>
重置
</
Button
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
>
<
Row
style=
{
{
margin
:
'16px 0'
}
}
>
{
{
isSearch
&&
isSearch
&&
<
Col
>
<
Col
>
{
props
.
type
===
'1'
?
<
Select
<
Select
value=
{
searchForm
.
outSideStatus
}
className=
{
style
.
select
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
outSideStatus
:
val
})
}
value=
{
searchForm
.
buyer
}
>
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
buyer
:
val
})
}
<
Option
value=
''
>
收货方(全部)
</
Option
>
>
<
Option
value=
'1'
>
待审核
</
Option
>
<
Option
value=
''
>
物流服务商(全部)
</
Option
>
<
Option
value=
'2'
>
审核通过
</
Option
>
<
Option
value=
'1'
>
待审核
</
Option
>
<
Option
value=
'3'
>
审核不通过
</
Option
>
<
Option
value=
'2'
>
审核通过
</
Option
>
</
Select
>
<
Option
value=
'3'
>
审核不通过
</
Option
>
</
Select
>
:
<
Select
className=
{
style
.
select
}
value=
{
searchForm
.
buyer
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
buyer
:
val
})
}
>
<
Option
value=
''
>
发货方(全部)
</
Option
>
<
Option
value=
'1'
>
待审核
</
Option
>
<
Option
value=
'2'
>
审核通过
</
Option
>
<
Option
value=
'3'
>
审核不通过
</
Option
>
</
Select
>
}
<
Select
<
Select
className=
{
style
.
select
}
value=
{
searchForm
.
TimeRange
}
value=
{
searchForm
.
TimeRange
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
TimeRange
:
val
})
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
TimeRange
:
val
})
}
>
>
<
Option
value=
''
>
单据时间
</
Option
>
{
<
Option
value=
'1'
>
今天
</
Option
>
TimeList
.
map
((
item
)
=>
{
<
Option
value=
'2'
>
一周内
</
Option
>
return
<
Option
value=
{
item
.
value
}
>
{
item
.
label
}
</
Option
>
<
Option
value=
'3'
>
一个月内
</
Option
>
})
<
Option
value=
'4'
>
三个月内
</
Option
>
}
<
Option
value=
'5'
>
六个月内
</
Option
>
<
Option
value=
'6'
>
一年内
</
Option
>
<
Option
value=
'7'
>
一年前
</
Option
>
</
Select
>
</
Select
>
<
Select
<
Select
className=
{
style
.
select
}
value=
{
searchForm
.
outSideStatus
}
value=
{
searchForm
.
outSideStatus
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
outSideStatus
:
val
})
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
outSideStatus
:
val
})
}
>
>
<
Option
value=
''
>
外部状态(全部)
</
Option
>
{
<
Option
value=
'1'
>
待审核
</
Option
>
outSideStatusList
.
map
((
item
)
=>
{
<
Option
value=
'2'
>
审核通过
</
Option
>
return
<
Option
value=
{
item
.
value
}
>
{
item
.
label
}
</
Option
>
<
Option
value=
'3'
>
审核不通过
</
Option
>
})
}
</
Select
>
</
Select
>
</
Col
>
</
Col
>
}
}
...
@@ -244,6 +330,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
...
@@ -244,6 +330,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
)
)
}
}
orderSearchList
.
defaultProps
=
{
orderSearchList
.
defaultProps
=
{
type
:
'1'
,
title
:
'123'
}
}
export
default
orderSearchList
export
default
orderSearchList
\ No newline at end of file
src/pages/logistics/list/addCompany.css
View file @
392814eb
.ant-input-group-addon
{
.
btn-wrap
.ant-input-group
.
ant-input-group-addon
{
padding
:
0
;
padding
:
0
!important
;
}
}
src/pages/logistics/list/addCompany.less
View file @
392814eb
.ant-input-group-addon{
.btn-wrap{
padding: 0;
.ant-input-group{
}
.ant-input-group-addon{
\ No newline at end of file
padding: 0 !important;
}
}
}
src/pages/logistics/list/addCompany.tsx
View file @
392814eb
...
@@ -9,7 +9,8 @@ import { history } from 'umi'
...
@@ -9,7 +9,8 @@ import { history } from 'umi'
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
PublicApi
,
CustomApi
}
from
'@/services/api'
import
{
PublicApi
,
CustomApi
}
from
'@/services/api'
import
{
addCompany
,
updateCompany
,
getCompanyDetail
}
from
'@/services/logistics/index'
import
{
addCompany
,
updateCompany
,
getCompanyDetail
}
from
'@/services/logistics/index'
import
"./addCompany.less"
import
style
from
"./addCompany.less"
const
{
location
}
=
history
export
interface
companyProps
{
export
interface
companyProps
{
}
}
...
@@ -71,6 +72,7 @@ const company: React.FC<{}> = () => {
...
@@ -71,6 +72,7 @@ const company: React.FC<{}> = () => {
//hook只能写在函数组件的顶级作用域
//hook只能写在函数组件的顶级作用域
const
ref
=
useRef
({})
const
ref
=
useRef
({})
const
[
menuForm
]
=
Form
.
useForm
();
const
[
menuForm
]
=
Form
.
useForm
();
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
'新建物流公司'
)
const
[
Code
,
setCode
]
=
useState
(
''
)
const
[
Code
,
setCode
]
=
useState
(
''
)
const
[
codeDisabled
,
setCodeDisabled
]
=
useState
(
false
)
const
[
codeDisabled
,
setCodeDisabled
]
=
useState
(
false
)
const
[
id
,
setId
]
=
useState
<
string
>
(
history
.
location
.
query
.
id
||
null
)
const
[
id
,
setId
]
=
useState
<
string
>
(
history
.
location
.
query
.
id
||
null
)
...
@@ -80,9 +82,10 @@ const company: React.FC<{}> = () => {
...
@@ -80,9 +82,10 @@ const company: React.FC<{}> = () => {
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
// 模态框选择的行数据
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
useEffect
(()
=>
{
useEffect
(()
=>
{
const
{
location
}
=
history
let
_title
=
location
.
query
.
id
==
0
?
'新建'
:
console
.
log
(
'id'
,
id
)
location
.
query
.
isSee
?
'查看'
:
'编辑'
if
(
id
)
{
setHeaderTitle
(
`
${
_title
}
物流公司`
)
if
(
id
!==
'0'
)
{
PublicApi
.
getLogisticsCompanyGet
({
id
:
id
}).
then
(
res
=>
{
PublicApi
.
getLogisticsCompanyGet
({
id
:
id
}).
then
(
res
=>
{
const
data
=
res
.
data
const
data
=
res
.
data
menuForm
.
setFieldsValue
(
data
)
menuForm
.
setFieldsValue
(
data
)
...
@@ -173,7 +176,7 @@ const company: React.FC<{}> = () => {
...
@@ -173,7 +176,7 @@ const company: React.FC<{}> = () => {
<
PageHeaderWrapper
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
"新建物流公司"
title=
{
headerTitle
}
>
>
<
Row
gutter=
{
[
36
,
36
]
}
>
<
Row
gutter=
{
[
36
,
36
]
}
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
...
@@ -198,7 +201,7 @@ const company: React.FC<{}> = () => {
...
@@ -198,7 +201,7 @@ const company: React.FC<{}> = () => {
message
:
'合作类型为必须项!'
,
message
:
'合作类型为必须项!'
,
},
},
]
}
]
}
initialValue=
"1"
// initialValue=
{}
>
>
<
Select
placeholder=
"请选择合作类型"
value=
{
companyType
}
onChange=
{
onChangeType
}
>
<
Select
placeholder=
"请选择合作类型"
value=
{
companyType
}
onChange=
{
onChangeType
}
>
<
Option
value=
{
1
}
>
平台物流服务商
</
Option
>
<
Option
value=
{
1
}
>
平台物流服务商
</
Option
>
...
@@ -221,7 +224,7 @@ const company: React.FC<{}> = () => {
...
@@ -221,7 +224,7 @@ const company: React.FC<{}> = () => {
}
}
]
}
]
}
>
>
<
Input
disabled
maxLength=
{
20
}
addonAfter=
{
selectBtn
}
/>
<
Input
className=
{
style
[
'btn-wrap'
]
}
disabled
maxLength=
{
20
}
addonAfter=
{
selectBtn
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
:
:
<
Form
.
Item
<
Form
.
Item
...
...
src/pages/logistics/list/company.tsx
View file @
392814eb
/*
/*
* @Date: 2020-07-13 15:01:40
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-2
2 11:07
:17
* @LastEditTime: 2020-07-2
4 16:25
:17
*/
*/
import
React
,
{
ReactNode
,
useRef
}
from
'react'
import
React
,
{
ReactNode
,
useRef
}
from
'react'
...
@@ -73,7 +73,7 @@ const Company: React.FC<{}> = () => {
...
@@ -73,7 +73,7 @@ const Company: React.FC<{}> = () => {
dataIndex
:
'name'
,
dataIndex
:
'name'
,
align
:
'center'
,
align
:
'center'
,
key
:
'name'
,
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
>
{
text
}
<
EyeOutlined
/></
span
>
},
},
{
{
title
:
'合作类型'
,
title
:
'合作类型'
,
...
@@ -94,17 +94,9 @@ const Company: React.FC<{}> = () => {
...
@@ -94,17 +94,9 @@ const Company: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
let
component
:
ReactNode
=
null
component
=
(
component
=
(
<
Popconfirm
<
Button
type=
"link"
style=
{
record
.
status
===
1
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
status
===
1
?
'有效'
:
'无效'
}
title=
"确定要执行这个操作?"
{
record
.
status
===
1
?
<
PlayCircleOutlined
/>
:
<
PauseCircleOutlined
/>
}
onConfirm=
{
confirm
}
</
Button
>
onCancel=
{
cancel
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
onClick=
{
()
=>
handleModify
(
record
)
}
style=
{
record
.
status
===
1
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
status
===
1
?
'有效'
:
'无效'
}
{
record
.
status
===
1
?
<
PlayCircleOutlined
/>
:
<
PauseCircleOutlined
/>
}
</
Button
>
</
Popconfirm
>
)
)
return
component
return
component
}
}
...
@@ -118,12 +110,11 @@ const Company: React.FC<{}> = () => {
...
@@ -118,12 +110,11 @@ const Company: React.FC<{}> = () => {
const
title
=
`确定要
${
status
}
吗?`
const
title
=
`确定要
${
status
}
吗?`
return
(
return
(
<>
<>
<
Popconfirm
title=
{
title
}
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleChangeStatus
(
record
.
id
,
record
.
status
)
}
>
<
Popconfirm
title=
{
title
}
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleChangeStatus
(
record
.
id
,
record
.
status
)
}
>
<
Button
type=
'link'
>
<
Button
type=
'link'
>
{
record
.
status
===
0
?
'启用'
:
'停用'
}
{
record
.
status
===
0
?
'启用'
:
'停用'
}
</
Button
>
</
Button
>
</
Popconfirm
>
</
Popconfirm
>
{
record
.
status
===
0
?
{
record
.
status
===
0
?
<>
<>
...
@@ -135,7 +126,7 @@ const Company: React.FC<{}> = () => {
...
@@ -135,7 +126,7 @@ const Company: React.FC<{}> = () => {
</
Popconfirm
>
</
Popconfirm
>
</>
</>
:
''
}
:
''
}
<
Button
type=
'link'
onClick=
{
()
=>
h
istory
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}&isSee=true`
)
}
>
查看
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
h
andleSee
(
record
.
id
)
}
>
查看
</
Button
>
</>
</>
)
)
}
}
...
@@ -165,7 +156,6 @@ const Company: React.FC<{}> = () => {
...
@@ -165,7 +156,6 @@ const Company: React.FC<{}> = () => {
const
handleDelete
=
(
id
:
any
)
=>
{
const
handleDelete
=
(
id
:
any
)
=>
{
PublicApi
.
postLogisticsCompanyDelete
({
id
:
id
}).
then
(
res
=>
{
PublicApi
.
postLogisticsCompanyDelete
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
message
.
success
(
res
.
message
)
ref
.
current
.
reload
()
ref
.
current
.
reload
()
}
}
})
})
...
@@ -174,15 +164,14 @@ const Company: React.FC<{}> = () => {
...
@@ -174,15 +164,14 @@ const Company: React.FC<{}> = () => {
let
_status
=
status
==
0
?
1
:
0
let
_status
=
status
==
0
?
1
:
0
PublicApi
.
postLogisticsCompanyEnable
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
PublicApi
.
postLogisticsCompanyEnable
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
if
(
res
.
code
===
1000
){
message
.
success
(
res
.
message
)
console
.
log
(
ref
)
console
.
log
(
ref
)
ref
.
current
.
reload
()
ref
.
current
.
reload
()
}
}
})
})
}
}
const
handleSee
=
(
record
:
any
)
=>
{
const
handleSee
=
(
id
:
number
)
=>
{
console
.
log
(
'see'
)
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addCompany?id=
${
id
}
&isSee=true`
)
}
}
const
confirm
=
()
=>
{
const
confirm
=
()
=>
{
...
@@ -208,7 +197,7 @@ const Company: React.FC<{}> = () => {
...
@@ -208,7 +197,7 @@ const Company: React.FC<{}> = () => {
formilyChilds=
{
{
formilyChilds=
{
{
children
:
(
children
:
(
<>
<>
<
Button
type=
"primary"
onClick=
{
()
=>
history
.
push
(
'/memberCenter/logisticsAbility/logistics/list/addCompany'
)
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
history
.
push
(
'/memberCenter/logisticsAbility/logistics/list/addCompany
?id=0
'
)
}
>
新建
<
PlusOutlined
/>
新建
<
PlusOutlined
/>
</
Button
>
</
Button
>
</>
</>
...
...
src/pages/logistics/list/components/addressForm.tsx
View file @
392814eb
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
* @Author: LeeJiancong
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-
18 11:47:19
* @LastEditTime: 2020-07-
24 16:31:22
*/
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
import
ReactDOM
from
'react-dom'
import
{
import
{
SchemaForm
,
SchemaForm
,
...
@@ -12,23 +12,26 @@ import {
...
@@ -12,23 +12,26 @@ import {
createFormActions
,
createFormActions
,
FormButtonGroup
,
FormButtonGroup
,
registerFormFields
,
registerFormFields
,
FormEffectHooks
,
FormPath
,
Submit
,
Submit
,
Reset
,
Reset
,
connect
connect
}
from
'@formily/antd'
}
from
'@formily/antd'
import
{
history
}
from
'umi'
import
{
history
}
from
'umi'
import
{
Row
,
Col
,
Card
,
Button
,
Popconfirm
,
Select
as
ISelect
}
from
'antd'
;
import
{
Row
,
Col
,
Card
,
Button
,
Popconfirm
,
Select
as
ISelect
,
message
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
MegaLayout
,
Input
,
Switch
,
Select
,
FormMegaLayout
}
from
'@formily/antd-components'
import
{
MegaLayout
,
Input
,
Switch
,
Select
,
FormMegaLayout
}
from
'@formily/antd-components'
import
{
PublicApi
}
from
'@/services/api'
import
ReutrnEle
from
'@/components/ReturnEle'
import
ReutrnEle
from
'@/components/ReturnEle'
import
ChinaImg
from
'../../../../../mockStatic/china.png'
import
ChinaImg
from
'../../../../../mockStatic/china.png'
import
gou
from
'../../../../../mockStatic/gou.png'
import
gou
from
'../../../../../mockStatic/gou.png'
import
japenImg
from
'../../../../../mockStatic/japen.png'
import
japenImg
from
'../../../../../mockStatic/japen.png'
import
korenImg
from
'../../../../../mockStatic/koren.png'
import
korenImg
from
'../../../../../mockStatic/koren.png'
import
us
from
'../../../../../mockStatic/us.png'
import
us
from
'../../../../../mockStatic/us.png'
const
_width
:
number
=
24
const
_width
:
number
=
24
const
_height
:
number
=
17
const
_height
:
number
=
17
const
{
location
}
=
history
interface
countryItem
{
interface
countryItem
{
name
:
string
,
name
:
string
,
key
:
string
,
key
:
string
,
...
@@ -49,6 +52,9 @@ export interface ListType {
...
@@ -49,6 +52,9 @@ export interface ListType {
* @return:
* @return:
*/
*/
const
{
Option
}
=
ISelect
;
const
{
Option
}
=
ISelect
;
const
actions
=
createFormActions
()
const
{
onFieldValueChange$
}
=
FormEffectHooks
const
children
:
any
=
[];
const
children
:
any
=
[];
for
(
let
i
=
10
;
i
<
36
;
i
++
)
{
for
(
let
i
=
10
;
i
<
36
;
i
++
)
{
children
.
push
(<
Option
value=
{
i
}
key=
{
i
.
toString
(
36
)
+
i
}
>
{
i
.
toString
(
36
)
+
i
}
</
Option
>);
children
.
push
(<
Option
value=
{
i
}
key=
{
i
.
toString
(
36
)
+
i
}
>
{
i
.
toString
(
36
)
+
i
}
</
Option
>);
...
@@ -67,11 +73,17 @@ const dropdownRender = () => {
...
@@ -67,11 +73,17 @@ const dropdownRender = () => {
// )
// )
// }
// }
// registerFormFields({ prefixSelect: connect()(CustomSelect) })
// registerFormFields({ prefixSelect: connect()(CustomSelect) })
const
diaLogForm
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
const
diaLogForm
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
const
type
:
string
=
history
.
location
.
query
.
addType
const
[
Options
,
setOptions
]
=
useState
([])
const
type
:
string
=
history
.
location
.
query
.
type
const
[
Options
,
setOptions
]
=
useState
([])
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
''
)
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
''
)
const
[
provinceList
,
setProvinceList
]
=
useState
([])
const
[
cityList
,
setCityList
]
=
useState
([])
const
[
select
,
setSelect
]
=
useState
<
countryItem
>
({
const
[
select
,
setSelect
]
=
useState
<
countryItem
>
({
key
:
'cn'
,
key
:
'cn'
,
name
:
'简体中文-ZH'
,
name
:
'简体中文-ZH'
,
...
@@ -82,39 +94,174 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -82,39 +94,174 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
span
><
img
src=
{
ChinaImg
}
alt=
""
/></
span
>
<
span
><
img
src=
{
ChinaImg
}
alt=
""
/></
span
>
)
)
}
}
const
confirm
=
()
=>
{
/**
console
.
log
(
'confirm'
)
* @description:
history
.
go
(
-
1
)
* @param {type}
* @return:
*/
const
formSubmit
=
(
values
)
=>
{
console
.
log
(
values
)
let
id
=
location
.
query
.
id
//0新建
let
type
=
location
.
query
.
type
//'1' 发货 '2'收货
let
value
=
{
...
values
}
value
.
isDefault
=
values
.
isDefault
?
1
:
0
if
(
type
==
1
)
{
if
(
id
==
0
)
{
PublicApi
.
postLogisticsShipperAddressAdd
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
})
}
else
{
PublicApi
.
postLogisticsShipperAddressUpdate
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
})
}
}
else
{
if
(
id
==
0
)
{
PublicApi
.
postLogisticsReceiverAddressAdd
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
})
}
else
{
PublicApi
.
postLogisticsReceiverAddressUpdate
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
})
}
}
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
);
}
}
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
console
.
log
(
'cancel'
)
console
.
log
(
'cancel'
)
}
}
const
confirm
=
()
=>
{
// message.error(`未保存地址信息`)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
const
handleChangeSelect
=
()
=>
{
const
handleChangeSelect
=
()
=>
{
}
}
const
List
:
any
=
[
ChinaImg
,
gou
,
japenImg
,
korenImg
,
us
]
const
List
:
any
=
[
ChinaImg
,
gou
,
japenImg
,
korenImg
,
us
]
const
selectList
:
any
=
[
const
selectList
:
any
=
[
{
label
:
<><
img
src=
{
ChinaImg
}
key=
'1'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'1'
},
{
label
:
<><
img
src=
{
ChinaImg
}
key=
'1'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'1'
},
{
label
:
<><
img
src=
{
gou
}
key=
'2'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'2'
},
{
label
:
<><
img
src=
{
gou
}
key=
'2'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'2'
},
{
label
:
<><
img
src=
{
japenImg
}
key=
'3'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'3'
},
{
label
:
<><
img
src=
{
japenImg
}
key=
'3'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'3'
},
{
label
:
<><
img
src=
{
korenImg
}
key=
'4'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'4'
},
{
label
:
<><
img
src=
{
korenImg
}
key=
'4'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'4'
},
{
label
:
<><
img
src=
{
us
}
key=
'5'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'5'
}
{
label
:
<><
img
src=
{
us
}
key=
'5'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'5'
}
]
]
let
_Options
:
any
=
[]
let
_Options
:
any
=
[]
List
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
List
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
let
tem
=
<><
img
src=
{
item
}
key=
{
'item'
+
index
}
style=
{
{
width
:
_width
,
height
:
_height
}
}
/>
+86
</>
let
tem
=
<><
img
src=
{
item
}
key=
{
'item'
+
index
}
style=
{
{
width
:
_width
,
height
:
_height
}
}
/>
+86
</>
_Options
.
push
({
label
:
tem
,
value
:
index
+
1
})
_Options
.
push
({
label
:
tem
,
value
:
index
+
1
})
})
})
/**
* @description: formilyjs表单赋值方法 actions.setFieldState(key,state=> {state.value= **})
* @param {type}
* @return:
*/
useEffect
(()
=>
{
useEffect
(()
=>
{
history
.
location
.
query
.
addType
==
'1'
?
setHeaderTitle
(
'新建发货地址'
)
:
setHeaderTitle
(
'新建收货地址'
)
const
id
=
history
.
location
.
query
.
id
setOptions
(
_Options
)
let
title
=
id
==
0
?
'新建'
:
'编辑'
history
.
location
.
query
.
type
==
'1'
?
setHeaderTitle
(
`
${
title
}
发货地址`
)
:
setHeaderTitle
(
`
${
title
}
收货地址`
)
setOptions
(
_Options
)
PublicApi
.
getLogisticsShipperAddressGetTelCode
().
then
(
res
=>
{})
PublicApi
.
getWarehouseAreaByPcodeAll
({
pcode
:
'100000'
}).
then
(
res
=>
{
let
list
=
[]
res
.
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
list
.
push
({
label
:
item
.
name
,
value
:
item
.
code
})
})
setProvinceList
(
list
)
})
if
(
location
.
query
.
id
!=
0
&&
location
.
query
.
type
==
'1'
)
{
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
actions
.
setFieldState
(
key
,
state
=>
{
state
.
value
=
data
[
key
]
if
(
key
==
'isDefault'
)
{
state
.
value
=
data
[
key
]
===
0
?
false
:
true
}
})
})
}
})
}
//收货
if
(
location
.
query
.
id
!=
0
&&
location
.
query
.
type
==
'2'
)
{
PublicApi
.
getLogisticsReceiverAddressGet
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
actions
.
setFieldState
(
key
,
state
=>
{
state
.
value
=
data
[
key
]
if
(
key
==
'isDefault'
)
{
state
.
value
=
data
[
key
]
===
0
?
false
:
true
}
})
})
}
})
}
return
()
=>
{
return
()
=>
{
}
}
},[])
},
[])
/**
* @description: 自定义HOOK
* @param {type}
* @return:
*/
const
useAreaEffects
=
()
=>
{
const
{
setFieldState
}
=
createFormActions
()
onFieldValueChange$
(
'provinceId'
).
subscribe
(({
value
})
=>
{
console
.
log
(
value
)
setFieldState
(
'districtId'
,
state
=>
{
state
.
value
=
''
})
setFieldState
(
'*(cityId)'
,
state
=>
{
state
.
value
=
''
let
list
=
[]
PublicApi
.
getWarehouseAreaByPcodeAll
({
pcode
:
value
}).
then
(
res
=>
{
res
.
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
list
.
push
({
label
:
item
.
name
,
value
:
item
.
code
})
})
// setCityList(list)
})
FormPath
.
setIn
(
state
,
'props.enum'
,
list
)
})
})
onFieldValueChange$
(
'cityId'
).
subscribe
(({
value
})
=>
{
console
.
log
(
value
)
setFieldState
(
'*(districtId)'
,
state
=>
{
state
.
value
=
''
let
list
=
[]
PublicApi
.
getWarehouseAreaByPcodeAll
({
pcode
:
value
}).
then
(
res
=>
{
res
.
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
list
.
push
({
label
:
item
.
name
,
value
:
item
.
code
})
})
})
FormPath
.
setIn
(
state
,
'props.enum'
,
list
)
})
})
}
return
(
return
(
<
PageHeaderWrapper
<
PageHeaderWrapper
...
@@ -126,33 +273,51 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -126,33 +273,51 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
Row
>
<
Row
>
<
Col
span=
{
16
}
>
<
Col
span=
{
16
}
>
<
SchemaForm
editable=
{
state
.
editable
}
<
SchemaForm
editable=
{
state
.
editable
}
initialValues=
{
{
// initialValues={{
provic
:
'广东省'
,
// provinceId: '',
phoneHead
:
1
// cityId:'111120',
// districtId:'121212'
}
}
// }}
actions=
{
actions
}
//要传递
components=
{
{
components=
{
{
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
}
}
}
}
effects=
{
()
=>
useAreaEffects
()
}
onSubmit=
{
(
values
)
=>
formSubmit
(
values
)
}
>
>
<
FormMegaLayout
labelCol=
{
4
}
labelAlign=
"left"
>
<
FormMegaLayout
labelCol=
{
4
}
labelAlign=
"left"
>
<
Field
{
required
location
.
query
.
type
==
'1'
?
title=
"发货人"
<
Field
name=
"user"
required
maxLength=
{
40
}
title=
"发货人"
x
-
component=
"Input"
name=
"shipperName"
x
-
component
-
props=
{
{
maxLength=
{
40
}
placeholder
:
'请输入收货人'
x
-
component=
"Input"
}
}
x
-
component
-
props=
{
{
/>
placeholder
:
'请输入发货人'
<
FormMegaLayout
label=
'发货地区'
grid
full
autoRow
required
>
}
}
/>
:
<
Field
required
title=
"收货人"
name=
"receiverName"
maxLength=
{
40
}
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'请输入收货人'
}
}
/>
}
<
FormMegaLayout
label=
{
location
.
query
.
type
==
'1'
?
'发货地区'
:
'收货地区'
}
grid
full
autoRow
required
>
<
Field
<
Field
x
-
mega
-
props=
{
{
span
:
1
}
}
x
-
mega
-
props=
{
{
span
:
1
}
}
x
-
component=
"Select"
x
-
component=
"Select"
enum=
{
select
List
}
enum=
{
province
List
}
required
required
name=
"provi
c
"
name=
"provi
nceId
"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
placeholder
:
'-省份/直辖市-'
placeholder
:
'-省份/直辖市-'
}
}
}
}
...
@@ -160,9 +325,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -160,9 +325,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
Field
<
Field
x
-
mega
-
props=
{
{
span
:
1
}
}
x
-
mega
-
props=
{
{
span
:
1
}
}
x
-
component=
"Select"
x
-
component=
"Select"
enum=
{
select
List
}
enum=
{
city
List
}
required
required
name=
"city"
name=
"city
Id
"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
placeholder
:
'-市-'
placeholder
:
'-市-'
}
}
}
}
...
@@ -172,7 +337,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -172,7 +337,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x
-
component=
"Select"
x
-
component=
"Select"
enum=
{
selectList
}
enum=
{
selectList
}
required
required
name=
"
area
"
name=
"
districtId
"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
placeholder
:
'-区-'
placeholder
:
'-区-'
}
}
}
}
...
@@ -181,7 +346,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -181,7 +346,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
Field
<
Field
required
required
title=
"详细地址"
title=
"详细地址"
name=
"address
Info
"
name=
"address"
maxLength=
{
60
}
maxLength=
{
60
}
x
-
component=
"TextArea"
x
-
component=
"TextArea"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
...
@@ -190,7 +355,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -190,7 +355,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
/>
<
Field
<
Field
title=
"邮编"
title=
"邮编"
name=
"
c
ode"
name=
"
postalC
ode"
maxLength=
{
12
}
maxLength=
{
12
}
x
-
component=
"Input"
x
-
component=
"Input"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
...
@@ -200,7 +365,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -200,7 +365,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
FormMegaLayout
label=
'手机号码'
grid
required
full
>
<
FormMegaLayout
label=
'手机号码'
grid
required
full
>
<
Field
<
Field
x
-
mega
-
props=
{
{
span
:
1
}
}
x
-
mega
-
props=
{
{
span
:
1
}
}
name=
"
phoneHead
"
name=
"
areaCode
"
required
required
x
-
component=
"Select"
x
-
component=
"Select"
enum=
{
Options
}
enum=
{
Options
}
...
@@ -208,7 +373,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -208,7 +373,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
placeholder
:
'+86'
placeholder
:
'+86'
}
}
}
}
/>
/>
{
/* <Field
{
/* <Field
name="phoneHead2"
name="phoneHead2"
x-component="prefixSelect"
x-component="prefixSelect"
/> */
}
/> */
}
...
@@ -217,7 +382,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -217,7 +382,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
</ISelect>, */
}
</ISelect>, */
}
<
Field
<
Field
x
-
mega
-
props=
{
{
span
:
5
}
}
x
-
mega
-
props=
{
{
span
:
5
}
}
name=
"
mobieP
hone"
name=
"
p
hone"
required
required
x
-
component=
"Input"
x
-
component=
"Input"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
...
@@ -226,17 +391,17 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -226,17 +391,17 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
/>
</
FormMegaLayout
>
</
FormMegaLayout
>
<
FormMegaLayout
label=
'电话号码'
grid
full
>
<
FormMegaLayout
label=
'电话号码'
grid
full
>
<
Field
{
/*
<Field
x-mega-props={{ span: 1 }}
x-mega-props={{ span: 1 }}
name="phoneHead"
name="phoneHead"
x-component="Input"
x-component="Input"
x-component-props={{
x-component-props={{
placeholder: '区号'
placeholder: '区号'
}}
}}
/>
/>
*/
}
<
Field
<
Field
x
-
mega
-
props=
{
{
span
:
5
}
}
x
-
mega
-
props=
{
{
span
:
5
}
}
name=
"tel
phone
"
name=
"tel"
x
-
component=
"Input"
x
-
component=
"Input"
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
placeholder
:
''
placeholder
:
''
...
...
src/pages/logistics/list/components/addressList.tsx
View file @
392814eb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-2
2 11:47:39
* @LastEditTime: 2020-07-2
4 10:58:55
*/
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
history
}
from
'umi'
...
@@ -18,7 +18,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
...
@@ -18,7 +18,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import
{
StandardTable
}
from
'god'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
const
data
=
[
const
data
=
[
{
{
key
:
'1'
,
key
:
'1'
,
...
@@ -121,20 +121,18 @@ const AddressList: React.FC<ListProps> = (props) => {
...
@@ -121,20 +121,18 @@ const AddressList: React.FC<ListProps> = (props) => {
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
table
,
setTable
]
=
useState
([])
const
[
table
,
setTable
]
=
useState
([])
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
const
edit
=
(
record
:
Item
)
=>
{
const
toEdit
=
(
id
:
number
)
=>
{
setEditingKey
(
record
.
key
);
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addressForm?type=
${
props
.
type
}
&id=
${
id
}
`
)
form
.
setFieldsValue
({
code
:
''
,
...
record
});
console
.
log
(
record
.
key
)
};
};
const
columns
:
ColumnType
<
any
>
[]
=
[
const
columns
:
ColumnType
<
any
>
[]
=
[
{
{
title
:
'发
货人姓名'
,
title
:
props
.
type
==
'1'
?
'发货人姓名'
:
'收
货人姓名'
,
dataIndex
:
'shipp
erName'
,
dataIndex
:
props
.
type
==
'1'
?
'shipperName'
:
'receiv
erName'
,
align
:
'center'
,
align
:
'center'
,
key
:
'shipp
erName'
,
key
:
props
.
type
==
'1'
?
'shipperName'
:
'receiv
erName'
,
},
},
{
{
title
:
'发
货地址'
,
title
:
props
.
type
==
'1'
?
'发货地址'
:
'收
货地址'
,
align
:
'left'
,
align
:
'left'
,
dataIndex
:
'address'
,
dataIndex
:
'address'
,
key
:
'address'
,
key
:
'address'
,
...
@@ -146,21 +144,21 @@ const AddressList: React.FC<ListProps> = (props) => {
...
@@ -146,21 +144,21 @@ const AddressList: React.FC<ListProps> = (props) => {
},
},
{
{
title
:
'邮编'
,
title
:
'邮编'
,
dataIndex
:
'
c
ode'
,
dataIndex
:
'
postalC
ode'
,
align
:
'center'
,
align
:
'center'
,
key
:
'
c
ode'
key
:
'
postalC
ode'
},
},
{
{
title
:
'手机号码'
,
title
:
'手机号码'
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'phone
NO
'
,
dataIndex
:
'phone'
,
key
:
'phone
NO
'
,
key
:
'phone'
,
},
},
{
{
title
:
'电话号码'
,
title
:
'电话号码'
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'tel
NO
'
,
dataIndex
:
'tel'
,
key
:
'tel
NO'
,
key
:
'tel
'
},
},
{
{
title
:
'是否默认'
,
title
:
'是否默认'
,
...
@@ -168,7 +166,7 @@ const AddressList: React.FC<ListProps> = (props) => {
...
@@ -168,7 +166,7 @@ const AddressList: React.FC<ListProps> = (props) => {
dataIndex
:
'isDefault'
,
dataIndex
:
'isDefault'
,
key
:
'isDefault'
,
key
:
'isDefault'
,
render
:
(
_
:
any
,
record
:
any
)
=>
render
:
(
_
:
any
,
record
:
any
)
=>
<
Switch
size=
'small'
defaultChecked=
{
record
.
isDefault
==
0
?
false
:
true
}
<
Switch
size=
'small'
d
isabled
d
efaultChecked=
{
record
.
isDefault
==
0
?
false
:
true
}
/>,
/>,
},
},
...
@@ -179,18 +177,11 @@ const AddressList: React.FC<ListProps> = (props) => {
...
@@ -179,18 +177,11 @@ const AddressList: React.FC<ListProps> = (props) => {
render
:
(
_
:
any
,
record
:
any
)
=>
{
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
return
(
<>
<>
<
Button
type=
'link'
>
启用
</
Button
>
<><
Button
type=
"link"
onClick=
{
()
=>
toEdit
(
record
.
id
)
}
>
编辑
</
Button
>
{
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
record
.
status
===
0
?
<
Button
type=
'link'
>
删除
</
Button
>
<><
Button
type=
"link"
onClick=
{
()
=>
edit
(
record
)
}
>
编辑
</
Button
>
</
Popconfirm
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
handleDelete
}
>
</>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
</>
:
''
}
<
Button
type=
'link'
>
查看
</
Button
>
</>
</>
)
)
}
}
...
@@ -198,20 +189,20 @@ const AddressList: React.FC<ListProps> = (props) => {
...
@@ -198,20 +189,20 @@ const AddressList: React.FC<ListProps> = (props) => {
];
];
// 模拟请求
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
props
.
type
===
'1'
)
{
//发货
if
(
props
.
type
===
'1'
)
{
//发货
PublicApi
.
getLogisticsShipperAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
PublicApi
.
getLogisticsShipperAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
})
})
}
else
{
}
else
{
PublicApi
.
getLogisticsReceiverAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
PublicApi
.
getLogisticsReceiverAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
})
})
}
}
})
})
}
}
//生命周期
//生命周期
// useEffect(() => {
// useEffect(() => {
// effect
// effect
...
@@ -226,8 +217,17 @@ const fetchData = (params: any) => {
...
@@ -226,8 +217,17 @@ const fetchData = (params: any) => {
})
})
}
}
const
handleDelete
=
()
=>
{
const
handleDelete
=
(
id
:
number
)
=>
{
console
.
log
(
'delete'
)
if
(
props
.
type
===
'1'
){
PublicApi
.
postLogisticsShipperAddressDelete
({
id
:
id
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
else
{
PublicApi
.
postLogisticsReceiverAddressDelete
({
id
:
id
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
}
}
const
search
:
IFormFilter
[]
=
[
const
search
:
IFormFilter
[]
=
[
{
{
...
@@ -270,6 +270,7 @@ const fetchData = (params: any) => {
...
@@ -270,6 +270,7 @@ const fetchData = (params: any) => {
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Card
>
<
Card
>
<
StandardTable
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
}
}
columns=
{
columns
}
columns=
{
columns
}
currentRef=
{
ref
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
...
@@ -277,7 +278,7 @@ const fetchData = (params: any) => {
...
@@ -277,7 +278,7 @@ const fetchData = (params: any) => {
formilyChilds=
{
{
formilyChilds=
{
{
children
:
(
children
:
(
<>
<>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addressForm?
addType=${props.type}
`
)
}
>
新建
</
Button
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addressForm?
type=${props.type}&id=0
`
)
}
>
新建
</
Button
>
</>
</>
)
)
}
}
}
}
...
...
src/pages/logistics/list/components/templateForm.tsx
View file @
392814eb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-2
2 11:23:30
* @LastEditTime: 2020-07-2
4 16:52:18
*/
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
import
ReactDOM
from
'react-dom'
...
@@ -36,6 +36,7 @@ import gou from '../../../../../mockStatic/gou.png'
...
@@ -36,6 +36,7 @@ import gou from '../../../../../mockStatic/gou.png'
import
japenImg
from
'../../../../../mockStatic/japen.png'
import
japenImg
from
'../../../../../mockStatic/japen.png'
import
korenImg
from
'../../../../../mockStatic/koren.png'
import
korenImg
from
'../../../../../mockStatic/koren.png'
import
us
from
'../../../../../mockStatic/us.png'
import
us
from
'../../../../../mockStatic/us.png'
import
{
values
}
from
'mobx'
;
const
_width
:
number
=
24
const
_width
:
number
=
24
const
_height
:
number
=
17
const
_height
:
number
=
17
...
@@ -57,7 +58,7 @@ export interface ListType {
...
@@ -57,7 +58,7 @@ export interface ListType {
* @param {type}
* @param {type}
* @return:
* @return:
*/
*/
const
{
location
}
=
history
const
actions
=
createFormActions
()
const
actions
=
createFormActions
()
const
{
ON_FORM_SUBMIT
}
=
LifeCycleTypes
//拿到Form提交API
const
{
ON_FORM_SUBMIT
}
=
LifeCycleTypes
//拿到Form提交API
const
onFormSubmit$
=
FormEffectHooks
const
onFormSubmit$
=
FormEffectHooks
...
@@ -82,7 +83,7 @@ const dropdownRender = () => {
...
@@ -82,7 +83,7 @@ const dropdownRender = () => {
// registerFormFields({ prefixSelect: connect()(CustomSelect) })
// registerFormFields({ prefixSelect: connect()(CustomSelect) })
const
diaLogForm
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
const
diaLogForm
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
const
type
:
string
=
history
.
location
.
query
.
addType
const
[
provinceList
,
setProvinceList
]
=
useState
([])
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
''
)
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
''
)
const
[
select
,
setSelect
]
=
useState
<
countryItem
>
({
const
[
select
,
setSelect
]
=
useState
<
countryItem
>
({
...
@@ -106,8 +107,39 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -106,8 +107,39 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const
handleChangeSelect
=
()
=>
{
const
handleChangeSelect
=
()
=>
{
}
}
/**
* @description: useEffect
* @param {type}
* @return:
*/
useEffect
(()
=>
{
useEffect
(()
=>
{
setHeaderTitle
(
'新建运费模板'
)
let
id
=
location
.
query
.
id
let
_title
=
id
==
0
?
'新建'
:
location
.
query
.
isSee
?
'查看'
:
'编辑'
setHeaderTitle
(
`
${
_title
}
运费模板`
)
PublicApi
.
getWarehouseAreaByPcodeAll
({
pcode
:
'100000'
}).
then
(
res
=>
{
let
list
=
[]
res
.
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
list
.
push
({
label
:
item
.
name
,
value
:
item
.
code
})
})
setProvinceList
(
list
)
})
if
(
id
!=
0
){
PublicApi
.
getLogisticsFreightTemplateGet
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
actions
.
setFieldState
(
key
,
state
=>
{
state
.
value
=
data
[
key
]
// if (key == 'isDefault') {
// state.value = data[key] === 0 ? false : true
// }
})
})
}
})
}
return
()
=>
{
return
()
=>
{
}
}
...
@@ -121,7 +153,18 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -121,7 +153,18 @@ const diaLogForm: React.FC<ListProps> = (props) => {
{
label
:
<><
img
src=
{
us
}
key=
'5'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'5'
}
{
label
:
<><
img
src=
{
us
}
key=
'5'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'5'
}
]
]
const
FormSumbit
=
(
values
:
any
)
=>
{
const
FormSumbit
=
(
values
:
any
)
=>
{
console
.
log
(
1111
,
values
)
let
id
=
location
.
query
.
id
let
value
=
{
...
values
}
if
(
id
==
0
){
PublicApi
.
postLogisticsFreightTemplateAdd
(
value
).
then
(
res
=>
{})
}
else
{
value
.
id
=
Number
(
id
)
PublicApi
.
postLogisticsFreightTemplateUpdate
(
value
).
then
(
res
=>
{})
}
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
}
const
addStyle
=
{
const
addStyle
=
{
padding
:
'2px 0'
,
padding
:
'2px 0'
,
...
@@ -152,7 +195,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -152,7 +195,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
transportMode
:
'1'
,
transportMode
:
'1'
,
designateList
:
[{}]
designateList
:
[{}]
}
}
}
}
onSubmit=
{
FormSumbit
}
onSubmit=
{
(
values
)
=>
FormSumbit
(
values
)
}
components=
{
{
components=
{
{
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
,
Radio
,
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
,
Radio
,
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
ArrayCards
,
Transfer
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
ArrayCards
,
Transfer
...
@@ -177,7 +220,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -177,7 +220,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
required
required
x
-
component=
"RadioGroup"
x
-
component=
"RadioGroup"
enum=
{
[
enum=
{
[
{
label
:
'按重量'
,
value
:
'1'
}
{
label
:
'按重量'
,
value
:
1
}
]
}
]
}
/>
/>
<
Field
<
Field
...
@@ -186,7 +229,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -186,7 +229,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
required
required
x
-
component=
"RadioGroup"
x
-
component=
"RadioGroup"
enum=
{
[
enum=
{
[
{
label
:
'快递'
,
value
:
'1'
}
{
label
:
'快递'
,
value
:
1
}
]
}
]
}
/>
/>
</
FormMegaLayout
>
</
FormMegaLayout
>
...
@@ -309,18 +352,13 @@ const diaLogForm: React.FC<ListProps> = (props) => {
...
@@ -309,18 +352,13 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x
-
component=
"Select"
x
-
component=
"Select"
title=
"运送到"
title=
"运送到"
name=
"areaIds"
name=
"areaIds"
enum=
{
[
enum=
{
provinceList
}
{
label
:
'广东省'
,
value
:
'1'
,
key
:
'1'
},
{
label
:
'海南省'
,
value
:
'2'
,
key
:
'2'
},
{
label
:
'广西省'
,
value
:
'3'
,
key
:
'3'
},
{
label
:
'Four'
,
value
:
'4'
,
key
:
'4'
}
]
}
x
-
component
-
props=
{
{
x
-
component
-
props=
{
{
showSearch
:
true
,
showSearch
:
true
,
mode
:
'tags'
,
//"multiple",
mode
:
'tags'
,
//"multiple",
onSearch
:
()
=>
{
onSearch
}
onSearch
:
()
=>
{
onSearch
}
,
// optionLabelProp:"value"//指定回显
}
}
}
}
/>
/>
<
Field
name=
"weight"
<
Field
name=
"weight"
...
...
src/pages/logistics/list/template.tsx
View file @
392814eb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-
18 15:13:49
* @LastEditTime: 2020-07-
24 16:20:16
*/
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
history
}
from
'umi'
...
@@ -18,6 +18,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
...
@@ -18,6 +18,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import
{
StandardTable
}
from
'god'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
PublicApi
}
from
'@/services/api'
const
data
=
[
const
data
=
[
{
{
...
@@ -44,26 +45,11 @@ const data = [
...
@@ -44,26 +45,11 @@ const data = [
// 模拟请求
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
)
PublicApi
.
getLogisticsFreightTemplatePage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
setTimeout
(()
=>
{
resolve
(
res
.
data
)
resolve
({
})
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
})
},
1000
)
})
})
}
}
// const fetchData = (param: any) => {
// return new Promise((resolve) => {
// let reqParam = {
// ...param
// }
// getUserInfoList(reqParam).then(res => {
// resolve(res)
// })
// })
// }
interface
Item
{
interface
Item
{
key
:
string
key
:
string
}
}
...
@@ -143,15 +129,25 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -143,15 +129,25 @@ const Template: React.FC<ListProps> = (props) => {
},
},
{
{
title
:
'计价方式'
,
title
:
'计价方式'
,
align
:
'
left
'
,
align
:
'
center
'
,
dataIndex
:
'pricingMode'
,
dataIndex
:
'pricingMode'
,
key
:
'pricingMode'
,
key
:
'pricingMode'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
transportMode
===
1
?
'按重量'
:
''
}
</>
)
}
},
},
{
{
title
:
'运送方式'
,
title
:
'运送方式'
,
dataIndex
:
'transportMode'
,
dataIndex
:
'transportMode'
,
align
:
'center'
,
align
:
'center'
,
key
:
'transportMode'
key
:
'transportMode'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
transportMode
===
1
?
'快递'
:
''
}
</>
)
}
},
},
{
{
title
:
'运费说明'
,
title
:
'运费说明'
,
...
@@ -164,23 +160,12 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -164,23 +160,12 @@ const Template: React.FC<ListProps> = (props) => {
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'status'
,
dataIndex
:
'status'
,
key
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
_
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
return
(
component
=
(
<
Button
type=
"link"
style=
{
record
.
status
===
1
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
status
===
1
?
'有效'
:
'无效'
}
<
Popconfirm
{
record
.
status
===
1
?
<
PlayCircleOutlined
/>
:
<
PauseCircleOutlined
/>
}
title=
"确定要执行这个操作?"
</
Button
>
onConfirm=
{
confirm
}
onCancel=
{
cancel
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
onClick=
{
()
=>
handleModify
(
record
)
}
style=
{
record
.
status
===
1
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
status
===
1
?
'有效'
:
'无效'
}
{
record
.
status
===
1
?
<
PlayCircleOutlined
/>
:
<
PauseCircleOutlined
/>
}
</
Button
>
</
Popconfirm
>
)
)
return
component
}
}
},
},
{
{
...
@@ -188,20 +173,27 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -188,20 +173,27 @@ const Template: React.FC<ListProps> = (props) => {
dataIndex
:
'option'
,
dataIndex
:
'option'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
render
:
(
_
:
any
,
record
:
any
)
=>
{
const
status
=
record
.
status
===
0
?
'启用'
:
'停用'
const
title
=
`确定要
${
status
}
吗?`
return
(
return
(
<>
<>
<
Button
type=
'link'
>
启用
</
Button
>
<
Popconfirm
title=
{
title
}
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleChangeStatus
(
record
.
id
,
record
.
status
)
}
>
<
Button
type=
'link'
>
{
record
.
status
===
0
?
'启用'
:
'停用'
}
</
Button
>
</
Popconfirm
>
{
{
record
.
status
===
0
?
record
.
status
===
0
?
<><
Button
type=
"link"
onClick=
{
()
=>
edit
(
record
)
}
>
编辑
</
Button
>
<>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
handleDelete
}
>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?id=${record.id}`
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
<
Button
type=
'link'
>
<
Button
type=
'link'
>
删除
删除
</
Button
>
</
Button
>
</
Popconfirm
>
</
Popconfirm
>
</>
:
''
</>
:
''
}
}
<
Button
type=
'link'
>
查看
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
handleSee
(
record
.
id
)
}
>
查看
</
Button
>
</>
</>
)
)
}
}
...
@@ -221,9 +213,21 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -221,9 +213,21 @@ const Template: React.FC<ListProps> = (props) => {
columns
.
forEach
((
v
,
index
)
=>
{
columns
.
forEach
((
v
,
index
)
=>
{
})
})
}
}
const
handleChangeStatus
=
(
id
:
any
,
status
:
any
)
=>
{
const
handleDelete
=
()
=>
{
let
_status
=
status
==
0
?
1
:
0
console
.
log
(
'delete'
)
PublicApi
.
postLogisticsFreightTemplateEnable
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
console
.
log
(
ref
)
ref
.
current
.
reload
()
}
})
}
const
handleDelete
=
(
id
:
number
)
=>
{
PublicApi
.
postLogisticsFreightTemplateDelete
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
ref
.
current
.
reload
()
}
})
}
}
const
search
:
IFormFilter
[]
=
[
const
search
:
IFormFilter
[]
=
[
{
{
...
@@ -233,20 +237,8 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -233,20 +237,8 @@ const Template: React.FC<ListProps> = (props) => {
placeHolder
:
'输入属性名称'
placeHolder
:
'输入属性名称'
}
}
]
]
const
handleSee
=
(
id
:
number
)
=>
{
const
searchBarActions
:
IButtonFilter
[]
=
[
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?id=
${
id
}
&isSee=true`
)
{
type
:
'primary'
,
text
:
'新建'
,
icon
:
<
PlusOutlined
/>,
handler
:
()
=>
{
history
.
push
(
'/memberCenter/logisticsAbility/logistics/list/addCompany'
)
}
}
]
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
}
}
const
confirm
=
()
=>
{
const
confirm
=
()
=>
{
...
@@ -273,7 +265,7 @@ const Template: React.FC<ListProps> = (props) => {
...
@@ -273,7 +265,7 @@ const Template: React.FC<ListProps> = (props) => {
formilyChilds=
{
{
formilyChilds=
{
{
children
:
(
children
:
(
<>
<>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?
addType=${props.type}
`
)
}
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?
id=0
`
)
}
>
新建
新建
</
Button
>
</
Button
>
</>
</>
...
...
src/pages/logistics/logisticsResult/orderSearchList.tsx
0 → 100644
View file @
392814eb
import
React
,
{
Component
}
from
'react'
import
OrderList
from
'../components/orderSearchList'
const
List
=
()
=>
{
return
(
<
OrderList
title=
'处理'
type=
'2'
/>
)
}
export
default
List
\ No newline at end of file
src/pages/logistics/logisticsSubmit/orderSearchList.tsx
View file @
392814eb
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
OrderList
from
'../components/orderSearchList'
import
OrderList
from
'../components/orderSearchList'
const
order
List
=
()
=>
{
const
List
=
()
=>
{
return
(
return
(
<
OrderList
/>
<
OrderList
title=
'提交'
type=
'1'
/>
)
)
}
}
export
default
OrderList
export
default
List
\ No newline at end of file
\ No newline at end of file
src/pages/logistics/logisticsSubmit/toOrderSumitList.tsx
0 → 100644
View file @
392814eb
/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-23 13:54:05
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
Modal
,
Card
,
Button
,
Form
,
InputNumber
,
Radio
,
Popconfirm
,
Switch
,
Input
}
from
'antd'
;
import
{
PlayCircleOutlined
,
PauseCircleOutlined
,
PlusOutlined
,
EyeOutlined
,
PlusCircleOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
PublicApi
}
from
'@/services/api'
const
data
=
[
{
key
:
'1'
,
shipperName
:
'采购商'
,
phone
:
'18819276235'
,
tel
:
'02020'
,
required
:
'平台物流服务商'
,
isDefault
:
0
,
code
:
252525
,
status
:
1
,
address
:
'地址'
},
{
key
:
'2'
,
shipperName
:
'采购商'
,
phone
:
'18819276235'
,
tel
:
'02020'
,
required
:
'平台物流服务商'
,
isDefault
:
0
,
code
:
252525
,
status
:
0
,
address
:
'地址32'
},
]
// const fetchData = (param: any) => {
// return new Promise((resolve) => {
// let reqParam = {
// ...param
// }
// getUserInfoList(reqParam).then(res => {
// resolve(res.data)
// })
// })
// }
interface
Item
{
key
:
string
}
//父页面传递来的参数
export
interface
ListProps
{
title
?:
React
.
ReactNode
,
type
:
string
}
export
interface
ListType
{
checked
:
boolean
//可选
}
interface
EditableCellProps
extends
React
.
HTMLAttributes
<
HTMLElement
>
{
editing
:
boolean
;
dataIndex
:
string
;
title
:
any
;
inputType
:
'number'
|
'text'
;
record
:
Item
;
index
:
number
;
children
:
React
.
ReactNode
;
}
const
EditableCell
:
React
.
FC
<
EditableCellProps
>
=
({
editing
,
dataIndex
,
title
,
inputType
,
record
,
index
,
children
,
...
restProps
})
=>
{
const
inputNode
=
inputType
===
'number'
?
<
InputNumber
/>
:
<
Input
/>;
return
(
<
td
{
...
restProps
}
>
{
editing
?
(
<
Form
.
Item
name=
{
dataIndex
}
style=
{
{
margin
:
0
}
}
rules=
{
[
{
required
:
true
,
message
:
`Please Input ${title}!`
,
},
]
}
>
{
inputNode
}
</
Form
.
Item
>
)
:
(
children
)
}
</
td
>
);
};
/**
* @description:
* @param {type}
* @return:
*/
const
AddressList
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
console
.
log
(
props
)
const
ref
=
useRef
({})
const
[
form
]
=
Form
.
useForm
();
const
[
table
,
setTable
]
=
useState
([])
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
const
edit
=
(
record
:
Item
)
=>
{
setEditingKey
(
record
.
key
);
form
.
setFieldsValue
({
code
:
''
,
...
record
});
console
.
log
(
record
.
key
)
};
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'发货人姓名'
,
dataIndex
:
'shipperName'
,
align
:
'center'
,
key
:
'shipperName'
,
},
{
title
:
'发货地址'
,
align
:
'left'
,
dataIndex
:
'address'
,
key
:
'address'
,
render
:
(
_
:
any
,
record
:
any
)
=>
(
<>
{
record
.
fullAddress
}
</>
)
},
{
title
:
'邮编'
,
dataIndex
:
'code'
,
align
:
'center'
,
key
:
'code'
},
{
title
:
'手机号码'
,
align
:
'center'
,
dataIndex
:
'phoneNO'
,
key
:
'phoneNO'
,
},
{
title
:
'电话号码'
,
align
:
'center'
,
dataIndex
:
'telNO'
,
key
:
'telNO'
},
{
title
:
'是否默认'
,
align
:
'center'
,
dataIndex
:
'isDefault'
,
key
:
'isDefault'
,
render
:
(
_
:
any
,
record
:
any
)
=>
<
Switch
size=
'small'
disabled
defaultChecked=
{
record
.
isDefault
==
0
?
false
:
true
}
/>,
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
<>
<
Button
type=
'link'
>
启用
</
Button
>
{
record
.
status
===
0
?
<><
Button
type=
"link"
onClick=
{
()
=>
edit
(
record
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
handleDelete
}
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
</>
:
''
}
<
Button
type=
'link'
>
查看
</
Button
>
</>
)
}
}
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
props
.
type
===
'1'
){
//发货
PublicApi
.
getLogisticsShipperAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
}
else
{
PublicApi
.
getLogisticsReceiverAddressPage
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
}
})
}
//生命周期
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [input])
const
onDefaultChange
=
(
id
:
any
,
checked
:
boolean
)
=>
{
console
.
log
(
id
,
checked
)
columns
.
forEach
((
v
,
index
)
=>
{
})
}
const
handleDelete
=
()
=>
{
console
.
log
(
'delete'
)
}
const
search
:
IFormFilter
[]
=
[
{
type
:
'Input'
,
value
:
'keywords'
,
col
:
4
,
placeHolder
:
'输入属性名称'
}
]
const
searchBarActions
:
IButtonFilter
[]
=
[
{
type
:
'primary'
,
text
:
'新建'
,
icon
:
<
PlusOutlined
/>,
handler
:
()
=>
{
history
.
push
(
'/logisticsAbility/logistics/list/addCompany'
)
}
}
]
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
}
const
confirm
=
()
=>
{
console
.
log
(
'confirm'
)
}
const
cancel
=
()
=>
{
console
.
log
(
'cancel'
)
}
const
handleModify
=
(
record
:
object
)
=>
{
// 通过传入的params字符串判断是修改那种类型的数据
console
.
log
(
'执行状态修改'
,
record
)
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
rowClassName=
"editable-row"
formilyChilds=
{
{
children
:
(
<>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addressForm?addType=${props.type}`
)
}
>
新建
</
Button
>
</>
)
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
AddressList
.
defaultProps
=
{
}
export
default
AddressList
\ No newline at end of file
src/pages/member/components/index.less
View file @
392814eb
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
color : #6B778C;
color : #6B778C;
&:nth-last-of-type(1) {
&:nth-last-of-type(1) {
flex :
3
;
flex :
2.5
;
padding-right: 20px;
padding-right: 20px;
box-sizing : border-box;
box-sizing : border-box;
color : #172B4D;
color : #172B4D;
...
@@ -201,4 +201,10 @@
...
@@ -201,4 +201,10 @@
color : #fff;
color : #fff;
background : @main-color;
background : @main-color;
margin-left: 10px;
margin-left: 10px;
}
.count{
font-weight: 500;
color: #172B4D;
font-size: 24px;
}
}
\ No newline at end of file
src/services/index.ts
View file @
392814eb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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