Commit d9cdc364 by Zhang Xin

添加补货完成按钮在扫码页面

parent 748ca8b6
......@@ -23,16 +23,18 @@ const emptyErrorInfo = ()=>{
}
}
const finishReplenish = (info)=>{
const finishReplenish = (info,source)=>{
//source 1 : 商品页 , 2 : 扫码页
//已放入回收箱
let {userInfo,taskInfo,storeInfo} = info;
let {userInfo,taskInfo,storeInfo,taskList} = info;
let bodyData = Object.assign({},{
storeId : storeInfo.id,
taskId : taskInfo.taskId,
userId : userInfo.id,
taskType : taskInfo.currentTaskType,
area : taskInfo.area
})
area : taskInfo.area,
id : source === 1 ? taskList.workListId : 0,
});
let url=`${domain}machine_pad/trigger_ck_task_sku.action`
return (dispatch)=>{
fetch(url,{
......
......@@ -18,10 +18,13 @@ export default class ReplenishScanPage extends React.Component{
this.getScanDom = this.getScanDom.bind(this);
this.hidePop = this.hidePop.bind(this);
this.showErrorInfo = this.showErrorInfo.bind(this);
this.handleScanOver = this.handleScanOver.bind(this);
this.scanOver = this.scanOver.bind(this);
this.state = {
barcodeText : '',
barcodeErrorText : '',
showInput : false
showInput : false,
btnClock : false
}
}
......@@ -32,6 +35,13 @@ export default class ReplenishScanPage extends React.Component{
) || (JSON.stringify(nextState) !== JSON.stringify(this.state)))
}
componentWillUnmount(){
console.log("ReplenishScanPage componentWillUnmount")
this.setState({
btnClock : false
})
}
componentWillReceiveProps(nextProps){
console.log("ReplenishScanPage componentWillReceiveProps ",nextProps);
......@@ -115,9 +125,45 @@ export default class ReplenishScanPage extends React.Component{
return <div className={"otherHeader replenishScanQrcodeHeader font32 clearfix colfff "}>
<i className={"iconfont middle icon font50 icon-circle-left circleIcon fl"} onClick={()=>this.goBack.bind(this)(1)}/>
<span className={"middle"}>任务目标:将{taskInfo.area || ""}区补货箱中的货品扫码后放到货架上</span>
<Button btnContainer={"barcodeInputBarcode font32 backff775c colfff"} key={"barcodeInputBarcode"} style={{display:'inline-block'}} text={"扫描结束"} option={this.handleScanOver}/>
</div>
}
handleScanOver(){
console.log("扫描结束");
//货道商品不符
let {showPopup,hidePopup} = this.props;
let btnDom1 = <Button btnContainer={"replenishHandleScanOverBtn1 font32"} key={"replenishHandleScanOverBtn1"} text={"继续扫描"} option={hidePopup}/>
let btnDom2 = <Button btnContainer={"replenishHandleScanOverBtn2 backff775c colfff font32"} key={"replenishHandleScanOverBtn2"} text={"确认扫描完毕"} option={this.scanOver}/>
let popDom =
<PopModel popupTitle={"补货结束确认"} classContainer={"replenishPopInfo"}>
<div className={"icon iconfont icon-exclamation font150 colf5a623"} />
<div className={"text font40 col000"}>
<p>请仔细确认是否所有待补货品都已经扫描完毕</p>
</div>
<div className={"btn"}>
{btnDom1}
{btnDom2}
</div>
</PopModel>;
showPopup({popupChild:popDom});
}
//确认扫描完毕
scanOver(){
console.log("确认扫描完毕 ",this.state.btnClock)
let props = this.props;
if(!this.state.btnClock){
this.setState({
btnClock : true
},()=>{
props.hidePopup()
props.finishReplenish(2);
})
}
}
handleInputChange(e){
this.setState({
barcodeText:e.target.value
......
......@@ -81,8 +81,8 @@ export default class ReplenishSkuPage extends React.Component{
handleScanOver(){
console.log("扫描结束")
//货道商品不符
let {showPopup} = this.props;
let btnDom1 = <Button btnContainer={"replenishHandleScanOverBtn1 font32"} key={"replenishHandleScanOverBtn1"} text={"继续扫描"} option={this.continueScan}/>
let {showPopup,hidePopup} = this.props;
let btnDom1 = <Button btnContainer={"replenishHandleScanOverBtn1 font32"} key={"replenishHandleScanOverBtn1"} text={"继续扫描"} option={hidePopup}/>
let btnDom2 = <Button btnContainer={"replenishHandleScanOverBtn2 backff775c colfff font32"} key={"replenishHandleScanOverBtn2"} text={"确认扫描完毕"} option={this.scanOver}/>
let popDom =
<PopModel popupTitle={"补货结束确认"} classContainer={"replenishPopInfo"}>
......@@ -106,7 +106,7 @@ export default class ReplenishSkuPage extends React.Component{
btnClock : true
},()=>{
props.hidePopup()
props.finishReplenish();
props.finishReplenish(1);
})
}
}
......
......@@ -228,6 +228,7 @@ class PageContainer extends React.Component {
this.changePages(CONFIG.showPage[5]);
break;
case 'CK' :
case 'CR' :
this.changePages(CONFIG.showPage[6]);
break;
case 'RE' :
......@@ -236,6 +237,9 @@ class PageContainer extends React.Component {
case 'ADDR' :
this.changePages(CONFIG.showPage[11]);
break;
case 'PF' :
this.changePages(CONFIG.showPage[initPage]);
break;
}
}
......@@ -638,7 +642,7 @@ class PageContainer extends React.Component {
finishBoxRecovery={()=>dispatch(finishBoxRecovery(state.commonInfo))}
emptyErrorInfo={()=>dispatch(replenishAction.emptyErrorInfo())}
uploadError={(exceptionType)=>dispatch(uploadError(state.commonInfo,exceptionType))}
finishReplenish={()=>dispatch(replenishAction.finishReplenish(state.commonInfo))}
finishReplenish={(source)=>dispatch(replenishAction.finishReplenish(state.commonInfo,source))}
/>
/*以下是二期页面 end*/
}
......
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