Commit 101e1cd9 by Zhang Xin

联调回收修改BUG

parent 6b8de31b
import fetch from 'isomorphic-fetch'
import saveCommonInfo from './common'
import {saveCommonInfo} from './common'
import barcodeActionType from '../actiontype/barcodeCommon'
import replenishAction from './replenish'
let domain1 = ENV.domain;
let domain = 'http://192.168.10.128:8080/web/'
let domain = 'http://192.168.10.37:8080/maxbox/web/'
// const changeStatus = (data)=>{
// let {taskId,currentTaskType}=data.taskInfo;
......@@ -49,15 +49,15 @@ const getBarCodeProductInfo = (data)=>{
.then((json)=>{
if(json.meta.success&&json.data){
dispatch(replenishAction.emptyErrorInfo()); //补货清空错误数据
let info = Object.assign({},{taskList:json.data.product});
let info = Object.assign({},{taskList:json.data});
dispatch(saveCommonInfo(info))
dispatch(saveProductInfo(json.data))
}else{
switch (taskInfo.currentTaskNum){
switch (taskInfo.currentTaskType){
case 3 :
//回收任务
break;
case 4 :
case 'ADDR' :
//补货任务
let errorInfo = {
errorType : json.data.errorType || "",
......
......@@ -45,6 +45,7 @@ const getTaskInfo = (data)=>{
// credentials : 'include',
method : 'GET',
mode : 'cors',
headers: myHeaders,
}).then((response)=>response.json())
.then(json=>{
let taskInfo=Object.assign({});
......@@ -122,7 +123,7 @@ const hasNoSku = (commonInfo)=>{
// credentials : 'include',
method : 'PUT',
mode : 'cors',
// headers: myHeaders
headers: myHeaders
}).then(response=>response.json())
.then((json)=>{
dispatch(getTaskList(commonInfo))
......@@ -154,7 +155,7 @@ const getTaskList = (data={})=>{
let childNum = 0;
let currentTaskType = json.data.flatCommonVo.currentTaskType;
let currentTaskNum = json.data.flatCommonVo.currentTaskNum;
if(currentTaskNum === 3){
if(currentTaskType === 'RE'){
//回收
childNum = json.data.skuFlatVo.whetherType ? 1 : 2
}
......
import fetch from 'isomorphic-fetch';
import actionType from '../actiontype/recovery'
import {getTaskList} from "./common";
const domain = ENV.domain;
let domain = 'http://192.168.10.37:8080/maxbox/web'
let myHeaders = new Headers({
// 'Access-Control-Allow-Origin': '*',
......@@ -21,13 +21,14 @@ const finishBoxRecovery = (info)=>{
taskType : taskInfo.currentTaskType,
area : taskInfo.area
})
let url=`${ENV.domain}/machine_pad/update_machine_recovery_sku.action`
let url=`${domain}/machine_pad/update_machine_recovery_sku.action`
return (dispatch)=>{
fetch(url,{
// credentials : 'include',
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: myHeaders
headers: myHeaders,
body:JSON.stringify(bodyData)
}).then(response=>response.json())
.then((json)=>{
dispatch(getTaskList(info));
......
import fetch from 'isomorphic-fetch'
import actionType from '../actiontype/error'
import {getTaskList} from './common'
let domain = ENV.domain;
let domain = 'http://192.168.10.37:8080/maxbox/web/';
var myHeaders = new Headers({
'Access-Control-Allow-Origin': '*',
......@@ -16,7 +16,7 @@ const uploadErrorOld = (info)=>{
taskId : info.taskId
};
return (dispatch =>{
fetch(domain + '/machine_pad/flat_warn_record',{
fetch(domain + '/machine_pad/flat_warn_record.action',{
credentials : 'include',
method : 'POST',
mode : 'cors',
......@@ -41,7 +41,7 @@ const uploadError = (info,exceptionType)=>{
area : taskInfo.area || ''
};
return (dispatch =>{
fetch(domain + '/machine_pad/flat_warn_record',{
fetch(domain + 'machine_pad/exception_skupass_sku.action',{
credentials : 'include',
method : 'POST',
mode : 'cors',
......@@ -50,7 +50,7 @@ const uploadError = (info,exceptionType)=>{
}).then((response)=>response.json())
.then(json=>{
dispatch(getTaskList());
dispatch(getTaskList(info));
}).catch(e=>{console.error(e)});
})
}
......
......@@ -25,9 +25,9 @@ export default class ReplenishScanPage extends React.Component{
}
componentWillReceiveProps(nextProps){
if(nextProps.replenishInfo && nextProps.replenishInfo.errorInfo && nextProps.replenishInfo.errorInfo.errorMessage){
if(nextProps.replenishInfo && nextProps.replenishInfo.errorInfo && (nextProps.replenishInfo.errorInfo.errorType)){
//有错误信息,再对应页面弹出错误信息弹窗,要区分错误信息
nextProps.hidePopup();
// nextProps.hidePopup();
if(nextProps.replenishInfo.errorInfo.errorType){
switch (nextProps.replenishInfo.errorInfo.errorType) {
case "NT":
......
......@@ -35,6 +35,9 @@ export default class ReplenishSkuPage extends React.Component{
}
handleScanQrcode(){
//扫描下一个
this.props.finishBoxRecovery();
this.continueScan()
}
......@@ -53,7 +56,7 @@ export default class ReplenishSkuPage extends React.Component{
<div className={"btn pageBtn"}>
<div className={"tips colff775c font30"} onClick={()=>this.getPage(2)}>遇到问题?</div>
<Button btnContainer={"replenishPageBtn1 font32"} key={"replenishPageBtn1"} text={'扫描工作结束'} option={this.handleScanOver}/>
<Button btnContainer={"replenishPageBtn2 font32 colfff backff775c"} key={"replenishPageBtn2"} text={'扫描下一个'} option={this.continueScan}/>
<Button btnContainer={"replenishPageBtn2 font32 colfff backff775c"} key={"replenishPageBtn2"} text={'扫描下一个'} option={this.handleScanQrcode}/>
</div>
</div>
</div>
......@@ -266,7 +269,7 @@ export default class ReplenishSkuPage extends React.Component{
continueScan(){
let {showPopup,hidePopup,beginScan} = this.props;
hidePopup();
beginScan()
beginScan();
}
render(){
......
......@@ -627,6 +627,7 @@ class PageContainer extends React.Component {
barcodeInfo={state.barcodeCommon}
replenishInfo={state.replenishInfo}
getBarCodeProductInfo={(barcode)=>{dispatch(getBarCodeProductInfo({barcode,commonInfo:state.commonInfo}))}}
finishBoxRecovery={()=>dispatch(finishBoxRecovery(state.commonInfo))}
/>
/*以下是二期页面 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