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
bbf3c769
Commit
bbf3c769
authored
Sep 18, 2018
by
wujiabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改动 breakageContainer
parent
84418fae
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
132 additions
and
55 deletions
+132
-55
client/actions/BreakageContainer.js
+47
-20
client/actions/common.js
+11
-9
client/actiontype/breakageContainer.js
+5
-0
client/components/BreakageComponent/BreakageCode/BreakageCode.jsx
+20
-3
client/components/BreakageComponent/BreakageCode/index.css
+0
-0
client/components/BreakageComponent/defaultComponent/DefaultComponnet.jsx
+6
-0
client/containers/BreakageContainer/BreakageConatiner.jsx
+29
-13
client/containers/PageContainer/PageContainer.jsx
+11
-8
client/reducers/index.js
+3
-2
No files found.
client/actions/BreakageContainer.js
View file @
bbf3c769
import
fetch
from
'isomorphic-fetch'
import
getTaskList
from
'./common'
import
breakActionType
from
'../actiontype/breakageContainer'
const
changeStatus
=
(
data
)
=>
{
// const changeStatus = (data)=>{
let
{
taskId
,
currentTaskType
}
=
data
.
taskInfo
;
let
url
=
`http://192.168.10.128:8080/web/flat/work/lr/status/
${
taskId
}
/
${
currentTaskType
}
`
return
(
dispatch
)
=>
{
fetch
(
url
,{
credentials
:
'include'
,
method
:
'PUT'
,
mode
:
'cors'
,
body
:
{}
}).
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
if
(
json
.
data
){
getTaskList
(
data
)
}
})
}
}
//
let {taskId,currentTaskType}=data.taskInfo;
//
let url = `http://192.168.10.128:8080/web/flat/work/lr/status/${taskId}/${currentTaskType}`
//
return (dispatch)=>{
//
fetch(url,{
//
credentials : 'include',
//
method : 'PUT',
//
mode : 'cors',
//
body : {}
//
}).then((response)=>response.json())
//
.then((json)=>{
//
if(json.data){
//
getTaskList(data)
//
}
//
})
//
}
//
}
const
changeTaskStatus
=
(
data
)
=>
{
return
{
}
}
\ No newline at end of file
}
//test 输入条形码获取商品信息
const
getProductInfo
=
(
data
)
=>
{
let
{
barcode
}
=
data
;
let
url
=
`http://192.168.10.128:8080/web/flat/barcode/1/A/LR/
${
barcode
}
`
return
(
dispatch
)
=>
{
fetch
(
url
,{
method
:
'GET'
,
mode
:
'cors'
}).
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
if
(
json
.
meta
.
success
&&
json
.
data
){
dispatch
(
saveProductInfo
(
json
.
data
))
}
})
}
}
const
saveProductInfo
=
(
data
)
=>
{
return
{
type
:
breakActionType
.
GETPRODUCTINFO
,
data
}
}
export
{
getProductInfo
}
\ No newline at end of file
client/actions/common.js
View file @
bbf3c769
...
...
@@ -15,11 +15,11 @@ let myHeaders = new Headers({
//开始工作
const
getTaskInfo
=
(
data
)
=>
{
console
.
log
(
data
,
'吴加宝 打印'
)
let
{
userInfo
,
storeInfo
}
=
data
;
// let {userInfo,storeInfo} = data;
return
(
dispatch
)
=>
{
if
(
userInfo
&&
userInfo
.
id
&&
storeInfo
&&
storeInfo
.
id
)
{
let
url
=
`
${
ENV
.
domain
}
flat/ready/
${
storeInfo
.
id
}
/
${
userInfo
.
id
}
`
;
// if(userInfo && userInfo.id && storeInfo && storeInfo.id) {
let
url
=
'http://192.168.10.128:8080/web/flat/ready/1/A/28'
;
// let url = `${ENV.domain}flat/ready/${storeInfo.id}/${userInfo.id}`;
fetch
(
url
,{
// credentials : 'include',
method
:
'GET'
,
...
...
@@ -33,9 +33,9 @@ const getTaskInfo = (data)=>{
}
dispatch
(
saveCommonInfo
(
Object
.
assign
({},{
taskInfo
})))
}).
catch
(
e
=>
{
console
.
error
(
e
)})
}
else
{
dispatch
(
addErrorInfo
(
"用户或门店不对"
))
}
//
}else {
//
dispatch(addErrorInfo("用户或门店不对"))
//
}
}
};
...
...
@@ -116,7 +116,8 @@ const getUserinfo = (employeeId,storeId)=>{
//test 没有散落货品
const
hasNoSku
=
(
storeInfo
)
=>
{
return
(
dispatch
)
=>
{
let
url
=
`
${
ENV
.
domain
}
/flat/work/status/1`
// let url=`${ENV.domain}/flat/work/status/1`;
let
url
=
'http://192.168.10.128:8080/web/flat/work/status/1/A/LR'
;
fetch
(
url
,{
// credentials : 'include',
method
:
'PUT'
,
...
...
@@ -132,7 +133,8 @@ const hasNoSku = (storeInfo)=>{
//拉取工单
const
getTaskList
=
(
data
=
{})
=>
{
let
url
=
`
${
ENV
.
domain
}
/flat/work/list/13`
// let url=`${ENV.domain}/flat/work/list/13`;
let
url
=
'http://192.168.10.128:8080/web/flat/work/list/1/A/28'
;
return
(
dispatch
)
=>
{
fetch
(
url
,{
// credentials : 'include',
...
...
client/actiontype/breakageContainer.js
0 → 100644
View file @
bbf3c769
const
breakActionType
=
{
GETPRODUCTINFO
:
'GETPRODUCTINFO'
}
export
default
breakActionType
\ No newline at end of file
client/components/BreakageComponent/BreakageCode/BreakageCode.jsx
View file @
bbf3c769
import
React
from
'react'
import
Button
from
'../../CommonComponent/ButtonComponent/ButtonComponent'
class
BreakageCode
extends
React
.
Component
{
constructor
(
props
){
super
(
props
)
this
.
state
=
{
barcode
:
''
}
}
render
(){
let
{
barcode
}
=
this
.
state
;
return
(
<
div
className=
{
'breakageContent'
}
>
<
div
className=
{
'breakageContent'
}
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
background
:
'rgba(0,0,0,1)'
,
position
:
'absolute'
}
}
>
<
div
className=
{
'breakageHeader'
}
>
<
span
>
返回
</
span
>
<
span
>
请输入遗留货品的条形码
</
span
>
<
span
>
条形码残缺?
</
span
>
</
div
>
<
div
className=
{
'breakageCodeContent'
}
>
<
p
>
条形码输入错误,请重新输入
</
p
>
<
input
type=
"text"
vlaue=
{
barcode
}
onChange=
{
(
ev
)
=>
{
this
.
setState
({
barcode
:
ev
.
target
.
value
})}
}
/>
<
p
>
or
<
span
>
条形码扫描
</
span
></
p
>
</
div
>
<
Button
text=
{
'确定'
}
option=
{
this
.
getCodeProduct
.
bind
(
this
)
}
btnContainer=
{
'font30 backff775c colfff'
}
style=
{
{
border
:
'0'
}
}
/>
</
div
>
)
}
getCodeProduct
(){
let
{
barcode
}
=
this
.
state
;
this
.
props
.
getProductInfo
(
barcode
)
}
}
export
default
BreakageCode
;
\ No newline at end of file
client/components/BreakageComponent/BreakageCode/index.css
0 → 100644
View file @
bbf3c769
client/components/BreakageComponent/defaultComponent/DefaultComponnet.jsx
View file @
bbf3c769
...
...
@@ -12,14 +12,19 @@ class DefaultComponent extends React.Component{
text=
{
'有,扫码上报'
}
btnContainer=
{
'col333 font30'
}
style=
{
{
marginTop
:
'150px'
,
marginLeft
:
'50%'
,
transform
:
'translate(-50%)'
}
}
option=
{
this
.
skipInputCode
.
bind
(
this
)
}
/>
<
Button
text=
{
'没有'
}
btnContainer=
{
'col333 font30'
}
style=
{
{
marginTop
:
'30px'
,
marginLeft
:
'50%'
,
transform
:
'translate(-50%)'
}
}
option=
{
this
.
props
.
pullTaskList
}
/>
</
div
>
)
}
skipInputCode
(){
this
.
props
.
changeCodePage
(
false
)
}
}
export
default
DefaultComponent
;
\ No newline at end of file
client/containers/BreakageContainer/BreakageConatiner.jsx
View file @
bbf3c769
...
...
@@ -10,22 +10,28 @@ class BreakageContainer extends React.Component {
constructor
(
props
){
super
(
props
)
this
.
state
=
{
showPage
:
1
showPage
:
1
,
isShow
:
true
}
this
.
changePage
=
this
.
changePage
.
bind
(
this
);
}
render
(){
let
props
=
this
.
props
;
let
{
isShow
}
=
this
.
state
;
return
(
<
div
className=
{
"BreakageContainer"
}
>
<
HeaderComponent
headerInfo=
{
props
.
headerInfo
}
/>
<
LeftContainer
leftInfo=
{
props
.
headerInfo
}
/>
<
RightContainer
>
{
this
.
getPages
()
}
</
RightContainer
>
{
isShow
?<
div
>
<
HeaderComponent
headerInfo=
{
props
.
headerInfo
}
/>
<
LeftContainer
leftInfo=
{
props
.
headerInfo
}
/>
<
RightContainer
>
{
this
.
getPages
()
}
</
RightContainer
>
</
div
>:<
BreakageCode
changePage=
{
this
.
changePage
}
getProductInfo=
{
this
.
getproductCode
.
bind
(
this
)
}
/>
}
</
div
>
)
}
...
...
@@ -38,21 +44,30 @@ class BreakageContainer extends React.Component {
showPage
:
page
})
}
//切换到扫码的页面
changeCodePage
(
bool
){
this
.
setState
({
isShow
:
bool
})
}
getPages
(){
let
pages
=
null
;
let
props
=
this
.
props
;
let
{
showPage
}
=
this
.
state
;
switch
(
showPage
){
case
1
:
pages
=
<
DefaultComponent
/>
pages
=
<
DefaultComponent
pullTaskList=
{
props
.
pullTaskList
}
changeCodePage=
{
this
.
changeCodePage
.
bind
(
this
)
}
/>
break
;
case
2
:
pages
=
<
BreakageProductDetail
/>
break
;
case
3
:
pages
=
<
BreakageCode
/>
break
;
}
return
pages
;
}
getproductCode
(
barcode
){
this
.
props
.
getProductInfo
(
barcode
)
}
}
export
default
BreakageContainer
\ No newline at end of file
client/containers/PageContainer/PageContainer.jsx
View file @
bbf3c769
...
...
@@ -10,7 +10,6 @@ import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitPr
import
{
getReportDamageList
,
deleteDamageItem
}
from
'../../actions/reportDamageList'
import
{
getRefreshImg
,
deleteImg
,
emptyImg
}
from
"../../actions/refreshImg"
import
{
uploadError
,
addErrorInfo
}
from
'../../actions/uploadError'
import
{
getTaskInfo
,
getTaskList
}
from
'../../actions/common'
import
PopupComponent
from
'../../components/CommonComponent/PopupComponent/PopupComponent'
import
TroubleContainer
from
'../TroubleContainer/TroubleContainer'
import
ScanBarCodeContainer
from
'../ScanBarCodeContainer/ScanBarCodeContaienr'
...
...
@@ -28,6 +27,8 @@ import TakeStokeContainer from '../TakeStokeContainer/TakeStokeContainer'
import
BreakageContainer
from
'../BreakageContainer/BreakageConatiner'
import
RecoveryPage
from
'../RecoveryContainer/RecoveryContainer'
import
ReplenishContainer
from
'../ReplenishContainer/ReplenishContainer'
import
{
getProductInfo
}
from
'../../actions/BreakageContainer'
import
{
getTaskInfo
,
getTaskList
}
from
'../../actions/common'
/*二期引用 end*/
import
{
on
,
remove
}
from
'../../util/event'
;
...
...
@@ -482,7 +483,6 @@ class PageContainer extends React.Component {
})
}
getPages
(){
let
pages
=
null
;
let
{
state
,
dispatch
}
=
this
.
props
;
...
...
@@ -593,16 +593,17 @@ class PageContainer extends React.Component {
pages =
<
BreakageContainer
pullTaskList=
{
()
=>
{
dispatch
(
hasNoSku
(
state
.
commonInfo
.
storeInfo
))}
}
headerInfo=
{
state
.
commonInfo
}
getProductInfo=
{
(
barcode
)
=>
{
dispatch
(
getProductInfo
({
barcode
}))}
}
/>
;
break;
case showPage[10]:
pages =
<
RecoveryPage
headerInfo
=
{
state
.
commonInfo
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
3
,
2
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
())
}
wrongShelf=
{
()
=>
dispatch
(
wrongShelf
())
}
headerInfo
=
{
state
.
commonInfo
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
getTaskName=
{
()
=>
dispatch
(
getTaskName
(
3
,
2
))
}
finishBoxRecovery=
{
()
=>
dispatch
(
finishBoxRecovery
())
}
wrongShelf=
{
()
=>
dispatch
(
wrongShelf
())
}
/>
;
break;
case showPage[11]:
...
...
@@ -615,6 +616,8 @@ class PageContainer extends React.Component {
}
return pages;
}
handleTouch()
{
console
.
log
(
"handleTouch"
);
...
...
client/reducers/index.js
View file @
bbf3c769
...
...
@@ -9,7 +9,7 @@ import headerInfo from './initHeader' //获取头部信息
import
reportDamageList
from
'./reportDamge'
//一期商铺报损
import
errMsg
from
'./error'
//上报异常
import
commonInfo
from
'./common'
//上报异常
import
breakageContainer
from
'./breakageContainer'
export
default
combineReducers
({
troubleList
,
storeInfo
,
...
...
@@ -20,7 +20,8 @@ export default combineReducers({
headerInfo
,
reportDamageList
,
errMsg
,
commonInfo
commonInfo
,
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