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
5bded2e7
Commit
5bded2e7
authored
Jul 22, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'1'
parent
089186ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
187 additions
and
30 deletions
+187
-30
addCompany.tsx
src/pages/logistics/list/addCompany.tsx
+0
-0
company.tsx
src/pages/logistics/list/company.tsx
+56
-22
addressList.tsx
src/pages/logistics/list/components/addressList.tsx
+1
-1
API.d.ts
src/services/logistics/API.d.ts
+42
-2
index.ts
src/services/logistics/index.ts
+88
-5
No files found.
src/pages/logistics/list/addCompany.tsx
View file @
5bded2e7
This diff is collapsed.
Click to expand it.
src/pages/logistics/list/company.tsx
View file @
5bded2e7
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-
18 15:12:44
* @LastEditTime: 2020-07-
20 17:19:01
*/
import
React
,
{
ReactNode
,
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Popconfirm
,
Card
}
from
'antd'
import
{
Button
,
Popconfirm
,
Card
,
message
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PlusOutlined
,
...
...
@@ -17,6 +17,7 @@ import {
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
{
getCompanyList
,
delCompany
,
updateCompanyStatus
}
from
'@/services/logistics/index'
const
data
=
[
{
...
...
@@ -38,16 +39,12 @@ const data = [
]
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
)
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
})
},
1000
)
getCompanyList
({
current
:
params
.
page
,
pageSize
:
params
.
rows
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
...
...
@@ -57,21 +54,24 @@ const Company: React.FC<{}> = () => {
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'
key
'
,
dataIndex
:
'
id
'
,
align
:
'center'
,
key
:
'
key
'
,
key
:
'
id
'
,
},
{
title
:
'物流公司编码/平台会员ID'
,
align
:
'center'
,
dataIndex
:
'required'
,
key
:
'required'
,
dataIndex
:
'memberId'
,
key
:
"memberId"
,
render
:
(
value
:
any
,
recond
:
any
)
=>
<>
{
recond
.
memberId
?
recond
.
memberId
:
recond
.
code
}
</>
},
{
title
:
'属性名称'
,
dataIndex
:
'
attrN
ame'
,
dataIndex
:
'
n
ame'
,
align
:
'center'
,
key
:
'
attrN
ame'
,
key
:
'
n
ame'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
},
{
...
...
@@ -113,13 +113,28 @@ const Company: React.FC<{}> = () => {
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
const
status
=
record
.
status
===
0
?
'启用'
:
'停用'
const
title
=
`确定要
${
status
}
吗?`
return
(
<>
<
Button
type=
'link'
>
启用
</
Button
>
{
record
.
status
===
0
?
<><
Button
type=
'link'
>
编辑
</
Button
><
Button
type=
'link'
>
删除
</
Button
></>
:
''
}
<
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
?
<>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}`
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
</>
:
''
}
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}&isSee=true`
)
}
>
查看
</
Button
>
</>
)
}
...
...
@@ -135,6 +150,7 @@ const Company: React.FC<{}> = () => {
}
]
const
searchBarActions
:
IButtonFilter
[]
=
[
{
type
:
'primary'
,
...
...
@@ -145,6 +161,24 @@ const Company: React.FC<{}> = () => {
}
}
]
const
handleDelete
=
(
id
:
any
)
=>
{
delCompany
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
success
(
res
.
message
)
ref
.
current
.
reload
()
}
})
}
const
handleChangeStatus
=
(
id
:
any
,
status
:
any
)
=>
{
let
_status
=
status
==
0
?
1
:
0
updateCompanyStatus
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
message
.
success
(
res
.
message
)
console
.
log
(
ref
)
ref
.
current
.
reload
()
}
})
}
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
...
...
src/pages/logistics/list/components/addressList.tsx
View file @
5bded2e7
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-
18 17:48:11
* @LastEditTime: 2020-07-
20 16:08:09
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
...
...
src/services/logistics/API.d.ts
View file @
5bded2e7
declare
namespace
LogisticsApi
{
interface
RegisterTypeDTO
{
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 16:33:05
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-20 17:02:09
*/
declare
namespace
LogisticsAPI
{
/**
* @description: 只有基础参数
* @param {type} current ;pageSize
* @return:
*/
export
interface
justBaseParams
{
current
:
number
,
pageSize
:
number
}
//删除id
export
interface
delID
{
id
:
number
|
string
}
//查询id
export
interface
detailID
{
id
:
number
}
//添加 || 编辑
export
interface
CompanyItem
{
id
?:
number
,
memberId
?:
number
,
name
:
string
,
code
?:
string
|
number
,
cooperateType
:
number
,
remark
:
string
}
export
interface
CompanyStatus
{
id
:
number
,
status
:
number
|
string
}
}
\ No newline at end of file
src/services/logistics/index.ts
View file @
5bded2e7
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 16:33:16
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-20 17:14:20
*/
import
request
from
'@/utils/request'
;
const
prefix
=
''
/**
* @description 物流公司
* @description 物流公司
列表
* @param
*/
export
async
function
getCompanyList
(
params
:
LogisticsA
pi
.
RegisterTypeDTO
)
{
return
request
(
''
,
{
export
async
function
getCompanyList
(
params
:
LogisticsA
PI
.
justBaseParams
)
{
return
request
(
'
/logistics/company/page
'
,
{
method
:
'get'
,
prefix
,
params
//get请求 不用写 data: params这样形式
})
}
/**
* @description: 新增公司
* @param {type}
* @return:
*/
export
async
function
addCompany
(
params
:
LogisticsAPI
.
CompanyItem
){
return
request
(
'/logistics/company/add'
,{
method
:
'post'
,
prefix
,
data
:
params
})
}
/**
* @description: 编辑公司
* @param {type}
* @return:
*/
export
async
function
updateCompany
(
params
:
LogisticsAPI
.
CompanyItem
){
return
request
(
'/logistics/company/update'
,{
method
:
'post'
,
prefix
,
data
:
params
})
}
/**
* @description: 删除公司
* @param {type}
* @return:
*/
export
async
function
delCompany
(
params
:
LogisticsAPI
.
delID
){
return
request
(
'/logistics/company/delete'
,{
method
:
'post'
,
prefix
,
data
:
params
})
}
export
async
function
getCompanyDetail
(
params
:
LogisticsAPI
.
delID
){
return
request
(
'/logistics/company/get'
,{
method
:
'get'
,
prefix
,
params
})
}
/**
* @description: 公司状态
* @param {type}
* @return:
*/
export
async
function
updateCompanyStatus
(
params
:
LogisticsAPI
.
CompanyStatus
){
return
request
(
'/logistics/company/enable'
,{
method
:
'post'
,
prefix
,
data
:
params
})
}
/**
* @description: 物流模板列表
* @param {type}
* @return:
*/
export
async
function
freightTemplateList
(
params
:
LogisticsAPI
.
justBaseParams
){
return
request
(
'/logistics/freightTemplate/page'
,{
method
:
'post'
,
prefix
,
data
:
params
})
}
\ No newline at end of file
}
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