Commit 1f6c7f23 by wujiabao

联调了一下 breakageContainer

parent 7b8b5cd0
...@@ -30,9 +30,13 @@ const changeTaskStatus = (data)=>{ ...@@ -30,9 +30,13 @@ const changeTaskStatus = (data)=>{
//test 输入条形码获取商品信息 //test 输入条形码获取商品信息
const getProductInfo = (data)=>{ const getBarCodeProductInfo = (data)=>{
let {barcode}=data; let {barcode,commonInfo}=data;
let url=`http://192.168.10.128:8080/web/flat/barcode/1/A/LR/${barcode}` // let {taskInfo,storeInfo,userInfo}=commonInfo;
// let storeId=storeInfo.id;
// let {currentTaskType,taskId,area}=taskInfo;
console.log(barcode,commonInfo,'这是吴加宝打印的数据')
let url=`http://192.168.10.128:8080/web/flat/barcode/13/336/A/LR/${barcode}`
return (dispatch)=>{ return (dispatch)=>{
fetch(url,{ fetch(url,{
method : 'GET', method : 'GET',
...@@ -53,4 +57,4 @@ const saveProductInfo = (data)=>{ ...@@ -53,4 +57,4 @@ const saveProductInfo = (data)=>{
} }
} }
export {getProductInfo} export {getBarCodeProductInfo}
\ No newline at end of file \ No newline at end of file
const breakActionType={
GETPRODUCTINFO:'GETPRODUCTINFO'
}
export default breakActionType
\ No newline at end of file
import React from 'react' import React from 'react'
import Button from '../../CommonComponent/ButtonComponent/ButtonComponent' import Button from '../../CommonComponent/ButtonComponent/ButtonComponent'
require('./index.css')
class BreakageCode extends React.Component{ class BreakageCode extends React.Component{
constructor(props){ constructor(props){
super(props) super(props)
this.state={ this.state={
barcode:'' barcode:'',
barcodeWord:false
} }
} }
render(){ render(){
let {barcode}=this.state; let { barcode , barcodeWord } = this.state;
return ( return (
<div className={'breakageContent'} style={{width:'100%',height:'100%',background:'rgba(0,0,0,1)',position:'absolute'}}> <div className={'breakageContent'} style={{width:'100%',height:'100%',background:'rgba(0,0,0,1)'}}>
<div className={'breakageHeader'}> <div className={"breakageCodeHeader font32 colfff "}>
<span>返回</span> <i className={"iconfont middle icon font50 icon-circle-left circleIcon fl"} style={{flexBasis:'100px'}}/>
<span>请输入遗留货品的条形码</span> <span className={"font40"}>请输入遗留商品的条形码</span>
<span>条形码残缺?</span> <span className={'font30'}>条形码残缺?</span>
</div> </div>
<div className={'breakageCodeContent'}> <div className={'breakageCodeContent'}>
<p>条形码输入错误,请重新输入</p> {
<input type="text" vlaue={barcode} onChange={(ev)=>{this.setState({barcode:ev.target.value})}}/> barcodeWord?<p className={'font30'} style={{color:'#d0021b',textAlign:'center',marginTop:'20px'}}>条形码输入错误,请重新输入</p>:null
<p>or<span>条形码扫描</span></p> }
<input type="text" className={'font30'} vlaue={barcode} onChange={(ev)=>{this.setState({barcode:ev.target.value})}}/>
<p className={'barcodeScan font30 colfff'}>or<span className={'colff7860'}>条形码扫描</span></p>
</div> </div>
<Button text={'确定'} option={this.getCodeProduct.bind(this)} btnContainer={'font30 backff775c colfff'} style={{border:'0'}} /> <Button text={'确定'} option={this.getCodeProduct.bind(this)} btnContainer={'font30 backff775c colfff'} style={{border:'0',margin:'0 auto',marginTop:'120px'}} />
</div> </div>
) )
} }
getCodeProduct(){ getCodeProduct(){
let {barcode}=this.state; let {barcode}=this.state;
this.props.getProductInfo(barcode) //验证输入的条形码是否为空
if(barcode){
this.props.getBarCodeProductInfo(barcode);
this.props.changePage(2)
this.setState({barcodeWord:false})
}else{
this.setState({barcodeWord:true})
}
} }
} }
export default BreakageCode; export default BreakageCode;
\ No newline at end of file
.breakageContent .breakageCodeHeader{
width:100%;
line-height: 98px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
padding:0 20px;
box-sizing: border-box;
}
.breakageContent .breakageCodeContent{
text-align: center;
margin-top:120px;
}
.breakageContent .breakageCodeContent input{
width:540px;
height:80px;
border:2px solid #9b9b9b ;
border-radius: 10px;
margin-top:20px;
}
.breakageContent .breakageCodeContent .barcodeScan{
margin-top:30px;
}
.breakageContent .breakageCodeContent .barcodeScan span{
margin-left:15px;
}
\ No newline at end of file
...@@ -3,11 +3,16 @@ import Button from '../../../components/CommonComponent/ButtonComponent/ButtonCo ...@@ -3,11 +3,16 @@ import Button from '../../../components/CommonComponent/ButtonComponent/ButtonCo
require('./index.css') require('./index.css')
class BreakageProductDetail extends React.Component{ class BreakageProductDetail extends React.Component{
constructor(props){ constructor(props){
super(props) super(props);
this
} }
render (){ render (){
let {breakageProductInfo}=this.props;
return ( return (
<div>
{
Object.keys(breakageProductInfo).length>0?
<div className={'breakageContent'}> <div className={'breakageContent'}>
<div className={'commonPage'}> <div className={'commonPage'}>
<div className={'pageTitle clo333 font40'} style={{marginBottom:'20px'}}> <div className={'pageTitle clo333 font40'} style={{marginBottom:'20px'}}>
...@@ -17,10 +22,10 @@ class BreakageProductDetail extends React.Component{ ...@@ -17,10 +22,10 @@ class BreakageProductDetail extends React.Component{
<div className={'breakProduct'}> <div className={'breakProduct'}>
<div className={'breakProductInfo'}> <div className={'breakProductInfo'}>
<div className={'breakProductImg'}> <div className={'breakProductImg'}>
<img src={UTILPATH.localImg.defaultImg} alt=""/> <img src={breakageProductInfo.product.skuImage} alt=""/>
</div> </div>
<div style={{marginTop:'30px',textAlign:'left',marginLeft:'10px'}}> <div style={{marginTop:'30px',textAlign:'left',marginLeft:'10px'}}>
<h2 className={'col333 font40'} style={{fontWeight:'800'}}>雪碧 250ml</h2> <h2 className={'col333 font40'} style={{fontWeight:'800'}}>{breakageProductInfo.product.skuName}</h2>
<p className={'col333 font28'} style={{marginTop:'20px'}}><span>条形码:</span>56546213456554</p> <p className={'col333 font28'} style={{marginTop:'20px'}}><span>条形码:</span>56546213456554</p>
</div> </div>
</div> </div>
...@@ -46,7 +51,9 @@ class BreakageProductDetail extends React.Component{ ...@@ -46,7 +51,9 @@ class BreakageProductDetail extends React.Component{
</div> </div>
</div> </div>
</div> </div>
<Button btnContainer={'colfff font30 backff775c'} text={'提交'} style={{position:'absolute',bottom:'120px',left:'50%',transform:'translate(-50%)'}} /> <Button btnContainer={'colfff font30 backff775c'} text={'提交'} style={{position:'absolute',bottom:'120px',left:'50%',transform:'translate(-50%)'}} option={{}} />
</div>:null
}
</div> </div>
) )
} }
......
...@@ -30,7 +30,7 @@ class BreakageContainer extends React.Component { ...@@ -30,7 +30,7 @@ class BreakageContainer extends React.Component {
this.getPages() this.getPages()
} }
</RightContainer> </RightContainer>
</div>:<BreakageCode changePage={this.changePage} getProductInfo={this.getproductCode.bind(this)} /> </div>:<BreakageCode changePage={this.changePage.bind(this)} getBarCodeProductInfo={this.getproductCode.bind(this)} />
} }
</div> </div>
) )
...@@ -40,8 +40,10 @@ class BreakageContainer extends React.Component { ...@@ -40,8 +40,10 @@ class BreakageContainer extends React.Component {
} }
//改变显示的组件 //改变显示的组件
changePage(page){ changePage(page){
console.log(page,'这是传过来显示那个页面的值')
this.setState({ this.setState({
showPage:page showPage:page,
isShow:true
}) })
} }
//切换到扫码的页面 //切换到扫码的页面
...@@ -61,13 +63,13 @@ class BreakageContainer extends React.Component { ...@@ -61,13 +63,13 @@ class BreakageContainer extends React.Component {
/> />
break; break;
case 2 : case 2 :
pages=<BreakageProductDetail /> pages=<BreakageProductDetail breakageProductInfo={props.breakageProductInfo} />
break; break;
} }
return pages; return pages;
} }
getproductCode(barcode){ getproductCode(barcode){
this.props.getProductInfo(barcode) this.props.getBarCodeProductInfo(barcode)
} }
} }
export default BreakageContainer export default BreakageContainer
\ No newline at end of file
...@@ -27,7 +27,7 @@ import TakeStokeContainer from '../TakeStokeContainer/TakeStokeContainer' ...@@ -27,7 +27,7 @@ import TakeStokeContainer from '../TakeStokeContainer/TakeStokeContainer'
import BreakageContainer from '../BreakageContainer/BreakageConatiner' import BreakageContainer from '../BreakageContainer/BreakageConatiner'
import RecoveryPage from '../RecoveryContainer/RecoveryContainer' import RecoveryPage from '../RecoveryContainer/RecoveryContainer'
import ReplenishContainer from '../ReplenishContainer/ReplenishContainer' import ReplenishContainer from '../ReplenishContainer/ReplenishContainer'
import {getProductInfo} from '../../actions/barcodeCommon' import {getBarCodeProductInfo} from '../../actions/barcodeCommon'
import {getTaskInfo,getTaskList} from '../../actions/common' import {getTaskInfo,getTaskList} from '../../actions/common'
/*二期引用 end*/ /*二期引用 end*/
...@@ -57,7 +57,7 @@ class PageContainer extends React.Component { ...@@ -57,7 +57,7 @@ class PageContainer extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
showPage : showPage[5], showPage : showPage[13],
lastPage : '', lastPage : '',
page : null, page : null,
popupInfo : defaultPopupInfo, popupInfo : defaultPopupInfo,
...@@ -593,7 +593,8 @@ class PageContainer extends React.Component { ...@@ -593,7 +593,8 @@ class PageContainer extends React.Component {
pages = <BreakageContainer pages = <BreakageContainer
pullTaskList={()=>{dispatch(hasNoSku(state.commonInfo))}} pullTaskList={()=>{dispatch(hasNoSku(state.commonInfo))}}
headerInfo={state.commonInfo} headerInfo={state.commonInfo}
getProductInfo={(barcode)=>{dispatch(getProductInfo({barcode}))}} getBarCodeProductInfo={(barcode)=>{dispatch(getBarCodeProductInfo({barcode,commonInfo:state.commonInfo}))}}
breakageProductInfo={state.barcodeCommon}
/>; />;
break; break;
case showPage[10]: case showPage[10]:
......
...@@ -3,7 +3,6 @@ import barcodeActionType from '../actiontype/barcodeCommon' ...@@ -3,7 +3,6 @@ import barcodeActionType from '../actiontype/barcodeCommon'
//扫码商品的信息 //扫码商品的信息
const saveProductInfo = (data,content)=>{ const saveProductInfo = (data,content)=>{
console.log(content,'这是吴加宝打印的数据')
return Object.assign({},data,{product:content}) return Object.assign({},data,{product:content})
} }
export default function(state={}, action) { export default function(state={}, action) {
......
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