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
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
263 additions
and
87 deletions
+263
-87
client/actions/barcodeCommon.js
+5
-3
client/actions/common.js
+10
-0
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
+30
-2
client/components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage.jsx
+87
-17
client/components/ReplenishComponent/ReplenishSkuPage/ReplenishSkuPage.jsx
+0
-0
client/config/taskErrorType.js
+7
-5
client/containers/LeftContainer/LeftContainer.jsx
+0
-1
client/containers/PageContainer/PageContainer.jsx
+30
-25
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)=>{
dispatch
(
saveCommonInfo
(
info
))
dispatch
(
saveProductInfo
(
json
.
data
))
}
else
{
dispatch
(
saveProductInfo
({}));
switch
(
taskInfo
.
currentTaskType
){
case
3
:
//回收任务
...
...
@@ -68,6 +69,7 @@ const saveProductInfo = (data)=>{
type
:
barcodeActionType
.
GETPRODUCTINFO
,
data
}
}
}
export
{
getBarCodeProductInfo
}
\ No newline at end of file
export
{
getBarCodeProductInfo
,
saveProductInfo
}
\ No newline at end of file
client/actions/common.js
View file @
644e9bd1
...
...
@@ -73,6 +73,11 @@ const getTaskList = (data={})=>{
let
taskId
=
taskInfo
.
taskId
||
0
;
let
url
=
`
${
domain
}
flat/work/list/
${
storeInfo
.
id
}
/
${
taskInfo
.
area
}
/
${
taskId
}
/
${
userInfo
.
id
}
`
;
return
(
dispatch
)
=>
{
if
(
!
userInfo
.
id
){
dispatch
(
addErrorInfo
(
'没有获取用户信息'
))
}
else
if
(
!
taskInfo
.
area
){
dispatch
(
addErrorInfo
(
'没有获取区域信息'
))
}
else
{
fetch
(
url
,{
// credentials : 'include',
method
:
'GET'
,
...
...
@@ -90,13 +95,18 @@ const getTaskList = (data={})=>{
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
(
saveCommonInfo
(
Object
.
assign
({},
data
)))
})
}
}
}
const
saveCommonInfo
=
(
data
)
=>
{
...
...
client/actions/recovery.js
View file @
644e9bd1
import
fetch
from
'isomorphic-fetch'
;
import
{
getTaskList
}
from
"./common"
;
import
{
saveProductInfo
}
from
'./barcodeCommon'
const
domain
=
ENV
.
domain
;
let
myHeaders
=
new
Headers
({
// 'Access-Control-Allow-Origin': '*',
...
...
@@ -29,10 +30,10 @@ const finishBoxRecovery = (info)=>{
body
:
JSON
.
stringify
(
bodyData
)
}).
then
(
response
=>
response
.
json
())
.
then
((
json
)
=>
{
dispatch
(
saveProductInfo
({}));
dispatch
(
getTaskList
(
info
));
})
}
};
export
{
finishBoxRecovery
}
client/actions/replenish.js
View file @
644e9bd1
import
fetch
from
'isomorphic-fetch'
;
import
actionType
from
'../actiontype/replenish'
import
{
getTaskList
}
from
"./common"
;
import
{
saveProductInfo
}
from
"./barcodeCommon"
;
const
domain
=
ENV
.
domain
;
let
myHeaders
=
new
Headers
({
...
...
@@ -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
actionType
from
'../actiontype/error'
import
{
getTaskList
}
from
'./common'
let
domain
=
'http://192.168.10.37:8080/maxbox/web/'
;
import
{
getTaskList
}
from
'./common'
;
import
{
saveProductInfo
}
from
'./barcodeCommon'
let
domain
=
ENV
.
domain
;
var
myHeaders
=
new
Headers
({
'Access-Control-Allow-Origin'
:
'*'
,
...
...
@@ -51,6 +52,7 @@ const uploadError = (info,exceptionType)=>{
}).
then
((
response
)
=>
response
.
json
())
.
then
(
json
=>
{
dispatch
(
getTaskList
(
info
));
dispatch
(
saveProductInfo
({}))
}).
catch
(
e
=>
{
console
.
error
(
e
)});
})
}
...
...
client/components/CommonComponent/ButtonComponent/ButtonComponent.jsx
View file @
644e9bd1
...
...
@@ -4,13 +4,22 @@ require('./index.css');
export
default
class
ButtonComponent
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
handleButtonClick
=
this
.
handleButtonClick
.
bind
(
this
)
}
handleButtonClick
(){
let
props
=
this
.
props
;
let
{
option
=
null
}
=
props
;
if
(
option
){
option
();
}
}
render
(){
let
props
=
this
.
props
;
let
{
btnContainer
=
""
,
style
=
{},
option
=
null
}
=
props
;
return
(
<
div
className=
{
`buttonComponent ${btnContainer}`
}
style=
{
style
}
onClick=
{
()
=>
{
option
()}
}
>
<
div
className=
{
`buttonComponent ${btnContainer}`
}
style=
{
style
}
onClick=
{
this
.
handleButtonClick
}
>
{
props
.
text
}
</
div
>
)
...
...
client/components/CommonComponent/SkuInfoComponent/SkuInfoComponent.jsx
View file @
644e9bd1
...
...
@@ -27,7 +27,7 @@ export default class SkuInfoComponent extends React.Component{
render
(){
let
props
=
this
.
props
;
let
{
classNames
=
''
,
style
=
{},
skuInfo
=
{}}
=
props
;
let
{
classNames
=
''
,
style
=
{},
skuInfo
=
{}
,
taskType
=
""
}
=
props
;
return
(
<
div
className=
{
"skuInfoComponent "
+
classNames
}
style=
{
style
}
>
<
div
className=
{
"img"
}
>
...
...
@@ -48,7 +48,7 @@ export default class SkuInfoComponent extends React.Component{
}
</
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
}
...
...
client/components/RecoveryComponent/RecoveryFirstPage/RecoveryFirstPage.jsx
View file @
644e9bd1
...
...
@@ -8,11 +8,12 @@ export default class RecoveryFirstPage extends React.Component{
render
(){
let
props
=
this
.
props
;
let
{
headerInfo
}
=
props
;
let
{
taskInfo
=
{}}
=
headerInfo
;
return
(
<
div
className=
{
"recoveryFirstPage"
}
>
<
div
className=
{
"text font40 col333"
}
>
任务目标:请将
A
区回收箱进行整体更换
</
div
>
<
Button
btnContainer=
{
"RecoveryFirstPageBtn font32 backff775c colfff"
}
key=
{
"RecoveryFirstPageBtn"
}
text=
{
'已替换完成'
}
option=
{
props
.
f
inishBoxRecovery
}
/>
<
div
className=
{
"text font40 col333"
}
>
任务目标:请将
{
taskInfo
.
area
||
""
}
区回收箱进行整体更换
</
div
>
<
Button
btnContainer=
{
"RecoveryFirstPageBtn font32 backff775c colfff"
}
key=
{
"RecoveryFirstPageBtn"
}
text=
{
'已替换完成'
}
option=
{
props
.
handleF
inishBoxRecovery
}
/>
<
div
className=
{
"tips font24"
}
>
查看回收箱位置
</
div
>
</
div
>
)
...
...
client/components/RecoveryComponent/RecoveryScanPage/RecoveryScanPage.jsx
View file @
644e9bd1
...
...
@@ -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
popDom
=
<
PopModel
popupTitle=
{
"遇到问题-货品不对"
}
classContainer=
{
"recoveryPopInfo"
}
>
<
div
className=
{
"icon iconfont icon-wrong font150"
}
/>
<
div
className=
{
"icon iconfont icon-wrong font150
colf00
"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
您拿错货品了,请放回货架!
</
p
>
</
div
>
...
...
client/components/RecoveryComponent/RecoverySecondPage/RecoverySecondPage.jsx
View file @
644e9bd1
...
...
@@ -13,10 +13,29 @@ export default class RecoverySecondPage extends React.Component{
style
:
{
width
:
"100%"
,
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
(){
//货道商品不符
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
...
...
@@ -39,7 +58,15 @@ export default class RecoverySecondPage extends React.Component{
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{
render
(){
let
props
=
this
.
props
;
let
{
headerInfo
}
=
props
;
let
{
taskInfo
=
{},
taskList
=
{}}
=
headerInfo
;
return
(
<
div
className=
{
"RecoverySecondPage commonPage"
}
>
<
div
className=
{
"title font40 col333 pageTitle"
}
>
任务目标:请将该货道货品进行扫码回收
</
div
>
<
div
className=
{
"box pagebox"
}
>
<
SkuInfoComponent
style=
{
{
'display'
:
'flex'
}
}
skuInfo=
{
headerInfo
.
taskList
||
{}
}
/>
<
SkuInfoComponent
style=
{
{
'display'
:
'flex'
}
}
skuInfo=
{
taskList
}
taskType=
{
taskInfo
.
currentTaskType
||
""
}
/>
<
div
className=
{
"btn"
}
>
<
Button
btnContainer=
{
"recoverySecondPageBtn font32 colfff"
}
key=
{
"RecoverySecondPageBtn"
}
text=
{
'扫码回收'
}
option=
{
this
.
scanQrcode
}
/>
<
div
className=
{
"text colff775c font28"
}
onClick=
{
()
=>
this
.
wrongSku
()
}
>
货品不符?
</
div
>
...
...
client/components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage.jsx
View file @
644e9bd1
...
...
@@ -17,6 +17,7 @@ export default class ReplenishScanPage extends React.Component{
this
.
changeShowInput
=
this
.
changeShowInput
.
bind
(
this
);
this
.
getScanDom
=
this
.
getScanDom
.
bind
(
this
);
this
.
hidePop
=
this
.
hidePop
.
bind
(
this
);
this
.
showErrorInfo
=
this
.
showErrorInfo
.
bind
(
this
);
this
.
state
=
{
barcodeText
:
''
,
barcodeErrorText
:
''
,
...
...
@@ -24,13 +25,21 @@ export default class ReplenishScanPage extends React.Component{
}
}
shouldComponentUpdate
(
nextProps
,
nextState
){
return
!!
(
nextProps
.
replenishInfo
&&
nextProps
.
replenishInfo
.
errorInfo
&&
(
!
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
||
!
this
.
props
.
replenishInfo
||
!
this
.
props
.
replenishInfo
.
errorInfo
||
!
this
.
props
.
replenishInfo
.
errorInfo
.
errorMessage
||
(
this
.
props
.
replenishInfo
.
errorInfo
.
errorMessage
!==
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
)
)
||
(
JSON
.
stringify
(
nextState
)
!==
JSON
.
stringify
(
this
.
state
)))
}
componentWillReceiveProps
(
nextProps
){
console
.
log
(
"ReplenishScanPage componentWillReceiveProps "
,
nextProps
);
let
props
=
this
.
props
;
let
{
replenishInfo
}
=
props
;
let
{
replenishInfo
,
barcodeInfo
}
=
props
;
if
(
JSON
.
stringify
(
this
.
props
)
!==
JSON
.
stringify
(
nextProps
)){
if
(
nextProps
.
replenishInfo
&&
nextProps
.
replenishInfo
.
errorInfo
&&
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
){
//有错误信息,再对应页面弹出错误信息弹窗,要区分错误信息
// nextProps.hidePopup();
...
...
@@ -48,29 +57,63 @@ export default class ReplenishScanPage extends React.Component{
}
else
{
//没有错误类型的错误
console
.
log
(
"ReplenishScanPage "
,
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
)
this
.
showErrorInfo
(
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
);
}
}
}
else
if
(
nextProps
.
barcodeInfo
&&
nextProps
.
barcodeInfo
.
product
&&
nextProps
.
barcodeInfo
.
product
.
skuId
&&
(
!
this
.
props
.
barcodeInfo
||
!
this
.
props
.
barcodeInfo
.
product
||
!
this
.
props
.
barcodeInfo
.
skuId
||
this
.
props
.
barcodeInfo
.
skuId
!==
nextProps
.
barcodeInfo
.
product
.
skuId
)){
this
.
goBack
.
bind
(
this
)(
2
)
}
}
}
goBack
(){
componentDidMount
(){
this
.
_startScan
()
}
showErrorInfo
(
errMsg
){
let
{
showPopup
,
hidePopup
,
barcodeInfo
}
=
this
.
props
;
let
{
product
}
=
barcodeInfo
;
let
btnDom
=
<
Button
btnContainer=
{
"replenishScanPageErrorSkuBtn font32 backff775c colfff"
}
key=
{
"replenishScanPageErrorSkuBtn"
}
text=
{
"确定"
}
option=
{
this
.
hidePop
}
/>
let
popDom
=
<
PopModel
popupTitle=
{
"扫描出错"
}
classContainer=
{
"replenishPopInfo replenishScanPageErrorInfo"
}
>
<
div
className=
{
"icon iconfont icon-exclamation colf5a623 font150"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
{
errMsg
}
</
p
>
</
div
>
<
div
className=
{
"btn"
}
>
{
btnDom
}
</
div
>
</
PopModel
>
showPopup
({
popupChild
:
popDom
});
}
goBack
(
type
){
let
{
emptyErrorInfo
,
goBack
,
hidePopup
}
=
this
.
props
;
emptyErrorInfo
();
hidePopup
();
goBack
()
goBack
(
type
)
}
hidePop
(){
let
{
emptyErrorInfo
,
hidePopup
}
=
this
.
props
;
emptyErrorInfo
();
hidePopup
();
this
.
setState
({
barcodeText
:
''
});
if
(
!
this
.
state
.
showInput
){
this
.
_startScan
()
}
}
getOtherHeader
(){
let
{
headerInfo
}
=
this
.
props
;
let
{
taskInfo
=
{}}
=
headerInfo
;
return
<
div
className=
{
"otherHeader replenishScanQrcodeHeader font32 clearfix colfff "
}
>
<
i
className=
{
"iconfont middle icon font50 icon-circle-left circleIcon fl"
}
onClick=
{
()
=>
this
.
goBack
.
bind
(
this
)()
}
/>
<
i
className=
{
"iconfont middle icon font50 icon-circle-left circleIcon fl"
}
onClick=
{
()
=>
this
.
goBack
.
bind
(
this
)(
1
)
}
/>
<
span
className=
{
"middle"
}
>
任务目标:将
{
taskInfo
.
area
||
""
}
区补货箱中的货品扫码后放到货架上
</
span
>
</
div
>
}
...
...
@@ -96,14 +139,14 @@ export default class ReplenishScanPage extends React.Component{
//扫描货品异常
errorSku
(){
//货道已满解决办法
let
{
showPopup
,
hidePopup
,
barcode
Info
}
=
this
.
props
;
let
{
product
}
=
barcode
Info
;
let
{
showPopup
,
hidePopup
,
header
Info
}
=
this
.
props
;
let
{
taskList
=
{}}
=
header
Info
;
let
btnDom
=
<
Button
btnContainer=
{
"replenishScanPageErrorSkuBtn font32 backff775c colfff"
}
key=
{
"replenishScanPageErrorSkuBtn"
}
text=
{
"确认扫描完毕"
}
option=
{
this
.
hidePop
}
/>
let
popDom
=
<
PopModel
popupTitle=
{
"扫描货品异常"
}
classContainer=
{
"replenishPopInfo replenishScanPageErrorSku"
}
>
<
div
className=
{
"icon iconfont icon-exclamation colf5a623 font150"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
您需要补完【
{
produc
t
.
skuName
||
""
}
】,才能补其他货品
</
p
>
<
p
>
您需要补完【
{
taskLis
t
.
skuName
||
""
}
】,才能补其他货品
</
p
>
</
div
>
<
div
className=
{
"btn"
}
>
{
btnDom
}
...
...
@@ -116,7 +159,7 @@ export default class ReplenishScanPage extends React.Component{
//忘记样子
forgetSku
(){
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
let
btnDom
=
<
Button
btnContainer=
{
"replenishScanPageForgetSkuBtn font32 backff775c colfff"
}
style=
{
{
marginTop
:
"
10%
"
}
}
key=
{
"replenishScanPageForgetSkuBtn"
}
text=
{
"继续扫描"
}
option=
{
this
.
hidePop
}
/>
let
btnDom
=
<
Button
btnContainer=
{
"replenishScanPageForgetSkuBtn font32 backff775c colfff"
}
style=
{
{
marginTop
:
"
0
"
}
}
key=
{
"replenishScanPageForgetSkuBtn"
}
text=
{
"继续扫描"
}
option=
{
this
.
hidePop
}
/>
let
popDom
=
<
PopModel
popupTitle=
{
"扫描货品异常"
}
classContainer=
{
"replenishPopInfo replenishScanPageForgetSku"
}
>
{
this
.
getSkuInfo
()
}
...
...
@@ -146,25 +189,26 @@ export default class ReplenishScanPage extends React.Component{
}
getSkuInfo
(){
let
{
barcodeInfo
}
=
this
.
props
;
let
{
headerInfo
}
=
this
.
props
;
let
{
taskList
=
{}}
=
headerInfo
;
return
(
<
div
className=
{
"replenishSkuInfo"
}
>
<
div
className=
{
"skuName font30 col333"
}
>
商品名称:
{
barcodeInfo
.
skuName
||
""
}
</
div
>
<
div
className=
{
"skuName font30 col333"
}
>
商品名称:
{
taskList
.
skuName
||
""
}
</
div
>
<
div
className=
{
"skuInfo"
}
>
<
div
className=
{
"skuImg"
}
>
<
img
src=
""
alt=
""
/>
<
img
src=
{
taskList
.
skuImage
||
UTILPATH
.
localImg
.
defaultImg
}
alt=
""
/>
</
div
>
<
div
className=
{
"areaImg"
}
>
<
img
src=
""
alt=
""
/>
<
img
src=
{
taskList
.
areaImage
||
UTILPATH
.
localImg
.
defaultImg
}
alt=
""
/>
</
div
>
<
div
className=
{
"skuPos col333 font30"
}
>
<
ul
>
<
li
><
span
className=
{
"skuPosTitle fl"
}
>
所在区域:
</
span
>
{
barcodeInfo
.
area
||
""
}
区域
<
span
className=
{
"colff775c showAreaImg"
}
>
区域照片
</
span
></
li
>
<
li
><
span
className=
{
"skuPosTitle fl"
}
>
所在区域:
</
span
>
{
taskList
.
area
||
""
}
区域
<
span
className=
{
"colff775c showAreaImg"
}
>
区域照片
</
span
></
li
>
<
li
className=
{
""
}
>
<
span
className=
{
"skuPosTitle"
}
>
货道信息:
</
span
>
<
span
className=
{
""
}
>
{
barcodeInfo
.
position
||
""
}
</
span
>
<
span
className=
{
""
}
>
{
taskList
.
position
||
""
}
</
span
>
</
li
>
<
li
><
span
className=
{
"skuPosTitle fl"
}
>
货道编号:
</
span
>
{
barcodeInfo
.
positionNum
||
""
}
</
li
>
<
li
><
span
className=
{
"skuPosTitle fl"
}
>
货道编号:
</
span
>
{
taskList
.
positionNum
||
""
}
</
li
>
</
ul
>
</
div
>
</
div
>
...
...
@@ -217,6 +261,25 @@ export default class ReplenishScanPage extends React.Component{
return
reg
.
test
(
str
);
}
_onBarCodeRead
=
(
e
)
=>
{
// console.log(`e.nativeEvent.data.type = ${e.nativeEvent.data.type}, e.nativeEvent.data.code = ${e.nativeEvent.data.code}`)
this
.
_stopScan
();
this
.
setState
({
barcodeText
:
e
.
nativeEvent
.
data
.
code
},()
=>
{
this
.
submitBarcode
()
});
};
_startScan
=
(
e
)
=>
{
// this._barCode.startScan()
};
_stopScan
=
(
e
)
=>
{
// this._barCode.stopScan()
}
/**
* 调用扫描条形码
...
...
@@ -236,7 +299,14 @@ export default class ReplenishScanPage extends React.Component{
changeShowInput
(){
this
.
setState
({
showInput
:
!
this
.
state
.
showInput
,
barcodeText
:
""
barcodeText
:
""
,
barcodeErrorText
:
""
},()
=>
{
if
(
this
.
state
.
showInput
){
this
.
_stopScan
()
}
else
{
this
.
_startScan
()
}
})
}
...
...
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
=
{
WRONG_SKU
:
'SU'
,
//回收 货品不符合
SLT
:
'SLT'
,
SUM
:
'SUM'
,
SF
:
'SF'
WRONGSHELF
:
'SU'
,
LOWSKU
:
'SLT'
,
WRONGSKU
:
'SUM'
,
OVERSHELF
:
'SF'
,
BADSKU
:
'SD'
}
module
.
exports
=
errorType
;
\ No newline at end of file
client/containers/LeftContainer/LeftContainer.jsx
View file @
644e9bd1
...
...
@@ -12,7 +12,6 @@ export default class LeftContainer extends React.Component{
<
div
className=
{
"leftContainer"
}
>
<
ul
>
<
li
className=
{
"icon iconfont icon-task font90"
}
/>
<
li
className=
{
"taskNumber font40 col333"
}
>
任务
{
taskInfo
.
currentTaskNum
||
''
}
</
li
>
<
li
className=
{
"leftText font30"
}
>
{
taskInfo
.
taskName
||
''
}
</
li
>
</
ul
>
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
644e9bd1
...
...
@@ -37,6 +37,7 @@ import replenishAction from "../../actions/replenish";
/*二期引用 end*/
import
{
on
,
remove
}
from
'../../util/event'
;
import
common
from
"../../reducers/common"
;
require
(
'./index.css'
);
...
...
@@ -205,28 +206,24 @@ class PageContainer extends React.Component {
}
componentWillReceiveProps
(
nextProps
){
let
{
state
,
dispatch
}
=
nextProps
;
console
.
log
(
"pagecontainer nextProps "
,
nextProps
)
console
.
log
(
"pagecontainer nextProps "
,
Object
.
keys
(
nextProps
))
console
.
log
(
"pagecontainer nextProps "
,
nextProps
.
state
)
console
.
log
(
"pagecontainer nextProps "
,
Object
.
keys
(
nextProps
.
state
))
let
userinfo
=
state
.
userInfo
;
let
nowUserInfo
=
this
.
props
.
state
.
userInfo
;
let
isNotOneUser
=
userinfo
&&
userinfo
.
employee
&&
userinfo
.
employee
.
id
&&
(
!
nowUserInfo
||
!
nowUserInfo
.
employee
||
(
nowUserInfo
.
employee
.
id
!==
userinfo
.
employee
.
id
));
let
isNotOneTask
=
userinfo
&&
userinfo
.
type
&&
userinfo
.
type
!==
nowUserInfo
.
type
;
if
(
isNotOneUser
&&
isNotOneTask
){
//不是同一个用户,并且不是同一个任务
this
.
dealPageByType
(
userinfo
.
type
);
}
if
(
state
.
errMsg
&&
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
){
let
nextCommonInfo
=
state
.
commonInfo
;
let
nextUserInfo
=
nextCommonInfo
.
userInfo
||
{};
if
(
nextUserInfo
&&
nextUserInfo
.
taskType
&&
nextUserInfo
.
id
)
{
let
commonInfo
=
state
.
commonInfo
;
let
{
userInfo
=
{}}
=
commonInfo
.
userInfo
;
if
(
!
userInfo
||
!
userInfo
.
taskType
||
!
userInfo
.
id
||
(
userInfo
.
id
!==
nextUserInfo
.
id
)
||
(
userInfo
.
taskType
!==
nextUserInfo
.
taskType
)){
//如果不是同一个用户或者不是同一个任务,会再次进入
this
.
dealPageByType
(
nextUserInfo
.
taskType
);
}
//补货人员,根据type判断显示页面
let
nextTaskInfo
=
nextCommonInfo
.
taskInfo
||
{};
if
(
nextUserInfo
.
taskType
===
"BH"
&&
nextTaskInfo
&&
nextTaskInfo
.
currentTaskType
){
switch
(
nextTaskInfo
.
currentTaskType
)
{
case
'LR'
:
this
.
changePages
(
CONFIG
.
showPage
[
5
]);
break
;
...
...
@@ -241,6 +238,13 @@ class PageContainer extends React.Component {
break
;
}
}
}
if
(
state
.
errMsg
&&
state
.
errMsg
.
errMsg
){
//有错误信息,弹出错误信息弹窗
this
.
showError
(
state
.
errMsg
.
errMsg
)
}
}
componentWillUnmount
(){
}
...
...
@@ -360,13 +364,13 @@ class PageContainer extends React.Component {
getPopDom
(
info
){
let
{
t
ext
=
''
,
popupButtons
=
[],
style
=
{}}
=
info
let
{
popupT
ext
=
''
,
popupButtons
=
[],
style
=
{}}
=
info
let
dom
=
popupButtons
.
map
((
a
,
k
)
=>
{
return
a
;
});
return
<
div
className=
{
"defaultPopup col333"
}
style=
{
style
}
>
<
div
className=
{
"defaultPopupText font30"
}
>
{
t
ext
}
{
popupT
ext
}
</
div
>
<
div
className=
{
"defaultPopupButtons font32"
}
>
{
dom
}
...
...
@@ -617,7 +621,7 @@ class PageContainer extends React.Component {
recoveryInfo
=
{
state
.
recoveryInfo
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
3
,
2
))
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
state
.
commonInfo
.
taskInfo
.
currentTaskType
,
2
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
uploadError=
{
(
exceptionType
)
=>
dispatch
(
uploadError
(
state
.
commonInfo
,
exceptionType
))
}
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
...
...
@@ -633,6 +637,7 @@ class PageContainer extends React.Component {
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
:
state
.
commonInfo
}))}
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
(
state
.
commonInfo
))
}
emptyErrorInfo=
{
()
=>
dispatch
(
replenishAction
.
emptyErrorInfo
())
}
uploadError=
{
(
exceptionType
)
=>
dispatch
(
uploadError
(
state
.
commonInfo
,
exceptionType
))
}
/>
/*以下是二期页面 end*/
}
...
...
client/containers/RecoveryContainer/RecoveryContainer.jsx
View file @
644e9bd1
...
...
@@ -22,7 +22,7 @@ export default class RecoveryContainer extends React.Component{
this
.
getFirstPage
=
this
.
getFirstPage
.
bind
(
this
);
//展示第一页
this
.
getSecondPage
=
this
.
getSecondPage
.
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
);
//完成回收箱商品回收
}
...
...
@@ -50,13 +50,13 @@ export default class RecoveryContainer extends React.Component{
let
taskList
=
headerInfo
.
taskList
;
if
(
taskList
.
skuId
!==
oldTaskList
.
skuId
||
(
taskList
.
skuId
===
oldTaskList
.
skuId
&&
taskList
.
recoverNum
!==
oldTaskList
.
recoverNum
)){
hidePopup
();
this
.
f
inishBoxRecovery
();
this
.
handleF
inishBoxRecovery
();
}
}
}
f
inishBoxRecovery
(){
handleF
inishBoxRecovery
(){
//完成回收箱物品回收
let
props
=
this
.
props
;
props
.
getTaskName
()
...
...
@@ -67,7 +67,7 @@ export default class RecoveryContainer extends React.Component{
getFirstPage
(
props
){
return
(
<
RecovertyFirstPage
finishBoxRecovery=
{
()
=>
this
.
finishBoxRecovery
()
}
/>
<
RecovertyFirstPage
handleFinishBoxRecovery=
{
()
=>
this
.
handleFinishBoxRecovery
()
}
{
...
props
}
/>
)
}
getSecondPage
(
props
){
...
...
client/containers/ReplenishContainer/ReplenishContainer.jsx
View file @
644e9bd1
...
...
@@ -32,21 +32,42 @@ export default class ReplenishContainer extends React.Component{
}
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
){
console
.
log
(
"2222222"
);
nextProps
.
hidePopup
();
this
.
setState
({
pageType
:
2
,
showScanQrcode
:
false
})
}
}
else
if
(
nextProps
.
replenishInfo
&&
nextProps
.
replenishInfo
.
errorInfo
&&
nextProps
.
replenishInfo
.
errorInfo
.
errorMessage
){
//有错误信息,再对应页面弹出错误信息弹窗,要区分错误信息
}
console
.
log
(
"componentWillReceiveProps "
,
nextProps
);
//如果有错误信息,弹出错误信息
//如果有条形码信息,展示条形码信息
// if(!nextProps.replenishInfo.errorInfo || !nextProps.replenishInfo.errorInfo.errorMessage){
//
// }else{
//
// }
//
//
//
//
//
// 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
){
...
...
@@ -79,10 +100,10 @@ export default class ReplenishContainer extends React.Component{
return
<
ReplenishScanPage
{
...
props
}
/>
}
goBack
(){
goBack
(
type
){
this
.
setState
({
showScanQrcode
:
false
,
pageType
:
1
pageType
:
type
})
}
...
...
client/reducers/barcodeCommon.js
View file @
644e9bd1
...
...
@@ -3,12 +3,12 @@ import barcodeActionType from '../actiontype/barcodeCommon'
//扫码商品的信息
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
)
{
switch
(
action
.
type
)
{
case
barcodeActionType
.
GETPRODUCTINFO
:
console
.
log
(
action
.
data
,
'吴加宝打印barcode reducer'
)
return
saveProductInfo
(
state
,
action
.
data
);
default
:
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