Commit b1ac6330 by wujiabao

更改pageContainer

parent 4015187e
import fetch from 'isomorphic-fetch'
import getTaskList from './common'
const changeStatus = (data)=>{
let {taskId,currentTaskType}=data;
let url = `http://192.168.10.128:8080/`
let {taskId,currentTaskType}=data.taskInfo;
let url = `http://192.168.10.128:8080/web/flat/work/lr/status/${taskId}/${currentTaskType}`
return (dispatch)=>{
fetch('',{
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
......@@ -38,7 +38,7 @@ let test='http://192.168.10.128:8080/'
const getTaskInfo = (data)=>{
// let {employeeId,storeId} = data;
// let url = `${test}web/flat/ready${storeId}/${employeeId}`
let url=`${test}web/flat/ready/16/2`;
let url=`${test}web/flat/ready/5/2`;
return(dispatch)=>{
// let taskInfo=testData.data;
// dispatch(startalljob(Object.assign({},{taskInfo})))
......@@ -55,7 +55,6 @@ const getTaskInfo = (data)=>{
taskInfo = Object.assign({},json.data)
}
console.log(taskInfo)
dispatch(saveCommonInfo(Object.assign({},taskInfo)))
dispatch(startalljob(Object.assign({},{taskInfo})))
}).catch(e=>{console.error(e)})
......@@ -113,7 +112,6 @@ const getInfoByBarcode = (data)=>{
const getUserinfo = (employeeId,storeId)=>{
let bodyData = Object.assign({},{employeeId,storeId})
return(dispatch)=>{
dispatch(saveHeaderInfo(info));
fetch(domain + 'machine_pad/get_alowed_task.action',{
credentials : 'include',
method : 'POST',
......@@ -138,17 +136,17 @@ const getUserinfo = (employeeId,storeId)=>{
}
};
const test = ()=>{
fetch('http://192.168.10.128:8080/web/flat/work/status/1',{
credentials : 'include',
method : 'PUT',
mode : 'cors',
headers:myHeaders,
}).then((response)=>response.json())
.then(json=>{
console.log(json)
}).catch(e=>{console.error(e)})
}
// const test = ()=>{
// fetch('http://192.168.10.128:8080/web/flat/work/status/1',{
// credentials : 'include',
// method : 'PUT',
// mode : 'cors',
// headers:myHeaders,
// }).then((response)=>response.json())
// .then(json=>{
// console.log(json)
// }).catch(e=>{console.error(e)})
// }
//拉取工单
const getTaskList = (data)=>{
......
......@@ -47,27 +47,7 @@ export default class HomePageContainer extends React.Component{
let props=this.props;
props.startTask();
}
componentWillReceiveProps(nextProps){
let props=this.props;
if(nextProps.headerInfo.taskInfo){
let num=nextProps.headerInfo.taskInfo.currentTaskNum;
switch(num){
case 1 :
props.changePages(CONFIG.showPage[5]);
break;
case 2 :
props.changePages(CONFIG.showPage[5]);
break;
case 1 :
props.changePages(CONFIG.showPage[6]);
break;
case 1 :
props.changePages(CONFIG.showPage[6]);
break;
}
}
}
}
HomePageContainer.propTypes = {
......
......@@ -54,7 +54,7 @@ class PageContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
showPage : showPage[10],
showPage : showPage[13],
lastPage : '',
page : null,
popupInfo : defaultPopupInfo,
......@@ -210,6 +210,23 @@ class PageContainer extends React.Component {
//有错误信息,弹出错误信息弹窗
this.showError(state.errMsg.errMsg)
}
if(nextProps.state.commonInfo.taskInfo){
let num=nextProps.state.commonInfo.taskInfo.currentTaskNum;
switch(num){
case 1 :
this.changePages(CONFIG.showPage[5]);
break;
case 2 :
this.changePages(CONFIG.showPage[5]);
break;
case 1 :
this.changePages(CONFIG.showPage[6]);
break;
case 1 :
this.changePages(CONFIG.showPage[6]);
break;
}
}
}
componentWillUnmount(){
}
......
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