dev_xds
姜玉琦 2023-09-09 01:37:18 +08:00
commit 4cc7bb0b4f
8 changed files with 148 additions and 332 deletions

View File

@ -42,3 +42,11 @@ export function delProjectPlan(id) {
method: 'delete' method: 'delete'
}) })
} }
export function listAll(type) {
return request({
url: '/project/projectPlan/listAll/' + type,
method: 'get'
})
}

View File

@ -1,360 +1,172 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-tabs v-model="activeName" @tab-click="tabClick">
<el-form-item label="包抓部门" prop="dept"> <el-tab-pane label="城建项目计划" name="f"></el-tab-pane>
<el-input <el-tab-pane label="重点项目计划" name="s"></el-tab-pane>
v-model="queryParams.dept" </el-tabs>
placeholder="请输入包抓部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开工日期" prop="startDate">
<el-date-picker clearable
v-model="queryParams.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开工日期">
</el-date-picker>
</el-form-item>
<el-form-item label="完工日期" prop="endDate">
<el-date-picker clearable
v-model="queryParams.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择完工日期">
</el-date-picker>
</el-form-item>
<el-form-item label="总投资" prop="totalInvestment">
<el-input
v-model="queryParams.totalInvestment"
placeholder="请输入总投资"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年度投资" prop="yearInvestment">
<el-input
v-model="queryParams.yearInvestment"
placeholder="请输入年度投资"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否删除" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入是否删除"
clearable
@keyup.enter.native="handleQuery"
/>
</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>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="doImport"
type="primary" v-hasPermi="['project:projectPlan:import']">导入</el-button>
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:projectPlan:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="doExport"
type="success" v-hasPermi="['project:projectPlan:export']">导出</el-button>
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:projectPlan:edit']"
>修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getList"></right-toolbar>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:projectPlan: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:projectPlan:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="projectPlanList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="projectPlanList">
<el-table-column type="selection" width="55" align="center" /> <el-table-column label="No." align="center" prop="id" width="50"><template slot-scope="scope" >{{scope.$index+1}}</template></el-table-column>
<el-table-column label="" align="center" prop="id" /> <el-table-column :label="activeName == 'f' ? '项目名称' : '项目名称'" align="left" min-width="200" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column :label="activeName == 'f' ? '建设规模及主要工程内容' : '建设规模及主要建设内容'" min-width="300" align="left" prop="content" :show-overflow-tooltip="true"/>
<el-table-column label="建设规模及主要建设内容" align="center" prop="content" /> <el-table-column :label="activeName == 'f' ? '建设性质' : '建设性质'" align="center" prop="buildType" />
<el-table-column label="建设性质" align="center" prop="buildType" /> <el-table-column :label="activeName == 'f' ? '包抓部门' : '包抓部门'" align="center" prop="dept" min-width="200"/>
<el-table-column label="包抓部门" align="center" prop="dept" /> <el-table-column :label="activeName == 'f' ? '开工时限' : '开工日期'" align="center" prop="startDate" width="180">
<el-table-column label="开工日期" align="center" prop="startDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="完工日期" align="center" prop="endDate" width="180"> <el-table-column :label="activeName == 'f' ? '建成时限' : '完工日期'" align="center" prop="endDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总投资" align="center" prop="totalInvestment" /> <el-table-column :label="activeName == 'f' ? '总投资(万元)' : '总投资(万元)'" min-width="100" align="center" prop="totalInvestment" />
<el-table-column label="年度投资" align="center" prop="yearInvestment" /> <el-table-column :label="activeName == 'f' ? '年度投资(万元)' : '年度计划投资(万元)'" min-width="150" align="center" prop="yearInvestment" />
<el-table-column label="0-城建项目计划,1-重点项目计划" align="center" prop="planType" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="是否删除" align="center" prop="isDel" />
<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="handleUpdate(scope.row)"
v-hasPermi="['project:projectPlan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:projectPlan:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<!-- 用户导入对话框 -->
<pagination <el-dialog :title="upload.title" :visible.sync="upload.open" width="600px" :close-on-click-modal="false" :key="activeName"
v-show="total>0" :close-on-press-escape="false" append-to-body :custom-class="'proj-plan-import-dlg file-' + upload.files.length">
:total="total" <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :multiple="false"
:page.sync="queryParams.pageNum" :on-change="uploadChange" :action="upload.url + '?updateSupport=' + upload.updateSupport"
:limit.sync="queryParams.pageSize" :disabled="upload.isUploading" :on-remove="uploadChange" :on-progress="handleFileUploadProgress"
@pagination="getList" :on-success="handleFileSuccess" :auto-upload="false" drag>
/> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<!-- 添加或修改项目跟进计划对话框 --> <div class="el-upload__tip text-center" slot="tip">
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <span>仅允许导入xlsxlsx格式文件</span>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
<el-form-item label="项目名称" prop="projectName"> @click="doExport">下载模板</el-link>
<el-input v-model="form.projectName" type="textarea" placeholder="请输入内容" /> </div>
</el-form-item> </el-upload>
<el-form-item label="建设规模及主要建设内容">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<el-form-item label="包抓部门" prop="dept">
<el-input v-model="form.dept" placeholder="请输入包抓部门" />
</el-form-item>
<el-form-item label="开工日期" prop="startDate">
<el-date-picker clearable
v-model="form.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开工日期">
</el-date-picker>
</el-form-item>
<el-form-item label="完工日期" prop="endDate">
<el-date-picker clearable
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择完工日期">
</el-date-picker>
</el-form-item>
<el-form-item label="总投资" prop="totalInvestment">
<el-input v-model="form.totalInvestment" placeholder="请输入总投资" />
</el-form-item>
<el-form-item label="年度投资" prop="yearInvestment">
<el-input v-model="form.yearInvestment" placeholder="请输入年度投资" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="是否删除" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入是否删除" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="upload.open = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listProjectPlan, getProjectPlan, delProjectPlan, addProjectPlan, updateProjectPlan } from "@/api/project/projectPlan"; import { listAll} from "@/api/project/projectPlan.js";
import { getToken } from "@/utils/auth";
export default { export default {
name: "ProjectPlan", name: "ProjectPlan",
data() { data() {
return { return {
activeName: 'f',
showSearch: false,
// //
loading: true, loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// //
projectPlanList: [], projectPlanList: [],
// //
title: "", upload: {
// files: [],
//
open: false, open: false,
// //
queryParams: { title: "",
pageNum: 1, //
pageSize: 10, isUploading: false,
projectName: null, //
content: null, updateSupport: 0,
buildType: null, //
dept: null, headers: { Authorization: "Bearer " + getToken() },
startDate: null, //
endDate: null, url: process.env.VUE_APP_BASE_API ,
totalInvestment: null,
yearInvestment: null,
planType: null,
isDel: null,
}, },
//
form: {},
//
rules: {
}
}; };
}, },
created() { created() {
},
mounted(){
this.getList(); this.getList();
}, },
methods: { methods: {
tabClick() {
this.getList();
},
/** 查询项目跟进计划列表 */ /** 查询项目跟进计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listProjectPlan(this.queryParams).then(response => { listAll(this.activeName=='f'?0:1).then(data => {
this.projectPlanList = response.rows; this.projectPlanList =data.data||[];
this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
// uploadChange(a, b, c) {
cancel() { this.upload.files = b;
this.open = false;
this.reset();
}, },
// submitFileForm() {
reset() { this.$refs.upload.submit();
this.form = {
id: null,
projectName: null,
content: null,
buildType: null,
dept: null,
startDate: null,
endDate: null,
totalInvestment: null,
yearInvestment: null,
planType: null,
remark: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ //
handleQuery() { handleFileUploadProgress(event, file, fileList) {
this.queryParams.pageNum = 1; this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList(); this.getList();
}, },
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { doImport() {
this.reset(); if (this.activeName == 'f') {
this.open = true; this.upload.url = process.env.VUE_APP_BASE_API + "/project/projectPlan/importUrbanPlan";
this.title = "添加项目跟进计划";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProjectPlan(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改项目跟进计划";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProjectPlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else { } else {
addProjectPlan(this.form).then(response => { this.upload.url = process.env.VUE_APP_BASE_API +"/project/projectPlan/importMajorPlan";
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} }
} let name = this.activeName == 'f' ? '城建项目计划' : '重点项目计划';
}); this.upload.title = `${name}_导入`;
}, this.upload.open = true;
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除项目跟进计划编号为"' + ids + '"的数据项?').then(function() {
return delProjectPlan(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { doExport() {
this.download('project/projectPlan/export', { let url = `project/projectPlan/export/${this.activeName == 'f' ? 0 : 1}`;
...this.queryParams let name = this.activeName == 'f' ? '城建项目计划' : '重点项目计划';
}, `projectPlan_${new Date().getTime()}.xlsx`) this.download(url, {}, `${name}_${this.$dt(new Date()).format("YYYYMMDDHHmmss")}.xlsx`)
} }
} }
}; };
</script> </script>
<style lang="scss">
.proj-plan-import-dlg {
.el-upload {
width: 100%;
.el-upload-dragger {
width: 100%;
}
}
&.file-1 {
.el-upload {
display: none;
}
.el-upload__tip {
display: none;
}
}
}
</style>

View File

@ -67,7 +67,7 @@ public class SurProjectPlanController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('project:projectPlan:export')") @PreAuthorize("@ss.hasPermi('project:projectPlan:export')")
@Log(title = "项目跟进计划", businessType = BusinessType.EXPORT) @Log(title = "项目跟进计划", businessType = BusinessType.EXPORT)
@GetMapping("/export/{type}") @PostMapping("/export/{type}")
public void export(HttpServletResponse response,@PathVariable("type") Long type) public void export(HttpServletResponse response,@PathVariable("type") Long type)
{ {
SurProjectPlan where=new SurProjectPlan(); SurProjectPlan where=new SurProjectPlan();

View File

@ -1,7 +1,5 @@
package com.yanzhu.jh.project.domain; package com.yanzhu.jh.project.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -11,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* sur_project_plan * sur_project_plan
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-07 * @date 2023-09-08
*/ */
public class SurProjectPlan extends BaseEntity public class SurProjectPlan extends BaseEntity
{ {
@ -37,14 +35,12 @@ public class SurProjectPlan extends BaseEntity
private String dept; private String dept;
/** 开工日期 */ /** 开工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "开工日期")
@Excel(name = "开工日期", width = 30, dateFormat = "yyyy-MM-dd") private String startDate;
private Date startDate;
/** 完工日期 */ /** 完工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "完工日期")
@Excel(name = "完工日期", width = 30, dateFormat = "yyyy-MM-dd") private String endDate;
private Date endDate;
/** 总投资(万元) */ /** 总投资(万元) */
@Excel(name = "总投资", readConverterExp = "万=元") @Excel(name = "总投资", readConverterExp = "万=元")
@ -107,21 +103,21 @@ public class SurProjectPlan extends BaseEntity
{ {
return dept; return dept;
} }
public void setStartDate(Date startDate) public void setStartDate(String startDate)
{ {
this.startDate = startDate; this.startDate = startDate;
} }
public Date getStartDate() public String getStartDate()
{ {
return startDate; return startDate;
} }
public void setEndDate(Date endDate) public void setEndDate(String endDate)
{ {
this.endDate = endDate; this.endDate = endDate;
} }
public Date getEndDate() public String getEndDate()
{ {
return endDate; return endDate;
} }

View File

@ -70,19 +70,19 @@ public class MajorPlanExport
this.dept = dept; this.dept = dept;
} }
public Date getStartDate() { public String getStartDate() {
return startDate; return startDate;
} }
public void setStartDate(Date startDate) { public void setStartDate(String startDate) {
this.startDate = startDate; this.startDate = startDate;
} }
public Date getEndDate() { public String getEndDate() {
return endDate; return endDate;
} }
public void setEndDate(Date endDate) { public void setEndDate(String endDate) {
this.endDate = endDate; this.endDate = endDate;
} }
@ -121,12 +121,12 @@ public class MajorPlanExport
/** 开工日期 */ /** 开工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开工日期", dateFormat = "yyyy.MM") @Excel(name = "开工日期", dateFormat = "yyyy.MM")
private Date startDate; private String startDate;
/** 完工日期 */ /** 完工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完工日期", dateFormat = "yyyy.MM") @Excel(name = "完工日期", dateFormat = "yyyy.MM")
private Date endDate; private String endDate;
/** 总投资(万元) */ /** 总投资(万元) */
@Excel(name = "总投资(万元)") @Excel(name = "总投资(万元)")

View File

@ -33,12 +33,12 @@ public class UrbanPlanExport {
/** 开工日期 */ /** 开工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开工时限", dateFormat = "yyyy.MM") @Excel(name = "开工时限", dateFormat = "yyyy.MM")
private Date startDate; private String startDate;
/** 完工日期 */ /** 完工日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "建成时限", dateFormat = "yyyy.MM") @Excel(name = "建成时限", dateFormat = "yyyy.MM")
private Date endDate; private String endDate;
/** 总投资(万元) */ /** 总投资(万元) */
@Excel(name = "总投资(万元)") @Excel(name = "总投资(万元)")
@ -102,19 +102,19 @@ public class UrbanPlanExport {
this.dept = dept; this.dept = dept;
} }
public Date getStartDate() { public String getStartDate() {
return startDate; return startDate;
} }
public void setStartDate(Date startDate) { public void setStartDate(String startDate) {
this.startDate = startDate; this.startDate = startDate;
} }
public Date getEndDate() { public String getEndDate() {
return endDate; return endDate;
} }
public void setEndDate(Date endDate) { public void setEndDate(String endDate) {
this.endDate = endDate; this.endDate = endDate;
} }

View File

@ -7,7 +7,7 @@ import com.yanzhu.jh.project.domain.SurProjectPlan;
* Mapper * Mapper
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-07 * @date 2023-09-08
*/ */
public interface SurProjectPlanMapper public interface SurProjectPlanMapper
{ {

View File

@ -34,8 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null and content != ''"> and content = #{content}</if> <if test="content != null and content != ''"> and content = #{content}</if>
<if test="buildType != null and buildType != ''"> and build_type = #{buildType}</if> <if test="buildType != null and buildType != ''"> and build_type = #{buildType}</if>
<if test="dept != null and dept != ''"> and dept = #{dept}</if> <if test="dept != null and dept != ''"> and dept = #{dept}</if>
<if test="startDate != null "> and start_date = #{startDate}</if> <if test="startDate != null and startDate != ''"> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if> <if test="endDate != null and endDate != ''"> and end_date = #{endDate}</if>
<if test="totalInvestment != null "> and total_investment = #{totalInvestment}</if> <if test="totalInvestment != null "> and total_investment = #{totalInvestment}</if>
<if test="yearInvestment != null "> and year_investment = #{yearInvestment}</if> <if test="yearInvestment != null "> and year_investment = #{yearInvestment}</if>
<if test="planType != null "> and plan_type = #{planType}</if> <if test="planType != null "> and plan_type = #{planType}</if>