解决订单结算

This commit is contained in:
red-deng-deng 2021-11-23 21:38:13 +08:00
parent 1deb03c2e6
commit 50c74d1f43
1 changed files with 15 additions and 4 deletions

View File

@ -128,13 +128,24 @@ export default class orderlist extends React.Component{
tableHeight:500,
page:1,
limit:10,
key_word:''
key_word:'',
officialprice:0,contractprice:0,costprice:0,totalprice:0
}
}
//选中表格的选框
selection(selection){
this.setState({selectiondata:selection});
let officialprice=0;
let contractprice=0;
let costprice=0;
let totalprice=0;
selection.forEach(item=>{
officialprice+=Number(item.official_price);
contractprice+=Number(item.contract_price);
costprice+=Number(item.cost_price);
totalprice+=Number(item.total);
});
this.setState({officialprice,contractprice,costprice,totalprice});
}
//新建订单
clickFn(){
@ -400,7 +411,7 @@ componentDidUpdate(prevProps,prevState){
type="info"
extraContent={<Button type="primary" onClick={this.clearFn.bind(this)}>清空</Button>}
>
已选择<font color="#296bef" style={{fontWeight:'bold'}}>{this.state.selectiondata.length}</font>30.0030.0036.436.4
已选择<font color="#296bef" style={{fontWeight:'bold'}}>{this.state.selectiondata.length}</font>{this.state.officialprice.toFixed(4)}{this.state.contractprice.toFixed(4)}{this.state.costprice.toFixed(4)}{this.state.totalprice.toFixed(4)}
</Alert>):null
}
<Grid