Commit c963de04 by Zhang Xin

完整回收流程

parent 5b8d66a1
import fetch from 'isomorphic-fetch'
import getTaskList from './common'
import saveCommonInfo from './common'
import barcodeActionType from '../actiontype/barcodeCommon'
import replenishAction from './replenish'
let domain1 = ENV.domain;
......@@ -49,6 +49,8 @@ const getBarCodeProductInfo = (data)=>{
.then((json)=>{
if(json.meta.success&&json.data){
dispatch(replenishAction.emptyErrorInfo()); //补货清空错误数据
let info = Object.assign({},{taskList:json.data.product});
dispatch(saveCommonInfo(info))
dispatch(saveProductInfo(json.data))
}else{
switch (taskInfo.currentTaskNum){
......@@ -57,7 +59,11 @@ const getBarCodeProductInfo = (data)=>{
break;
case 4 :
//补货任务
dispatch(replenishAction.wrongQrcode(json));
let errorInfo = {
errorType : json.data.errorType || "",
errorMessage : json.meta.message
};
dispatch(replenishAction.wrongQrcode(errorInfo));
break;
}
}
......
......@@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch';
import actionType from '../actiontype/common'
import {addErrorInfo} from './uploadError'
let domain1 = ENV.domain;
let domain = 'http://192.168.10.128:8080/web/'
let domain = ENV.domain
let myHeaders = new Headers({
// 'Access-Control-Allow-Origin': '*',
......@@ -36,6 +36,29 @@ let myHeaders = new Headers({
// }
// }
// };
const getTaskInfo = (data)=>{
let {userInfo,storeInfo,taskInfo} = data;
return(dispatch)=>{
if(userInfo && userInfo.id && storeInfo && storeInfo.id) {
let url = `${domain}flat/ready/${storeInfo.id}/${taskInfo.area}/${userInfo.id}`;
fetch(url,{
// credentials : 'include',
method : 'GET',
mode : 'cors',
}).then((response)=>response.json())
.then(json=>{
let taskInfo=Object.assign({});
if(json.meta.success && json.data){
taskInfo = Object.assign({},json.data);
dispatch(getTaskName(json.data.currentTaskNum))
}
dispatch(saveCommonInfo(Object.assign({},{taskInfo})))
}).catch(e=>{console.error(e)})
}else {
dispatch(addErrorInfo("用户或门店不对"))
}
}
};
//获取店铺信息
const getStoreInfo = (storeId)=>{
......@@ -60,28 +83,6 @@ const getStoreInfo = (storeId)=>{
}
};
//获取条形码信息
const getInfoByBarcode = (data)=>{
let {storeId,barcode} = data;
let url = `flat/barcode/${storeId}/${barcode}`
return (dispatch)=>{
// dispatch(clearBarcodeInfo()); //清空barcode信息
fetch(domain + url,{
credentials : 'include',
method : 'GET',
mode : 'cors',
headers: { 'Content-Type': 'application/json' }
}).then(response=>response.json())
.then(json=>{
if(json.meta.success){
//扫码成功
}else{
//扫码失败
}
})
}
};
//获取用户信息
const getUserinfo = (employeeId,storeId)=>{
......@@ -145,6 +146,7 @@ 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)
data.taskList = Object.assign({},json.data.skuFlatVo);
......@@ -209,4 +211,8 @@ const getTaskName = (currentTaskNum,childTaskNum=0)=>{
}
}
<<<<<<< HEAD
export {getStoreInfo,getInfoByBarcode,saveCommonInfo,getUserinfo,logout,startalljob,saveTaskListInfo,getTaskList,hasNoSku,getTaskName}
=======
export {getStoreInfo,getTaskInfo,saveCommonInfo,getUserinfo,logout,startalljob,saveTaskListInfo,getTaskList,hasNoSku,getTaskName}
>>>>>>> 完整回收流程
......@@ -10,8 +10,17 @@ let myHeaders = new Headers({
'Content-Type': 'application/json; charset=UTF-8',
});
const finishBoxRecovery = ()=>{
//完成
const finishBoxRecovery = (info)=>{
//已放入回收箱
let {userInfo,taskInfo,storeInfo,taskList} = info;
let bodyData = Object.assign({},{
storeId : storeInfo.id,
taskId : taskInfo.taskId,
userId : userInfo.id,
id : taskList.workListId,
taskType : taskInfo.currentTaskType,
area : taskInfo.area
})
let url=`${ENV.domain}/machine_pad/update_machine_recovery_sku.action`
return (dispatch)=>{
fetch(url,{
......@@ -21,25 +30,10 @@ const finishBoxRecovery = ()=>{
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
dispatch(getTaskList());
dispatch(getTaskList(info));
})
}
};
const wrongShelf = ()=>{
//货道不符
let url=`${ENV.domain}/machine_pad/wrong_machine_recovery_sku.action`
return (dispatch)=>{
fetch(url,{
// credentials : 'include',
method : 'POST',
mode : 'cors',
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
dispatch(getTaskList());
})
}
}
export {finishBoxRecovery,wrongShelf}
export {finishBoxRecovery}
......@@ -50,6 +50,7 @@ const uploadError = (info,exceptionType)=>{
}).then((response)=>response.json())
.then(json=>{
dispatch(getTaskList());
}).catch(e=>{console.error(e)});
})
}
......
import React from 'react';
import Button from '../../CommonComponent/ButtonComponent/ButtonComponent'
import Header from '../../CommonComponent/HeaderComponent/HeaderComponent';
import PopModel from '../../CommonComponent/PopupComponent/PopupChildComponent'
require('./index.css')
export default class RecoveryScanPage extends React.Component{
constructor(props){
super(props);
this.getOtherHeader = this.getOtherHeader.bind(this)
this.getBarcodeInput = this.getBarcodeInput.bind(this)
this.wrongQrcode = this.wrongQrcode.bind(this)
this.makeSureScanOver = this.makeSureScanOver.bind(this);
this.submitBarcode = this.submitBarcode.bind(this);
this.failSubmit = this.failSubmit.bind(this);
this.getScanDom = this.getScanDom.bind(this);
this.changeShowInput = this.changeShowInput.bind(this);
this.getPopInfo = this.getPopInfo.bind(this);
this.correctQrcode = this.correctQrcode.bind(this);
this.state = {
barcodeText : '',
barcodeErrorText : '',
showInput : false
}
}
componentWillReceiveProps(nextProps){
let {recoveryInfo} = nextProps;
}
getPopInfo(){
let {finishBoxRecovery} = this.props;
let btnDom = <Button btnContainer={"recoveryContainerQrcode font32 backff775c colfff"} style={{marginTop:'10%'}} key={"recoveryContainerCorrectQrcode"} text={"已放入"} option={finishBoxRecovery}/>
return (
<PopModel popupTitle={"货品匹配成功"} classContainer={"recoveryPopInfo"}>
<div className={"icon iconfont icon-correct font150 col27ce61"} />
<div className={"text font40 col000"}>
<p>请将货品放入回收箱</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>
)
}
getOtherHeader(){
let {headerInfo,goBack} = this.props;
return <div className={"otherHeader replenishScanQrcodeHeader font32 clearfix colfff "}>
<i className={"iconfont middle icon font50 icon-circle-left circleIcon fl"} onClick={()=>goBack(2)}/>
</div>
}
handleInputChange(e){
this.setState({
barcodeText:e.target.value
})
}
getBarcodeInput(){
return (
<div className={"barcodeInputDom"}>
<div className={"barcodeInputText font30"}>{this.state.barcodeErrorText}</div>
<input value={this.state.barcodeText} className={"barcodeInput font30 col000"} type="text" onChange={this.handleInputChange.bind(this)}/>
<div className={"barcodeInputTip font30 colff775c"} onClick={()=>this.changeShowInput()}><span className={"colfff"}>or</span>条形码扫描</div>
<Button btnContainer={"barcodeInputBarcode font32 backff775c colfff"} key={"barcodeInputBarcode"} text={"确定"} option={this.submitBarcode}/>
</div>
)
}
/**
* 扫描错误商品(后台返回)
*/
wrongQrcode(){
//拿错货品
let {showPopup,hidePopup} = this.props;
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={"text font40 col000"}>
<p>您拿错货品了,请放回货架!</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>
showPopup({popupChild:popDom});
}
correctQrcode(){
let {showPopup} = this.props;
let popDom = this.getPopInfo();
showPopup({popupChild:popDom});
}
/**
* 条形码扫描完毕
*/
makeSureScanOver(){
//确认扫描完毕
let {hidePopup} = this.props;
hidePopup()
}
/**
* 条形码提交失败,前台判断
*/
failSubmit(){
this.setState({
barcodeText : ''
},()=>{
this.props.hidePopup()
})
}
/**
* 提交条形码
*/
submitBarcode(){
//提交条形码信息
let barcodeText = this.state.barcodeText;
let {showPopup,getBarCodeProductInfo,headerInfo} = this.props;
let {taskList={}} = headerInfo;
if(barcodeText){
barcodeText = barcodeText.trim();
if(this.checkNumber(barcodeText)){
console.log("submitBarcode ",barcodeText);
console.log("submitBarcode ",taskList);
console.log("submitBarcode ",taskList.barcode);
this.setState({
barcodeErrorText : ''
});
if(taskList.barcode && parseInt(barcodeText) === parseInt(taskList.barcode)){
this.correctQrcode()
}else{
this.wrongQrcode()
}
}else{
//提示条形码不正确
this.setState({
barcodeErrorText : '条形码输入错误,请重新输入'
})
}
}else{
//提示输入条形码
this.setState({
barcodeErrorText : '请输入条形码'
})
}
}
/**
* 验证条形码结果是否为纯数字
* @param str
* @returns {boolean}
*/
checkNumber(str){
let reg = /^[0-9]*$/;
return reg.test(str);
}
/**
* 调用扫描条形码
* @returns {*}
*/
getScanDom(){
let {headerInfo} = this.props;
let {taskList={}} = headerInfo;
return (
<div className={"recoveryScanDom"}>
<div className={"colfff font30 scanText"}>目标回收数量:<span className={"font40 colff775c"}>{taskList.targetNum || 0}</span> 已回收数量:<span className={"font40 colff775c"}>{taskList.recoverNum || 0}</span></div>
<div className={"colff775c scanTips font30"} onClick={()=>this.changeShowInput()}><span className={"colfff font26"}>or</span> 手动输入条形码</div>
<div className={"colfff scanInfo font30"}>
<span>货道信息:{taskList.position || ''}</span>
<span>货道编号:{taskList.positionNum || ''}</span>
<span>货物条形码:{taskList.barcode || ''}</span>
</div>
</div>
)
}
/**
* 条形码扫描和输入框切换
*/
changeShowInput(){
this.setState({
showInput : !this.state.showInput,
barcodeText :""
})
}
render(){
let props = this.props;
let {headerInfo} = props;
let {taskInfo={}} = headerInfo;
return(
<div className={"replenishScanPage"} style={{width:'100%',height:'100%',backgroundColor:'#000'}}>
<Header
showHeader={CONFIG.headerStatus[2]}
>
{this.getOtherHeader()}
</Header>
{
this.state.showInput ? this.getBarcodeInput() : this.getScanDom()
}
</div>
)
}
}
.barcodeInputDom{
text-align: center;
margin-top: 133px;
}
.barcodeInputDom .barcodeInputText{
color:#d0021b;
line-height: 90px;
}
.barcodeInputDom .barcodeInput{
border:2px solid #9b9b9b ;
border-radius: 20px;
width: 540px;
height: 80px;
line-height: 80px;
background-color: #ffffff;
text-align: center;
}
.barcodeInputDom .barcodeInputTip{
line-height: 90px;
}
.barcodeInputDom .barcodeInputTip>span{
margin-right: 30px;
}
.barcodeInputDom .barcodeInputBarcode{
border:none;
display: inline-block;
margin-top: 110px;
}
.replenishScanPageErrorSku .handleForgetSku{
line-height: 90px;
}
.replenishScanPageErrorSku .btn{
flex-direction: column;
align-items: center;
}
.replenishScanPageForgetSku .replenishSkuInfo{
margin-top: 8%;
}
.recoveryScanDom{
position: relative;
width: 100%;
height: 90%;
text-align: center;
}
.recoveryScanDom>div{
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.recoveryScanDom .scanText{
top: 8%;
}
.recoveryScanDom .scanTips{
top: 80%;
}
.recoveryScanDom .scanTips>span{
margin-right: 20px;
}
.recoveryScanDom .scanInfo{
top: 90%;
width: 100%;
white-space: nowrap;
}
.recoveryScanDom .scanInfo>span{
margin-right: 30px;
}
.recoveryScanDom .scanInfo>span:last-child{
margin-right: 0;
}
\ No newline at end of file
......@@ -7,9 +7,6 @@ export default class RecoverySecondPage extends React.Component{
constructor(props){
super(props);
this.scanQrcode = this.scanQrcode.bind(this); //扫码回收
this.wrongQrcode = this.wrongQrcode.bind(this); //扫描错误商品
this.correctQrcode = this.correctQrcode.bind(this); //扫描正确商品
this.putSkuToBox = this.putSkuToBox.bind(this); //将商品放入回收箱
this.wrongSku = this.wrongSku.bind(this); //完成回收箱商品回收
this.uploadWrongSku = this.uploadWrongSku.bind(this); //货品不符上报
this.state={
......@@ -20,43 +17,10 @@ export default class RecoverySecondPage extends React.Component{
}
}
getPopInfo(){
let btnDom = <Button btnContainer={"recoveryContainerQrcode font32 backff775c colfff"} key={"recoveryContainerCorrectQrcode"} text={"已放入"} option={this.putSkuToBox}/>
return (
<PopModel popupTitle={"货品匹配成功"} classContainer={"recoveryPopInfo"}>
<div className={"icon iconfont icon-correct font150 col27ce61"} />
<div className={"text font40 col000"}>
<p>请将货品放入回收箱</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>
)
}
wrongQrcode(){
//拿错货品
let {showPopup,hidePopup} = this.props;
let btnDom = <Button btnContainer={"recoveryContainerQrcode font32"} key={"recoveryContainerWrongQrcode"} text={"关闭"} option={hidePopup}/>
let popDom =
<PopModel popupTitle={"遇到问题-货品不对"} classContainer={"recoveryPopInfo"}>
<div className={"icon iconfont icon-wrong font150"} />
<div className={"text font40 col000"}>
<p>您拿错货品了,请放回货架!</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>
showPopup({popupChild:popDom});
}
wrongSku(){
//货道商品不符
let {showPopup,hidePopup} = this.props;
let btnDom1 = <Button btnContainer={"recoveryPopInfoWrongSkuBtn1 font32"} key={"recoveryContainerShelfWrong1"} style={{'width':"100%"}} text={"货品不符"} option={this.uploadWrongSku}/>
let btnDom1 = <Button btnContainer={"recoveryPopInfoWrongSkuBtn1 font32"} key={"recoveryContainerShelfWrong1"} text={"货品不符"} option={this.uploadWrongSku}/>
let btnDom2 = <Button btnContainer={"recoveryPopInfoWrongSkuBtn2 backff775c colfff font32"} key={"recoveryContainerShelfWrong2"} text={"关闭窗口"} option={hidePopup}/>
let popDom =
<PopModel popupTitle={"遇到问题-货品不符"} classContainer={"recoveryPopInfo"}>
......@@ -72,25 +36,16 @@ export default class RecoverySecondPage extends React.Component{
showPopup({popupChild:popDom});
}
correctQrcode(){
let {showPopup} = this.props;
let popDom = this.getPopInfo();
showPopup({popupChild:popDom});
}
putSkuToBox(){
//调取接口,将商品放入回收箱
}
uploadWrongSku(){
//货品不符上报
this.props.wrongShelf();
this.props.uploadError(CONFIG.taskErrorType.WRONG_SKU);
}
scanQrcode(){
//扫码回收
this.props.finishBoxRecovery();
this.props.beginScan(3)
}
......@@ -105,7 +60,7 @@ export default class RecoverySecondPage extends React.Component{
<SkuInfoComponent style={{'display':'flex'}} skuInfo={headerInfo.taskList || {}}/>
<div className={"btn"}>
<Button btnContainer={"recoverySecondPageBtn font32 colfff"} key={"RecoverySecondPageBtn"} text={'扫码回收'} option={this.scanQrcode}/>
<div className={"text colff775c font28"} onClick={()=>this.wrongQrcode()}>货品不符?</div>
<div className={"text colff775c font28"} onClick={()=>this.wrongSku()}>货品不符?</div>
</div>
</div>
</div>
......
import swiperContainers from './swiperContainer'
import showPage from './showPage'
import socketType from './socketType'
import taskErrorType from './taskErrorType'
module.exports = {swiperContainers,...showPage,socketType}
\ No newline at end of file
module.exports = {swiperContainers,...showPage,socketType,taskErrorType}
\ No newline at end of file
//异常类型("SU"货道不符 ,"SLT"货品少拿 ,"SUM"货品种类不符,"SF"货道已满)
const errorType = {
SU:'SU',
WRONG_SKU:'SU', //回收 货品不符合
SLT:'SLT',
SUM :'SUM',
SF : 'SF'
......
......@@ -16,7 +16,7 @@ export default class HomePageContainer extends React.Component{
render(){
let props = this.props;
let {headerInfo} = props;
let {headerInfo={}} = props;
let {taskInfo={}} = headerInfo;
let buttonStyle={background:'#ff775c',margin:"0 auto",marginTop:'77px'};
return(
......
......@@ -3,7 +3,7 @@ import React from 'react'
import { connect } from 'react-redux';
import {getStoreInfo,saveCommonInfo,getUserinfo,logout,hasNoSku,getTaskName} from "../../actions/common";
import {finishBoxRecovery,wrongShelf} from "../../actions/recovery";
import {finishBoxRecovery} from "../../actions/recovery";
import {getTroubleList,updateTroubleList} from "../../actions/getTroubles";
import {initGetOtherProblem,addNewProbem,deleteProblem,editProblemItem,submitProblemList} from "../../actions/otherQuestion"
import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitProductSuccess,clearProductSuccess} from "../../actions/ScanBarCode"
......@@ -201,22 +201,26 @@ 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.employee && userinfo.employee.id &&
let isNotOneUser = userinfo && userinfo.employee && userinfo.employee.id &&
(!nowUserInfo || !nowUserInfo.employee || (nowUserInfo.employee.id !== userinfo.employee.id));
let isNotOneTask = userinfo.type && userinfo.type !== nowUserInfo.type;
let isNotOneTask = userinfo && userinfo.type && userinfo.type !== nowUserInfo.type;
if(isNotOneUser && isNotOneTask){
//不是同一个用户,并且不是同一个任务
this.dealPageByType(userinfo.type);
}
if(state.errMsg.errMsg){
if(state.errMsg && state.errMsg.errMsg){
//有错误信息,弹出错误信息弹窗
this.showError(state.errMsg.errMsg)
}
//根据后台数据控制该显示的页面
if(nextProps.state.commonInfo.taskInfo){
if(nextProps.state.commonInfo && nextProps.state.commonInfo.taskInfo){
let num=nextProps.state.commonInfo.taskInfo.currentTaskNum;
switch(num){
case 1 :
......@@ -602,15 +606,16 @@ class PageContainer extends React.Component {
case showPage[10]:
pages = <RecoveryPage
headerInfo = {state.commonInfo}
recoveryInfo = {state.recoveryInfo}
showPopup={(info)=>this.showPopup(info)}
hidePopup={()=>this.hidePopup()}
getTaskName={()=>dispatch(getTaskName(3,2))}
finishBoxRecovery={()=>dispatch(finishBoxRecovery())}
wrongShelf={()=>dispatch(wrongShelf())}
finishBoxRecovery={()=>dispatch(finishBoxRecovery(state.commonInfo))}
uploadError={(exceptionType)=>dispatch(uploadError(state.commonInfo,exceptionType))}
getBarCodeProductInfo={(barcode)=>{dispatch(getBarCodeProductInfo({barcode,commonInfo:state.commonInfo}))}}
/>;
break;
case showPage[11]:
console.log("showPage[11] ",state)
pages = <ReplenishContainer
headerInfo = {state.commonInfo}
showPopup={(info)=>this.showPopup(info)}
......
......@@ -4,23 +4,26 @@ import LeftContainer from '../LeftContainer/LeftContainer';
import RightContainer from '../RightContainer/RightContainer';
import RecovertyFirstPage from '../../components/RecoveryComponent/RecoveryFirstPage/RecoveryFirstPage'
import RecoverySecondPage from '../../components/RecoveryComponent/RecoverySecondPage/RecoverySecondPage'
import RecoveryScanPage from '../../components/RecoveryComponent/RecoveryScanPage/RecoveryScanPage'
require('./index.css');
const recoveryPageIndex = {
1 : "boxRecovery",
2 : "shelfRecovery"
1 : "getFirstPage",
2 : "getSecondPage",
3 : "getScanPage"
}
export default class RecoveryContainer extends React.Component{
constructor(props){
super(props);
this.state = {
showPage : recoveryPageIndex[1] //展示回收箱页面
showPage : 1 //展示回收箱页面
};
this.getFirstPage = this.getFirstPage.bind(this); //展示第一页
this.getSecondPage = this.getSecondPage.bind(this); //展示第二页
this.getPage = this.getPage.bind(this); //获取要展示的页面
this.finishBoxRecovery = this.finishBoxRecovery.bind(this); //完成回收箱商品回收
this.setPage = this.setPage.bind(this); //完成回收箱商品回收
}
componentWillMount() {
......@@ -32,13 +35,24 @@ export default class RecoveryContainer extends React.Component{
console.log("没有回收箱物品")
//没有回收箱物品
this.setState({
showPage : recoveryPageIndex[2]
showPage : 2
})
}
}
componentWillReceiveProps(nextProps){
let {hidePopup,headerInfo} = nextProps;
console.log("nextProps ",nextProps)
console.log("props ",this.props)
if(this.props.headerInfo && this.props.headerInfo.taskList && headerInfo && headerInfo.taskList){
let oldTaskList = this.props.headerInfo.taskList;
let taskList = headerInfo.taskList;
if(taskList.skuId !== oldTaskList.skuId || (taskList.skuId === oldTaskList.skuId && taskList.recoverNum !== oldTaskList.recoverNum)){
hidePopup();
this.finishBoxRecovery();
}
}
}
......@@ -47,48 +61,57 @@ export default class RecoveryContainer extends React.Component{
let props = this.props;
props.getTaskName()
this.setState({
showPage : recoveryPageIndex[2]
showPage : 2
})
}
getFirstPage(){
getFirstPage(props){
return (
<RecovertyFirstPage finishBoxRecovery={()=>this.finishBoxRecovery()}/>
)
}
getSecondPage(){
let props = this.props;
getSecondPage(props){
return (
<RecoverySecondPage {...props}/>
<RecoverySecondPage {...props} beginScan={this.setPage}/>
)
}
getPage(){
console.log("getPage ",this.state.showPage)
switch (this.state.showPage){
case recoveryPageIndex[1]:
return this.getFirstPage();
case recoveryPageIndex[2]:
return this.getSecondPage();
}
getScanPage(props){
return (
<RecoveryScanPage {...props} goBack={this.setPage}/>
)
}
setPage(page){
this.setState({
showPage : page
})
}
getPage(type){
return (props)=>this[recoveryPageIndex[type]](props)
}
render(){
let dom = this.getPage();
let props = this.props;
let dom = this.getPage(this.state.showPage)(props);
return(
<div className={"recoveryContainer page"}>
{
props.headerInfo && props.headerInfo.storeInfo ?
<Header headerInfo={props.headerInfo}/> : null
}
this.state.showPage === 3 ?
this.getScanPage(props) :
<div style={{width:'100%',height:'100%'}}>
{
props.headerInfo && props.headerInfo.storeInfo ?
<Header headerInfo={props.headerInfo}/> : null
}
<LeftContainer leftInfo={props.headerInfo}/>
<RightContainer>
{
dom
}
</RightContainer>
<LeftContainer leftInfo={props.headerInfo}/>
<RightContainer>
{dom}
</RightContainer>
</div>
}
</div>
)
}
......
......@@ -12,8 +12,10 @@
position: relative;
left: 50%;
transform: translateX(-50%);
display: flex;
flex-direction: column;
align-items: center;
}
.recoveryPopInfo .btn .recoveryContainerQrcode{
display: inline-block;
margin-top: 10%;
.recoveryPopInfo .btn>div:nth-child(2){
margin-top: 5%;
}
\ No newline at end of file
......@@ -101,7 +101,7 @@ export default class ReplenishContainer extends React.Component{
console.log("render ",this.state.pageType,this.state.showScanQrcode);
let props = this.props;
return (
<div className={"replenishContainer"}>
<div className={"replenishContainer page"}>
{
this.state.showScanQrcode ?
<ReplenishScanPage {...props} goBack={this.goBack}/> :
......
import actionTypes from '../actiontype/common';
const saveCommonInfo = (state,data)=>{
const saveCommonInfo = (newState,data)=>{
let keys = Object.keys(data);
let state = JSON.parse(JSON.stringify(newState))
keys.forEach(k=>
{
if(state[k]){
......@@ -16,7 +17,7 @@ const saveCommonInfo = (state,data)=>{
state[k] = data[k]
}
});
return Object.assign({},state);
return Object.assign({},state)
};
const emptyCommInfo = (state,data)=>{
......
......@@ -11,6 +11,7 @@ import errMsg from './error' //上报异常
import commonInfo from './common' //上报异常
import barcodeCommon from './barcodeCommon'
import replenishInfo from './replenish'
import recoveryInfo from './recovery'
export default combineReducers({
troubleList,
storeInfo,
......@@ -23,7 +24,8 @@ export default combineReducers({
errMsg,
commonInfo,
barcodeCommon,
replenishInfo
replenishInfo,
recoveryInfo
})
......
......@@ -5,7 +5,7 @@ const setErrorInfo = (state,errorInfo)=>{
return Object.assign({},state,{errorInfo});
};
const emptyErrorInfo = (state)=>{
return Object.assign({},state,{errorInfo:null})
return Object.assign({},state,{errorInfo:{}})
}
export default function(state={}, action) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment