This commit is contained in:
parent
98c71ab171
commit
71bc0eed61
|
@ -646,7 +646,8 @@ export default class acclist extends React.Component{
|
||||||
}
|
}
|
||||||
onQuantityChange(e,row,rowIndex){
|
onQuantityChange(e,row,rowIndex){
|
||||||
|
|
||||||
this.state.tempdata[rowIndex].quantity =e.target.value;
|
this.state.tempdata[rowIndex].quantity =e.target.value == "" ? 0 : e.target.value;
|
||||||
|
this.state.tempdata[rowIndex].stock = e.target.value == "" ? 0 : e.target.value;
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onPriceChange(e,row,rowIndex){
|
onPriceChange(e,row,rowIndex){
|
||||||
|
|
|
@ -355,9 +355,12 @@ export default class exchangedit extends React.Component{
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onQuantityChange(e,row){
|
onQuantityChange(e,row){
|
||||||
|
|
||||||
|
this.setState({tempdata:this.state.tempdata})
|
||||||
|
let value = e.target.value == "" ? 0 : e.target.value;
|
||||||
let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id})
|
let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id})
|
||||||
this.state.tempdata[rowIndex].quantity =e.target.value;
|
this.state.tempdata[rowIndex].quantity = value;
|
||||||
this.state.tempdata[rowIndex].stock =e.target.value - this.state.tempdata[rowIndex].usage ;
|
this.state.tempdata[rowIndex].stock = value - this.state.tempdata[rowIndex].usage ;
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onPriceChange(e,row){
|
onPriceChange(e,row){
|
||||||
|
|
|
@ -231,6 +231,7 @@ export default class acclist extends React.Component{
|
||||||
sum += parseInt( o.quantity);
|
sum += parseInt( o.quantity);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
console.log("sum",sum)
|
console.log("sum",sum)
|
||||||
if(sum < this.state.codeInfo.issued)
|
if(sum < this.state.codeInfo.issued)
|
||||||
{
|
{
|
||||||
|
@ -487,9 +488,8 @@ export default class acclist extends React.Component{
|
||||||
|
|
||||||
}
|
}
|
||||||
onQuantityChange(e,row,rowIndex){
|
onQuantityChange(e,row,rowIndex){
|
||||||
|
this.state.tempdata[rowIndex].quantity =e.target.value == "" ? 0 : e.target.value;
|
||||||
this.state.tempdata[rowIndex].quantity =e.target.value;
|
this.state.tempdata[rowIndex].stock = e.target.value == "" ? 0 : e.target.value;
|
||||||
this.state.tempdata[rowIndex].stock = e.target.value;
|
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onPriceChange(e,row,rowIndex){
|
onPriceChange(e,row,rowIndex){
|
||||||
|
|
|
@ -525,9 +525,12 @@ export default class acclist extends React.Component{
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onQuantityChange(e,row,rowIndex){
|
onQuantityChange(e,row,rowIndex){
|
||||||
|
let value = e.target.value == "" ? 0 : e.target.value;
|
||||||
|
|
||||||
this.state.tempdata[rowIndex].stock = e.target.value - this.state.tempdata[rowIndex].usage;
|
|
||||||
this.state.tempdata[rowIndex].quantity =e.target.value;
|
|
||||||
|
this.state.tempdata[rowIndex].stock = value - this.state.tempdata[rowIndex].usage;
|
||||||
|
this.state.tempdata[rowIndex].quantity =value;
|
||||||
this.setState({tempdata:this.state.tempdata})
|
this.setState({tempdata:this.state.tempdata})
|
||||||
}
|
}
|
||||||
onPriceChange(e,row,rowIndex){
|
onPriceChange(e,row,rowIndex){
|
||||||
|
|
Loading…
Reference in New Issue