From 133d7f235e51a63ddba8255add23c83468c31304 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com>
Date: Mon, 29 Nov 2021 21:36:32 +0800
Subject: [PATCH] Update step2.js
---
src/pages/plan/add/step2.js | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js
index 0466111a..fc8f2985 100644
--- a/src/pages/plan/add/step2.js
+++ b/src/pages/plan/add/step2.js
@@ -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 {this.onRestrict(e,rowData)}} />
+ return {this.onRestrict(e,rowData,rowIndex)}} />
}
if(com == "edit")
{
- return
+ return {this.rowItemClick(rowData,rowIndex)}} style={{color:"#2B66F2"}} >编辑
}