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
38ba5926
Commit
38ba5926
authored
Oct 31, 2018
by
wujiabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug add pop
parent
916df3fc
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
137 additions
and
29 deletions
+137
-29
client/actions/barcodeCommon.js
+12
-2
client/actions/breakaegContainer.js
+11
-4
client/actions/common.js
+0
-2
client/actiontype/barcodeCommon.js
+3
-1
client/actiontype/breakageContainer.js
+5
-0
client/components/BreakageComponent/BreakageCode/BreakageCode.jsx
+1
-0
client/components/BreakageComponent/BreakageProductDetail/BreakageProductDetail.jsx
+19
-7
client/components/BreakageComponent/PopComponent/PopComponent.jsx
+0
-0
client/components/CommonComponent/BarcodeComponent/BarcodeComponent.jsx
+10
-2
client/containers/BreakageContainer/BreakageConatiner.jsx
+49
-10
client/containers/PageContainer/PageContainer.jsx
+1
-0
client/reducers/barcodeCommon.js
+6
-0
client/reducers/breakageContainer.js
+17
-0
client/reducers/index.js
+3
-1
No files found.
client/actions/barcodeCommon.js
View file @
38ba5926
...
...
@@ -3,7 +3,6 @@ import {saveCommonInfo} from './common'
import
barcodeActionType
from
'../actiontype/barcodeCommon'
import
replenishAction
from
'./replenish'
let
domain
=
ENV
.
domain
;
let
domain1
=
'http://192.168.10.176:8080/web/'
//test 输入条形码获取商品信息
const
getBarCodeProductInfo
=
(
data
)
=>
{
...
...
@@ -21,6 +20,9 @@ const getBarCodeProductInfo = (data)=>{
mode
:
'cors'
}).
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
if
(
!
json
.
meta
.
success
&&!
json
.
data
){
dispatch
(
saveProductInfo
(
json
.
meta
))
}
else
{
if
(
json
.
meta
.
success
&&
json
.
data
){
dispatch
(
replenishAction
.
emptyErrorInfo
());
//补货清空错误数据
let
info
=
Object
.
assign
({},{
taskList
:
json
.
data
});
...
...
@@ -58,6 +60,8 @@ const getBarCodeProductInfo = (data)=>{
break
;
}
}
}
})
}
...
...
@@ -70,6 +74,11 @@ const saveProductInfo = (data)=>{
data
}
}
const
saveStatus
=
(
data
)
=>
{
return
{
type
:
barcodeActionType
.
GETSTATUS
,
data
}
}
export
{
getBarCodeProductInfo
,
saveProductInfo
}
\ No newline at end of file
client/actions/breakaegContainer.js
View file @
38ba5926
import
fetch
from
'isomorphic-fetch'
import
{
getTaskList
}
from
"./common"
;
import
breakageActionType
from
'../actiontype/breakageContainer'
let
domain
=
ENV
.
domain
;
let
domain1
=
'http://192.168.10.176:8080/web/'
//提交遗留上报的商品
let
myHeaders
=
new
Headers
({
// 'Access-Control-Allow-Origin': '*',
...
...
@@ -11,7 +11,6 @@ let myHeaders = new Headers({
});
const
submitBreakageProduct
=
(
data
)
=>
{
console
.
log
(
data
,
"执行了提交遗留上报"
)
let
{
productDetail
,
commonInfo
}
=
data
;
let
userId
=
commonInfo
.
userInfo
.
id
;
let
{
taskId
}
=
commonInfo
.
taskInfo
;
...
...
@@ -19,7 +18,7 @@ const submitBreakageProduct = (data)=>{
let
{
skuPosition
,
skuId
,
skuStatus
}
=
productDetail
;
let
bodyData
=
{
skuPosition
,
skuId
,
skuStatus
,
machineId
,
taskId
}
let
url
=
domain
+
`machine_pad/lr/
${
userId
}
`
return
()
=>
{
return
(
dispatch
)
=>
{
fetch
(
url
,{
// credentials : 'include',
method
:
'POST'
,
...
...
@@ -31,7 +30,8 @@ const submitBreakageProduct = (data)=>{
body
:
JSON
.
stringify
(
bodyData
)
}).
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
console
.
log
(
json
)
console
.
log
(
json
,
'breakageContainerjs'
)
dispatch
(
getSubmitStatus
(
json
.
meta
))
})
}
}
...
...
@@ -55,4 +55,10 @@ const hasNoSku = (commonInfo)=>{
}
}
const
getSubmitStatus
=
(
data
)
=>
{
return
{
type
:
breakageActionType
.
SUBMITSTATUS
,
data
}
}
export
{
submitBreakageProduct
,
hasNoSku
}
\ No newline at end of file
client/actions/common.js
View file @
38ba5926
...
...
@@ -67,7 +67,6 @@ const getUserinfo = (employeeId,storeId)=>{
//拉取工单
const
getTaskList
=
(
data
=
{})
=>
{
let
{
storeInfo
=
{},
userInfo
=
{},
taskInfo
=
{}}
=
data
;
console
.
log
(
"getTaskList "
,
data
)
let
taskId
=
taskInfo
.
taskId
||
0
;
let
url
=
`
${
domain
}
machine_pad/work/list/
${
storeInfo
.
id
}
/
${
taskInfo
.
area
}
/
${
taskId
}
/
${
userInfo
.
id
}
`
;
return
(
dispatch
)
=>
{
...
...
@@ -84,7 +83,6 @@ const getTaskList = (data={})=>{
}).
then
(
response
=>
response
.
json
())
.
then
((
json
)
=>
{
let
data
=
Object
.
assign
({});
console
.
log
(
"拉取工单 "
,
json
)
if
(
json
.
meta
.
success
&&
json
.
data
){
data
.
taskInfo
=
Object
.
assign
({},
json
.
data
.
flatCommonVo
);
// if(json.data.flatCommonVo.currentTaskType !== 'ADDR'){
...
...
client/actiontype/barcodeCommon.js
View file @
38ba5926
const
breakActionType
=
{
GETPRODUCTINFO
:
'GETPRODUCTINFO'
GETPRODUCTINFO
:
'GETPRODUCTINFO'
,
GETSTATUS
:
'GETSTATUS'
}
export
default
breakActionType
\ No newline at end of file
client/actiontype/breakageContainer.js
0 → 100644
View file @
38ba5926
const
breakageActionType
=
{
SUBMITSTATUS
:
'SUBMITSTATUS'
}
export
default
breakageActionType
\ No newline at end of file
client/components/BreakageComponent/BreakageCode/BreakageCode.jsx
View file @
38ba5926
...
...
@@ -16,6 +16,7 @@ class BreakageCode extends React.Component{
</
div
>
<
BarcodeComponent
getBarCodeProductInfo=
{
this
.
props
.
getBarCodeProductInfo
}
changePage=
{
this
.
props
.
changePage
}
breakageProductInfo=
{
this
.
props
.
breakageProductInfo
}
/>
</
div
>
)
...
...
client/components/BreakageComponent/BreakageProductDetail/BreakageProductDetail.jsx
View file @
38ba5926
...
...
@@ -29,7 +29,8 @@ class BreakageProductDetail extends React.Component{
{
Object
.
keys
(
breakageProductInfo
).
length
>
0
?
<
div
className=
{
'breakageContent'
}
>
<
div
className=
{
'commonPage'
}
>
{
breakageProductInfo
.
product
?<
div
className=
{
'commonPage'
}
>
<
div
className=
{
'pageTitle clo333 font40'
}
style=
{
{
marginBottom
:
UTILPATH
.
getRemByPx
(
20
)}
}
>
<
span
>
上报遗留货品信息
</
span
>
</
div
>
...
...
@@ -37,10 +38,20 @@ class BreakageProductDetail extends React.Component{
<
div
className=
{
'breakProduct'
}
>
<
div
className=
{
'breakProductInfo'
}
>
<
div
className=
{
'breakProductImg'
}
>
<
img
src=
{
breakageProductInfo
.
product
.
skuImage
}
alt=
""
/>
<
img
src=
{
breakageProductInfo
.
product
&&
breakageProductInfo
.
product
.
skuImage
}
alt=
""
/>
</
div
>
<
div
style=
{
{
marginTop
:
UTILPATH
.
getRemByPx
(
30
),
textAlign
:
'left'
,
marginLeft
:
UTILPATH
.
getRemByPx
(
10
)}
}
>
<
h2
className=
{
'col333 font40'
}
style=
{
{
fontWeight
:
'800'
,
width
:
'4.5rem'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
}
}
>
{
breakageProductInfo
.
product
.
skuName
}
啊士大夫艰苦就
</
h2
>
<
h2
className=
{
'col333 font40'
}
style=
{
{
fontWeight
:
'800'
,
width
:
'4.5rem'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
position
:
'relative'
,
zIndex
:
99
}
}
>
{
breakageProductInfo
.
product
.
skuName
}
</
h2
>
<
p
className=
{
'col333 font28'
}
style=
{
{
marginTop
:
UTILPATH
.
getRemByPx
(
20
)}
}
><
span
>
条形码:
</
span
>
{
breakageProductInfo
.
product
.
barcode
}
</
p
>
</
div
>
</
div
>
...
...
@@ -72,7 +83,7 @@ class BreakageProductDetail extends React.Component{
<
img
src=
{
UTILPATH
.
localImg
.
defaultImg
}
alt=
""
/>
<
span
className=
{
'font28 col333'
}
>
{
item
}
</
span
>
</
li
>
}):
breakageProductInfo
.
product
.
skuPositionList
.
map
((
item
,
key
)
=>
{
}):
breakageProductInfo
.
product
.
skuPositionList
&&
breakageProductInfo
.
product
.
skuPositionList
.
map
((
item
,
key
)
=>
{
return
<
li
key=
{
key
}
className=
{
positionColor
===
key
?
'active'
:
''
}
...
...
@@ -87,11 +98,12 @@ class BreakageProductDetail extends React.Component{
</
div
>
</
div
>
<
div
className=
{
'breakProductPosition'
}
>
{
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
]?<
img
src=
{
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
].
filePath
}
alt=
""
/>:<
img
src=
{
UTILPATH
.
localImg
.
defaultImg
}
alt=
""
/>
}
<
span
className=
{
'font28 col333'
}
style=
{
{
marginTop
:
'0.2rem'
,
display
:
'inline-block'
}
}
>
{
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
]?
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
].
name
:
123
}
</
span
>
</
div
>
{
breakageProductInfo
.
product
.
skuPositionList
&&
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
]?<
img
src=
{
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
].
filePath
}
alt=
""
/>:<
img
src=
{
UTILPATH
.
localImg
.
defaultImg
}
alt=
""
/>
}
<
span
className=
{
'font28 col333'
}
style=
{
{
marginTop
:
'0.2rem'
,
display
:
'inline-block'
}
}
>
{
breakageProductInfo
.
product
.
skuPositionList
&&
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
]?
breakageProductInfo
.
product
.
skuPositionList
[
positionColor
].
name
:
123
}
</
span
>
</
div
>
</
div
>
</
div
>
:
null
}
<
Button
btnContainer=
{
'colfff font30 backff775c'
}
text=
{
'提交'
}
style=
{
{
position
:
'absolute'
,
bottom
:
UTILPATH
.
getRemByPx
(
120
),
left
:
'50%'
,
transform
:
'translate(-50%)'
}
}
option=
{
this
.
changePageDefault
.
bind
(
this
)
}
/>
</
div
>:
null
}
...
...
client/components/BreakageComponent/PopComponent/PopComponent.jsx
0 → 100644
View file @
38ba5926
client/components/CommonComponent/BarcodeComponent/BarcodeComponent.jsx
View file @
38ba5926
...
...
@@ -35,11 +35,18 @@ class BarcodeComponent extends React.Component{
//验证输入的条形码是否为空
if
(
barcode
){
props
.
getBarCodeProductInfo
(
barcode
);
props
.
changePage
&&
props
.
changePage
(
2
)
this
.
setState
({
barcodeWord
:
false
})
//
props.changePage&&props.changePage(2)
this
.
setState
({
barcodeWord
:
false
,
barcode
:
''
});
}
else
{
this
.
setState
({
barcodeWord
:
true
})
}
}
componentWillReceiveProps
(
nextProps
){
let
props
=
this
.
props
;
if
(
nextProps
.
breakageProductInfo
.
product
&&
nextProps
.
breakageProductInfo
.
product
.
success
!==
false
){
props
.
changePage
&&
props
.
changePage
(
2
)
}
}
}
export
default
BarcodeComponent
;
\ No newline at end of file
client/containers/BreakageContainer/BreakageConatiner.jsx
View file @
38ba5926
...
...
@@ -16,14 +16,15 @@ class BreakageContainer extends React.Component {
showPage
:
1
,
//初始显示的页面
isShow
:
true
,
//控制扫码页的显示隐藏
SanCodePage
:
'SanCode'
,
//控制显示扫码或手动输入
popShow
:
false
//控制弹框
popShow
:
false
,
//控制弹框,
pop1Show
:
true
//控制异常弹窗显示
}
this
.
changePage
=
this
.
changePage
.
bind
(
this
);
}
render
(){
let
props
=
this
.
props
;
let
{
isShow
,
popShow
}
=
this
.
state
;
let
{
isShow
,
popShow
,
pop1Show
}
=
this
.
state
;
return
(
<
div
className=
{
"BreakageContainer"
}
>
{
...
...
@@ -39,13 +40,26 @@ class BreakageContainer extends React.Component {
}
{
popShow
?<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
background
:
'rgba(0,0,0,.8)'
,
position
:
'absolute'
,
top
:
'0'
,
left
:
'0'
}
}
>
<
PopModel
popupTitle=
{
"货品匹配成功"
}
classContainer=
{
"recoveryPopInfo"
}
>
<
div
className=
{
"icon iconfont icon-correct font150 col27ce61
"
}
/>
<
PopModel
popupTitle=
{
props
.
breakageContainer
.
status
&&
props
.
breakageContainer
.
status
.
success
?
"货品匹配成功"
:
'货品匹配失败'
}
classContainer=
{
"recoveryPopInfo"
}
>
<
div
className=
{
props
.
breakageContainer
.
status
&&
props
.
breakageContainer
.
status
.
success
?
"icon iconfont icon-correct font150 col27ce61"
:
"icon iconfont icon-exclamation font150 colfffd00
"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
请将货品放入回收箱
</
p
>
<
p
>
{
props
.
breakageContainer
.
status
&&
props
.
breakageContainer
.
status
.
message
}
</
p
>
</
div
>
<
div
className=
{
"btn"
}
>
<
Button
text=
{
'已放入'
}
btnContainer=
{
'font32 backff775c colfff'
}
option=
{
this
.
changePopHide
.
bind
(
this
)
}
/>
<
Button
text=
{
props
.
breakageContainer
.
status
&&
props
.
breakageContainer
.
status
.
success
?
"已放入"
:
'关闭'
}
btnContainer=
{
'font32 backff775c colfff'
}
option=
{
this
.
changePopHide
.
bind
(
this
,
props
.
breakageContainer
.
status
&&
props
.
breakageContainer
.
status
.
success
)
}
/>
</
div
>
</
PopModel
>
</
div
>:
null
}
{
!
pop1Show
?<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
background
:
'rgba(0,0,0,.8)'
,
position
:
'absolute'
,
top
:
'0'
,
left
:
'0'
}
}
>
<
PopModel
popupTitle=
{
"货品异常"
}
classContainer=
{
"recoveryPopInfo"
}
>
<
div
className=
{
"icon iconfont icon-exclamation font150 colfffd00"
}
/>
<
div
className=
{
"text font40 col000"
}
>
<
p
>
{
props
.
breakageProductInfo
.
product
.
message
}
</
p
>
</
div
>
<
div
className=
{
"btn"
}
>
<
Button
text=
{
'关闭'
}
btnContainer=
{
'font32 backff775c colfff'
}
option=
{
this
.
changePopHideReturn
.
bind
(
this
)
}
/>
</
div
>
</
PopModel
>
</
div
>:
null
...
...
@@ -55,11 +69,22 @@ class BreakageContainer extends React.Component {
}
//控制弹框消失
changePopHide
(){
this
.
changePopShow
(
false
)
changePopHide
(
bool
){
this
.
changePopShow
(
false
);
if
(
bool
){
this
.
changePage
(
1
)
}
else
{
this
.
changeCodePage
(
false
);
this
.
changeSanCodePage
(
'HandCode'
);
}
}
//控制弹框消失返回输入条形码页
changePopHideReturn
(){
this
.
setState
({
pop1Show
:
true
})
this
.
changeSanCodePage
(
'HandCode'
)
}
//改变显示的组件
changePage
(
page
){
this
.
setState
({
...
...
@@ -109,6 +134,7 @@ class BreakageContainer extends React.Component {
getSanCodePgae
(){
let
{
SanCodePage
}
=
this
.
state
;
let
SanPage
=
null
;
let
props
=
this
.
props
;
switch
(
SanCodePage
){
case
'SanCode'
:
SanPage
=
<
SanCodeComponent
changeSanCodePage=
{
this
.
changeSanCodePage
.
bind
(
this
)
}
...
...
@@ -116,7 +142,12 @@ class BreakageContainer extends React.Component {
/>
break
;
case
'HandCode'
:
SanPage
=
<
BreakageCode
changePage=
{
this
.
changePage
.
bind
(
this
)
}
changeSanCodePage=
{
this
.
changeSanCodePage
.
bind
(
this
)
}
getBarCodeProductInfo=
{
this
.
getproductCode
.
bind
(
this
)
}
/>
SanPage
=
<
BreakageCode
changePage=
{
this
.
changePage
.
bind
(
this
)
}
changeSanCodePage=
{
this
.
changeSanCodePage
.
bind
(
this
)
}
getBarCodeProductInfo=
{
this
.
getproductCode
.
bind
(
this
)
}
breakageProductInfo=
{
props
.
breakageProductInfo
}
/>
break
;
}
return
SanPage
;
...
...
@@ -136,5 +167,12 @@ class BreakageContainer extends React.Component {
changePopShow
(
bool
){
this
.
setState
({
popShow
:
bool
})
}
componentWillReceiveProps
(
nextProps
){
if
(
nextProps
.
breakageProductInfo
.
product
&&
nextProps
.
breakageProductInfo
.
product
.
success
===
false
){
this
.
setState
({
pop1Show
:
nextProps
.
breakageProductInfo
.
product
.
success
})
}
else
{
this
.
setState
({
pop1Show
:
true
})
}
}
}
export
default
BreakageContainer
\ No newline at end of file
client/containers/PageContainer/PageContainer.jsx
View file @
38ba5926
...
...
@@ -617,6 +617,7 @@ class PageContainer extends React.Component {
headerInfo=
{
commonInfo
}
getBarCodeProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getBarCodeProductInfo
({
barcode
,
commonInfo
}))}
}
breakageProductInfo=
{
state
.
barcodeCommon
}
breakageContainer
={
state
.
breakageContainer
}
submitBreakageProduct=
{
(
productDetail
)
=>
{
dispatch
(
submitBreakageProduct
({
commonInfo
,
productDetail
}))}
}
/>
;
break;
...
...
client/reducers/barcodeCommon.js
View file @
38ba5926
...
...
@@ -6,10 +6,16 @@ const saveProductInfo = (data,content)=>{
let
newState
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Object
.
assign
({},
newState
,{
product
:
content
})
}
const
saveStatus
=
(
data
,
content
)
=>
{
let
newState
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Object
.
assign
({},
newState
,{
status
:
content
})
}
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
case
barcodeActionType
.
GETPRODUCTINFO
:
return
saveProductInfo
(
state
,
action
.
data
);
case
barcodeActionType
.
GETSTATUS
:
return
saveStatus
(
state
,
action
.
data
)
default
:
return
state
;
}
...
...
client/reducers/breakageContainer.js
0 → 100644
View file @
38ba5926
import
breakageActionType
from
'../actiontype/breakageContainer'
//扫码商品的信息
const
saveStatus
=
(
data
,
content
)
=>
{
let
newState
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Object
.
assign
({},
newState
,{
status
:
content
})
}
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
case
breakageActionType
.
SUBMITSTATUS
:
return
saveStatus
(
state
,
action
.
data
)
default
:
return
state
;
}
}
\ No newline at end of file
client/reducers/index.js
View file @
38ba5926
...
...
@@ -13,6 +13,7 @@ import barcodeCommon from './barcodeCommon'
import
replenishInfo
from
'./replenish'
import
recoveryInfo
from
'./recovery'
import
TokeStokeContainer
from
'./TokeStokeContainer'
import
breakageContainer
from
'./breakageContainer'
export
default
combineReducers
({
troubleList
,
storeInfo
,
...
...
@@ -27,7 +28,8 @@ export default combineReducers({
barcodeCommon
,
replenishInfo
,
recoveryInfo
,
TokeStokeContainer
TokeStokeContainer
,
breakageContainer
})
...
...
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