<template>
|
<div class="box-content">
|
<p class="title_name">
|
<span>
|
<i class="el-icon-arrow-left size-f" @click="back"></i>基本信息</span
|
>
|
<span :class="`color${details.status}`">{{
|
statusLevel[details.status]
|
}}</span>
|
</p>
|
<table class="titleTable">
|
<tr>
|
<td><span>项目名称:</span>{{ details.name }}</td>
|
<td><span>当前项目层级:</span>{{ details.level }}级</td>
|
<td><span>责任方:</span>{{ details.responsibility }}</td>
|
</tr>
|
<tr>
|
<td><span>创建时间:</span>{{ details.createTime }}</td>
|
<td><span>一级分类:</span>{{ details.columnName }}</td>
|
<td><span>二级分类:</span>{{ details.secondColumnName }}</td>
|
</tr>
|
</table>
|
<div class="tab_p">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tab-pane label="关联项目" name="first"
|
><project
|
:item="datas"
|
:level="details.level"
|
@detailsSuccess="detailsSuccess"
|
></project
|
></el-tab-pane>
|
<el-tab-pane label="项目宣传" name="second"
|
><propagate :item="datas" :level="details.level"></propagate
|
></el-tab-pane>
|
<el-tab-pane label="项目活动" name="third"
|
><activity :item="datas" :level="details.level"></activity
|
></el-tab-pane>
|
<el-tab-pane label="项目介绍" name="fourth"
|
><introduce :item="datas" :level="details.level"></introduce
|
></el-tab-pane>
|
<el-tab-pane label="项目进度" name="five"
|
><schedule :item="datas" :level="details.level"></schedule
|
></el-tab-pane>
|
<el-tab-pane label="参与人员" name="six"
|
><personnel :item="datas" :level="details.level"></personnel
|
></el-tab-pane>
|
</el-tabs>
|
</div>
|
<div>
|
<!-- 公开发布权限 1.status状态为1 2.判断街道账号street_id -->
|
<el-button
|
v-if="details.status == 1"
|
@click="release()"
|
size="small"
|
type="primary"
|
>公开发布</el-button
|
>
|
<el-button
|
v-if="details.status == 2"
|
@click="noRelease()"
|
size="small"
|
type="primary"
|
>撤销发布</el-button
|
>
|
<el-button
|
type="primary"
|
@click="endClickProject"
|
v-if="details.status == 3"
|
size="small"
|
>结束项目</el-button
|
>
|
<el-button
|
@click="uploadFileData"
|
size="small"
|
>下载资料</el-button
|
>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import project from "./components/project.vue";
|
import propagate from "./components/propagate.vue";
|
import activity from "./components/activity.vue";
|
import introduce from "./components/introduce.vue";
|
import schedule from "./components/schedule.vue";
|
import personnel from "./components/personnel.vue";
|
export default {
|
components: { project, propagate, activity, introduce, schedule, personnel },
|
data() {
|
return {
|
activeName: "first",
|
info_id: "",
|
details: {},
|
datas: {},
|
statusLevel: ["", "初创项目", "公开发布", "运作中", "已结束"],
|
responsibilityList: [
|
"公共文化服务项目",
|
"社会组织参与型项目",
|
"社会企业带动型项目",
|
"其他项目",
|
],
|
userType: null,
|
};
|
},
|
watch: {
|
$route() {
|
if (this.$route.query.id) {
|
this.info_id = this.$route.query.id;
|
this.getDetails();
|
}
|
},
|
},
|
mounted() {
|
this.userType = demo.$session.get("user").userType;
|
if (this.$route.query.id) {
|
this.info_id = this.$route.query.id;
|
this.getDetails();
|
}
|
},
|
methods: {
|
uploadFileData(){
|
console.log(this.details.url)
|
if(this.details.url){
|
window.location.href = this.details.url
|
}else{
|
demo.toast('当前项目没有可下载资料')
|
}
|
},
|
endClickProject() {
|
this.$confirm("是否结束当前项目?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
}).then(() => {
|
this.$api.post('comActSocialProject/update',{
|
status:4,
|
id:this.$route.query.id
|
},e=>{
|
demo.toast('已结束');
|
this.getDetails();
|
})
|
});
|
},
|
handleClick() {},
|
back() {
|
this.$router.go(-1);
|
this.info_id = this.$route.query.id;
|
this.getDetails();
|
},
|
getDetails() {
|
this.$api.get(`comActSocialProject/${this.info_id}`, {}, (e) => {
|
this.details = e;
|
this.datas = {
|
id: e.id,
|
level: e.level,
|
status: e.status,
|
};
|
});
|
},
|
//公开发布
|
release() {
|
this.$confirm("是否公开发布项目?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
}).then(() => {
|
let params = {
|
id: this.$route.query.id,
|
status: 2, //公开发布
|
};
|
this.$api.post("/comActSocialProject/update", params, (e) => {
|
demo.toast("发布成功");
|
this.getDetails();
|
});
|
});
|
},
|
//撤销发布
|
noRelease() {
|
this.$confirm("是否撤销项目?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
}).then(() => {
|
let params = {
|
id: this.$route.query.id,
|
status: 1,
|
};
|
this.$api.post("/comActSocialProject/update", params, (e) => {
|
demo.toast("撤销成功");
|
this.getDetails();
|
});
|
});
|
},
|
//关联项目
|
relation() {
|
let params = {
|
paramId: this.details.id,
|
level: this.details.level,
|
page: 1,
|
};
|
this.$api.post("comActSocialProject/getRelation", {}, (e) => {
|
this.details = e;
|
});
|
},
|
//子组件触发详细
|
detailsSuccess(val) {
|
this.info_id = val;
|
this.getDetails();
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.box-content {
|
overflow: scroll;
|
}
|
.title_name {
|
display: flex;
|
width: 100%;
|
padding: 20px 0 20px 0;
|
justify-content: space-between;
|
.color1 {
|
color: #e6a23c;
|
}
|
.color2 {
|
color: #f56c6c;
|
}
|
.color3 {
|
color: #409eff;
|
}
|
.color4 {
|
color: #909399;
|
}
|
}
|
.size-f {
|
font-size: 24px;
|
position: relative;
|
top: 3px;
|
cursor: pointer;
|
}
|
.tab_p {
|
padding-top: 40px;
|
}
|
.titleTable {
|
width: 100%;
|
tr {
|
padding: 5px 0;
|
}
|
tr td {
|
text-align: left;
|
}
|
}
|
</style>
|