Commit 1f23c97d by wujiabao

测试

parent eac263a1
import React from 'react' import React from 'react'
import Button from '../../../components/CommonComponent/ButtonComponent/ButtonComponent' import Button from '../../../components/CommonComponent/ButtonComponent/ButtonComponent'
import WeChatUtil from '../../../util/WeChatUtil'
require('./index.css') require('./index.css')
class BreakageProductDetail extends React.Component{ class BreakageProductDetail extends React.Component{
constructor(props){ constructor(props){
......
...@@ -7,6 +7,7 @@ import BreakageProductDetail from '../../components/BreakageComponent/BreakagePr ...@@ -7,6 +7,7 @@ import BreakageProductDetail from '../../components/BreakageComponent/BreakagePr
import BreakageCode from '../../components/BreakageComponent/BreakageCode/BreakageCode' import BreakageCode from '../../components/BreakageComponent/BreakageCode/BreakageCode'
import SanCodeComponent from '../../components/BreakageComponent/SanCodeComponent/SanCodeComponent' import SanCodeComponent from '../../components/BreakageComponent/SanCodeComponent/SanCodeComponent'
import PopModel from '../../components/CommonComponent/PopupComponent/PopupChildComponent' import PopModel from '../../components/CommonComponent/PopupComponent/PopupChildComponent'
import WeChatUtil from '../../util/WeChatUtil'
import Button from '../../components/CommonComponent/ButtonComponent/ButtonComponent' import Button from '../../components/CommonComponent/ButtonComponent/ButtonComponent'
require('./index.css') require('./index.css')
class BreakageContainer extends React.Component { class BreakageContainer extends React.Component {
...@@ -27,6 +28,7 @@ class BreakageContainer extends React.Component { ...@@ -27,6 +28,7 @@ class BreakageContainer extends React.Component {
render(){ render(){
let props=this.props; let props=this.props;
let {isShow,popShow,pop1Show,pop2Show}=this.state; let {isShow,popShow,pop1Show,pop2Show}=this.state;
isShow=WeChatUtil.getUrlParam().isShow?WeChatUtil.getUrlParam().isShow:isShow;
return ( return (
<div className={"BreakageContainer"}> <div className={"BreakageContainer"}>
{ {
...@@ -134,6 +136,7 @@ class BreakageContainer extends React.Component { ...@@ -134,6 +136,7 @@ class BreakageContainer extends React.Component {
let pages=null; let pages=null;
let props=this.props; let props=this.props;
let {showPage}=this.state; let {showPage}=this.state;
showPage=WeChatUtil.getUrlParam().children?Number(WeChatUtil.getUrlParam().children):showPage;
switch(showPage){ switch(showPage){
case 1 : case 1 :
pages=<DefaultComponent pullTaskList={props.pullTaskList} pages=<DefaultComponent pullTaskList={props.pullTaskList}
......
...@@ -42,15 +42,15 @@ import AllClassify from '../AllClassifyContainer/AllClassifyContainer' ...@@ -42,15 +42,15 @@ import AllClassify from '../AllClassifyContainer/AllClassifyContainer'
import {willCloseDoor,closeDoorSuccess} from '../../actions/chooseTaskContainer' import {willCloseDoor,closeDoorSuccess} from '../../actions/chooseTaskContainer'
import {sendMsg} from '../../util/socket' import {sendMsg} from '../../util/socket'
import PopModel from '../../components/CommonComponent/PopupComponent/PopupChildComponent' import PopModel from '../../components/CommonComponent/PopupComponent/PopupChildComponent'
import MachineInfo from '../MachineInfo/MachineInfo'
import WeChatUtil from '../../util/WeChatUtil' import WeChatUtil from '../../util/WeChatUtil'
import DevPage from '../DevPage/DevPage' import DevPage from '../DevPage/DevPage'
/*二期引用 end*/ /*二期引用 end*/
/**引用测试数据*/
import testTakeStoreData from '../../../testData/takeStore.json'
import testBreakData from '../../../testData/breakData.json'
import {on,remove} from '../../util/event'; import {on,remove} from '../../util/event';
require('./index.css'); require('./index.css');
const showPage = CONFIG.showPage; const showPage = CONFIG.showPage;
const headerStatus = CONFIG.headerStatus; const headerStatus = CONFIG.headerStatus;
...@@ -161,7 +161,9 @@ class PageContainer extends React.Component { ...@@ -161,7 +161,9 @@ class PageContainer extends React.Component {
this.getPageStyle(); this.getPageStyle();
let that = this; let that = this;
let {dispatch} = this.props; let {dispatch} = this.props;
if(WeChatUtil.getUrlParam().type){
this.switchPages(WeChatUtil.getUrlParam().type)
}
/** /**
* 测试数据 * 测试数据
* @type {number} * @type {number}
...@@ -358,38 +360,11 @@ class PageContainer extends React.Component { ...@@ -358,38 +360,11 @@ class PageContainer extends React.Component {
} }
componentDidUpdate() { componentDidUpdate() {
} }
componentWillReceiveProps(nextProps){
let {state,dispatch} = nextProps;
let nextCommonInfo = state.commonInfo;
let nextUserInfo = nextCommonInfo.userInfo || {};
let nextStoreInfo = nextCommonInfo.storeInfo || {};
let nextTaskInfo = nextCommonInfo.taskInfo || {};
let nextStoreId = nextStoreInfo.id || 0;
let nextUserId = nextUserInfo.id || "";
let nextEmployeeId = nextUserInfo.employeeId || 0;
let nextArea = nextTaskInfo.area || "";
let storeList = state.storeInfo && state.storeInfo.storeList ? state.storeInfo.storeList : [];
if(nextUserInfo && nextUserInfo.taskType && nextUserInfo.id) {
let commonInfo = this.props.state.commonInfo;
let {userInfo={},taskInfo={}} = commonInfo;
if(!userInfo || !userInfo.taskType || !userInfo.id || (
userInfo.id !== nextUserInfo.id || (userInfo.employeeId !== nextUserInfo.employeeId)
) || (
userInfo.taskType !== nextUserInfo.taskType
)){
//如果不是同一个用户或者不是同一个任务,会再次进入
this.dealPageByType(nextUserInfo.taskType);
}
//补货人员,根据type判断显示页面
let lastCurrentType = taskInfo.currentTaskType || '';
//判断要显示的页面的函数
if(nextUserInfo.taskType === "SECOND" && nextTaskInfo && nextTaskInfo.currentTaskType && switchPages (type) {
nextTaskInfo.currentTaskType !== lastCurrentType && lastCurrentType !== 'FINISH' switch (type) {
){
switch (nextTaskInfo.currentTaskType) {
case 'LR' : case 'LR' :
this.changePages(CONFIG.showPage[5]); this.changePages(CONFIG.showPage[5]);
break; break;
...@@ -420,8 +395,41 @@ class PageContainer extends React.Component { ...@@ -420,8 +395,41 @@ class PageContainer extends React.Component {
break; break;
} }
} }
componentWillReceiveProps(nextProps){
let {state,dispatch} = nextProps;
let nextCommonInfo = state.commonInfo;
let nextUserInfo = nextCommonInfo.userInfo || {};
let nextStoreInfo = nextCommonInfo.storeInfo || {};
let nextTaskInfo = nextCommonInfo.taskInfo || {};
let nextStoreId = nextStoreInfo.id || 0;
let nextUserId = nextUserInfo.id || "";
let nextEmployeeId = nextUserInfo.employeeId || 0;
let nextArea = nextTaskInfo.area || "";
let storeList = state.storeInfo && state.storeInfo.storeList ? state.storeInfo.storeList : [];
if(nextUserInfo && nextUserInfo.taskType && nextUserInfo.id) {
let commonInfo = this.props.state.commonInfo;
let {userInfo={},taskInfo={}} = commonInfo;
if(!userInfo || !userInfo.taskType || !userInfo.id || (
userInfo.id !== nextUserInfo.id || (userInfo.employeeId !== nextUserInfo.employeeId)
) || (
userInfo.taskType !== nextUserInfo.taskType
)){
//如果不是同一个用户或者不是同一个任务,会再次进入
this.dealPageByType(nextUserInfo.taskType);
}
//补货人员,根据type判断显示页面
let lastCurrentType = taskInfo.currentTaskType || '';
if(nextUserInfo.taskType === "SECOND" && nextTaskInfo && nextTaskInfo.currentTaskType &&
nextTaskInfo.currentTaskType !== lastCurrentType && lastCurrentType !== 'FINISH'
){
this.switchPages(nextTaskInfo.currentTaskType)
}
}else if(!nextUserInfo.employeeId && this.state.showPage !== showPage[initPage]){ }else if(!nextUserInfo.employeeId && this.state.showPage !== showPage[initPage]&& !WeChatUtil.getUrlParam().type){
this.setState({ this.setState({
showPage : showPage[initPage] showPage : showPage[initPage]
}) })
...@@ -1050,7 +1058,7 @@ class PageContainer extends React.Component { ...@@ -1050,7 +1058,7 @@ class PageContainer extends React.Component {
pages = <TakeStokeContainer headerInfo = {commonInfo} pages = <TakeStokeContainer headerInfo = {commonInfo}
showPopup={(info)=>this.showPopup(info)} showPopup={(info)=>this.showPopup(info)}
hidePopup={()=>this.hidePopup()} hidePopup={()=>this.hidePopup()}
tokeTaskProduct={commonInfo.taskList} tokeTaskProduct={WeChatUtil.getUrlParam().type&&WeChatUtil.getUrlParam().type==='CK'?testTakeStoreData.data.skuFlatVo:commonInfo.taskList}
checkProductQuantity={(tokeProductInfo)=>{dispatch(checkProductQuantity({commonInfo,tokeProductInfo}))}} checkProductQuantity={(tokeProductInfo)=>{dispatch(checkProductQuantity({commonInfo,tokeProductInfo}))}}
TokeStokeState={state.TokeStokeContainer} TokeStokeState={state.TokeStokeContainer}
getTaskList={()=>{dispatch(getTaskList(commonInfo))}} getTaskList={()=>{dispatch(getTaskList(commonInfo))}}
...@@ -1062,7 +1070,7 @@ class PageContainer extends React.Component { ...@@ -1062,7 +1070,7 @@ class PageContainer extends React.Component {
pullTaskList={()=>{dispatch(hasNoSku(commonInfo))}} pullTaskList={()=>{dispatch(hasNoSku(commonInfo))}}
headerInfo={commonInfo} headerInfo={commonInfo}
getBarCodeProductInfo={(barcode)=>{dispatch(getBarCodeProductInfo({barcode,commonInfo}))}} getBarCodeProductInfo={(barcode)=>{dispatch(getBarCodeProductInfo({barcode,commonInfo}))}}
breakageProductInfo={state.barcodeCommon} breakageProductInfo={WeChatUtil.getUrlParam().type&&WeChatUtil.getUrlParam().type==='LR'?testBreakData.data:state.barcodeCommon}
breakageContainer ={state.breakageContainer} breakageContainer ={state.breakageContainer}
submitBreakageProduct={(productDetail)=>{dispatch(submitBreakageProduct({commonInfo,productDetail}))}} submitBreakageProduct={(productDetail)=>{dispatch(submitBreakageProduct({commonInfo,productDetail}))}}
area={area} area={area}
......
...@@ -5,7 +5,7 @@ import RightContainer from '../RightContainer/RightContainer'; ...@@ -5,7 +5,7 @@ import RightContainer from '../RightContainer/RightContainer';
import ReplenishHomePage from '../../components/ReplenishComponent/ReplenishHomePage/ReplenishHomePage' import ReplenishHomePage from '../../components/ReplenishComponent/ReplenishHomePage/ReplenishHomePage'
import ReplenishSkuPage from '../../components/ReplenishComponent/ReplenishSkuPage/ReplenishSkuPage' import ReplenishSkuPage from '../../components/ReplenishComponent/ReplenishSkuPage/ReplenishSkuPage'
import ReplenishScanPage from '../../components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage' import ReplenishScanPage from '../../components/ReplenishComponent/ReplenishScanPage/ReplenishScanPage'
import WeChatUtil from '../../util/WeChatUtil'
require('./index.css'); require('./index.css');
const replenishPageIndex = { const replenishPageIndex = {
...@@ -74,6 +74,8 @@ export default class ReplenishContainer extends React.Component{ ...@@ -74,6 +74,8 @@ export default class ReplenishContainer extends React.Component{
render(){ render(){
let props = this.props; let props = this.props;
let {pageType}=this.state;
pageType = WeChatUtil.getUrlParam().pageType?WeChatUtil.getUrlParam().pageType:pageType;
return ( return (
<div className={"replenishContainer page"}> <div className={"replenishContainer page"}>
{ {
...@@ -87,7 +89,7 @@ export default class ReplenishContainer extends React.Component{ ...@@ -87,7 +89,7 @@ export default class ReplenishContainer extends React.Component{
<LeftContainer leftInfo={props.headerInfo}/> <LeftContainer leftInfo={props.headerInfo}/>
<RightContainer> <RightContainer>
{this.getPage(this.state.pageType)(props)} {this.getPage(pageType)(props)}
</RightContainer> </RightContainer>
</div> </div>
} }
......
...@@ -20,6 +20,7 @@ class TakeStokeContaniner extends React.Component { ...@@ -20,6 +20,7 @@ class TakeStokeContaniner extends React.Component {
let {showButton,number,initNum}=this.state; let {showButton,number,initNum}=this.state;
let props = this.props; let props = this.props;
let tokeTaskProduct=props.tokeTaskProduct; let tokeTaskProduct=props.tokeTaskProduct;
console.log(tokeTaskProduct)
return ( return (
<div className={'TokeStokeContainer'}> <div className={'TokeStokeContainer'}>
<HeaderComponent headerStatus={headerStatus[1]} headerInfo={props.headerInfo}/> <HeaderComponent headerStatus={headerStatus[1]} headerInfo={props.headerInfo}/>
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
* Created by ruibing on 16/11/2. * Created by ruibing on 16/11/2.
*/ */
module.exports = { module.exports = {
domain: 'https://www.mjitech.com/web/', domain: 'https://test.mjitech.com/web/',
uploadImg : 'https://preprod.mjitech.com/static/uploadTrouble' uploadImg : 'https://preprod.mjitech.com/static/uploadTrouble'
} }
\ No newline at end of file
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