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
644e9bd1
Commit
644e9bd1
authored
Sep 26, 2018
by
Zhang Xin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
é联调捕补货
parent
0846eb2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
210 additions
and
104 deletions
+210
-104
client/actions/barcodeCommon.js
+5
-3
client/actions/common.js
+32
-22
client/actions/recovery.js
+2
-1
client/actions/replenish.js
+27
-1
client/actions/uploadError.js
+4
-2
client/components/CommonComponent/ButtonComponent/ButtonComponent.jsx
+10
-1
client/components/CommonComponent/SkuInfoComponent/SkuInfoComponent.jsx
+2
-2
client/components/RecoveryComponent/RecoveryFirstPage/RecoveryFirstPage.jsx
+4
-3
client/components/RecoveryComponent/RecoveryScanPage/RecoveryScanPage.jsx
+1
-1
client/components/RecoveryComponent/RecoverySecondPage/RecoverySecondPage.jsx
+31
-3
client/components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage.jsx
+0
-0
client/components/ReplenishComponent/ReplenishSkuPage/ReplenishSkuPage.jsx
+0
-0
client/config/taskErrorType.js
+7
-5
client/containers/LeftContainer/LeftContainer.jsx
+2
-3
client/containers/PageContainer/PageContainer.jsx
+39
-34
client/containers/RecoveryContainer/RecoveryContainer.jsx
+4
-4
client/containers/ReplenishContainer/ReplenishContainer.jsx
+38
-17
client/reducers/barcodeCommon.js
+2
-2
No files found.
client/actions/barcodeCommon.js
View file @
644e9bd1
...
@@ -27,6 +27,7 @@ const getBarCodeProductInfo = (data)=>{
...
@@ -27,6 +27,7 @@ const getBarCodeProductInfo = (data)=>{
dispatch
(
saveCommonInfo
(
info
))
dispatch
(
saveCommonInfo
(
info
))
dispatch
(
saveProductInfo
(
json
.
data
))
dispatch
(
saveProductInfo
(
json
.
data
))
}
else
{
}
else
{
dispatch
(
saveProductInfo
({}));
switch
(
taskInfo
.
currentTaskType
){
switch
(
taskInfo
.
currentTaskType
){
case
3
:
case
3
:
//回收任务
//回收任务
...
@@ -68,6 +69,7 @@ const saveProductInfo = (data)=>{
...
@@ -68,6 +69,7 @@ const saveProductInfo = (data)=>{
type
:
barcodeActionType
.
GETPRODUCTINFO
,
type
:
barcodeActionType
.
GETPRODUCTINFO
,
data
data
}
}
}
}
export
{
getBarCodeProductInfo
}
export
{
getBarCodeProductInfo
,
saveProductInfo
}
\ No newline at end of file
\ No newline at end of file
client/actions/common.js
View file @
644e9bd1
...
@@ -73,29 +73,39 @@ const getTaskList = (data={})=>{
...
@@ -73,29 +73,39 @@ const getTaskList = (data={})=>{
let
taskId
=
taskInfo
.
taskId
||
0
;
let
taskId
=
taskInfo
.
taskId
||
0
;
let
url
=
`
${
domain
}
flat/work/list/
${
storeInfo
.
id
}
/
${
taskInfo
.
area
}
/
${
taskId
}
/
${
userInfo
.
id
}
`
;
let
url
=
`
${
domain
}
flat/work/list/
${
storeInfo
.
id
}
/
${
taskInfo
.
area
}
/
${
taskId
}
/
${
userInfo
.
id
}
`
;
return
(
dispatch
)
=>
{
return
(
dispatch
)
=>
{
fetch
(
url
,{
if
(
!
userInfo
.
id
){
// credentials : 'include',
dispatch
(
addErrorInfo
(
'没有获取用户信息'
))
method
:
'GET'
,
}
else
if
(
!
taskInfo
.
area
){
mode
:
'cors'
,
dispatch
(
addErrorInfo
(
'没有获取区域信息'
))
headers
:
myHeaders
}
else
{
}).
then
(
response
=>
response
.
json
())
fetch
(
url
,{
.
then
((
json
)
=>
{
// credentials : 'include',
let
data
=
Object
.
assign
({});
method
:
'GET'
,
console
.
log
(
"拉取工单 "
,
json
)
mode
:
'cors'
,
if
(
json
.
meta
.
success
&&
json
.
data
){
headers
:
myHeaders
data
.
taskInfo
=
Object
.
assign
({},
json
.
data
.
flatCommonVo
)
}).
then
(
response
=>
response
.
json
())
data
.
taskList
=
Object
.
assign
({},
json
.
data
.
skuFlatVo
);
.
then
((
json
)
=>
{
let
childNum
=
0
;
let
data
=
Object
.
assign
({});
let
currentTaskType
=
json
.
data
.
flatCommonVo
.
currentTaskType
;
console
.
log
(
"拉取工单 "
,
json
)
let
currentTaskNum
=
json
.
data
.
flatCommonVo
.
currentTaskNum
;
if
(
json
.
meta
.
success
&&
json
.
data
){
if
(
currentTaskType
===
'RE'
){
data
.
taskInfo
=
Object
.
assign
({},
json
.
data
.
flatCommonVo
)
//回收
data
.
taskList
=
Object
.
assign
({},
json
.
data
.
skuFlatVo
);
childNum
=
json
.
data
.
skuFlatVo
.
whetherType
?
1
:
2
let
childNum
=
0
;
let
currentTaskType
=
json
.
data
.
flatCommonVo
.
currentTaskType
;
let
currentTaskNum
=
json
.
data
.
flatCommonVo
.
currentTaskNum
;
if
(
currentTaskType
===
'RE'
){
//回收
if
(
taskInfo
.
currentTaskType
!==
"RE"
){
childNum
=
json
.
data
.
skuFlatVo
.
whetherType
?
1
:
2
}
else
{
childNum
=
2
}
}
dispatch
(
getTaskName
(
currentTaskType
,
childNum
))
}
}
dispatch
(
getTaskName
(
currentTaskType
,
childNum
))
dispatch
(
saveCommonInfo
(
Object
.
assign
({},
data
)))
}
})
dispatch
(
saveCommonInfo
(
Object
.
assign
({},
data
)))
}
})
}
}
}
}
...
...
client/actions/recovery.js
View file @
644e9bd1
import
fetch
from
'isomorphic-fetch'
;
import
fetch
from
'isomorphic-fetch'
;
import
{
getTaskList
}
from
"./common"
;
import
{
getTaskList
}
from
"./common"
;
import
{
saveProductInfo
}
from
'./barcodeCommon'
const
domain
=
ENV
.
domain
;
const
domain
=
ENV
.
domain
;
let
myHeaders
=
new
Headers
({
let
myHeaders
=
new
Headers
({
// 'Access-Control-Allow-Origin': '*',
// 'Access-Control-Allow-Origin': '*',
...
@@ -29,10 +30,10 @@ const finishBoxRecovery = (info)=>{
...
@@ -29,10 +30,10 @@ const finishBoxRecovery = (info)=>{
body
:
JSON
.
stringify
(
bodyData
)
body
:
JSON
.
stringify
(
bodyData
)
}).
then
(
response
=>
response
.
json
())
}).
then
(
response
=>
response
.
json
())
.
then
((
json
)
=>
{
.
then
((
json
)
=>
{
dispatch
(
saveProductInfo
({}));
dispatch
(
getTaskList
(
info
));
dispatch
(
getTaskList
(
info
));
})
})
}
}
};
};
export
{
finishBoxRecovery
}
export
{
finishBoxRecovery
}
client/actions/replenish.js
View file @
644e9bd1
import
fetch
from
'isomorphic-fetch'
;
import
fetch
from
'isomorphic-fetch'
;
import
actionType
from
'../actiontype/replenish'
import
actionType
from
'../actiontype/replenish'
import
{
getTaskList
}
from
"./common"
;
import
{
getTaskList
}
from
"./common"
;
import
{
saveProductInfo
}
from
"./barcodeCommon"
;
const
domain
=
ENV
.
domain
;
const
domain
=
ENV
.
domain
;
let
myHeaders
=
new
Headers
({
let
myHeaders
=
new
Headers
({
...
@@ -22,4 +23,29 @@ const emptyErrorInfo = ()=>{
...
@@ -22,4 +23,29 @@ const emptyErrorInfo = ()=>{
}
}
}
}
export
default
{
wrongQrcode
,
emptyErrorInfo
}
const
finishReplenish
=
(
info
)
=>
{
//已放入回收箱
let
{
userInfo
,
taskInfo
,
storeInfo
}
=
info
;
let
bodyData
=
Object
.
assign
({},{
storeId
:
storeInfo
.
id
,
taskId
:
taskInfo
.
taskId
,
userId
:
userInfo
.
id
,
taskType
:
taskInfo
.
currentTaskType
,
area
:
taskInfo
.
area
})
let
url
=
`
${
domain
}
machine_pad/trigger_ck_task_sku.action`
return
(
dispatch
)
=>
{
fetch
(
url
,{
credentials
:
'include'
,
method
:
'POST'
,
mode
:
'cors'
,
headers
:
myHeaders
,
body
:
JSON
.
stringify
(
bodyData
)
}).
then
(
response
=>
response
.
json
())
.
then
((
json
)
=>
{
dispatch
(
getTaskList
(
info
));
})
}
}
export
default
{
wrongQrcode
,
emptyErrorInfo
,
finishReplenish
}
client/actions/uploadError.js
View file @
644e9bd1
import
fetch
from
'isomorphic-fetch'
import
fetch
from
'isomorphic-fetch'
import
actionType
from
'../actiontype/error'
import
actionType
from
'../actiontype/error'
import
{
getTaskList
}
from
'./common'
import
{
getTaskList
}
from
'./common'
;
let
domain
=
'http://192.168.10.37:8080/maxbox/web/'
;
import
{
saveProductInfo
}
from
'./barcodeCommon'
let
domain
=
ENV
.
domain
;
var
myHeaders
=
new
Headers
({
var
myHeaders
=
new
Headers
({
'Access-Control-Allow-Origin'
:
'*'
,
'Access-Control-Allow-Origin'
:
'*'
,
...
@@ -51,6 +52,7 @@ const uploadError = (info,exceptionType)=>{
...
@@ -51,6 +52,7 @@ const uploadError = (info,exceptionType)=>{
}).
then
((
response
)
=>
response
.
json
())
}).
then
((
response
)
=>
response
.
json
())
.
then
(
json
=>
{
.
then
(
json
=>
{
dispatch
(
getTaskList
(
info
));
dispatch
(
getTaskList
(
info
));
dispatch
(
saveProductInfo
({}))
}).
catch
(
e
=>
{
console
.
error
(
e
)});
}).
catch
(
e
=>
{
console
.
error
(
e
)});
})
})
}
}
...
...
client/components/CommonComponent/ButtonComponent/ButtonComponent.jsx
View file @
644e9bd1
...
@@ -4,13 +4,22 @@ require('./index.css');
...
@@ -4,13 +4,22 @@ require('./index.css');
export
default
class
ButtonComponent
extends
React
.
Component
{
export
default
class
ButtonComponent
extends
React
.
Component
{
constructor
(
props
){
constructor
(
props
){
super
(
props
);
super
(
props
);
this
.
handleButtonClick
=
this
.
handleButtonClick
.
bind
(
this
)
}
handleButtonClick
(){
let
props
=
this
.
props
;
let
{
option
=
null
}
=
props
;
if
(
option
){
option
();
}
}
}
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
btnContainer
=
""
,
style
=
{},
option
=
null
}
=
props
;
let
{
btnContainer
=
""
,
style
=
{},
option
=
null
}
=
props
;
return
(
return
(
<
div
className=
{
`buttonComponent ${btnContainer}`
}
style=
{
style
}
onClick=
{
()
=>
{
option
()}
}
>
<
div
className=
{
`buttonComponent ${btnContainer}`
}
style=
{
style
}
onClick=
{
this
.
handleButtonClick
}
>
{
props
.
text
}
{
props
.
text
}
</
div
>
</
div
>
)
)
...
...
client/components/CommonComponent/SkuInfoComponent/SkuInfoComponent.jsx
View file @
644e9bd1
...
@@ -27,7 +27,7 @@ export default class SkuInfoComponent extends React.Component{
...
@@ -27,7 +27,7 @@ export default class SkuInfoComponent extends React.Component{
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
classNames
=
''
,
style
=
{},
skuInfo
=
{}}
=
props
;
let
{
classNames
=
''
,
style
=
{},
skuInfo
=
{}
,
taskType
=
""
}
=
props
;
return
(
return
(
<
div
className=
{
"skuInfoComponent "
+
classNames
}
style=
{
style
}
>
<
div
className=
{
"skuInfoComponent "
+
classNames
}
style=
{
style
}
>
<
div
className=
{
"img"
}
>
<
div
className=
{
"img"
}
>
...
@@ -48,7 +48,7 @@ export default class SkuInfoComponent extends React.Component{
...
@@ -48,7 +48,7 @@ export default class SkuInfoComponent extends React.Component{
}
}
</
span
>
</
span
>
{
{
skuInfo
.
recoverNum
?
<
span
className=
{
"currentNum"
}
>
已回收数量:
<
span
className=
{
"font40 colff775c"
}
>
{
skuInfo
.
recoverNum
||
0
}
</
span
></
span
>
taskType
===
"RE"
?
<
span
className=
{
"currentNum"
}
>
已回收数量:
<
span
className=
{
"font40 colff775c"
}
>
{
skuInfo
.
recoverNum
||
0
}
</
span
></
span
>
:
null
:
null
}
}
...
...
client/components/RecoveryComponent/RecoveryFirstPage/RecoveryFirstPage.jsx
View file @
644e9bd1
...
@@ -8,11 +8,12 @@ export default class RecoveryFirstPage extends React.Component{
...
@@ -8,11 +8,12 @@ export default class RecoveryFirstPage extends React.Component{
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
headerInfo
}
=
props
;
let
{
taskInfo
=
{}}
=
headerInfo
;
return
(
return
(
<
div
className=
{
"recoveryFirstPage"
}
>
<
div
className=
{
"recoveryFirstPage"
}
>
<
div
className=
{
"text font40 col333"
}
>
任务目标:请将
A
区回收箱进行整体更换
</
div
>
<
div
className=
{
"text font40 col333"
}
>
任务目标:请将
{
taskInfo
.
area
||
""
}
区回收箱进行整体更换
</
div
>
<
Button
btnContainer=
{
"RecoveryFirstPageBtn font32 backff775c colfff"
}
key=
{
"RecoveryFirstPageBtn"
}
text=
{
'已替换完成'
}
option=
{
props
.
f
inishBoxRecovery
}
/>
<
Button
btnContainer=
{
"RecoveryFirstPageBtn font32 backff775c colfff"
}
key=
{
"RecoveryFirstPageBtn"
}
text=
{
'已替换完成'
}
option=
{
props
.
handleF
inishBoxRecovery
}
/>
<
div
className=
{
"tips font24"
}
>
查看回收箱位置
</
div
>
<
div
className=
{
"tips font24"
}
>
查看回收箱位置
</
div
>
</
div
>
</
div
>
)
)
...
...
client/components/RecoveryComponent/RecoveryScanPage/RecoveryScanPage.jsx
View file @
644e9bd1
...
@@ -78,7 +78,7 @@ export default class RecoveryScanPage extends React.Component{
...
@@ -78,7 +78,7 @@ export default class RecoveryScanPage extends React.Component{
let
btnDom
=
<
Button
btnContainer=
{
"recoveryContainerQrcode font32"
}
key=
{
"recoveryContainerWrongQrcode"
}
style=
{
{
marginTop
:
'10%'
}
}
text=
{
"关闭"
}
option=
{
hidePopup
}
/>
let
btnDom
=
<
Button
btnContainer=
{
"recoveryContainerQrcode font32"
}
key=
{
"recoveryContainerWrongQrcode"
}
style=
{
{
marginTop
:
'10%'
}
}
text=
{
"关闭"
}
option=
{
hidePopup
}
/>
let
popDom
=
let
popDom
=
<
PopModel
popupTitle=
{
"遇到问题-货品不对"
}
classContainer=
{
"recoveryPopInfo"
}
>
<
PopModel
popupTitle=
{
"遇到问题-货品不对"
}
classContainer=
{
"recoveryPopInfo"
}
>
<
div
className=
{
"icon iconfont icon-wrong font150"
}
/>
<
div
className=
{
"icon iconfont icon-wrong font150
colf00
"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
您拿错货品了,请放回货架!
</
p
>
<
p
>
您拿错货品了,请放回货架!
</
p
>
</
div
>
</
div
>
...
...
client/components/RecoveryComponent/RecoverySecondPage/RecoverySecondPage.jsx
View file @
644e9bd1
...
@@ -13,10 +13,29 @@ export default class RecoverySecondPage extends React.Component{
...
@@ -13,10 +13,29 @@ export default class RecoverySecondPage extends React.Component{
style
:
{
style
:
{
width
:
"100%"
,
width
:
"100%"
,
height
:
"auto"
height
:
"auto"
}
},
btnClock
:
false
}
}
}
}
componentWillReceiveProps
(
nextProps
)
{
let
nextHeaderInfo
=
nextProps
.
headerInfo
;
let
headerInfo
=
this
.
props
.
headerInfo
;
if
(
nextHeaderInfo
.
taskList
&&
nextHeaderInfo
.
taskList
.
skuId
&&
headerInfo
.
taskList
&&
headerInfo
.
taskList
.
skuId
&&
headerInfo
.
taskList
.
skuId
!==
nextHeaderInfo
.
taskList
.
skuId
){
this
.
setState
({
btnClock
:
false
})
}
}
wrongSku
(){
wrongSku
(){
//货道商品不符
//货道商品不符
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
...
@@ -39,7 +58,15 @@ export default class RecoverySecondPage extends React.Component{
...
@@ -39,7 +58,15 @@ export default class RecoverySecondPage extends React.Component{
uploadWrongSku
(){
uploadWrongSku
(){
//货品不符上报
//货品不符上报
this
.
props
.
uploadError
(
CONFIG
.
taskErrorType
.
WRONG_SKU
);
if
(
!
this
.
state
.
btnClock
){
this
.
setState
({
btnClock
:
true
},()
=>
{
this
.
props
.
uploadError
(
CONFIG
.
taskErrorType
.
WRONGSHELF
);
})
}
}
}
...
@@ -53,11 +80,12 @@ export default class RecoverySecondPage extends React.Component{
...
@@ -53,11 +80,12 @@ export default class RecoverySecondPage extends React.Component{
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
headerInfo
}
=
props
;
let
{
headerInfo
}
=
props
;
let
{
taskInfo
=
{},
taskList
=
{}}
=
headerInfo
;
return
(
return
(
<
div
className=
{
"RecoverySecondPage commonPage"
}
>
<
div
className=
{
"RecoverySecondPage commonPage"
}
>
<
div
className=
{
"title font40 col333 pageTitle"
}
>
任务目标:请将该货道货品进行扫码回收
</
div
>
<
div
className=
{
"title font40 col333 pageTitle"
}
>
任务目标:请将该货道货品进行扫码回收
</
div
>
<
div
className=
{
"box pagebox"
}
>
<
div
className=
{
"box pagebox"
}
>
<
SkuInfoComponent
style=
{
{
'display'
:
'flex'
}
}
skuInfo=
{
headerInfo
.
taskList
||
{}
}
/>
<
SkuInfoComponent
style=
{
{
'display'
:
'flex'
}
}
skuInfo=
{
taskList
}
taskType=
{
taskInfo
.
currentTaskType
||
""
}
/>
<
div
className=
{
"btn"
}
>
<
div
className=
{
"btn"
}
>
<
Button
btnContainer=
{
"recoverySecondPageBtn font32 colfff"
}
key=
{
"RecoverySecondPageBtn"
}
text=
{
'扫码回收'
}
option=
{
this
.
scanQrcode
}
/>
<
Button
btnContainer=
{
"recoverySecondPageBtn font32 colfff"
}
key=
{
"RecoverySecondPageBtn"
}
text=
{
'扫码回收'
}
option=
{
this
.
scanQrcode
}
/>
<
div
className=
{
"text colff775c font28"
}
onClick=
{
()
=>
this
.
wrongSku
()
}
>
货品不符?
</
div
>
<
div
className=
{
"text colff775c font28"
}
onClick=
{
()
=>
this
.
wrongSku
()
}
>
货品不符?
</
div
>
...
...
client/components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage.jsx
View file @
644e9bd1
This diff is collapsed.
Click to expand it.
client/components/ReplenishComponent/ReplenishSkuPage/ReplenishSkuPage.jsx
View file @
644e9bd1
This diff is collapsed.
Click to expand it.
client/config/taskErrorType.js
View file @
644e9bd1
//异常类型("SU"货道不符 ,"SLT"货品少拿 ,"SUM"货品种类不符,"SF"货道已满)
//异常类型("SU"货道不符 ,"SLT"货品少拿 ,"SUM"货品种类不符,"SF"货道已满
,"SD"商品破损
)
const
errorType
=
{
const
errorType
=
{
WRONG_SKU
:
'SU'
,
//回收 货品不符合
WRONGSHELF
:
'SU'
,
SLT
:
'SLT'
,
LOWSKU
:
'SLT'
,
SUM
:
'SUM'
,
WRONGSKU
:
'SUM'
,
SF
:
'SF'
OVERSHELF
:
'SF'
,
BADSKU
:
'SD'
}
}
module
.
exports
=
errorType
;
module
.
exports
=
errorType
;
\ No newline at end of file
client/containers/LeftContainer/LeftContainer.jsx
View file @
644e9bd1
...
@@ -12,9 +12,8 @@ export default class LeftContainer extends React.Component{
...
@@ -12,9 +12,8 @@ export default class LeftContainer extends React.Component{
<
div
className=
{
"leftContainer"
}
>
<
div
className=
{
"leftContainer"
}
>
<
ul
>
<
ul
>
<
li
className=
{
"icon iconfont icon-task font90"
}
/>
<
li
className=
{
"icon iconfont icon-task font90"
}
/>
<
li
className=
{
"taskNumber font40 col333"
}
>
任务
{
taskInfo
.
currentTaskNum
||
''
}
</
li
>
<
li
className=
{
"taskNumber font40 col333"
}
>
任务
{
taskInfo
.
currentTaskNum
||
''
}
</
li
>
<
li
className=
{
"leftText font30"
}
>
{
taskInfo
.
taskName
||
''
}
</
li
>
<
li
className=
{
"leftText font30"
}
>
{
taskInfo
.
taskName
||
''
}
</
li
>
</
ul
>
</
ul
>
</
div
>
</
div
>
)
)
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
644e9bd1
...
@@ -37,6 +37,7 @@ import replenishAction from "../../actions/replenish";
...
@@ -37,6 +37,7 @@ import replenishAction from "../../actions/replenish";
/*二期引用 end*/
/*二期引用 end*/
import
{
on
,
remove
}
from
'../../util/event'
;
import
{
on
,
remove
}
from
'../../util/event'
;
import
common
from
"../../reducers/common"
;
require
(
'./index.css'
);
require
(
'./index.css'
);
...
@@ -205,42 +206,45 @@ class PageContainer extends React.Component {
...
@@ -205,42 +206,45 @@ class PageContainer extends React.Component {
}
}
componentWillReceiveProps
(
nextProps
){
componentWillReceiveProps
(
nextProps
){
let
{
state
,
dispatch
}
=
nextProps
;
let
{
state
,
dispatch
}
=
nextProps
;
console
.
log
(
"pagecontainer nextProps "
,
nextProps
)
let
nextCommonInfo
=
state
.
commonInfo
;
console
.
log
(
"pagecontainer nextProps "
,
Object
.
keys
(
nextProps
))
let
nextUserInfo
=
nextCommonInfo
.
userInfo
||
{};
console
.
log
(
"pagecontainer nextProps "
,
nextProps
.
state
)
if
(
nextUserInfo
&&
nextUserInfo
.
taskType
&&
nextUserInfo
.
id
)
{
console
.
log
(
"pagecontainer nextProps "
,
Object
.
keys
(
nextProps
.
state
))
let
commonInfo
=
state
.
commonInfo
;
let
userinfo
=
state
.
userInfo
;
let
{
userInfo
=
{}}
=
commonInfo
.
userInfo
;
let
nowUserInfo
=
this
.
props
.
state
.
userInfo
;
if
(
!
userInfo
||
!
userInfo
.
taskType
||
!
userInfo
.
id
||
(
let
isNotOneUser
=
userinfo
&&
userinfo
.
employee
&&
userinfo
.
employee
.
id
&&
userInfo
.
id
!==
nextUserInfo
.
id
(
!
nowUserInfo
||
!
nowUserInfo
.
employee
||
(
nowUserInfo
.
employee
.
id
!==
userinfo
.
employee
.
id
));
)
||
(
let
isNotOneTask
=
userinfo
&&
userinfo
.
type
&&
userinfo
.
type
!==
nowUserInfo
.
type
;
userInfo
.
taskType
!==
nextUserInfo
.
taskType
)){
if
(
isNotOneUser
&&
isNotOneTask
){
//如果不是同一个用户或者不是同一个任务,会再次进入
//不是同一个用户,并且不是同一个任务
this
.
dealPageByType
(
nextUserInfo
.
taskType
);
this
.
dealPageByType
(
userinfo
.
type
);
}
//补货人员,根据type判断显示页面
let
nextTaskInfo
=
nextCommonInfo
.
taskInfo
||
{};
if
(
nextUserInfo
.
taskType
===
"BH"
&&
nextTaskInfo
&&
nextTaskInfo
.
currentTaskType
){
switch
(
nextTaskInfo
.
currentTaskType
)
{
case
'LR'
:
this
.
changePages
(
CONFIG
.
showPage
[
5
]);
break
;
case
'CK'
:
this
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
case
'RE'
:
this
.
changePages
(
CONFIG
.
showPage
[
10
]);
break
;
case
'ADDR'
:
this
.
changePages
(
CONFIG
.
showPage
[
11
]);
break
;
}
}
}
}
if
(
state
.
errMsg
&&
state
.
errMsg
.
errMsg
){
if
(
state
.
errMsg
&&
state
.
errMsg
.
errMsg
){
//有错误信息,弹出错误信息弹窗
//有错误信息,弹出错误信息弹窗
this
.
showError
(
state
.
errMsg
.
errMsg
)
this
.
showError
(
state
.
errMsg
.
errMsg
)
}
}
//根据后台数据控制该显示的页面
if
(
nextProps
.
state
.
commonInfo
&&
nextProps
.
state
.
commonInfo
.
taskInfo
){
let
type
=
nextProps
.
state
.
commonInfo
.
taskInfo
.
currentTaskType
;
switch
(
type
){
case
'LR'
:
this
.
changePages
(
CONFIG
.
showPage
[
5
]);
break
;
case
'CK'
:
this
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
case
'RE'
:
this
.
changePages
(
CONFIG
.
showPage
[
10
]);
break
;
case
'ADDR'
:
this
.
changePages
(
CONFIG
.
showPage
[
11
]);
break
;
}
}
}
}
componentWillUnmount
(){
componentWillUnmount
(){
}
}
...
@@ -360,13 +364,13 @@ class PageContainer extends React.Component {
...
@@ -360,13 +364,13 @@ class PageContainer extends React.Component {
getPopDom
(
info
){
getPopDom
(
info
){
let
{
t
ext
=
''
,
popupButtons
=
[],
style
=
{}}
=
info
let
{
popupT
ext
=
''
,
popupButtons
=
[],
style
=
{}}
=
info
let
dom
=
popupButtons
.
map
((
a
,
k
)
=>
{
let
dom
=
popupButtons
.
map
((
a
,
k
)
=>
{
return
a
;
return
a
;
});
});
return
<
div
className=
{
"defaultPopup col333"
}
style=
{
style
}
>
return
<
div
className=
{
"defaultPopup col333"
}
style=
{
style
}
>
<
div
className=
{
"defaultPopupText font30"
}
>
<
div
className=
{
"defaultPopupText font30"
}
>
{
t
ext
}
{
popupT
ext
}
</
div
>
</
div
>
<
div
className=
{
"defaultPopupButtons font32"
}
>
<
div
className=
{
"defaultPopupButtons font32"
}
>
{
dom
}
{
dom
}
...
@@ -617,7 +621,7 @@ class PageContainer extends React.Component {
...
@@ -617,7 +621,7 @@ class PageContainer extends React.Component {
recoveryInfo
=
{
state
.
recoveryInfo
}
recoveryInfo
=
{
state
.
recoveryInfo
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
3
,
2
))
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
state
.
commonInfo
.
taskInfo
.
currentTaskType
,
2
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
uploadError=
{
(
exceptionType
)
=>
dispatch
(
uploadError
(
state
.
commonInfo
,
exceptionType
))
}
uploadError=
{
(
exceptionType
)
=>
dispatch
(
uploadError
(
state
.
commonInfo
,
exceptionType
))
}
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
...
@@ -633,6 +637,7 @@ class PageContainer extends React.Component {
...
@@ -633,6 +637,7 @@ class PageContainer extends React.Component {
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
emptyErrorInfo=
{
()
=>
dispatch
(
replenishAction
.
emptyErrorInfo
())
}
emptyErrorInfo=
{
()
=>
dispatch
(
replenishAction
.
emptyErrorInfo
())
}
uploadError=
{
(
exceptionType
)
=>
dispatch
(
uploadError
(
state
.
commonInfo
,
exceptionType
))
}
/>
/>
/*以下是二期页面 end*/
/*以下是二期页面 end*/
}
}
...
...
client/containers/RecoveryContainer/RecoveryContainer.jsx
View file @
644e9bd1
...
@@ -22,7 +22,7 @@ export default class RecoveryContainer extends React.Component{
...
@@ -22,7 +22,7 @@ export default class RecoveryContainer extends React.Component{
this
.
getFirstPage
=
this
.
getFirstPage
.
bind
(
this
);
//展示第一页
this
.
getFirstPage
=
this
.
getFirstPage
.
bind
(
this
);
//展示第一页
this
.
getSecondPage
=
this
.
getSecondPage
.
bind
(
this
);
//展示第二页
this
.
getSecondPage
=
this
.
getSecondPage
.
bind
(
this
);
//展示第二页
this
.
getPage
=
this
.
getPage
.
bind
(
this
);
//获取要展示的页面
this
.
getPage
=
this
.
getPage
.
bind
(
this
);
//获取要展示的页面
this
.
finishBoxRecovery
=
this
.
f
inishBoxRecovery
.
bind
(
this
);
//完成回收箱商品回收
this
.
handleFinishBoxRecovery
=
this
.
handleF
inishBoxRecovery
.
bind
(
this
);
//完成回收箱商品回收
this
.
setPage
=
this
.
setPage
.
bind
(
this
);
//完成回收箱商品回收
this
.
setPage
=
this
.
setPage
.
bind
(
this
);
//完成回收箱商品回收
}
}
...
@@ -50,13 +50,13 @@ export default class RecoveryContainer extends React.Component{
...
@@ -50,13 +50,13 @@ export default class RecoveryContainer extends React.Component{
let
taskList
=
headerInfo
.
taskList
;
let
taskList
=
headerInfo
.
taskList
;
if
(
taskList
.
skuId
!==
oldTaskList
.
skuId
||
(
taskList
.
skuId
===
oldTaskList
.
skuId
&&
taskList
.
recoverNum
!==
oldTaskList
.
recoverNum
)){
if
(
taskList
.
skuId
!==
oldTaskList
.
skuId
||
(
taskList
.
skuId
===
oldTaskList
.
skuId
&&
taskList
.
recoverNum
!==
oldTaskList
.
recoverNum
)){
hidePopup
();
hidePopup
();
this
.
f
inishBoxRecovery
();
this
.
handleF
inishBoxRecovery
();
}
}
}
}
}
}
f
inishBoxRecovery
(){
handleF
inishBoxRecovery
(){
//完成回收箱物品回收
//完成回收箱物品回收
let
props
=
this
.
props
;
let
props
=
this
.
props
;
props
.
getTaskName
()
props
.
getTaskName
()
...
@@ -67,7 +67,7 @@ export default class RecoveryContainer extends React.Component{
...
@@ -67,7 +67,7 @@ export default class RecoveryContainer extends React.Component{
getFirstPage
(
props
){
getFirstPage
(
props
){
return
(
return
(
<
RecovertyFirstPage
finishBoxRecovery=
{
()
=>
this
.
finishBoxRecovery
()
}
/>
<
RecovertyFirstPage
handleFinishBoxRecovery=
{
()
=>
this
.
handleFinishBoxRecovery
()
}
{
...
props
}
/>
)
)
}
}
getSecondPage
(
props
){
getSecondPage
(
props
){
...
...
client/containers/ReplenishContainer/ReplenishContainer.jsx
View file @
644e9bd1
...
@@ -32,21 +32,42 @@ export default class ReplenishContainer extends React.Component{
...
@@ -32,21 +32,42 @@ export default class ReplenishContainer extends React.Component{
}
}
componentWillReceiveProps
(
nextProps
){
componentWillReceiveProps
(
nextProps
){
console
.
log
(
"componentWillReceiveProps "
,
nextProps
)
console
.
log
(
"componentWillReceiveProps "
,
nextProps
);
if
(
nextProps
.
barcodeInfo
&&
nextProps
.
barcodeInfo
.
product
&&
nextProps
.
replenishInfo
&&
(
!
nextProps
.
replenishInfo
.
errorInfo
||
!
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
)){
//有条形码信息且 没有错误信息 进入条形码扫描成功页面
//如果有错误信息,弹出错误信息
console
.
log
(
"in "
,
this
.
state
.
pageType
,
typeof
this
.
state
.
pageType
);
//如果有条形码信息,展示条形码信息
if
(
this
.
state
.
pageType
!==
2
){
// if(!nextProps.replenishInfo.errorInfo || !nextProps.replenishInfo.errorInfo.errorMessage){
console
.
log
(
"2222222"
);
//
nextProps
.
hidePopup
();
// }else{
this
.
setState
({
//
pageType
:
2
,
// }
showScanQrcode
:
false
//
})
//
}
//
}
else
if
(
nextProps
.
replenishInfo
&&
nextProps
.
replenishInfo
.
errorInfo
&&
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
){
//
//有错误信息,再对应页面弹出错误信息弹窗,要区分错误信息
//
}
// if(nextProps.barcodeInfo && nextProps.barcodeInfo.product && nextProps.barcodeInfo.product.skuId && nextProps.replenishInfo && (!nextProps.replenishInfo.errorInfo || !nextProps.replenishInfo.errorInfo.errorMessage)){
// //有条形码信息且 没有错误信息 进入条形码扫描成功页面
// console.log("in ",this.state.pageType,typeof this.state.pageType);
// if(this.state.pageType !== 2){
// console.log("2222222");
// nextProps.hidePopup();
// this.setState({
// pageType : 2,
// showScanQrcode : false
// })
// }
// }else if(nextProps.replenishInfo && nextProps.replenishInfo.errorInfo && nextProps.replenishInfo.errorInfo.errorMessage){
// //有错误信息,再对应页面弹出错误信息弹窗,要区分错误信息
// }else if(!nextProps.barcodeInfo || !nextProps.barcodeInfo.product || !nextProps.barcodeInfo.product.skuId){
// if(this.state.pageType !== 3){
// nextProps.hidePopup();
// this.setState({
// pageType : 3,
// showScanQrcode : false
// })
// }
// }
}
}
getPage
(
type
){
getPage
(
type
){
...
@@ -79,10 +100,10 @@ export default class ReplenishContainer extends React.Component{
...
@@ -79,10 +100,10 @@ export default class ReplenishContainer extends React.Component{
return
<
ReplenishScanPage
{
...
props
}
/>
return
<
ReplenishScanPage
{
...
props
}
/>
}
}
goBack
(){
goBack
(
type
){
this
.
setState
({
this
.
setState
({
showScanQrcode
:
false
,
showScanQrcode
:
false
,
pageType
:
1
pageType
:
type
})
})
}
}
...
...
client/reducers/barcodeCommon.js
View file @
644e9bd1
...
@@ -3,12 +3,12 @@ import barcodeActionType from '../actiontype/barcodeCommon'
...
@@ -3,12 +3,12 @@ import barcodeActionType from '../actiontype/barcodeCommon'
//扫码商品的信息
//扫码商品的信息
const
saveProductInfo
=
(
data
,
content
)
=>
{
const
saveProductInfo
=
(
data
,
content
)
=>
{
return
Object
.
assign
({},
data
,{
product
:
content
})
let
newState
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Object
.
assign
({},
newState
,{
product
:
content
})
}
}
export
default
function
(
state
=
{},
action
)
{
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
barcodeActionType
.
GETPRODUCTINFO
:
case
barcodeActionType
.
GETPRODUCTINFO
:
console
.
log
(
action
.
data
,
'吴加宝打印barcode reducer'
)
return
saveProductInfo
(
state
,
action
.
data
);
return
saveProductInfo
(
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