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
121eb5d0
Commit
121eb5d0
authored
Jul 24, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分状态-查看,编辑
parent
392814eb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
30 deletions
+39
-30
addCompany.tsx
src/pages/logistics/list/addCompany.tsx
+4
-4
company.tsx
src/pages/logistics/list/company.tsx
+1
-1
addressForm.tsx
src/pages/logistics/list/components/addressForm.tsx
+21
-13
templateForm.tsx
src/pages/logistics/list/components/templateForm.tsx
+11
-10
template.tsx
src/pages/logistics/list/template.tsx
+2
-2
index.ts
src/services/index.ts
+0
-0
No files found.
src/pages/logistics/list/addCompany.tsx
View file @
121eb5d0
...
...
@@ -10,7 +10,6 @@ import ReutrnEle from '@/components/ReturnEle';
import
{
PublicApi
,
CustomApi
}
from
'@/services/api'
import
{
addCompany
,
updateCompany
,
getCompanyDetail
}
from
'@/services/logistics/index'
import
style
from
"./addCompany.less"
const
{
location
}
=
history
export
interface
companyProps
{
}
...
...
@@ -82,8 +81,8 @@ const company: React.FC<{}> = () => {
const
[
selectRow
,
setSelectRow
]
=
useState
<
Item
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([])
useEffect
(()
=>
{
let
_title
=
location
.
query
.
id
==
0
?
'新建'
:
location
.
query
.
isSee
?
'查看'
:
'编辑'
let
_title
=
history
.
location
.
query
.
id
==
0
?
'新建'
:
history
.
location
.
query
.
isSee
?
'查看'
:
'编辑'
setHeaderTitle
(
`
${
_title
}
物流公司`
)
if
(
id
!==
'0'
)
{
PublicApi
.
getLogisticsCompanyGet
({
id
:
id
}).
then
(
res
=>
{
...
...
@@ -184,6 +183,7 @@ const company: React.FC<{}> = () => {
{
(<
Form
form=
{
menuForm
}
colon=
{
false
}
name=
"edit_infomation"
layout=
"horizontal"
labelAlign=
"left"
...
...
@@ -237,7 +237,7 @@ const company: React.FC<{}> = () => {
}
]
}
>
<
Input
disabled
maxLength=
{
20
}
/>
<
Input
maxLength=
{
20
}
/>
</
Form
.
Item
>
}
</
Col
>
...
...
src/pages/logistics/list/company.tsx
View file @
121eb5d0
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 1
6:25:17
* @LastEditTime: 2020-07-24 1
7:54:55
*/
import
React
,
{
ReactNode
,
useRef
}
from
'react'
...
...
src/pages/logistics/list/components/addressForm.tsx
View file @
121eb5d0
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 1
6:31:22
* @LastEditTime: 2020-07-24 1
9:48:44
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
...
...
@@ -79,6 +79,7 @@ const dropdownRender = () => {
const
diaLogForm
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
const
type
:
string
=
history
.
location
.
query
.
type
const
[
areaCode
,
setAreaCode
]
=
useState
<
number
>
(
null
)
const
[
Options
,
setOptions
]
=
useState
([])
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
headerTitle
,
setHeaderTitle
]
=
useState
(
''
)
...
...
@@ -112,6 +113,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
})
}
else
{
value
.
id
=
id
PublicApi
.
postLogisticsShipperAddressUpdate
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
...
...
@@ -124,6 +126,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
})
}
else
{
value
.
id
=
id
PublicApi
.
postLogisticsReceiverAddressUpdate
(
value
).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
}
...
...
@@ -160,7 +163,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
let
_Options
:
any
=
[]
List
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
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
).
toString
()
})
})
/**
...
...
@@ -169,8 +172,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
* @return:
*/
useEffect
(()
=>
{
const
id
=
history
.
location
.
query
.
id
let
title
=
id
==
0
?
'新建'
:
'编辑'
const
id
=
Number
(
history
.
location
.
query
.
id
)
console
.
log
(
typeof
(
id
))
let
title
=
id
===
0
?
'新建'
:
'编辑'
history
.
location
.
query
.
type
==
'1'
?
setHeaderTitle
(
`
${
title
}
发货地址`
)
:
setHeaderTitle
(
`
${
title
}
收货地址`
)
setOptions
(
_Options
)
PublicApi
.
getLogisticsShipperAddressGetTelCode
().
then
(
res
=>
{})
...
...
@@ -181,8 +185,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
setProvinceList
(
list
)
})
if
(
location
.
query
.
id
!
=
0
&&
location
.
query
.
type
==
'1'
)
{
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
id
}).
then
(
res
=>
{
if
(
id
!=
=
0
&&
location
.
query
.
type
==
'1'
)
{
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
id
.
toString
()
}).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
...
...
@@ -191,6 +195,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
if
(
key
==
'isDefault'
)
{
state
.
value
=
data
[
key
]
===
0
?
false
:
true
}
// else if(key == 'areaCode'){
// setAreaCode(Number(data[key]))
// }
})
})
}
...
...
@@ -198,8 +205,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
//收货
if
(
location
.
query
.
id
!
=
0
&&
location
.
query
.
type
==
'2'
)
{
PublicApi
.
getLogisticsReceiverAddressGet
({
id
:
id
}).
then
(
res
=>
{
if
(
id
==
=
0
&&
location
.
query
.
type
==
'2'
)
{
PublicApi
.
getLogisticsReceiverAddressGet
({
id
:
id
.
toString
()
}).
then
(
res
=>
{
if
(
res
.
code
==
1000
)
{
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
...
...
@@ -273,11 +280,12 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<
Row
>
<
Col
span=
{
16
}
>
<
SchemaForm
editable=
{
state
.
editable
}
// initialValues={{
// provinceId: '',
// cityId:'111120',
// districtId:'121212'
// }}
initialValues=
{
{
// areaCode: areaCode
// provinceId: '',
// cityId:'111120',
// districtId:'121212'
}
}
actions=
{
actions
}
//要传递
components=
{
{
Input
,
Select
,
TextArea
:
Input
.
TextArea
,
Switch
...
...
src/pages/logistics/list/components/templateForm.tsx
View file @
121eb5d0
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24
16:52:18
* @LastEditTime: 2020-07-24
20:10:56
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
...
...
@@ -58,7 +58,7 @@ export interface ListType {
* @param {type}
* @return:
*/
const
{
location
}
=
history
const
actions
=
createFormActions
()
const
{
ON_FORM_SUBMIT
}
=
LifeCycleTypes
//拿到Form提交API
const
onFormSubmit$
=
FormEffectHooks
...
...
@@ -113,14 +113,17 @@ const diaLogForm: React.FC<ListProps> = (props) => {
* @return:
*/
useEffect
(()
=>
{
let
id
=
location
.
query
.
id
let
_title
=
id
==
0
?
'新建'
:
location
.
query
.
isSee
?
'查看'
:
'编辑'
let
id
=
history
.
location
.
query
.
id
let
_title
=
history
.
location
.
query
.
isSee
?
'查看'
:
Number
(
id
)
===
0
?
'新建'
:
'编辑'
// console.log(id,typeof id,history.location.query.isSee,typeof history.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
})
list
.
push
({
label
:
item
.
name
,
value
:
Number
(
item
.
code
)
})
})
setProvinceList
(
list
)
})
...
...
@@ -130,10 +133,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
let
data
=
res
.
data
Object
.
keys
(
data
).
forEach
(
key
=>
{
actions
.
setFieldState
(
key
,
state
=>
{
console
.
log
(
111
,
key
)
state
.
value
=
data
[
key
]
// if (key == 'isDefault') {
// state.value = data[key] === 0 ? false : true
// }
})
})
}
...
...
@@ -153,7 +154,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
{
label
:
<><
img
src=
{
us
}
key=
'5'
style=
{
{
width
:
_width
,
height
:
17
}
}
/>
+86
</>,
value
:
'5'
}
]
const
FormSumbit
=
(
values
:
any
)
=>
{
let
id
=
location
.
query
.
id
let
id
=
history
.
location
.
query
.
id
let
value
=
{
...
values
}
if
(
id
==
0
){
PublicApi
.
postLogisticsFreightTemplateAdd
(
value
).
then
(
res
=>
{})
...
...
src/pages/logistics/list/template.tsx
View file @
121eb5d0
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24
16:20:16
* @LastEditTime: 2020-07-24
20:08:29
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
...
...
@@ -238,7 +238,7 @@ const Template: React.FC<ListProps> = (props) => {
}
]
const
handleSee
=
(
id
:
number
)
=>
{
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?id=
${
id
}
&isSee=
true
`
)
history
.
push
(
`/memberCenter/logisticsAbility/logistics/list/templateForm?id=
${
id
}
&isSee=
${
true
}
`
)
}
const
confirm
=
()
=>
{
...
...
src/services/index.ts
View file @
121eb5d0
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