Commit 101e1cd9 by Zhang Xin

联调回收修改BUG

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