hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<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>