Update step2.js
This commit is contained in:
parent
836f093790
commit
133d7f235e
|
@ -260,6 +260,7 @@ export default class acclist extends React.Component{
|
|||
begin_time:this.state.codeInfo.date_time[0],
|
||||
end_time:this.state.codeInfo.date_time[1],
|
||||
quantity:this.state.codeInfo.issued,
|
||||
restrict:this.state.codeInfo.restrict,
|
||||
range : rank.toString(),
|
||||
|
||||
}
|
||||
|
@ -287,6 +288,7 @@ export default class acclist extends React.Component{
|
|||
console.log("编辑")
|
||||
this.state.distdata[this.state.rowIndex] = temp;
|
||||
this.setState({distdata:this.state.distdata})
|
||||
console.log(this.state.distdata)
|
||||
}
|
||||
else{
|
||||
console.log("新增")
|
||||
|
@ -301,17 +303,11 @@ export default class acclist extends React.Component{
|
|||
addNewKey(){
|
||||
this.props.addNewkey()
|
||||
}
|
||||
onRestrict(e,rowdata){
|
||||
onRestrict(e,rowdata,index){
|
||||
|
||||
let text = e.target.value;
|
||||
text = text.replace(/[^\d]/g,'')
|
||||
|
||||
|
||||
let rowIndex =this.state.distdata.findIndex((o)=>{return o.title == rowdata.title})
|
||||
|
||||
|
||||
|
||||
this.state.distdata[rowIndex].restrict =text;
|
||||
this.state.distdata[index].restrict =text;
|
||||
this.setState({distdata:this.state.distdata})
|
||||
}
|
||||
|
||||
|
@ -547,7 +543,8 @@ export default class acclist extends React.Component{
|
|||
issued:row.quantity,//发放总量
|
||||
describe:row.describe,
|
||||
date_time:[row.begin_time,row.end_time],
|
||||
range:row.range
|
||||
range:row.range,
|
||||
restrict:row.restrict,
|
||||
}
|
||||
|
||||
let arr = _.map(row.product,(res)=>{
|
||||
|
@ -568,6 +565,7 @@ export default class acclist extends React.Component{
|
|||
})
|
||||
|
||||
|
||||
|
||||
this.setState({tempdata:temp})
|
||||
this.setState({drawerVisible:true})
|
||||
|
||||
|
@ -846,11 +844,11 @@ export default class acclist extends React.Component{
|
|||
if(com == "restrict")
|
||||
{
|
||||
|
||||
return <Input placeholder="请输入数量" type="number" width={120} value={rowData.restrict} onChange={(e)=>{this.onRestrict(e,rowData)}} />
|
||||
return <Input placeholder="请输入数量" type="number" width={120} value={rowData.restrict} onChange={(e)=>{this.onRestrict(e,rowData,rowIndex)}} />
|
||||
}
|
||||
if(com == "edit")
|
||||
{
|
||||
return <Button type="primary" onClick={(e)=>{this.rowItemClick(rowData,rowIndex)}}>编辑</Button>
|
||||
return <span onClick={(e)=>{this.rowItemClick(rowData,rowIndex)}} style={{color:"#2B66F2"}} >编辑</span>
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue