Commit 4015187e by wujiabao

add 根据人物跳页面

parent 357b52a7
import fetch from 'isomorphic-fetch'
const changeStatus = (data)=>{
let {taskId,currentTaskType}=data;
let url = `http://192.168.10.128:8080/`
return (dispatch)=>{
fetch('',{
credentials : 'include',
method : 'PUT',
mode : 'cors',
body : {}
})
}
}
\ No newline at end of file
......@@ -15,14 +15,33 @@ let myHeaders = new Headers({
//测试使用的数据
let testData={
"meta": {
"code": "200",
"message": "成功",
"success": true
},
"data": {
"whetherType": false,
"taskId": 297,
"currentTaskName": "遗留上报任务",
"currentTaskType": "LR",
"currentTaskNum": 2,
"totalTaskNum": 3
}
}
let test='http://192.168.10.128:8080/'
//开始工作
const getTaskInfo = (data)=>{
// let {employeeId,storeId} = data;
console.log(data)
console.log('获取工单信息')
let test='http://192.168.10.128:8080/'
// // let url = `${test}web/flat/ready${storeId}/${employeeId}`
let url=`${test}web/flat/ready/1/2`;
// let url = `${test}web/flat/ready${storeId}/${employeeId}`
let url=`${test}web/flat/ready/16/2`;
return(dispatch)=>{
// let taskInfo=testData.data;
// dispatch(startalljob(Object.assign({},{taskInfo})))
fetch(url,{
credentials : 'include',
method : 'GET',
......@@ -31,6 +50,7 @@ const getTaskInfo = (data)=>{
}).then((response)=>response.json())
.then(json=>{
let taskInfo=Object.assign({});
console.log(json,'开始工作')
if(json.meta.success && json.data){
taskInfo = Object.assign({},json.data)
}
......@@ -76,7 +96,7 @@ const getInfoByBarcode = (data)=>{
credentials : 'include',
method : 'GET',
mode : 'cors',
headers: { 'Content-Type': 'application/json' },
headers: { 'Content-Type': 'application/json' }
}).then(response=>response.json())
.then(json=>{
console.log(json);
......@@ -130,6 +150,37 @@ const test = ()=>{
}).catch(e=>{console.error(e)})
}
//拉取工单
const getTaskList = (data)=>{
console.log('拉取工单')
console.log(data)
// let storeId = data.id;
let url=`${test}web/flat/work/list/16`
return (dispatch)=>{
fetch(url,{
credentials : 'include',
method : 'GET',
mode : 'cors',
headers: { 'Content-Type': 'application/json' }
}).then((reponse)=>response.json())
.then((json)=>{
console.log(json,'拉取工单')
let taskList=Object.assign({})
if(json.meta.success && json.data){
taskList = Object.assign({},json.data)
}
dispatch(saveTaskListInfo(Object.assign({},{taskList})))
})
}
}
const saveTaskListInfo = (data)=>{
return{
type : actionType.GETTASKLIST,
data
}
}
const setBarcodeInfo = (data)=>{
return{
type : actionType.SETBARCODEINFO,
......@@ -164,4 +215,4 @@ const logout = ()=>{
}
}
export {getStoreInfo,getTaskInfo,getInfoByBarcode,saveCommonInfo,getUserinfo,logout,startalljob,test}
export {getStoreInfo,getTaskInfo,getInfoByBarcode,saveCommonInfo,getUserinfo,logout,startalljob,saveTaskListInfo,getTaskList}
......@@ -3,6 +3,7 @@ const actionTypes = {
EMPTYBARCODEINFO : 'EMPTYBARCODEINFO',
SAVECOMMONINFO : 'SAVECOMMONINFO',
EMPTYCOMMONINFO : 'EMPTYCOMMONINFO',
STARTALLJOB : 'STARTALLJOB'
STARTALLJOB : 'STARTALLJOB',
GETTASKLIST : 'GETTASKLIST'
}
export default actionTypes
\ No newline at end of file
import React from "react"
import Button from '../../components/CommonComponent/ButtonComponent/ButtonComponent'
import LeftContainer from '../LeftContainer/LeftContainer'
import RightContainer from '../RightContainer/RightContainer'
import HeaderComponent from '../../components/CommonComponent/HeaderComponent/HeaderComponent'
class BreakageContainer extends React.Component {
constructor(props){
super(props)
......@@ -7,12 +10,19 @@ class BreakageContainer extends React.Component {
render(){
let props=this.props;
return (
<div className={"BreakageContainer"}>
<HeaderComponent headerInfo={this.props.headerInfo} />
<LeftContainer />
<RightContainer>
<Button text={'没有'} option={this.props.pullTaskList} />
</RightContainer>
</div>
)
}
componentDidMount(){
}
}
export default BreakageContainer
\ No newline at end of file
......@@ -43,6 +43,7 @@ export default class HomePageContainer extends React.Component{
)
}
start(){
console.log('执行 开始工作了')
let props=this.props;
props.startTask();
}
......@@ -52,10 +53,10 @@ export default class HomePageContainer extends React.Component{
let num=nextProps.headerInfo.taskInfo.currentTaskNum;
switch(num){
case 1 :
props.changePages(CONFIG.showPage[6]);
props.changePages(CONFIG.showPage[5]);
break;
case 1 :
props.changePages(CONFIG.showPage[6]);
case 2 :
props.changePages(CONFIG.showPage[5]);
break;
case 1 :
props.changePages(CONFIG.showPage[6]);
......
......@@ -9,7 +9,7 @@ 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} from '../../actions/common'
import {getTaskInfo,getTaskList} from '../../actions/common'
import PopupComponent from '../../components/CommonComponent/PopupComponent/PopupComponent'
import TroubleContainer from '../TroubleContainer/TroubleContainer'
import ScanBarCodeContainer from '../ScanBarCodeContainer/ScanBarCodeContaienr'
......@@ -570,7 +570,10 @@ class PageContainer extends React.Component {
pages = <TakeStokeContainer headerInfo = {state.commonInfo}/>;
break;
case showPage[5]:
pages = <BreakageContainer />;
pages = <BreakageContainer
pullTaskList={()=>{dispatch(getTaskList(state.commonInfo.storeInfo))}}
headerInfo={state.commonInfo}
/>;
break;
case showPage[10]:
pages = <RecoveryPage
......
......@@ -23,25 +23,29 @@ const emptyCommInfo = (state,data)=>{
return Object.assign({},state,data)
}
let testData={
currentTaskNum:1,
childTaskNum:1
}
// 传入一个对象 对象中包含currentTaskNum表示大任务
// childTaskNum 表示大任务下的小任务
const NumChangeWord=(obj)=>{
const NumChangeWord = (obj)=>{
let arr=[
{
title:'散落商品检查',
children:['1','2']
children:['散落1','散落2']
},
{
title:'核对数量',
children:['1','2']
children:['核对1','核对2']
},
{
title:'回收区货品回收',
children:['1','2']
children:['回收1','回收2']
},
{
title:'补货',
children:['1','2']
children:['补货1','补货2']
}
]
let name=obj.currentTaskNum;
......@@ -50,34 +54,39 @@ const NumChangeWord=(obj)=>{
case 1 :
obj.currentTaskName=arr[name-1].title;
if(child){
obj.childTaskNum=arr[name-1].children[child-1]
obj.childTaskName=arr[name-1].children[child-1]
}
break;
case 2 :
obj.currentTaskName=arr[name-1].title;
if(child){
obj.childTaskNum=arr[name-1].children[child-1]
obj.childTaskName=arr[name-1].children[child-1]
}
break;
case 3 :
obj.currentTaskName=arr[name-1].title;
if(child){
obj.childTaskNum=arr[name-1].children[child-1]
obj.childTaskName=arr[name-1].children[child-1]
}
break;
case 4 :
obj.currentTaskName=arr[name-1].title;
if(child){
obj.childTaskNum=arr[name-1].children[child-1]
obj.childTaskName=arr[name-1].children[child-1]
}
break;
}
}
const startalljob= (state,data)=>{
const startalljob = (state,data)=>{
let info =saveCommonInfo(state,data);
return info;
}
const saveTaskList = (state,data)=>{
return Object.assign({},state,data)
}
export default function(state={}, action) {
switch (action.type) {
case actionTypes.SAVECOMMONINFO:
......@@ -86,6 +95,8 @@ export default function(state={}, action) {
return emptyCommInfo(state);
case actionTypes.STARTALLJOB :
return startalljob(state,action.data);
case actionTypes.GETTASKLIST :
return saveTaskList(state,action.data)
default:
return state;
}
......
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