Merge branch 'master' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend

This commit is contained in:
姜棚 2021-11-25 17:38:50 +08:00
commit 7120f63254
5 changed files with 19 additions and 15 deletions

View File

@ -90,8 +90,8 @@ const menu={
switch(params){ switch(params){
case 1:return '#ffaa00';break; case 1:return '#ffaa00';break;
case 2:return '#55ff7f';break; case 2:return '#55ff7f';break;
case 4:return '#e64c00';break; case 5:return '#e64c00';break;
case 5:return '#55aaff';break; case 4:return '#55aaff';break;
case 6:return '#555500';break; case 6:return '#555500';break;
case 7:return '#3575C7';break; case 7:return '#3575C7';break;
} }

View File

@ -219,7 +219,7 @@ export default class menu extends React.Component {
getCellValue(column,rowData){ getCellValue(column,rowData){
let value = _.get(rowData,column) let value = _.get(rowData,column)
return value ? value : "-" return value||value==0 ? value : "-"
} }
switchChange(index,e) { switchChange(index,e) {
@ -229,6 +229,7 @@ export default class menu extends React.Component {
tableData: this.state.tableData tableData: this.state.tableData
}) })
} }
editRow(e,column, row) { editRow(e,column, row) {

View File

@ -48,7 +48,7 @@ const Column = [
{ {
title: '券总数(已发放)', title: '券总数(已发放)',
name: 'quantity', name: 'quantity',
type: "slot", type: "normal",
prop:'quantity', prop:'quantity',
width:'120px', width:'120px',
}, { }, {

View File

@ -107,7 +107,7 @@ export default class acclist extends React.Component{
dataCount:0, dataCount:0,
page:1, page:1,
limit:10, limit:10,
tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"生效中"},{title:"暂停中"},{title:"失效中"}], tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"生效中"},{title:"暂停中"},{title:"失效中"},{title:"已作废"}],
distdata:[], distdata:[],
combinedValue:[], combinedValue:[],
distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 150604',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}], distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 150604',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}],
@ -222,12 +222,11 @@ export default class acclist extends React.Component{
onSwitchChange(status,row){ onSwitchChange(status,row){
let self = this; let self = this;
console.log(status)
Sweetalert.confirm({ Sweetalert.confirm({
type:'warning', type:'warning',
closeBtn:true, closeBtn:true,
title:'确认操作', title:'确认操作',
content: <p>是否改变当前数据状态</p>, content: <p>是否<b>[key-批次id{row.id}]</b>{row.status==4?'':''}</p>,
onConfirm:()=>{ this.changeState(status,row)}, onConfirm:()=>{ this.changeState(status,row)},
onCancel: this.onCancel, onCancel: this.onCancel,
className:'questModal', className:'questModal',
@ -237,7 +236,7 @@ export default class acclist extends React.Component{
//修改状态 //修改状态
changeState(status,row){ changeState(status,row){
let self=this;
let data = { let data = {
operation: status ? 4 : 5 operation: status ? 4 : 5
} }
@ -246,7 +245,12 @@ export default class acclist extends React.Component{
let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id}); let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id});
this.state.distdata[id].status = status; this.state.distdata[id].status = status;
this.setState({distdata:this.state.distdata}) this.setState({distdata:this.state.distdata})
Notify.success("更新状态成功"); Notify.success(msg);
let data = {
page:1,
limit:10,
plan_id: sessionStorage.getItem("key_plan_id")}
self.getKeyList(data);
},(err)=>{ },(err)=>{
Notify.error(err) Notify.error(err)
}) })
@ -489,7 +493,7 @@ phoneChange=(e)=>
ComponentHandler={(com,rowData)=>{ ComponentHandler={(com,rowData)=>{
if(com == "switch") if(com == "switch")
{ {
return <Switch size="small" checked={rowData.status} onChange={(e)=>{this.onSwitchChange(e,rowData)}}></Switch>; return <Switch size="small" checked={rowData.status==4?true:false} onChange={(e)=>{this.onSwitchChange(e,rowData)}}></Switch>;
} }
if(com == "status") if(com == "status")

View File

@ -24,7 +24,7 @@ export default class acclist extends React.Component{
limit:10, limit:10,
tabList:[{title:"营销计划列表"}], tabList:[{title:"营销计划列表"}],
distdata:[{title:'士大夫大师傅'}], distdata:[{title:'士大夫大师傅'}],
filterList:[{id:0,label:"状态",menuList:[{id:0,name:"草稿"},{id:1,name:"审核中"},{id:2,name:"生效中"},{id:3,name:"暂停中"},{id:4,name:"已失效"},{id:5,name:"待生效"}]}, filterList:[{id:0,label:"状态",menuList:[{id:0,name:"草稿"},{id:2,name:"审核中"},{id:4,name:"生效中"},{id:5,name:"暂停中"},{id:1,name:"创建中"},{id:3,name:"待生效"}]},
], ],
menuList:[{id:0,name:"状态",check:false}], menuList:[{id:0,name:"状态",check:false}],
email:"", email:"",
@ -99,12 +99,11 @@ export default class acclist extends React.Component{
//切换siwtch //切换siwtch
onSwitchChange(status,row){ onSwitchChange(status,row){
let self = this; let self = this;
console.log(status)
Sweetalert.confirm({ Sweetalert.confirm({
type:'warning', type:'warning',
closeBtn:true, closeBtn:true,
title:'确认操作', title:'确认操作',
content: <p>是否改变当前数据状态</p>, content: <p>是否改变{row.open==1?'关闭':'开启'}<b>[{row.title}]</b></p>,
onConfirm:()=>{ this.changeState(status,row)}, onConfirm:()=>{ this.changeState(status,row)},
onCancel: this.onCancel, onCancel: this.onCancel,
className:'questModal', className:'questModal',
@ -124,7 +123,7 @@ export default class acclist extends React.Component{
startOrStopPlan(row.id,data).then((res)=>{ startOrStopPlan(row.id,data).then((res)=>{
handelResponse(res,(req,msg)=>{ handelResponse(res,(req,msg)=>{
let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id}); let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id});
this.state.distdata[id].open = status ? 1 : 2; this.state.distdata[id].open = status ? 2 : 1;
this.setState({distdata:this.state.distdata}) this.setState({distdata:this.state.distdata})
let data = { let data = {
page:1, page:1,
@ -467,7 +466,7 @@ export default class acclist extends React.Component{
if(com == "status") if(com == "status")
{ {
return <p className="dflexa" ><span><font className="icon" style={{background:menu.planStatusBg(parseInt(rowData.status))}}></font>{menu.planStatus(parseInt(rowData.status))}</span></p> return <p className="dflexa" ><span><font className="icon" style={{background:menu.planStatusBg(parseInt(rowData.status))}}></font>{rowData.status_text}</span></p>
} }
if(com == "opearo") if(com == "opearo")
{ {