Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
max_android_panel
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xin
max_android_panel
Commits
4015187e
Commit
4015187e
authored
Sep 14, 2018
by
wujiabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 根据人物跳页面
parent
357b52a7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
26 deletions
+123
-26
client/actions/BreakageContainer.js
+18
-0
client/actions/common.js
+58
-7
client/actiontype/common.js
+3
-1
client/containers/BreakageContainer/BreakageConatiner.jsx
+14
-3
client/containers/HomePageContainer/HomePageContainer.jsx
+4
-3
client/containers/PageContainer/PageContainer.jsx
+5
-2
client/reducers/common.js
+21
-10
No files found.
client/actions/BreakageContainer.js
0 → 100644
View file @
4015187e
import
fetch
from
'isomorphic-fetch'
const
changeStatus
=
(
data
)
=>
{
let
{
taskId
,
currentTaskType
}
=
data
;
let
url
=
`http://192.168.10.128:8080/`
return
(
dispatch
)
=>
{
fetch
(
''
,{
credentials
:
'include'
,
method
:
'PUT'
,
mode
:
'cors'
,
body
:
{}
})
}
}
\ No newline at end of file
client/actions/common.js
View file @
4015187e
...
@@ -15,14 +15,33 @@ let myHeaders = new Headers({
...
@@ -15,14 +15,33 @@ let myHeaders = new Headers({
//测试使用的数据
let
testData
=
{
"meta"
:
{
"code"
:
"200"
,
"message"
:
"成功"
,
"success"
:
true
},
"data"
:
{
"whetherType"
:
false
,
"taskId"
:
297
,
"currentTaskName"
:
"遗留上报任务"
,
"currentTaskType"
:
"LR"
,
"currentTaskNum"
:
2
,
"totalTaskNum"
:
3
}
}
let
test
=
'http://192.168.10.128:8080/'
//开始工作
const
getTaskInfo
=
(
data
)
=>
{
const
getTaskInfo
=
(
data
)
=>
{
// let {employeeId,storeId} = data;
// let {employeeId,storeId} = data;
console
.
log
(
data
)
// let url = `${test}web/flat/ready${storeId}/${employeeId}`
console
.
log
(
'获取工单信息'
)
let
url
=
`
${
test
}
web/flat/ready/16/2`
;
let
test
=
'http://192.168.10.128:8080/'
// // let url = `${test}web/flat/ready${storeId}/${employeeId}`
let
url
=
`
${
test
}
web/flat/ready/1/2`
;
return
(
dispatch
)
=>
{
return
(
dispatch
)
=>
{
// let taskInfo=testData.data;
// dispatch(startalljob(Object.assign({},{taskInfo})))
fetch
(
url
,{
fetch
(
url
,{
credentials
:
'include'
,
credentials
:
'include'
,
method
:
'GET'
,
method
:
'GET'
,
...
@@ -31,6 +50,7 @@ const getTaskInfo = (data)=>{
...
@@ -31,6 +50,7 @@ const getTaskInfo = (data)=>{
}).
then
((
response
)
=>
response
.
json
())
}).
then
((
response
)
=>
response
.
json
())
.
then
(
json
=>
{
.
then
(
json
=>
{
let
taskInfo
=
Object
.
assign
({});
let
taskInfo
=
Object
.
assign
({});
console
.
log
(
json
,
'开始工作'
)
if
(
json
.
meta
.
success
&&
json
.
data
){
if
(
json
.
meta
.
success
&&
json
.
data
){
taskInfo
=
Object
.
assign
({},
json
.
data
)
taskInfo
=
Object
.
assign
({},
json
.
data
)
}
}
...
@@ -76,7 +96,7 @@ const getInfoByBarcode = (data)=>{
...
@@ -76,7 +96,7 @@ const getInfoByBarcode = (data)=>{
credentials
:
'include'
,
credentials
:
'include'
,
method
:
'GET'
,
method
:
'GET'
,
mode
:
'cors'
,
mode
:
'cors'
,
headers
:
{
'Content-Type'
:
'application/json'
}
,
headers
:
{
'Content-Type'
:
'application/json'
}
}).
then
(
response
=>
response
.
json
())
}).
then
(
response
=>
response
.
json
())
.
then
(
json
=>
{
.
then
(
json
=>
{
console
.
log
(
json
);
console
.
log
(
json
);
...
@@ -130,6 +150,37 @@ const test = ()=>{
...
@@ -130,6 +150,37 @@ const test = ()=>{
}).
catch
(
e
=>
{
console
.
error
(
e
)})
}).
catch
(
e
=>
{
console
.
error
(
e
)})
}
}
//拉取工单
const
getTaskList
=
(
data
)
=>
{
console
.
log
(
'拉取工单'
)
console
.
log
(
data
)
// let storeId = data.id;
let
url
=
`
${
test
}
web/flat/work/list/16`
return
(
dispatch
)
=>
{
fetch
(
url
,{
credentials
:
'include'
,
method
:
'GET'
,
mode
:
'cors'
,
headers
:
{
'Content-Type'
:
'application/json'
}
}).
then
((
reponse
)
=>
response
.
json
())
.
then
((
json
)
=>
{
console
.
log
(
json
,
'拉取工单'
)
let
taskList
=
Object
.
assign
({})
if
(
json
.
meta
.
success
&&
json
.
data
){
taskList
=
Object
.
assign
({},
json
.
data
)
}
dispatch
(
saveTaskListInfo
(
Object
.
assign
({},{
taskList
})))
})
}
}
const
saveTaskListInfo
=
(
data
)
=>
{
return
{
type
:
actionType
.
GETTASKLIST
,
data
}
}
const
setBarcodeInfo
=
(
data
)
=>
{
const
setBarcodeInfo
=
(
data
)
=>
{
return
{
return
{
type
:
actionType
.
SETBARCODEINFO
,
type
:
actionType
.
SETBARCODEINFO
,
...
@@ -164,4 +215,4 @@ const logout = ()=>{
...
@@ -164,4 +215,4 @@ const logout = ()=>{
}
}
}
}
export
{
getStoreInfo
,
getTaskInfo
,
getInfoByBarcode
,
saveCommonInfo
,
getUserinfo
,
logout
,
startalljob
,
te
st
}
export
{
getStoreInfo
,
getTaskInfo
,
getInfoByBarcode
,
saveCommonInfo
,
getUserinfo
,
logout
,
startalljob
,
saveTaskListInfo
,
getTaskLi
st
}
client/actiontype/common.js
View file @
4015187e
...
@@ -3,6 +3,7 @@ const actionTypes = {
...
@@ -3,6 +3,7 @@ const actionTypes = {
EMPTYBARCODEINFO
:
'EMPTYBARCODEINFO'
,
EMPTYBARCODEINFO
:
'EMPTYBARCODEINFO'
,
SAVECOMMONINFO
:
'SAVECOMMONINFO'
,
SAVECOMMONINFO
:
'SAVECOMMONINFO'
,
EMPTYCOMMONINFO
:
'EMPTYCOMMONINFO'
,
EMPTYCOMMONINFO
:
'EMPTYCOMMONINFO'
,
STARTALLJOB
:
'STARTALLJOB'
STARTALLJOB
:
'STARTALLJOB'
,
GETTASKLIST
:
'GETTASKLIST'
}
}
export
default
actionTypes
export
default
actionTypes
\ No newline at end of file
client/containers/BreakageContainer/BreakageConatiner.jsx
View file @
4015187e
import
React
from
"react"
import
React
from
"react"
import
Button
from
'../../components/CommonComponent/ButtonComponent/ButtonComponent'
import
LeftContainer
from
'../LeftContainer/LeftContainer'
import
RightContainer
from
'../RightContainer/RightContainer'
import
HeaderComponent
from
'../../components/CommonComponent/HeaderComponent/HeaderComponent'
class
BreakageContainer
extends
React
.
Component
{
class
BreakageContainer
extends
React
.
Component
{
constructor
(
props
){
constructor
(
props
){
super
(
props
)
super
(
props
)
...
@@ -7,12 +10,19 @@ class BreakageContainer extends React.Component {
...
@@ -7,12 +10,19 @@ class BreakageContainer extends React.Component {
render
(){
render
(){
let
props
=
this
.
props
;
return
(
return
(
<
div
className=
{
"BreakageContainer"
}
>
<
div
className=
{
"BreakageContainer"
}
>
<
HeaderComponent
headerInfo=
{
this
.
props
.
headerInfo
}
/>
<
LeftContainer
/>
<
RightContainer
>
<
Button
text=
{
'没有'
}
option=
{
this
.
props
.
pullTaskList
}
/>
</
RightContainer
>
</
div
>
</
div
>
)
)
}
}
componentDidMount
(){
}
}
}
export
default
BreakageContainer
export
default
BreakageContainer
\ No newline at end of file
client/containers/HomePageContainer/HomePageContainer.jsx
View file @
4015187e
...
@@ -43,6 +43,7 @@ export default class HomePageContainer extends React.Component{
...
@@ -43,6 +43,7 @@ export default class HomePageContainer extends React.Component{
)
)
}
}
start
(){
start
(){
console
.
log
(
'执行 开始工作了'
)
let
props
=
this
.
props
;
let
props
=
this
.
props
;
props
.
startTask
();
props
.
startTask
();
}
}
...
@@ -52,10 +53,10 @@ export default class HomePageContainer extends React.Component{
...
@@ -52,10 +53,10 @@ export default class HomePageContainer extends React.Component{
let
num
=
nextProps
.
headerInfo
.
taskInfo
.
currentTaskNum
;
let
num
=
nextProps
.
headerInfo
.
taskInfo
.
currentTaskNum
;
switch
(
num
){
switch
(
num
){
case
1
:
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
props
.
changePages
(
CONFIG
.
showPage
[
5
]);
break
;
break
;
case
1
:
case
2
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
props
.
changePages
(
CONFIG
.
showPage
[
5
]);
break
;
break
;
case
1
:
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
4015187e
...
@@ -9,7 +9,7 @@ import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitPr
...
@@ -9,7 +9,7 @@ import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitPr
import
{
getReportDamageList
,
deleteDamageItem
}
from
'../../actions/reportDamageList'
import
{
getReportDamageList
,
deleteDamageItem
}
from
'../../actions/reportDamageList'
import
{
getRefreshImg
,
deleteImg
,
emptyImg
}
from
"../../actions/refreshImg"
import
{
getRefreshImg
,
deleteImg
,
emptyImg
}
from
"../../actions/refreshImg"
import
{
uploadError
,
addErrorInfo
}
from
'../../actions/uploadError'
import
{
uploadError
,
addErrorInfo
}
from
'../../actions/uploadError'
import
{
getTaskInfo
}
from
'../../actions/common'
import
{
getTaskInfo
,
getTaskList
}
from
'../../actions/common'
import
PopupComponent
from
'../../components/CommonComponent/PopupComponent/PopupComponent'
import
PopupComponent
from
'../../components/CommonComponent/PopupComponent/PopupComponent'
import
TroubleContainer
from
'../TroubleContainer/TroubleContainer'
import
TroubleContainer
from
'../TroubleContainer/TroubleContainer'
import
ScanBarCodeContainer
from
'../ScanBarCodeContainer/ScanBarCodeContaienr'
import
ScanBarCodeContainer
from
'../ScanBarCodeContainer/ScanBarCodeContaienr'
...
@@ -570,7 +570,10 @@ class PageContainer extends React.Component {
...
@@ -570,7 +570,10 @@ class PageContainer extends React.Component {
pages =
<
TakeStokeContainer
headerInfo
=
{
state
.
commonInfo
}
/>
;
pages =
<
TakeStokeContainer
headerInfo
=
{
state
.
commonInfo
}
/>
;
break;
break;
case showPage[5]:
case showPage[5]:
pages =
<
BreakageContainer
/>
;
pages =
<
BreakageContainer
pullTaskList=
{
()
=>
{
dispatch
(
getTaskList
(
state
.
commonInfo
.
storeInfo
))}
}
headerInfo=
{
state
.
commonInfo
}
/>
;
break;
break;
case showPage[10]:
case showPage[10]:
pages =
<
RecoveryPage
pages =
<
RecoveryPage
...
...
client/reducers/common.js
View file @
4015187e
...
@@ -23,25 +23,29 @@ const emptyCommInfo = (state,data)=>{
...
@@ -23,25 +23,29 @@ const emptyCommInfo = (state,data)=>{
return
Object
.
assign
({},
state
,
data
)
return
Object
.
assign
({},
state
,
data
)
}
}
let
testData
=
{
currentTaskNum
:
1
,
childTaskNum
:
1
}
// 传入一个对象 对象中包含currentTaskNum表示大任务
// 传入一个对象 对象中包含currentTaskNum表示大任务
// childTaskNum 表示大任务下的小任务
// childTaskNum 表示大任务下的小任务
const
NumChangeWord
=
(
obj
)
=>
{
const
NumChangeWord
=
(
obj
)
=>
{
let
arr
=
[
let
arr
=
[
{
{
title
:
'散落商品检查'
,
title
:
'散落商品检查'
,
children
:[
'
1'
,
'
2'
]
children
:[
'
散落1'
,
'散落
2'
]
},
},
{
{
title
:
'核对数量'
,
title
:
'核对数量'
,
children
:[
'
1'
,
'
2'
]
children
:[
'
核对1'
,
'核对
2'
]
},
},
{
{
title
:
'回收区货品回收'
,
title
:
'回收区货品回收'
,
children
:[
'
1'
,
'
2'
]
children
:[
'
回收1'
,
'回收
2'
]
},
},
{
{
title
:
'补货'
,
title
:
'补货'
,
children
:[
'
1'
,
'
2'
]
children
:[
'
补货1'
,
'补货
2'
]
}
}
]
]
let
name
=
obj
.
currentTaskNum
;
let
name
=
obj
.
currentTaskNum
;
...
@@ -50,34 +54,39 @@ const NumChangeWord=(obj)=>{
...
@@ -50,34 +54,39 @@ const NumChangeWord=(obj)=>{
case
1
:
case
1
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
if
(
child
){
obj
.
childTaskN
um
=
arr
[
name
-
1
].
children
[
child
-
1
]
obj
.
childTaskN
ame
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
}
break
;
break
;
case
2
:
case
2
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
if
(
child
){
obj
.
childTaskN
um
=
arr
[
name
-
1
].
children
[
child
-
1
]
obj
.
childTaskN
ame
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
}
break
;
break
;
case
3
:
case
3
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
if
(
child
){
obj
.
childTaskN
um
=
arr
[
name
-
1
].
children
[
child
-
1
]
obj
.
childTaskN
ame
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
}
break
;
break
;
case
4
:
case
4
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
if
(
child
){
obj
.
childTaskN
um
=
arr
[
name
-
1
].
children
[
child
-
1
]
obj
.
childTaskN
ame
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
}
break
;
break
;
}
}
}
}
const
startalljob
=
(
state
,
data
)
=>
{
const
startalljob
=
(
state
,
data
)
=>
{
let
info
=
saveCommonInfo
(
state
,
data
);
let
info
=
saveCommonInfo
(
state
,
data
);
return
info
;
return
info
;
}
}
const
saveTaskList
=
(
state
,
data
)
=>
{
return
Object
.
assign
({},
state
,
data
)
}
export
default
function
(
state
=
{},
action
)
{
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
actionTypes
.
SAVECOMMONINFO
:
case
actionTypes
.
SAVECOMMONINFO
:
...
@@ -86,6 +95,8 @@ export default function(state={}, action) {
...
@@ -86,6 +95,8 @@ export default function(state={}, action) {
return
emptyCommInfo
(
state
);
return
emptyCommInfo
(
state
);
case
actionTypes
.
STARTALLJOB
:
case
actionTypes
.
STARTALLJOB
:
return
startalljob
(
state
,
action
.
data
);
return
startalljob
(
state
,
action
.
data
);
case
actionTypes
.
GETTASKLIST
:
return
saveTaskList
(
state
,
action
.
data
)
default
:
default
:
return
state
;
return
state
;
}
}
...
...
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