完成【复制key】逻辑串通

This commit is contained in:
red-deng-deng 2021-12-30 11:14:57 +08:00
parent 5d243384d9
commit 969afe9219
5 changed files with 37 additions and 16 deletions

2
.gitignore vendored
View File

@ -21,3 +21,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
src/pages/exchangecode/contenttaggedwith/add.js
src/pages/exchangecode/contenttaggedwith/add.less

View File

@ -77,18 +77,17 @@ export default class acclist extends React.Component{
componentDidMount(e){
let batch_id=sessionStorage.getItem("keybatch_id")
let copyOpearo=sessionStorage.getItem("copyOpearo")
//编辑
if(batch_id > 0)
if(batch_id > 0||copyOpearo==2)
{
this.setState({isEdit:true})
// this.setState({isEdit:true})
getKeyBatchDetail(batch_id).then((res)=>{
handelResponse(res,(req,msg)=>{
console.log("和编辑",req)
this.setState({pagetitle:"编辑key"})
this.setState({pagetitle:"复制key"})
let model = {
batch_name:req.batch_name,
title:req.plan_title,
batch_name:'',
style: req.style,
quantity:req.quantity,
allow_repetition:req.allow_repetition,
@ -102,8 +101,8 @@ export default class acclist extends React.Component{
this.setState({begintime:req.begin_time})
let list = _.map(req.code_batch,(item)=>{
item.disabled = true;
item.checked = true;
// item.disabled = true;
// item.checked = true;
return item
})
console.log(list)
@ -895,7 +894,7 @@ export default class acclist extends React.Component{
<Card style={{ width:'98%',height:"auto" ,"margin":"10px auto"}} title={this.state.pagetitle}>
<Form model={this.state.model} rules={rules} ref="form1">
<FormItem labelname=" key归属" prop="title" id="title">
<FormItem labelname=" key归属计划" prop="title" id="title">
<div className="line-value">{this.state.model.title}</div>
</FormItem>
<FormItem labelname="key批次名称" prop="batch_name" id="batch_name" >
@ -940,7 +939,7 @@ export default class acclist extends React.Component{
<Checkbox.Group value={this.state.checkedList} onChange={(e)=>{this.onCheckChange(e)}} disabled={this.state.isEdit} >
<Checkbox value={1}>兑换码</Checkbox>
<Checkbox value={2} disabled>优惠券</Checkbox>
<Checkbox value={4} disabled>立减金</Checkbox>
{/* <Checkbox value={4} disabled>立减金</Checkbox> */}
</Checkbox.Group>
</FormItem>
{

View File

@ -767,7 +767,7 @@ export default class acclist extends React.Component{
<Checkbox.Group value={this.state.checkedList} onChange={(e)=>{this.onCheckChange(e)}}>
<Checkbox value={1}>兑换码</Checkbox>
<Checkbox value={2} disabled>优惠券</Checkbox>
<Checkbox value={4} disabled>立减金</Checkbox>
{/* <Checkbox value={4} disabled>立减金</Checkbox> */}
</Checkbox.Group>
</FormItem>
{

View File

@ -832,7 +832,7 @@ export default class acclist extends React.Component{
<Card style={{ width:'98%',height:"auto" ,"margin":"10px auto"}} title={this.state.pagetitle}>
<Form model={this.state.model} rules={rules} ref="form1">
<FormItem labelname=" key归属" prop="plan_title" id="plan_title">
<FormItem labelname=" key归属计划" prop="plan_title" id="plan_title">
<div className="line-value">{this.state.model.plan_title}</div>
</FormItem>
@ -867,7 +867,7 @@ export default class acclist extends React.Component{
<Checkbox.Group value={this.state.checkedList} onChange={(e)=>{this.onCheckChange(e)}} disabled={this.state.isEdit} >
<Checkbox value={1}>兑换码</Checkbox>
<Checkbox value={2} disabled>优惠券</Checkbox>
<Checkbox value={4} disabled>立减金</Checkbox>
{/* <Checkbox value={4} disabled>立减金</Checkbox> */}
</Checkbox.Group>
</FormItem>
{

View File

@ -266,7 +266,7 @@ export default class acclist extends React.Component{
}
]}]
sessionStorage.setItem("keybatch_id","")
sessionStorage.setItem("copyOpearo",0)
sessionStorage.setItem('breakchangenav',JSON.stringify(activerou));
}
aboutFn(e,row){
@ -284,6 +284,24 @@ export default class acclist extends React.Component{
]}]
sessionStorage.setItem('breaknav',JSON.stringify(activerou));
}
//复制
onCopyRow(status,row){
this.props.history.push('/home/exchangecode-add');
sessionStorage.setItem('pathname2','/home/exchangecode-add')
let activerou=[{pagetitle:'复制',items:[
{
"path": "/home/exchangecode-list",
"name": "key列表管理"
},
{
"path": "/home/exchangecode-add",
"name": "复制key"
}
]}]
sessionStorage.setItem("keybatch_id",row.id)
sessionStorage.setItem("copyOpearo",1)
sessionStorage.setItem('breakchangenav',JSON.stringify(activerou));
}
//page
pageChange(e){
this.setState({page:e});
@ -397,6 +415,7 @@ onEditRow(status,row){
sessionStorage.setItem("keybatch_id",row.id)
}
//敲回车查询
iptsureFn(){
this.setState({page:1})
@ -621,6 +640,7 @@ linkTo(row){
str = <span>
<a className="grid-link" onClick={(e)=>{this.onEditRow(e,rowData)}} >编辑</a>
<a className="grid-link" onClick={(e)=>{this.onCopyRow(e,rowData)}} >复制</a>
<Dropdown position={DropdownPosition.RightTop } onVisibleChange={(e)=>{
keysIsSend(rowData.id).then((res)=>{