Commit d65e7cd5 by Zhang Xin

fix bug 2071

parent 38ba5926
......@@ -22,6 +22,21 @@ const getBarCodeProductInfo = (data)=>{
.then((json)=>{
if(!json.meta.success&&!json.data){
dispatch(saveProductInfo(json.meta))
switch (taskInfo.currentTaskType){
case 3 :
//回收任务
break;
case 'ADDR' :
//补货任务
let errorType = "WrongBarcode";
let errorMessage = json.meta.message;
let errorInfo = {
errorType : errorType,
errorMessage : json.meta.message
};
dispatch(replenishAction.wrongQrcode(errorInfo));
break;
}
}else{
if(json.meta.success&&json.data){
dispatch(replenishAction.emptyErrorInfo()); //补货清空错误数据
......@@ -36,7 +51,7 @@ const getBarCodeProductInfo = (data)=>{
break;
case 'ADDR' :
//补货任务
let errorType = json.data && json.data.errorType ? json.data.errorType : "";
let errorType = json.data && json.data.errorType ? json.data.errorType : "WrongBarcode";
let errorMessage = json.meta.message;
switch (errorType){
case "NT":
......@@ -53,8 +68,8 @@ const getBarCodeProductInfo = (data)=>{
break;
}
let errorInfo = {
errorType : errorType,
errorMessage : errorMessage
errorType ,
errorMessage
};
dispatch(replenishAction.wrongQrcode(errorInfo));
break;
......
......@@ -58,12 +58,20 @@ export default class ReplenishScanPage extends React.Component{
if(nextProps.replenishInfo.errorInfo.errorType){
switch (nextProps.replenishInfo.errorInfo.errorType) {
case "NT":
//不在本次
this.outReplenish.call(this);
break;
case "NA":
this.outReplenish();
//不在本区
this.outAreaReplenish.call(this);
break;
case "NS":
this.errorSku();
break;
case "WrongBarcode":
this.onWrongBarcode.call(this);
break;
}
}else{
//没有错误类型的错误
......@@ -176,12 +184,21 @@ export default class ReplenishScanPage extends React.Component{
barcodeText:e.target.value
})
}
handleFocus(){
if(this.state.barcodeErrorText){
this.setState({
barcodeErrorText : '',
barcodeText : ""
})
}
}
getBarcodeInput(){
return (
<div className={"replenishScanBarcodeInputDom"}>
<div className={"barcodeInputText font30"}>{this.state.barcodeErrorText}</div>
<input value={this.state.barcodeText} className={"barcodeInput font30 col000"} type="text" onChange={this.handleInputChange.bind(this)}/>
<input value={this.state.barcodeText} className={"barcodeInput font30 col000"} onFocus={this.handleFocus.bind(this)} type="text" onChange={this.handleInputChange.bind(this)}/>
<div className={"barcodeInputTip font30 colff775c"} onClick={()=>this.changeShowInput()}><span className={"colfff"}>or</span>条形码扫描</div>
<Button btnContainer={"barcodeInputBarcode font32 backff775c colfff"} key={"barcodeInputBarcode"} text={"确定"} option={this.submitBarcode}/>
</div>
......@@ -248,6 +265,46 @@ export default class ReplenishScanPage extends React.Component{
showPopup({popupChild:popDom});
}
//不在本区补货范围
outAreaReplenish(){
//货道已满解决办法
let {showPopup,hidePopup,headerInfo} = this.props;
let {taskInfo={}} = headerInfo;
console.log("不在本区补货范围 ",taskInfo);
let btnDom = <Button btnContainer={"replenishContainerQrcode font32 backff775c colfff"} key={"replenishContainerWrongQrcode"} text={"关闭"} option={this.hidePop}/>
let popDom =
<PopModel popupTitle={"扫描货品异常"} classContainer={"replenishPopInfo"}>
<div className={"icon iconfont icon-wrong font150 colf00"} />
<div className={"text font40 col000"}>
<p>此货品不在{taskInfo.area || ""}区补货范围内,请放入物流回收箱!</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>;
showPopup({popupChild:popDom});
}
//条形码错误
onWrongBarcode(){
//货道已满解决办法
let {showPopup,hidePopup} = this.props;
let btnDom = <Button btnContainer={"replenishContainerQrcode font32 backff775c colfff"} key={"replenishContainerWrongQrcode"} text={"关闭"} option={this.hidePop}/>
let popDom =
<PopModel popupTitle={"扫描货品异常"} classContainer={"replenishPopInfo"}>
<div className={"icon iconfont icon-wrong font150 colf00"} />
<div className={"text font40 col000"}>
<p>条形码错误!</p>
</div>
<div className={"btn"}>
{btnDom}
</div>
</PopModel>;
showPopup({popupChild:popDom});
}
getSkuInfo(){
let {headerInfo} = this.props;
let {taskList={}} = headerInfo;
......
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