提交 8033ed7e 编写于 作者: vino's avatar vino

Merge remote-tracking branch 'origin/dev-circle-nine-20201231' into dev-circle-nine-20201231

...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
created() { created() {
vm = this; vm = this;
vm.getCircleList();//可以放在自组件优化 vm.getCircleList();//可以放在自组件优化
vm.getModuleData();
}, },
data() { data() {
let checkProjectStr = (rule, value, callback) => { let checkProjectStr = (rule, value, callback) => {
...@@ -359,6 +359,7 @@ ...@@ -359,6 +359,7 @@
// 获取模块下拉数据 // 获取模块下拉数据
getModuleData() { getModuleData() {
getModuleData().then(function (res) { getModuleData().then(function (res) {
if(res.code == "000000") { if(res.code == "000000") {
vm.moduleArray = JSON.parse(JSON.stringify(res.data)); vm.moduleArray = JSON.parse(JSON.stringify(res.data));
...@@ -648,6 +649,7 @@ ...@@ -648,6 +649,7 @@
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
vm.circleList = res.data vm.circleList = res.data
vm.getModuleData();
} }
}).catch(err => { }).catch(err => {
this.$message.error('请求失败'); this.$message.error('请求失败');
......
...@@ -32,7 +32,24 @@ export const getActivityInfoReq = (activityId) => { ...@@ -32,7 +32,24 @@ export const getActivityInfoReq = (activityId) => {
description: '专区活动列表与搜索', description: '专区活动列表与搜索',
}) })
}; };
export const removeActivity = (params) => {
return fetch({
headers,
url: getBaseUrl(`circle/sso/activity/remove`),
method: 'delete',
data: params,
description: '后台管理--专区活动删除',
})
};
export const updateActivityStatus = (params) => {
return fetch({
headers,
url: getBaseUrl(`circle/sso/activity/deploy`),
method: 'post',
data: params,
description: '后台管理--专区活动上下线',
})
};
export const getActivityDocList = (params) => { export const getActivityDocList = (params) => {
......
...@@ -512,6 +512,14 @@ const vueFilter = { ...@@ -512,6 +512,14 @@ const vueFilter = {
return '-' return '-'
} }
}, },
//活动发布状态 1 已经发布 2未发布
activityStatus:(value) => {
if (value == 1) {
return '已发布'
}else if (value == 2) {
return '未发布'
}
},
liveStatusFilter: (value) => { liveStatusFilter: (value) => {
if (value == 1) { if (value == 1) {
return '预告' return '预告'
......
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
</el-row> </el-row>
</el-form> </el-form>
<el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;"> <el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;">
<el-table-column prop="id" label="活动ID" min-width="100" align="center"></el-table-column> <el-table-column prop="activityId" label="活动ID" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="后台标题" min-width="100" align="center"></el-table-column> <el-table-column prop="titleManager" label="后台标题" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="前台主标题" min-width="100" align="center"></el-table-column> <el-table-column prop="titleViewMain" label="前台主标题" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="创建者" min-width="100" align="center"></el-table-column> <el-table-column prop="createdName" label="创建者" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="最后修改" min-width="100" align="center"></el-table-column> <el-table-column prop="modifiedName" label="最后修改" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" min-width="100" align="center"> <el-table-column prop="createdTime" label="创建时间" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createdTime | liveDateFilter }}</span> <span>{{ scope.row.createdTime | liveDateFilter }}</span>
...@@ -72,28 +72,23 @@ ...@@ -72,28 +72,23 @@
</el-table-column> </el-table-column>
<el-table-column prop="status" label="状态" min-width="100" align="center"> <el-table-column prop="status" label="状态" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!--<span>{{ scope.row.status | rangeStatus }}</span>--> <span>{{ scope.row.status | activityStatus }}</span>
<span v-if="scope.row.status == 10 || scope.row.status == 40" style="color: #FAAD14">{{ scope.row.status | rangeStatus }}</span>
<span v-if="scope.row.status == 30" style="color: #1890FF">{{ scope.row.status | rangeStatus }}</span>
<span v-if="scope.row.status == 0 || scope.row.status == 50" style="color: #c7c8c9">{{ scope.row.status | rangeStatus }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="numberOfPeople" label="活动成员数" min-width="100" align="center"></el-table-column> <el-table-column prop="doctorCount" label="活动成员数" min-width="100" align="center"></el-table-column>
<el-table-column label="操作" min-width="370" align="center"> <el-table-column label="操作" min-width="370" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.status != 50"> <el-button @click="editRange(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="publishRange(scope.row)" v-if="scope.row.status != 30 && scope.row.status != 0" type="text" size="small">发布</el-button> <el-button @click="deleteActivity(scope.row)" type="text" size="small">删除</el-button>
<el-button @click="unPublishRange(scope.row)" v-if="scope.row.status == 30 && scope.row.status != 0" type="text" size="small">下线</el-button> <el-button @click="publishRange(scope.row)" v-if="scope.row.status == 2" type="text" size="small">发布</el-button>
<!--<el-button @click="liveManage(scope.row)" type="text" size="small" v-if="scope.row.status != 0">直播管理</el-button>--> <el-button @click="unPublishRange(scope.row)" v-if="scope.row.status == 1" type="text" size="small">下线</el-button>
<!--<el-button @click="roleManage(scope.row)" type="text" size="small" v-if="scope.row.status != 0">成员管理</el-button>-->
<el-button @click="editRange(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="activityManage(scope.row)" type="text" size="small">活动成员管理</el-button> <el-button @click="activityManage(scope.row)" type="text" size="small">活动成员管理</el-button>
<!--<el-button @click="setting(scope.row)" type="text" size="small" v-if="scope.row.status != 0 && showNewFlag">应用配置</el-button>--> <!--<el-button @click="setting(scope.row)" type="text" size="small" v-if="scope.row.status != 0 && showNewFlag">应用配置</el-button>-->
<el-button @click="rangeManage(scope.row)" type="text" size="small" v-if="scope.row.status != 0">删除</el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -163,7 +158,7 @@ ...@@ -163,7 +158,7 @@
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
import { updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi"; import { updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi";
import { getActivityList} from '@/utils/activitymanagement/activitymanagementApi'; import { getActivityList,removeActivity,updateActivityStatus} from '@/utils/activitymanagement/activitymanagementApi';
import ElTabPane from "element-ui/packages/tabs/src/tab-pane"; import ElTabPane from "element-ui/packages/tabs/src/tab-pane";
import RangeApply from "./range-apply"; import RangeApply from "./range-apply";
export default { export default {
...@@ -290,7 +285,7 @@ export default { ...@@ -290,7 +285,7 @@ export default {
getActivityList(params).then((res) => { getActivityList(params).then((res) => {
closeLoading(this); closeLoading(this);
if(res.code == "000000") { if(res.code == "000000") {
this.tableData = res.data.circleList; this.tableData = res.data.activityModelList;
this.totalRows = res.data.count; this.totalRows = res.data.count;
} else { } else {
this.tableData = []; this.tableData = [];
...@@ -303,7 +298,24 @@ export default { ...@@ -303,7 +298,24 @@ export default {
this.$message.error("请重试"); this.$message.error("请重试");
}) })
}, },
//删除活动
removeActivity(activityId){
let params = {
activityId: activityId,
}
openLoading(this);
removeActivity(params).then((res) => {
closeLoading(this);
if(res.code == "000000"){
this.$message.success("删除成功");
this.searchList();
}
}).catch((error) => {
this.$message.error("请重试");
}
)
},
resetForm() { resetForm() {
this.searchForm.name = ""; this.searchForm.name = "";
this.searchForm.createdTime = ""; this.searchForm.createdTime = "";
...@@ -317,58 +329,49 @@ export default { ...@@ -317,58 +329,49 @@ export default {
path: `/create-activity?enterType=${enterType}` path: `/create-activity?enterType=${enterType}`
}) })
}, },
//上线 //发布
publishRange(row) { publishRange(row) {
this.$confirm(`上线后圈子成员将收到入圈消息提醒(每天最多提醒一次),确定上线“${row.name}”吗?`, '', { this.updateStatus(row.activityId, 1);
confirmButtonText: '上线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
// confirm
this.updateStatus(row.id, "30");
}).catch(() => {
// cancel
// this.$message.error("上线失败");
});
}, },
//下线 //下线
unPublishRange(row) { unPublishRange(row) {
this.$confirm(`确定下线“${row.name}”吗?`, '', { var content = '';
if (row.doctorCount == 0){
content = '确认要下线该活动吗?'
}else if (row.doctorCount > 0){
content = '该活动的' + row.doctorCount + '个成员将无法参与活动,确认下线吗?'
}
this.$confirm(`${content}`, '', {
confirmButtonText: '下线', confirmButtonText: '下线',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
customClass: 'range-make-box', customClass: 'range-make-box',
}).then(() => { }).then(() => {
this.updateStatus(row.id, "40"); this.updateStatus(row.activityId, 2);
// confirm // confirm
}).catch(() => { }).catch(() => {
// cancel // cancel
}); });
}, },
// 更新圈子状态(上线,下线) // 更新活动状态(上线,下线)
updateStatus(id, status){ updateStatus(id, status){
let params = {"id": id, "status": status}; let params = {"activityId": id, "deployFlag": status};
updateRangeStatus(params).then((res) => { updateActivityStatus(params).then((res) => {
closeLoading(this); closeLoading(this);
if(res.code == "000000") { if(res.code == "000000") {
if(status == "40"){ if(status == 2){
this.$message.success("下线成功"); this.$message.success("下线成功");
} else if(status == "30") { } else if(status == 1) {
this.$message.success("上线成功"); this.$message.success("发布成功!");
}else if(status == "50") { }
this.$message.success("解散成功");
}
this.searchList(); this.searchList();
} else { } else {
if(status == "40"){ if(status == 2){
this.$message.error("下线失败,请重试"); this.$message.error("下线失败,请重试");
} else if(status == "30") { } else if(status == 1) {
this.$message.error("上线失败,请重试"); this.$message.error("发布失败,请重试");
}else if(status == "50") { }
this.$message.error("解散失败,请重试");
}
} }
...@@ -377,28 +380,35 @@ export default { ...@@ -377,28 +380,35 @@ export default {
// message: error, // message: error,
// type: 'error' // type: 'error'
// }); // });
if(status == "40"){ if(status == 2){
this.$message.error("下线失败,请重试"); this.$message.error("下线失败,请重试");
} else if(status == "30") { } else if(status == 1) {
this.$message.error("上线失败,请重试"); this.$message.error("发布失败,请重试");
}else if(status == "50") { }
this.$message.error("解散失败,请重试");
}
}) })
}, },
rangeManage(row) { deleteActivity(row) {
this.$router.push({ var content = '';
path: '/range-manage', if (row.doctorCount == 0){
query: { content = '确认要删除该活动吗?'
id: row.id, }else if (row.doctorCount > 0){
name: row.name, content = '该活动的' + row.doctorCount + '个成员将无法参与活动,确认删除吗?'
activeName: 'first', }
roleType: row.roleId, this.$confirm(`${content}`, '', {
} confirmButtonText: '删除',
}) cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
removeActivity(row.activityId);
// confirm
}).catch(() => {
// cancel
});
}, },
//直播管理 //直播管理
...@@ -419,7 +429,7 @@ export default { ...@@ -419,7 +429,7 @@ export default {
this.$router.push({ this.$router.push({
path: `/create-activity?enterType`, path: `/create-activity?enterType`,
query:{ query:{
id:row.id, id:row.activityId,
enterType:enterType, enterType:enterType,
roleType: row.roleId roleType: row.roleId
} }
...@@ -446,8 +456,8 @@ export default { ...@@ -446,8 +456,8 @@ export default {
this.$router.push({ this.$router.push({
path: '/activity-member', path: '/activity-member',
query: { query: {
id: row.id, id: row.activityId,
name: row.name, name: row.titleViewMain,
activeName: 'first', activeName: 'first',
} }
}) })
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
this.enterType = enterType; this.enterType = enterType;
this.roleType = roleType; this.roleType = roleType;
if(this.enterType != null && this.roleType != null){ if(this.enterType == 2){
this.curmbSecond = "编辑活动" this.curmbSecond = "编辑活动"
} }
...@@ -117,10 +117,7 @@ ...@@ -117,10 +117,7 @@
//完成 //完成
complete() { complete() {
// if(this.$refs.org.selectionList == null || this.$refs.org.selectionList == ""){
// this.$message.warning('请选择机构');
// return;
// }
console.log(this.formData.id); console.log(this.formData.id);
let req = { let req = {
circleId: this.formData.id, circleId: this.formData.id,
...@@ -168,18 +165,9 @@ ...@@ -168,18 +165,9 @@
}, },
//更新活动信息 //更新活动信息
commitActivityInfo() { commitActivityInfo() {
let req = vm.formData; let req = vm.formData;
console.log("commitActivityInfo() : name = " + req.titleManager + ", headUrl = " + req.listImage
+ ", coverUrl = " + req.introImage)
vm.POST("circle/sso/activity/save", req).then(res => { vm.POST("circle/sso/activity/save", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
// console.log(res);
// console.log(this.$refs);
// vm.formData.id = res.data;
// // this.active = 1;
// this.stepData = [false, true];
this.$message.success('保存成功'); this.$message.success('保存成功');
const _this = this; const _this = this;
setTimeout(function () { setTimeout(function () {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册