//停用/启用
change_status(row,index) {
let _this=this;
console.log(row);
let obj={};
if(row.status==0){
obj={
uid:1,
id:row.id,
project_id:row.project_id,
title:row.title,
logo:row.logo,
content:row.content,
status:1,
ntype:row.ntype,
ptype:row.ptype,
};
postFormAPI(obj, "/web_notice/addnotice").then(res => {
if (res.data.code === 1) {
this.tableData[index].status=1;
this.flag=1;
console.log("status=1");
} else {
_this.$message.error(res.data.data.info.detail);
}
}).catch(error => {
alert(error)
_this.$message.error(error);
});
}else{
obj={
uid:1,
id:row.id,
project_id:row.project_id,
title:row.title,
logo:row.logo,
content:row.content,
status:0,
ntype:row.ntype,
ptype:row.ptype,
};
postFormAPI(obj, "/web_notice/addnotice").then(res => {
if (res.data.code === 1) {
this.tableData[index].status=0;
this.flag=1;
console.log("status=0");
} else {
_this.$message.error(res.data.data.info.detail);
}
}).catch(error => {
alert(error)
_this.$message.error(error);
});
}
},