Commit b8296cba by wujiabao

整理报损模块

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