提交 55b65485 authored 作者: 林国禄's avatar 林国禄

更新项目

上级 0fa53bcd
import request from '@/utils/request'
// 获取统计点列表
export function getStatisticalPointsList() {
return request({
url: '/backstage/point/getStatisticalPointsList',
method: 'get',
})
}
// 修改统计点账号状态
export function changeStatus(id) {
return request({
......
import request from '@/utils/request'
// 获取关联主题列表详情
export function getThemeListDetail(id) {
return request({
url: '/backstage/project/getThemeListDetail/' + id,
method: 'get',
})
}
// 是否发布项目
export function changeReleaseStatus(id) {
return request({
......@@ -9,7 +17,7 @@ export function changeReleaseStatus(id) {
})
}
// 获取主题列表
// 获取主题列表(选择框)
export function getThemeList() {
return request({
url: '/backstage/project/getThemeList',
......
......@@ -77,12 +77,21 @@
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="考核主题数量" align="center" prop="targetCount" >
<!-- <template scope="scope">-->
<!-- <el-button @click="getTargetListDetail(scope.row.id)" round type="success">{{scope.row.targetCount}}</el-button>-->
<!-- </template>-->
<template scope="scope">
<el-button @click="getThemeListDetail(scope.row.id)" round type="success">{{scope.row.themeCount}}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="relevantStatisticalPoints(scope.row)"
v-hasPermi="['backstage:project:edit']"
>关联统计点</el-button>
<el-button
size="mini"
type="text"
......@@ -134,29 +143,61 @@
</el-dialog>
<!-- 考核主题列表 -->
<el-dialog :title="title" :visible.sync="themeListOpen" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="themeListOpen" width="800px" append-to-body>
<el-table v-loading="themeListLoading" :data="themeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主题名称" align="center" prop="name" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="参与村数量" align="center" prop="" />
<el-table-column label="考核指标数量" align="center" prop="targetCount"/>
<!-- <el-table-column label="参与村数量" align="center" prop="" />-->
<!-- <el-table-column label="考核指标数量" align="center" prop="targetCount"/>-->
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="repeatSubmit">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="themeListOpen = false" :disabled="repeatSubmit">确 定</el-button>
<el-button @click="themeListOpen = false">取 消</el-button>
</div>
</el-dialog>
<!-- 关联统计点弹出框 -->
<el-dialog :title="title" :visible.sync="statisticsPointOpen" width="500px" append-to-body>
<div>
<el-form>
<el-form-item label="关联统计点" prop="adminVillageLevelValue">
<div class="block">
<!-- <span class="demonstration"></span>-->
<el-cascader
style="width: 100%"
key="id"
placeholder="请选择统计点"
v-model="form.areaSelectValue"
:options="statisticsPoints"
:props="{multiple: true, expandTrigger: 'hover'}"
filterable
clearable></el-cascader>
</div>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="statisticsPointSubmit(form)" :disabled="repeatSubmit">确 定</el-button>
<el-button @click="statisticsPointOpen = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { changeReleaseStatus, getThemeList, listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/backstage/project";
import { relevantStatisticalPoints, getThemeListDetail, changeReleaseStatus, getThemeList, listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/backstage/project";
import { getStatisticalPointsList } from "@/api/backstage/point";
export default {
name: "Project",
data() {
return {
statisticsPoints:[],
statisticsPointOpen: false,
themeListLoading: false,
themeListOpen: false,
themeList: [],//主题列表
......@@ -381,6 +422,50 @@ export default {
this.$message.error('取消操作')
})
},
//考核主题详情列表
getThemeListDetail(id){
this.themeListLoading = true;
getThemeListDetail(id).then(res=>{
this.themeList = res.data;
this.themeListLoading = false;
this.title = '查看考核主题列表';
this.themeListOpen = true;
});
},
//关联统计点
relevantStatisticalPoints(row){
getProject(row.id).then(response => {
this.form = response.data;
if(this.form.areaSelectValue){
this.form.areaSelectValue = JSON.parse(this.form.areaSelectValue);
}
});
getStatisticalPointsList().then(res=>{
this.statisticsPoints = res.data;
this.statisticsPointOpen = true;
});
},
//关联统计点提交按钮
statisticsPointSubmit(row){
if(row.areaSelectValue != null && row.areaSelectValue.length>0){
row.areaSelectValue = JSON.stringify(row.areaSelectValue)
}else {
row.areaSelectValue = null
}
updateProject(row).then(response => {
this.msgSuccess("关联成功");
this.statisticsPointOpen = false;
this.getList();
}).catch(()=>{
if(row.areaSelectValue){
row.areaSelectValue = JSON.parse(row.areaSelectValue);
}
});
}
}
};
</script>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论