jhprjv2/ruoyi-ui/src/views/project/surProjectSchedule/index.vue

548 lines
16 KiB
Vue
Raw Normal View History

2023-08-10 21:09:49 +08:00
<template>
<div class="app-container">
<el-row>
<el-col :span="24">
2023-08-17 19:39:25 +08:00
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="责任主体"
prop="projectDeptId"
v-hasPermi="['project:project:zgs']"
>
<el-select
v-model="queryParams.projectDeptId"
placeholder="请选择责任主体"
clearable
>
<el-option
v-for="dict in depts"
:key="dict.deptId"
:label="dict.deptName"
:value="dict.deptId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="提交时间">
<el-date-picker
v-model="daterangeMarksTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
2023-08-10 21:09:49 +08:00
</el-col>
2023-08-17 19:39:25 +08:00
<el-col :span="24">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-if="1 == 2"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:surProjectSchedule:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:surProjectSchedule:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:surProjectSchedule:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['project:surProjectSchedule:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
2023-08-10 21:09:49 +08:00
</el-col>
</el-row>
2023-08-17 19:39:25 +08:00
<el-table
v-loading="loading"
:data="surProjectScheduleList"
@selection-change="handleSelectionChange"
>
2023-08-10 21:09:49 +08:00
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="id" />
2023-08-17 19:39:25 +08:00
<el-table-column
label="项目名称"
align="left"
prop="projectName"
show-overflow-tooltip
width="200"
/>
2023-08-10 21:09:49 +08:00
<el-table-column label="形象图片" align="center" prop="image" width="100">
<template slot-scope="scope">
2023-08-17 19:39:25 +08:00
<el-image
ref="preview"
style="width: 50px; height: 50px"
:src="getImageUrl(scope.row.image)"
@click="onPreview(scope.row.image)"
></el-image>
2023-08-10 21:09:49 +08:00
</template>
</el-table-column>
2023-08-17 19:39:25 +08:00
<el-table-column
label="计划节点"
align="left"
prop="plannedNode"
show-overflow-tooltip
/>
<el-table-column
label="实际节点"
align="left"
prop="actualNode"
show-overflow-tooltip
/>
<el-table-column
label="融资、招采进展"
align="left"
prop="purchaseProgress"
show-overflow-tooltip
width="160"
/>
<el-table-column
label="报建、设计进展"
align="left"
prop="designProgress"
show-overflow-tooltip
width="160"
/>
<el-table-column
label="施工进展"
align="left"
prop="constructionProgress"
show-overflow-tooltip
/>
<el-table-column
label="验收进展"
align="left"
prop="acceptanceProgress"
show-overflow-tooltip
/>
<el-table-column
label="下周计划"
align="left"
prop="planForNextWeek"
show-overflow-tooltip
/>
<el-table-column
label="存在问题"
align="celeftnter"
prop="existingProblem"
show-overflow-tooltip
/>
<el-table-column
label="问题推进情况"
align="left"
prop="problemProgress"
show-overflow-tooltip
width="160"
/>
2023-08-10 21:09:49 +08:00
<el-table-column label="提交时间" align="left" prop="createTime" width="160">
<template slot-scope="scope">
2023-08-18 00:18:03 +08:00
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}</span>
2023-08-10 21:09:49 +08:00
</template>
</el-table-column>
2023-08-17 19:39:25 +08:00
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
fixed="right"
>
2023-08-10 21:09:49 +08:00
<template slot-scope="scope">
2023-08-17 19:39:25 +08:00
<el-button
v-if="1 == 2"
2023-08-10 21:09:49 +08:00
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:surProjectSchedule:edit']"
2023-08-17 19:39:25 +08:00
>修改</el-button
>
2023-08-10 21:09:49 +08:00
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:surProjectSchedule:remove']"
2023-08-17 19:39:25 +08:00
>删除</el-button
>
2023-08-10 21:09:49 +08:00
</template>
</el-table-column>
</el-table>
<pagination
2023-08-17 19:39:25 +08:00
v-show="total > 0"
2023-08-10 21:09:49 +08:00
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2023-08-16 22:38:38 +08:00
<!-- 添加或修改形象进度对话框 -->
2023-08-17 19:39:25 +08:00
<el-dialog
:title="title"
v-if="open"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
>
2023-08-10 21:09:49 +08:00
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-col :span="24">
2023-08-17 19:39:25 +08:00
<el-form-item label="形象图片" prop="image">
2023-08-28 22:36:00 +08:00
<image-upload v-model="form.image" :limit="5" />
2023-08-17 19:39:25 +08:00
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划节点" prop="plannedNode">
<el-input
v-model="form.plannedNode"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="12">
<el-form-item label="实际节点" prop="actualNode">
<el-input
v-model="form.actualNode"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="12">
<el-form-item label="融资、招采进展" prop="purchaseProgress">
<el-input
v-model="form.purchaseProgress"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="12">
<el-form-item label="报建、设计进展" prop="designProgress">
<el-input
v-model="form.designProgress"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="24">
<el-form-item label="施工进展" prop="constructionProgress">
<el-input
v-model="form.constructionProgress"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="12">
<el-form-item label="验收进展" prop="acceptanceProgress">
<el-input
v-model="form.acceptanceProgress"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="12">
<el-form-item label="下周计划" prop="planForNextWeek">
<el-input
v-model="form.planForNextWeek"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="24">
<el-form-item label="存在问题" prop="existingProblem">
<el-input
v-model="form.existingProblem"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-col
><el-col :span="24">
<el-form-item label="问题推进情况" prop="problemProgress">
<el-input
v-model="form.problemProgress"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-form>
2023-08-10 21:09:49 +08:00
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
2023-08-17 19:39:25 +08:00
<el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="previewList" />
2023-08-10 21:09:49 +08:00
</div>
</template>
<script>
2023-08-17 19:39:25 +08:00
import {
listSurProjectSchedule,
getSurProjectSchedule,
delSurProjectSchedule,
addSurProjectSchedule,
updateSurProjectSchedule,
} from "@/api/project/surProjectSchedule";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
2023-08-10 21:09:49 +08:00
export default {
name: "SurProjectSchedule",
2023-08-17 19:39:25 +08:00
components: {
ElImageViewer,
},
dicts: ["sys_common_isdel"],
2023-08-10 21:09:49 +08:00
data() {
return {
2023-08-17 19:39:25 +08:00
showViewer: false,
2023-08-10 21:09:49 +08:00
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
2023-08-16 22:38:38 +08:00
// 形象进度表格数据
2023-08-10 21:09:49 +08:00
surProjectScheduleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
2023-08-17 19:39:25 +08:00
// 发布时间时间范围
2023-08-10 21:09:49 +08:00
daterangeMarksTime: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
plannedNode: null,
actualNode: null,
purchaseProgress: null,
designProgress: null,
constructionProgress: null,
acceptanceProgress: null,
planForNextWeek: null,
existingProblem: null,
problemProgress: null,
isDel: null,
2023-08-17 19:39:25 +08:00
projectDeptId: null,
2023-08-10 21:09:49 +08:00
},
2023-08-17 19:39:25 +08:00
depts: null,
2023-08-10 21:09:49 +08:00
// 表单参数
form: {},
// 表单校验
2023-08-17 19:39:25 +08:00
rules: {},
previewList: [],
2023-08-10 21:09:49 +08:00
};
},
created() {
this.getList();
2023-08-17 19:39:25 +08:00
this.$api.publics.getZgsDeptList().then((d) => {
this.depts = d?.data || [];
});
2023-08-10 21:09:49 +08:00
},
methods: {
2023-08-17 19:39:25 +08:00
getImageUrl(url) {
2023-09-07 22:14:21 +08:00
return process.env.VUE_APP_BASE_API + url.split(",")[0] + ".min.jpg";
2023-08-17 19:39:25 +08:00
},
onPreview(url) {
this.previewList = [];
2023-09-07 22:14:21 +08:00
url.split(",").forEach((item) => {
this.previewList.push(process.env.VUE_APP_BASE_API + item);
});
2023-08-17 19:39:25 +08:00
this.showViewer = true;
},
closeViewer() {
this.showViewer = false;
},
2023-08-16 22:38:38 +08:00
/** 查询形象进度列表 */
2023-08-10 21:09:49 +08:00
getList() {
this.loading = true;
this.queryParams.params = {};
2023-08-17 19:39:25 +08:00
if (null != this.daterangeMarksTime && "" != this.daterangeMarksTime) {
2023-08-10 21:09:49 +08:00
this.queryParams.params["beginMarksTime"] = this.daterangeMarksTime[0];
this.queryParams.params["endMarksTime"] = this.daterangeMarksTime[1];
}
2023-08-17 19:39:25 +08:00
listSurProjectSchedule(this.queryParams).then((response) => {
2023-08-10 21:09:49 +08:00
this.surProjectScheduleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
projectId: null,
image: null,
plannedNode: null,
actualNode: null,
purchaseProgress: null,
designProgress: null,
constructionProgress: null,
acceptanceProgress: null,
planForNextWeek: null,
existingProblem: null,
problemProgress: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
2023-08-17 19:39:25 +08:00
remark: null,
2023-08-10 21:09:49 +08:00
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
2023-08-17 19:39:25 +08:00
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
2023-08-10 21:09:49 +08:00
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
2023-08-16 22:38:38 +08:00
this.title = "添加形象进度";
2023-08-10 21:09:49 +08:00
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
2023-08-17 19:39:25 +08:00
const id = row.id || this.ids;
getSurProjectSchedule(id).then((response) => {
2023-08-10 21:09:49 +08:00
this.form = response.data;
this.open = true;
2023-08-16 22:38:38 +08:00
this.title = "修改形象进度";
2023-08-10 21:09:49 +08:00
});
},
/** 提交按钮 */
submitForm() {
2023-08-17 19:39:25 +08:00
this.$refs["form"].validate((valid) => {
2023-08-10 21:09:49 +08:00
if (valid) {
if (this.form.id != null) {
2023-08-17 19:39:25 +08:00
updateSurProjectSchedule(this.form).then((response) => {
2023-08-10 21:09:49 +08:00
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
2023-08-17 19:39:25 +08:00
addSurProjectSchedule(this.form).then((response) => {
2023-08-10 21:09:49 +08:00
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
2023-08-17 19:39:25 +08:00
this.$modal
.confirm('是否确认删除形象进度编号为"' + ids + '"的数据项?')
.then(function () {
return delSurProjectSchedule(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
2023-08-10 21:09:49 +08:00
},
/** 导出按钮操作 */
handleExport() {
2023-08-17 19:39:25 +08:00
this.download(
"project/surProjectSchedule/export",
{
...this.queryParams,
},
`surProjectSchedule_${new Date().getTime()}.xlsx`
);
},
},
2023-08-10 21:09:49 +08:00
};
</script>