You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
9.4 KiB

<template>
3 months ago
<div>
2 months ago
<!-- 负面清单 -->
3 months ago
<!-- 表单查询项 -->
<div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="200">
<el-row>
<el-col :span="5">
<el-form-item label="项目名称" style="width: 100%;">
<el-input v-model="queryParams.name" placeholder="请输入项目名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="7">
3 months ago
<el-form-item label="建设起止时间">
<el-date-picker v-model="queryParams.startTime" type="month" placeholder="开始月份"
value-format="yyyy-MM" style="width: 9rem;" :clearable="true">
3 months ago
</el-date-picker>
~
<el-date-picker v-model="queryParams.endTime" type="month" placeholder="结束月份"
value-format="yyyy-MM" style="width: 9rem;" :clearable="true">
3 months ago
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="现状分类">
<el-select v-model="queryParams.xzfl" placeholder="现状分类" clearable>
<el-option v-for="dict in dict.type.xzfl" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
3 months ago
<el-form-item label="项目法人单位">
<el-input v-model="queryParams.xmfrdwxz" placeholder="请输入项目名称" clearable
3 months ago
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item>
2 months ago
<el-button type="primary" icon="el-icon-search"
3 months ago
@click="handleQuery">查询</el-button>
2 months ago
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
3 months ago
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 表格内容区 -->
<div class="tablebox">
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" stripe>
2 months ago
<!-- <el-table-column type="selection" width="55" align="center" /> -->
3 months ago
<el-table-column label="序号" align="center">
<template slot-scope="scope">
2 months ago
{{ (scope.$index + 1) + (queryParams.current - 1) * queryParams.size }}
3 months ago
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="name" width="200" />
<el-table-column label="现状分类" align="center" prop="xzfl">
<template slot-scope="scope">
2 months ago
<dict-tag :options="dict.type.xzfl" :value="scope.row.xzfl" />
3 months ago
</template>
</el-table-column>
<el-table-column label="项目法人单位" align="center" prop="xmfrdwxz" width="200" />
<el-table-column label="统一信用代码" align="center" prop="tyshxydm" width="200" />
<el-table-column label="项目建设起止时间" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.begainTime }} {{ scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="总投资额(万元)" align="center" width="130" prop="ztze" />
<el-table-column label="总用地面积(平方米)" align="center" width="180" prop="zydmj" />
<el-table-column label="当前状态" align="center" prop="status">
<template slot-scope="scope">
<span :style="{ color: statusColors[statusMap[scope.row.status]] }">{{
statusMap[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
2 months ago
<el-button type="text" @click="getAdd(scope.row, 'detail')">详情</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-if="checkRole(['admin'])"
3 months ago
style="color: #F25353;">删除</el-button>
</template>
</el-table-column>
</el-table>
2 months ago
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" @pagination="getList" />
3 months ago
</div>
3 months ago
</div>
</template>
<script>
3 months ago
import { getBasicInformationPage, deleteBasicInformation } from "@/api/ManageApi/index";
import { checkPermi, checkRole } from "@/utils/permission";
3 months ago
export default {
3 months ago
dicts: ["xzfl"],
data() {
3 months ago
return {
3 months ago
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 项目表格数据
postList: [],
// 状态颜色映射
statusColors: {
'审核通过': '#6EDABE',
'待填报': '#FFBF6B',
'待审核': '#7693D8'
},
// 状态文本映射
statusMap: {
1: '待填报',
2: '待审核',
3: '审核通过'
},
// 查询参数
queryParams: {
2 months ago
current: 1,
size: 10,
3 months ago
xzfl: undefined,
name: undefined,
xmfrdwxz: undefined,
startTime: undefined,
endTime: undefined,
status: undefined,
isFmqd: 1
3 months ago
}
3 months ago
};
3 months ago
},
3 months ago
created() {
this.getList();
3 months ago
},
3 months ago
methods: {
checkPermi,
checkRole,
/** 查询项目列表 */
getList() {
this.loading = true;
// 只查询isFmqd=2的数据
3 months ago
const params = {
...this.queryParams,
isFmqd: 1
};
3 months ago
3 months ago
getBasicInformationPage(params).then((response) => {
this.postList = response.data.records;
this.total = response.data.total;
this.loading = false;
}).catch(error => {
console.error('API请求错误:', error);
this.loading = false;
});
},
3 months ago
3 months ago
//当选择项发生变化时会触发该事件
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
3 months ago
3 months ago
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除项目id为"' + ids + '"的数据项?')
.then(() => {
return deleteBasicInformation(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => { });
},
/** 详情按钮操作 */
getAdd(row, type) {
2 months ago
this.$store.commit("SET_CRUMBS", "项目详情");
3 months ago
const id = row.id || this.ids[0];
this.$router.push({ path: `/manage-add/${id}`, query: { action: type } });
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
2 months ago
current: 1,
size: 10,
3 months ago
xzfl: undefined,
name: undefined,
xmfrdwxz: undefined,
startTime: undefined,
endTime: undefined,
status: undefined,
isFmqd: 1
};
this.getList();
},
3 months ago
3 months ago
/** 搜索按钮操作 */
handleQuery() {
2 months ago
this.queryParams.current = 1;
3 months ago
this.getList();
}
}
3 months ago
};
</script>
<style scoped>
.headerbox {
3 months ago
background-color: #fff;
border-radius: .5rem;
padding: 1rem;
margin: .5rem;
border: 1px solid #eee;
3 months ago
}
.tablebox {
3 months ago
background-color: #fff;
border-radius: .5rem;
padding: 1rem;
margin: .5rem;
border: 1px solid #eee;
3 months ago
}
.tablehead {
3 months ago
display: flex;
justify-content: space-between;
align-items: center;
3 months ago
}
.headbtn {
3 months ago
display: flex;
3 months ago
}
.tablebtntwo {
3 months ago
margin-top: 1rem;
margin-bottom: 1rem;
3 months ago
}
</style>