Commit 53b49060 by Zhang Xin

完å–完善回收部分的数据逻辑

parent 550d188e
......@@ -13,8 +13,6 @@ let myHeaders = new Headers({
});
let test='http://192.168.10.128:8080/'
//开始工作
const getTaskInfo = (data)=>{
let {userInfo,storeInfo} = data;
......@@ -28,7 +26,6 @@ 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);
dispatch(getTaskName(json.data.currentTaskNum))
......@@ -78,7 +75,6 @@ const getInfoByBarcode = (data)=>{
headers: { 'Content-Type': 'application/json' }
}).then(response=>response.json())
.then(json=>{
console.log(json);
if(json.meta.success){
//扫码成功
}else{
......@@ -127,7 +123,6 @@ const hasNoSku = (storeInfo)=>{
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
console.log(json,'没有散落货品')
dispatch(getTaskList())
})
}
......@@ -145,7 +140,6 @@ const getTaskList = (data={})=>{
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
console.log(json,'拉取工单')
let data =Object.assign({});
if(json.meta.success && json.data){
data.taskInfo = Object.assign({},json.data.flatCommonVo)
......
import fetch from 'isomorphic-fetch';
import actionType from '../actiontype/recovery'
import {getTaskList} from "./common";
const domain = ENV.domain;
const initRecoveryInfo = (data)=>{
return{
type : actionType.INITRECOVERYINFO,
data
}
};
let myHeaders = new Headers({
// 'Access-Control-Allow-Origin': '*',
// 'Content-Type': 'text/plain;charset=UTF-8',
// 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Content-Type': 'application/json; charset=UTF-8',
});
const finishBoxRecovery = ()=>{
//将
//完成
let url=`${ENV.domain}/machine_pad/update_machine_recovery_sku.action`
return (dispatch)=>{
fetch(url,{
// credentials : 'include',
method : 'POST',
mode : 'cors',
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
dispatch(getTaskList());
})
}
};
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 {initRecoveryInfo}
export {finishBoxRecovery,wrongShelf}
......@@ -27,22 +27,22 @@ export default class SkuInfoComponent extends React.Component{
render(){
let props = this.props;
let {classNames='',style={}} = props;
let {classNames='',style={},skuInfo={}} = props;
return (
<div className={"skuInfoComponent " + classNames} style={style}>
<div className={"img"}>
<img style={this.state.style} ref={"secondPageImg"} onLoad={()=>this.handleLoadImg.bind(this)("secondPageImg")} onError={()=>this.handleErrorImg.bind(this)("secondPageImg")} src={UTILPATH.localImg.defaultImg} alt=""/>
<img style={this.state.style} ref={"secondPageImg"} onLoad={()=>this.handleLoadImg.bind(this)("secondPageImg")} onError={()=>this.handleErrorImg.bind(this)("secondPageImg")} src={skuInfo.skuImage} alt=""/>
</div>
<ul className={"shelfInfo font30 col333"}>
<li className={""}>
<span className={""}>货品名称:雪碧</span>
<span className={"totalNum "}>需回收数量:<span className={"font40 colff775c"}>5</span></span>
<span className={""}>货品名称:{skuInfo.skuName || ''}</span>
<span className={"totalNum "}>需回收数量:<span className={"font40 colff775c"}>{skuInfo.targetNum || 0}</span></span>
</li>
<li className={""}>
<span className={""}>所在区域:A区1号柜 <span className={"areaBtn colff775c"}>位置照片</span></span>
<span className={"currentNum"}>已回收数量:<span className={"font40 colff775c"}>5</span></span>
<span className={""}>所在区域:{skuInfo.shortPosition || ''} <span className={"areaBtn colff775c"}>位置照片</span></span>
<span className={"currentNum"}>已回收数量:<span className={"font40 colff775c"}>{skuInfo.recoverNum || 0}</span></span>
</li>
<li className={""}>货到信息:第6行 第3活到 13-6-6-6</li>
<li className={""}>货到信息:{skuInfo.position || ''}</li>
</ul>
</div>
)
......
......@@ -53,7 +53,6 @@ export default class RecoverySecondPage extends React.Component{
wrongSku(){
//货道商品不符
console.log("货道商品不符 ",this.props)
let {showPopup,hidePopup} = this.props;
let marginTop = '40px';
let btnDom1 = <Button key={"recoveryContainerShelfWrong1"} style={{'width':"100%"}} text={"货品不符"} option={this.uploadWrongSku}/>
......@@ -84,13 +83,13 @@ export default class RecoverySecondPage extends React.Component{
uploadWrongSku(){
//货品不符上报
this.props.wrongShelf();
}
scanQrcode(){
//扫码回收
console.log("scan")
this.props.finishBoxRecovery();
}
......@@ -101,12 +100,13 @@ export default class RecoverySecondPage extends React.Component{
let classInfo = {
colorInfo : "colfff",
className : ''
}
};
let {headerInfo} = props;
return(
<div className={"RecoverySecondPage"}>
<div className={"title font40 col333"}>任务目标:请将该货道货品进行扫码回收</div>
<div className={"box"}>
<SkuInfoComponent style={{'display':'flex'}}/>
<SkuInfoComponent style={{'display':'flex'}} skuInfo={headerInfo.taskList || {}}/>
<div className={"btn"}>
<Button key={"RecoverySecondPageBtn"} classInfo={classInfo} style={style} text={'扫码回收'} option={this.scanQrcode}/>
<div className={"text colff775c font28"} onClick={()=>this.wrongSku()}>货品不符?</div>
......
......@@ -3,6 +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 {getTroubleList,updateTroubleList} from "../../actions/getTroubles";
import {initGetOtherProblem,addNewProbem,deleteProblem,editProblemItem,submitProblemList} from "../../actions/otherQuestion"
import {scanBarCodeGetProductInfo,submitProductInfo,saveEditProductInfo,submitProductSuccess,clearProductSuccess} from "../../actions/ScanBarCode"
......@@ -312,7 +313,6 @@ class PageContainer extends React.Component {
console.log("countbackTimer ",this.countbackTimer,)
if(!this.countbackTimer && this.countBackTime >= 0){
this.countBackTime--;
console.log(this.countBackTime)
this.countbackTimer = window.setTimeout(()=>{
if(this.countBackTime > 0){
clearTimeout(this.countbackTimer);
......@@ -485,7 +485,6 @@ class PageContainer extends React.Component {
getPages(){
let pages = null;
let{state,dispatch} = this.props;
console.log(state);
switch (this.state.showPage){
case showPage[1]:
pages = <TroubleContainer
......@@ -598,6 +597,8 @@ class PageContainer extends React.Component {
showPopup={(info)=>this.showPopup(info)}
hidePopup={()=>this.hidePopup()}
getTaskName={()=>dispatch(getTaskName(3,2))}
finishBoxRecovery={()=>dispatch(finishBoxRecovery())}
wrongShelf={()=>dispatch(wrongShelf())}
/>;
break;
/*以下是二期页面 end*/
......@@ -611,7 +612,6 @@ class PageContainer extends React.Component {
}
render() {
console.log("render ");
let {state} = this.props;
let headerInfo = state.commonInfo;
let ip = headerInfo ? headerInfo.ip : '';
......
......@@ -25,15 +25,17 @@ export default class RecoveryContainer extends React.Component{
componentWillMount() {
let props = this.props;
console.log("props ",this.props)
// if(!props.whetherType){
// console.log("没有回收箱物品")
// //没有回收箱物品
// this.setState({
// showPage : recoveryPageIndex[2]
// })
//
// }
console.log("props ",this.props);
let {headerInfo = {}} = props;
let {taskList = {}} = headerInfo;
if(taskList && !taskList.whetherType){
console.log("没有回收箱物品")
//没有回收箱物品
this.setState({
showPage : recoveryPageIndex[2]
})
}
}
componentWillReceiveProps(nextProps){
......
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