解决启用停用bug

This commit is contained in:
red-deng-deng 2021-11-24 20:48:56 +08:00
parent 60650d994d
commit 7bc67bb3e6
1 changed files with 6 additions and 5 deletions

View File

@ -33,9 +33,9 @@ const Column = [
}, },
{ {
title: '营销计划归属', title: '营销计划归属',
name: 'plan', name: 'plan_title',
type: "normal", type: "normal",
prop:'plan', prop:'plan_title',
width:'90px' width:'90px'
}, },
{ {
@ -227,12 +227,13 @@ export default class acclist extends React.Component{
type:'warning', type:'warning',
closeBtn:true, closeBtn:true,
title:'确认操作', title:'确认操作',
content: <p>是否{row.status==0?'启用':'停用'}该兑换码批次</p>, content: <p>是否{row.status==1?'停用':'启用'}该兑换码批次</p>,
onConfirm:()=>{ onConfirm:()=>{
putCodeStatus(row.id,{'operation':1}).then(res=>{ putCodeStatus(row.id,{'operation':row.status==1?'2':'1'}).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
Notify.clear(); Notify.clear();
Notify.success(msg); Notify.success(msg);
self.getCodeListFn();
},(err)=>{ },(err)=>{
}) })
@ -369,7 +370,7 @@ componentDidUpdate(prevProps,prevState){
} }
if(com == "switch") if(com == "switch")
{ {
return <Switch size="small" checked={rowData.status==0?false:true} onChange={(e)=>this.changestatus(e,rowData)} disabled={rowData.status == 4 ||rowData.status == 5 } ></Switch>; return <Switch size="small" checked={rowData.status==2?false:true} onChange={(e)=>this.changestatus(e,rowData)} disabled={rowData.status == 4 ||rowData.status == 5 } ></Switch>;
} }
if(com == "status") if(com == "status")
{ {