Commit b8296cba by wujiabao

整理报损模块

parent 0105a36f
import fetch from 'isomorphic-fetch'
import {SUBMIT_NUM} from '../actiontype/TokeStokeContainer'
//初始的任务 返回工单
fetch(url,{
credentials : 'include',
......@@ -12,16 +13,32 @@ fetch(url,{
.then((data)=>{
console.log(data)
}).catch(e=>{console.log('err'+e)})
//点击提交后台核对商品数量 后台应该返回我ture 或者 false
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body:{}
}).then(response=>response.json())
.then((data)=>{
console.log(data)
}).catch(e=>{console.log('err'+e)})
\ No newline at end of file
//点击提交后台核对商品数量 后台应该返回我ture 或者 false
const checkProductQuantity = (data)=>{
let url=`http://192.168.10.128:8080/web/flat/barcode`
return (dispatch)=>{
fetch(url,{
credentials : 'include',
method : 'POST',
mode : 'cors',
headers: {
'content-type':'application/json;charset=UTF-8',
},
body:{}
}).then(response=>response.json())
.then((json)=>{
checkQuantity(json)
}).catch(e=>{console.log('err'+e)})
}
}
const checkQuantity = (data)=>{
return{
type :SUBMIT_NUM,
data
}
}
export {checkProductQuantity}
\ No newline at end of file
......@@ -4,7 +4,6 @@ require('./index.css')
class BreakageProductDetail extends React.Component{
constructor(props){
super(props);
this
}
render (){
......@@ -51,11 +50,14 @@ class BreakageProductDetail extends React.Component{
</div>
</div>
</div>
<Button btnContainer={'colfff font30 backff775c'} text={'提交'} style={{position:'absolute',bottom:'120px',left:'50%',transform:'translate(-50%)'}} option={{}} />
<Button btnContainer={'colfff font30 backff775c'} text={'提交'} style={{position:'absolute',bottom:'120px',left:'50%',transform:'translate(-50%)'}} option={this.changePageDefault.bind(this)} />
</div>:null
}
</div>
)
}
changePageDefault(){
this.props.changePage(1)
}
}
export default BreakageProductDetail
\ No newline at end of file
......@@ -40,12 +40,12 @@ class BreakageContainer extends React.Component {
}
//改变显示的组件
changePage(page){
console.log(page,'这是传过来显示那个页面的值')
this.setState({
showPage:page,
isShow:true
})
}
//切换到扫码的页面
changeCodePage(bool){
this.setState({
......@@ -63,7 +63,9 @@ class BreakageContainer extends React.Component {
/>
break;
case 2 :
pages=<BreakageProductDetail breakageProductInfo={props.breakageProductInfo} />
pages=<BreakageProductDetail breakageProductInfo={props.breakageProductInfo}
changePage={this.changePage}
/>
break;
}
return pages;
......
......@@ -11,7 +11,7 @@ class TakeStokeContaniner extends React.Component {
super(props);
this.state={
showButton:true,
number:1,
number:2,
initNum:0
}
}
......
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