This commit is contained in:
姜棚 2021-11-28 17:00:30 +08:00
parent 40c21370e1
commit 8e1d39e9e9
2 changed files with 51 additions and 14 deletions

View File

@ -38,7 +38,7 @@ export default class acclist extends React.Component{
merge_stock:1, merge_stock:1,
code_batch:"", code_batch:"",
draw_title:"", draw_title:"",
batch_name:""
}, },
drawerVisible:false, drawerVisible:false,
drawerVisible2:false, drawerVisible2:false,
@ -76,6 +76,7 @@ export default class acclist extends React.Component{
console.log("和编辑",req) console.log("和编辑",req)
this.setState({pagetitle:"编辑key"}) this.setState({pagetitle:"编辑key"})
let model = { let model = {
batch_name:req.batch_name,
style: req.style, style: req.style,
quantity:req.quantity, quantity:req.quantity,
allow_repetition:req.allow_repetition, allow_repetition:req.allow_repetition,
@ -113,16 +114,6 @@ export default class acclist extends React.Component{
plan_item = JSON.parse(plan_item) plan_item = JSON.parse(plan_item)
console.log("计划认为") console.log("计划认为")
console.log(plan_item) console.log(plan_item)
// let model = {
// title:plan_item.title,
// style: req.style,
// quantity:req.quantity,
// allow_repetition:req.allow_repetition,
// allow_loss:req.allow_loss,
// merge_stock:req.merge_stock,
// code_batch:req.code_batch,
// }
let model = this.state.model; let model = this.state.model;
model.title = plan_item.title; model.title = plan_item.title;
@ -144,6 +135,7 @@ export default class acclist extends React.Component{
if(this.refs.form1.validator()) if(this.refs.form1.validator())
{ {
let data = {}; let data = {};
data.batch_name = this.state.model.batch_name;
data.style = this.state.model.style; data.style = this.state.model.style;
data.quantity = this.state.model.quantity; data.quantity = this.state.model.quantity;
data.bind_object = this.state.model.bind_object; data.bind_object = this.state.model.bind_object;
@ -371,6 +363,7 @@ export default class acclist extends React.Component{
merge_stock:"1", merge_stock:"1",
code_batch:"", code_batch:"",
draw_title:"", draw_title:"",
batch_name:""
} }
let keys = this.state.keys; let keys = this.state.keys;
keys.push(obj) keys.push(obj)
@ -412,6 +405,7 @@ export default class acclist extends React.Component{
if(this.refs.form1.validator()) if(this.refs.form1.validator())
{ {
let data = {}; let data = {};
data.batch_name = this.state.model.batch_name;
data.style = this.state.model.style; data.style = this.state.model.style;
data.quantity = this.state.model.quantity; data.quantity = this.state.model.quantity;
data.bind_object = this.state.checkedList; data.bind_object = this.state.checkedList;
@ -513,7 +507,9 @@ export default class acclist extends React.Component{
bind_object: [ bind_object: [
{ type: "required", message: "请选择绑定类型"}, { type: "required", message: "请选择绑定类型"},
], ],
batch_name:[
{ type: "required", message: "请输入key批次名称"},
]
@ -603,6 +599,23 @@ export default class acclist extends React.Component{
<FormItem labelname=" key归属" prop="title" id="title"> <FormItem labelname=" key归属" prop="title" id="title">
<div className="line-value">{this.state.model.title}</div> <div className="line-value">{this.state.model.title}</div>
</FormItem> </FormItem>
<FormItem labelname="key批次名称" prop="batch_name" id="batch_name" >
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.batch_name = e;
this.setState({model:model2})
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.batch_name = "";
this.setState({model:model2})
}}
value={this.state.model.batch_name} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'400px'} alignment={'left'}/>
</FormItem>
<FormItem labelname=" key样式" prop="style" id="style"> <FormItem labelname=" key样式" prop="style" id="style">
<RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > <RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} >
<RadioButton value={1}>串码</RadioButton> <RadioButton value={1}>串码</RadioButton>

View File

@ -32,7 +32,7 @@ export default class acclist extends React.Component{
merge_stock:1, merge_stock:1,
code_batch:"", code_batch:"",
draw_title:"", draw_title:"",
batch_name:""
}, },
drawerVisible:false, drawerVisible:false,
drawerVisible2:false, drawerVisible2:false,
@ -74,6 +74,7 @@ export default class acclist extends React.Component{
console.log("验证成功") console.log("验证成功")
let data = {}; let data = {};
data.batch_name = this.state.model.batch_name;
data.style = this.state.model.style; data.style = this.state.model.style;
data.quantity = this.state.model.quantity; data.quantity = this.state.model.quantity;
data.bind_object = this.state.checkedList; data.bind_object = this.state.checkedList;
@ -302,6 +303,7 @@ export default class acclist extends React.Component{
console.log(data) console.log(data)
let model={ //数据模型不可少 let model={ //数据模型不可少
batch_name:data.batch_name,
style: parseInt(data.style), style: parseInt(data.style),
quantity:data.quantity, quantity:data.quantity,
allow_repetition: parseInt(data.allow_repetition), allow_repetition: parseInt(data.allow_repetition),
@ -495,7 +497,9 @@ export default class acclist extends React.Component{
{ type: "required", message: "请选择绑定类型"}, { type: "required", message: "请选择绑定类型"},
], ],
batch_name:[
{ type: "required", message: "请输入key批次名称"},
]
@ -617,6 +621,26 @@ export default class acclist extends React.Component{
<RadioButton value={3} disabled>二维码</RadioButton> <RadioButton value={3} disabled>二维码</RadioButton>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem labelname="key批次名称" prop="batch_name" id="batch_name" >
<Ipt onChange={(e)=>{
let model2 = this.state.model;
model2.batch_name = e;
this.setState({model:model2})
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.batch_name = "";
this.setState({model:model2})
}}
value={this.state.model.batch_name} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'400px'} alignment={'left'}/>
</FormItem>
<FormItem labelname="key数量" prop="quantity" id="quantity" > <FormItem labelname="key数量" prop="quantity" id="quantity" >
<Ipt onChange={(e)=>{ <Ipt onChange={(e)=>{