Commit 2740581d by wujiabao

change breakage&tokeStore

parent 31a78ff8
import React from 'react'
import Button from '../../CommonComponent/ButtonComponent/ButtonComponent'
import BarcodeComponent from '../../CommonComponent/BarcodeComponent/BarcodeComponent'
require('./index.css')
class BreakageCode extends React.Component{
......@@ -18,18 +17,10 @@ class BreakageCode extends React.Component{
<BarcodeComponent getBarCodeProductInfo={this.props.getBarCodeProductInfo}
changePage={this.props.changePage}
/>
{/* <div className={'breakageCodeContent'}>
{
barcodeWord?<p className={'font30'} style={{color:'#d0021b',textAlign:'center',marginTop:'20px'}}>条形码输入错误,请重新输入</p>:null
}
<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>
<Button text={'确定'} option={this.getCodeProduct.bind(this)} btnContainer={'font30 backff775c colfff'} style={{border:'0',margin:'0 auto',marginTop:'120px'}} /> */}
</div>
)
}
//控制显示扫码
changeSanCodePage(){
this.props.changeSanCodePage('SanCode')
}
......
......@@ -86,6 +86,8 @@ class BreakageProductDetail extends React.Component{
</div>
)
}
//改变显示的报损页面
changePageDefault(){
let {product}=this.props.breakageProductInfo;
let {statusColor}=this.state;
......@@ -93,9 +95,13 @@ class BreakageProductDetail extends React.Component{
this.props.submitBreakageProduct(productDetail);
this.props.changePopShow(true)
}
//点击添加商品状态选中样式
changeProductStatus(key){
this.setState({statusColor:key})
}
//点击添加商品位置选中状态
changePositionColor(key){
this.setState({positionColor:key})
}
......
......@@ -20,9 +20,13 @@ class SanCodeComponent extends React.Component{
</div>
</div>
}
changCodePage(){
//控制隐藏扫码页
changCodePage(){
this.props.changeCodePage(true)
}
//显示手动输入条形码页
changeSanCodePage(){
this.props.changeSanCodePage('HandCode')
}
......
......@@ -23,6 +23,8 @@ class DefaultComponent extends React.Component{
</div>
)
}
//控制显示扫码页面并且显示扫码页
skipInputCode(){
this.props.changeCodePage(false);
this.props.changeSanCodePage('SanCode')
......
......@@ -13,10 +13,10 @@ class BreakageContainer extends React.Component {
constructor(props){
super(props)
this.state={
showPage:1,
isShow:true,
SanCodePage:'SanCode',
popShow:false
showPage:1,//初始显示的页面
isShow:true,//控制扫码页的显示隐藏
SanCodePage:'SanCode',//控制显示扫码或手动输入
popShow:false //控制弹框
}
this.changePage=this.changePage.bind(this);
}
......@@ -53,14 +53,13 @@ class BreakageContainer extends React.Component {
</div>
)
}
componentDidMount(){
}
//控制弹框消失
changePopHide(){
this.changePopShow(false)
this.changePage(1)
}
//改变显示的组件
changePage(page){
this.setState({
......@@ -75,12 +74,15 @@ class BreakageContainer extends React.Component {
isShow:bool
})
}
//根据传入的值判断显示扫码页或手动输入码页
changeSanCodePage(CodePage){
this.setState({
SanCodePage:CodePage
})
}
//根据 判断 显示应该显示的组件
//根据判断显示应该显示的组件
getPages(){
let pages=null;
let props=this.props;
......@@ -102,6 +104,7 @@ class BreakageContainer extends React.Component {
}
return pages;
}
//根据数据显示扫码 还是手动输入条形码
getSanCodePgae(){
let {SanCodePage}=this.state;
......@@ -118,14 +121,18 @@ class BreakageContainer extends React.Component {
}
return SanPage;
}
//把二维码传给后台
getproductCode(barcode){
this.props.getBarCodeProductInfo(barcode)
}
//把 商品的详细信息传给后台
//把商品的详细信息传给后台
transmitInfo(productDetail){
this.props.submitBreakageProduct(productDetail)
}
//控制弹框的显示和隐藏
changePopShow(bool){
this.setState({popShow:bool})
}
......
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