Merge remote-tracking branch 'origin/main'

main
liukw 3 months ago
commit 964c34e4b8

@ -0,0 +1,104 @@
package com.ruoyi.server.project_budget_details.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.server.project_budget_details.domain.ProjectBudgetDetails;
import com.ruoyi.server.project_budget_details.service.IProjectBudgetDetailsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2024-07-02
*/
@RestController
@RequestMapping("/system/project_budget_details")
public class ProjectBudgetDetailsController extends BaseController
{
@Autowired
private IProjectBudgetDetailsService projectBudgetDetailsService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:list')")
@GetMapping("/list")
public TableDataInfo list(ProjectBudgetDetails projectBudgetDetails)
{
startPage();
List<ProjectBudgetDetails> list = projectBudgetDetailsService.selectProjectBudgetDetailsList(projectBudgetDetails);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:export')")
@Log(title = "项目预算信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProjectBudgetDetails projectBudgetDetails)
{
List<ProjectBudgetDetails> list = projectBudgetDetailsService.selectProjectBudgetDetailsList(projectBudgetDetails);
ExcelUtil<ProjectBudgetDetails> util = new ExcelUtil<ProjectBudgetDetails>(ProjectBudgetDetails.class);
util.exportExcel(response, list, "项目预算信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(projectBudgetDetailsService.selectProjectBudgetDetailsById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:add')")
@Log(title = "项目预算信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProjectBudgetDetails projectBudgetDetails)
{
return toAjax(projectBudgetDetailsService.insertProjectBudgetDetails(projectBudgetDetails));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:edit')")
@Log(title = "项目预算信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProjectBudgetDetails projectBudgetDetails)
{
return toAjax(projectBudgetDetailsService.updateProjectBudgetDetails(projectBudgetDetails));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:project_budget_details:remove')")
@Log(title = "项目预算信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(projectBudgetDetailsService.deleteProjectBudgetDetailsByIds(ids));
}
}

@ -0,0 +1,117 @@
package com.ruoyi.server.project_budget_details.domain;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* project_budget_details
*
* @author ruoyi
* @date 2024-07-02
*/
public class ProjectBudgetDetails extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 预算ID */
//@Excel(name = "预算ID")
private Long budgetId;
/** 预算名称 */
@Excel(name = "预算名称")
private String budgetName;
/** 支出类别 */
@Excel(name = "支出类别")
private String expenseCategory;
/** 金额 */
@Excel(name = "金额")
private BigDecimal amount;
@TableField(exist = false)
private BigDecimal endTotalBudget ;
@TableField(exist = false)
private BigDecimal startTotalBudget ;
public BigDecimal getEndTotalBudget() {
return endTotalBudget;
}
public void setEndTotalBudget(BigDecimal endTotalBudget) {
this.endTotalBudget = endTotalBudget;
}
public BigDecimal getStartTotalBudget() {
return startTotalBudget;
}
public void setStartTotalBudget(BigDecimal startTotalBudget) {
this.startTotalBudget = startTotalBudget;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setBudgetId(Long budgetId)
{
this.budgetId = budgetId;
}
public Long getBudgetId()
{
return budgetId;
}
public void setBudgetName(String budgetName)
{
this.budgetName = budgetName;
}
public String getBudgetName()
{
return budgetName;
}
public void setExpenseCategory(String expenseCategory)
{
this.expenseCategory = expenseCategory;
}
public String getExpenseCategory()
{
return expenseCategory;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("budgetId", getBudgetId())
.append("budgetName", getBudgetName())
.append("expenseCategory", getExpenseCategory())
.append("amount", getAmount())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.server.project_budget_details.mapper;
import java.util.List;
import com.ruoyi.server.project_budget_details.domain.ProjectBudgetDetails;
/**
* Mapper
*
* @author ruoyi
* @date 2024-07-02
*/
public interface ProjectBudgetDetailsMapper
{
/**
*
*
* @param id
* @return
*/
public ProjectBudgetDetails selectProjectBudgetDetailsById(Long id);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public List<ProjectBudgetDetails> selectProjectBudgetDetailsList(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public int insertProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public int updateProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param id
* @return
*/
public int deleteProjectBudgetDetailsById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteProjectBudgetDetailsByIds(Long[] ids);
}

@ -0,0 +1,61 @@
package com.ruoyi.server.project_budget_details.service;
import java.util.List;
import com.ruoyi.server.project_budget_details.domain.ProjectBudgetDetails;
/**
* Service
*
* @author ruoyi
* @date 2024-07-02
*/
public interface IProjectBudgetDetailsService
{
/**
*
*
* @param id
* @return
*/
public ProjectBudgetDetails selectProjectBudgetDetailsById(Long id);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public List<ProjectBudgetDetails> selectProjectBudgetDetailsList(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public int insertProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param projectBudgetDetails
* @return
*/
public int updateProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails);
/**
*
*
* @param ids
* @return
*/
public int deleteProjectBudgetDetailsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteProjectBudgetDetailsById(Long id);
}

@ -0,0 +1,125 @@
package com.ruoyi.server.project_budget_details.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.server.project_budgets.domain.ProjectBudgets;
import com.ruoyi.server.project_budgets.mapper.ProjectBudgetsMapper;
import com.ruoyi.server.project_proposals.domain.ProjectProposals;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.server.project_budget_details.mapper.ProjectBudgetDetailsMapper;
import com.ruoyi.server.project_budget_details.domain.ProjectBudgetDetails;
import com.ruoyi.server.project_budget_details.service.IProjectBudgetDetailsService;
/**
* Service
*
* @author ruoyi
* @date 2024-07-02
*/
@Service
public class ProjectBudgetDetailsServiceImpl implements IProjectBudgetDetailsService
{
@Autowired
private ProjectBudgetDetailsMapper projectBudgetDetailsMapper;
@Autowired
private ProjectBudgetsMapper projectBudgetsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public ProjectBudgetDetails selectProjectBudgetDetailsById(Long id)
{
return projectBudgetDetailsMapper.selectProjectBudgetDetailsById(id);
}
/**
*
*
* @param projectBudgetDetails
* @return
*/
@Override
public List<ProjectBudgetDetails> selectProjectBudgetDetailsList(ProjectBudgetDetails projectBudgetDetails)
{
return projectBudgetDetailsMapper.selectProjectBudgetDetailsList(projectBudgetDetails);
}
/**
*
*
* @param projectBudgetDetails
* @return
*/
@Override
public int insertProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails)
{
extracted(projectBudgetDetails);
return projectBudgetDetailsMapper.insertProjectBudgetDetails(projectBudgetDetails);
}
private void extracted(ProjectBudgetDetails projectBudgets) {
ProjectBudgets projectBudgets1 = projectBudgetsMapper.selectProjectBudgetsById(projectBudgets.getBudgetId());
if(projectBudgets1!=null){
projectBudgets.setBudgetName(projectBudgets1.getAllocation());
ProjectBudgetDetails budgetDetails=new ProjectBudgetDetails();
budgetDetails.setBudgetId(projectBudgets1.getId());
List<ProjectBudgetDetails> projectBudgetDetails = projectBudgetDetailsMapper.selectProjectBudgetDetailsList(budgetDetails);
if(!projectBudgetDetails.isEmpty()){
// 利用Stream API对amount字段进行汇总
BigDecimal totalAmount = projectBudgetDetails.stream()
.map(ProjectBudgetDetails::getAmount) // 提取每个ProjectBudgetDetails实例中的amount值
.reduce(BigDecimal.ZERO, BigDecimal::add); // 使用reduce操作将所有amount值累加初始值为0
projectBudgets1.setTotalBudget(totalAmount);
projectBudgetsMapper.updateProjectBudgets(projectBudgets1);
}
}
}
/**
*
*
* @param projectBudgetDetails
* @return
*/
@Override
public int updateProjectBudgetDetails(ProjectBudgetDetails projectBudgetDetails)
{
extracted(projectBudgetDetails);
return projectBudgetDetailsMapper.updateProjectBudgetDetails(projectBudgetDetails);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteProjectBudgetDetailsByIds(Long[] ids)
{
return projectBudgetDetailsMapper.deleteProjectBudgetDetailsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteProjectBudgetDetailsById(Long id)
{
return projectBudgetDetailsMapper.deleteProjectBudgetDetailsById(id);
}
}

@ -1,6 +1,8 @@
package com.ruoyi.server.project_budgets.domain;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -17,11 +19,11 @@ public class ProjectBudgets extends BaseEntity
private static final long serialVersionUID = 1L;
/** */
@Excel(name = "")
///@Excel(name = "")
private Long id;
/** 项目id */
@Excel(name = "项目id")
// @Excel(name = "项目id")
private Long projectId;
/** 项目名称 */
@ -36,6 +38,29 @@ public class ProjectBudgets extends BaseEntity
@Excel(name = "预算分配")
private String allocation;
@TableField(exist = false)
private BigDecimal endTotalBudget ;
@TableField(exist = false)
private BigDecimal startTotalBudget ;
public BigDecimal getEndTotalBudget() {
return endTotalBudget;
}
public void setEndTotalBudget(BigDecimal endTotalBudget) {
this.endTotalBudget = endTotalBudget;
}
public BigDecimal getStartTotalBudget() {
return startTotalBudget;
}
public void setStartTotalBudget(BigDecimal startTotalBudget) {
this.startTotalBudget = startTotalBudget;
}
public void setId(Long id)
{
this.id = id;

@ -55,6 +55,7 @@ public class ProjectProposalDetailsController extends BaseController
public void export(HttpServletResponse response, ProjectProposalDetails projectProposalDetails)
{
List<ProjectProposalDetails> list = projectProposalDetailsService.selectProjectProposalDetailsList(projectProposalDetails);
ExcelUtil<ProjectProposalDetails> util = new ExcelUtil<ProjectProposalDetails>(ProjectProposalDetails.class);
util.exportExcel(response, list, "项目立项信息数据");
}

@ -17,11 +17,11 @@ public class ProjectProposalDetails extends BaseEntity
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long id;
/** 立项ID */
@Excel(name = "立项ID")
// @Excel(name = "立项ID")
private Long proposalId;
@Excel(name = "立项名称")

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.server.project_budget_details.mapper.ProjectBudgetDetailsMapper">
<resultMap type="ProjectBudgetDetails" id="ProjectBudgetDetailsResult">
<result property="id" column="id" />
<result property="budgetId" column="budget_id" />
<result property="budgetName" column="budget_name" />
<result property="expenseCategory" column="expense_category" />
<result property="amount" column="amount" />
</resultMap>
<sql id="selectProjectBudgetDetailsVo">
select id, budget_id, budget_name, expense_category, amount from project_budget_details
</sql>
<select id="selectProjectBudgetDetailsList" parameterType="ProjectBudgetDetails" resultMap="ProjectBudgetDetailsResult">
<include refid="selectProjectBudgetDetailsVo"/>
<where>
<if test="budgetId != null "> and budget_id = #{budgetId}</if>
<if test="budgetName != null and budgetName != ''"> and budget_name like concat('%', #{budgetName}, '%')</if>
<if test="expenseCategory != null and expenseCategory != ''"> and expense_category = #{expenseCategory}</if>
<if test="startTotalBudget != null">
AND amount<![CDATA[>=]]> #{startTotalBudget}
</if>
<if test="endTotalBudget != null">
AND amount<![CDATA[<=]]> #{endTotalBudget}
</if>
<!-- <if test="amount != null "> and amount = #{amount}</if>-->
</where>
</select>
<select id="selectProjectBudgetDetailsById" parameterType="Long" resultMap="ProjectBudgetDetailsResult">
<include refid="selectProjectBudgetDetailsVo"/>
where id = #{id}
</select>
<insert id="insertProjectBudgetDetails" parameterType="ProjectBudgetDetails" useGeneratedKeys="true" keyProperty="id">
insert into project_budget_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="budgetId != null">budget_id,</if>
<if test="budgetName != null and budgetName != ''">budget_name,</if>
<if test="expenseCategory != null">expense_category,</if>
<if test="amount != null">amount,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="budgetId != null">#{budgetId},</if>
<if test="budgetName != null and budgetName != ''">#{budgetName},</if>
<if test="expenseCategory != null">#{expenseCategory},</if>
<if test="amount != null">#{amount},</if>
</trim>
</insert>
<update id="updateProjectBudgetDetails" parameterType="ProjectBudgetDetails">
update project_budget_details
<trim prefix="SET" suffixOverrides=",">
<if test="budgetId != null">budget_id = #{budgetId},</if>
<if test="budgetName != null and budgetName != ''">budget_name = #{budgetName},</if>
<if test="expenseCategory != null">expense_category = #{expenseCategory},</if>
<if test="amount != null">amount = #{amount},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProjectBudgetDetailsById" parameterType="Long">
delete from project_budget_details where id = #{id}
</delete>
<delete id="deleteProjectBudgetDetailsByIds" parameterType="String">
delete from project_budget_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -20,9 +20,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectProjectBudgetsVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="params.beginTotalBudget != null and params.beginTotalBudget != '' and params.endTotalBudget != null and params.endTotalBudget != ''"> and total_budget between #{params.beginTotalBudget} and #{params.endTotalBudget}</if>
<if test="allocation != null and allocation != ''"> and allocation = #{allocation}</if>
<if test="projectName != null and projectName != ''">
and project_name like concat('%', #{projectName}, '%')
</if>
<if test="allocation != null and allocation != ''">
and allocation like concat('%', #{allocation}, '%')
</if>
<if test="startTotalBudget != null">
AND total_budget<![CDATA[>=]]> #{startTotalBudget}
</if>
<if test="endTotalBudget != null">
AND total_budget<![CDATA[<=]]> #{endTotalBudget}
</if>
</where>
</select>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询项目预算信息列表
export function listProject_budget_details(query) {
return request({
url: '/system/project_budget_details/list',
method: 'get',
params: query
})
}
// 查询项目预算信息详细
export function getProject_budget_details(id) {
return request({
url: '/system/project_budget_details/' + id,
method: 'get'
})
}
// 新增项目预算信息
export function addProject_budget_details(data) {
return request({
url: '/system/project_budget_details',
method: 'post',
data: data
})
}
// 修改项目预算信息
export function updateProject_budget_details(data) {
return request({
url: '/system/project_budget_details',
method: 'put',
data: data
})
}
// 删除项目预算信息
export function delProject_budget_details(id) {
return request({
url: '/system/project_budget_details/' + id,
method: 'delete'
})
}

@ -0,0 +1,393 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="预算ID" prop="budgetId">
<el-input
v-model="queryParams.budgetId"
placeholder="请输入预算ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="预算名称" prop="budgetName">
<el-input
v-model="queryParams.budgetName"
placeholder="请输入预算名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支出类别" prop="expenseCategory">
<el-select v-model="queryParams.expenseCategory" placeholder="请选择支出类别" clearable>
<el-option
v-for="dict in dict.type.project_budget_details_expense_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="金额" prop="amount">
<el-input
v-model="queryParams.amount"
placeholder="请输入金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<!-- 起始预算输入框 -->
<el-form-item label="起始金额" prop="startTotalBudget">
<el-input
v-model="queryParams.startTotalBudget"
placeholder="请输入起始金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- 结束预算输入框 -->
<el-form-item label="结束金额" prop="endTotalBudget">
<el-input
v-model="queryParams.endTotalBudget"
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-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:project_budget_details: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="['system:project_budget_details: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="['system:project_budget_details: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="['system:project_budget_details:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="project_budget_detailsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="" align="center" prop="id" />-->
<el-table-column label="预算ID" align="center" prop="budgetId" />
<el-table-column label="预算名称" align="center" prop="budgetName" />
<el-table-column label="支出类别" align="center" prop="expenseCategory">
<template slot-scope="scope">
<dict-tag :options="dict.type.project_budget_details_expense_category" :value="scope.row.expenseCategory"/>
</template>
</el-table-column>
<el-table-column label="金额(元)" align="center" prop="amount" >
<template slot-scope="scope">
{{scope.row.amount}}
</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="handleUpdate(scope.row)"
v-hasPermi="['system:project_budget_details:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate1(scope.row)"
v-hasPermi="['system:project_budget_details:edit']"
>查看</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:project_budget_details:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改项目预算信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="预算ID" prop="budgetId">
<el-input v-model="form.budgetId" placeholder="请输入预算ID" />
</el-form-item>-->
<!-- <el-form-item label="预算名称" prop="budgetName">
<el-input v-model="form.budgetName" placeholder="请输入预算名称" />
</el-form-item>-->
<el-form-item label="预算名称" prop="budgetName">
<el-select v-model="form.budgetName" placeholder="请选择预算名称" @change="handleChange">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支出类别" prop="expenseCategory">
<el-select v-model="form.expenseCategory" placeholder="请选择支出类别">
<el-option
v-for="dict in dict.type.project_budget_details_expense_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="金额(元)" prop="amount">
<el-input v-model="form.amount" placeholder="请输入金额" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-show="this.title!='查看项目预算信息'" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProject_budget_details, getProject_budget_details, delProject_budget_details, addProject_budget_details, updateProject_budget_details } from "@/api/system/project_budget_details";
import { listProject_budgets, getProject_budgets, delProject_budgets, addProject_budgets, updateProject_budgets } from "@/api/system/project_budgets";
export default {
name: "Project_budget_details",
dicts: ['project_budget_details_expense_category'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
project_budget_detailsList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
budgetId: null,
budgetName: null,
expenseCategory: null,
startTotalBudget : null,
endTotalBudget : null,
amount: null
},
options: [],
optionsList: [],
getOptionsParamss: {
pageNum: 1,
pageSize: 999999
},
//
form: {},
//
rules: {
budgetId: [
{ required: true, message: "预算ID不能为空", trigger: "blur" }
],
budgetName: [
{ required: true, message: "预算名称不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询项目预算信息列表 */
getList() {
this.loading = true;
listProject_budget_details(this.queryParams).then(response => {
this.project_budget_detailsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
getOptions() {
this.value="";
this.options=[]
listProject_budgets(this.getOptionsParamss).then(response => {
this.optionsList=response.rows
for(let i=0;i<this.optionsList.length;i++){
this.options.push({
value:this.optionsList[i].id,
label:this.optionsList[i].allocation
})
}
});
},
handleChange(value) {
this.form.budgetId=value
console.log(this.form.budgetId)
},
//
reset() {
this.form = {
id: null,
budgetId: null,
budgetName: null,
expenseCategory: null,
amount: null
};
this.resetForm("form");
this. getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
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() {
this. getOptions();
this.reset();
this.open = true;
this.title = "添加项目预算信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this. getOptions();
this.reset();
const id = row.id || this.ids
getProject_budget_details(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改项目预算信息";
});
}, handleUpdate1(row) {
this. getOptions();
this.reset();
const id = row.id || this.ids
getProject_budget_details(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) {
updateProject_budget_details(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProject_budget_details(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除项目预算信息编号为"' + ids + '"的数据项?').then(function() {
return delProject_budget_details(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/project_budget_details/export', {
...this.queryParams
}, `project_budget_details_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -17,13 +17,39 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总预算" prop="totalBudget">
<!-- 起始预算输入框 -->
<el-form-item label="起始预算" prop="startTotalBudget">
<el-input
v-model="queryParams.startTotalBudget"
placeholder="请输入起始预算"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- 结束预算输入框 -->
<el-form-item label="结束预算" prop="endTotalBudget">
<el-input
v-model="queryParams.endTotalBudget"
placeholder="请输入结束预算"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="总预算" prop="totalBudget">
<el-input
v-model="queryParams.totalBudget"
placeholder="请输入总预算"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="项目预算名称" prop="totalBudget">
<el-input
v-model="queryParams.allocation"
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>
@ -42,7 +68,7 @@
v-hasPermi="['system:project_budgets:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -52,7 +78,7 @@
@click="handleUpdate"
v-hasPermi="['system:project_budgets:edit']"
>修改</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
@ -87,7 +113,7 @@
{{scope.row.totalBudget}}
</template>
</el-table-column>
<el-table-column label="预算分配" align="center" prop="allocation" />
<el-table-column label="项目预算名称" align="center" prop="allocation" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -97,6 +123,13 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['system:project_budgets:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate1(scope.row)"
v-hasPermi="['system:project_budgets:edit']"
>查看</el-button>
<el-button
size="mini"
type="text"
@ -129,8 +162,8 @@
</el-form-item>
-->
<el-form-item label="项目名称" prop="courseClassify">
<el-select v-model="form.projectId" placeholder="请选择项目" @change="handleChange">
<el-form-item label="项目名称" prop="projectName">
<el-select v-model="form.projectName" placeholder="请选择项目" @change="handleChange">
<el-option
v-for="item in options"
:key="item.value"
@ -143,12 +176,12 @@
<el-form-item label="总预算" prop="totalBudget">
<el-input v-model="form.totalBudget" placeholder="请输入总预算" />
</el-form-item>
<el-form-item label="预算分配" prop="allocation">
<el-form-item label="项目预算名称" prop="allocation">
<el-input v-model="form.allocation" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" v-show="this.title != '查看项目预算'" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -188,6 +221,8 @@ export default {
projectId: null,
projectName: null,
totalBudget: null,
startTotalBudget : null,
endTotalBudget : null,
allocation: null
},
options: [],
@ -201,9 +236,9 @@ export default {
form: {},
//
rules: {
projectId: [
/* projectId: [
{ required: true, message: "项目id不能为空", trigger: "blur" }
],
],*/
projectName: [
{ required: true, message: "项目名称不能为空", trigger: "blur" }
],
@ -256,6 +291,7 @@ export default {
allocation: null
};
this.resetForm("form");
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
@ -281,17 +317,29 @@ export default {
this.title = "添加项目预算";
},
handleChange(value) {
console.log(value)
this.form.projectId=value
console.log(this.form.projectId)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getOptions();
//this.reset();
const id = row.id || this.ids
getProject_budgets(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改项目预算";
});
}, handleUpdate1(row) {
this.getOptions();
//this.reset();
const id = row.id || this.ids
getProject_budgets(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "查看项目预算";
});
},
/** 提交按钮 */
submitForm() {

@ -45,7 +45,7 @@
v-hasPermi="['system:project_proposal_details:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -55,7 +55,7 @@
@click="handleUpdate"
v-hasPermi="['system:project_proposal_details:edit']"
>修改</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="danger"

@ -52,7 +52,7 @@
v-hasPermi="['system:project_proposals:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -62,7 +62,7 @@
@click="handleUpdate"
v-hasPermi="['system:project_proposals:edit']"
>修改</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
@ -131,8 +131,36 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:project_proposals:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDialog(scope.row)"
v-hasPermi="['system:project_proposals:remove']"
>查看进度</el-button>
<!-- 对话框 -->
<el-dialog
title="项目进度"
:visible.sync="dialogVisible"
width="40%"
@close="handleClose"
>
<!-- <el-steps :active="activeStep">
<el-step title="进行中" description=""></el-step>
<el-step title="规划中" description=""></el-step>
<el-step title="已完成" description=""></el-step>
</el-steps>-->
<el-steps :active="activeStep" finish-status="success">
<el-step title="进行中"></el-step>
<el-step title="规划中"></el-step>
<el-step title="已完成"></el-step>
</el-steps>
</el-dialog>
</template>
</el-table-column>
</el-table>
<pagination
@ -223,6 +251,8 @@ export default {
endDate: null,
status: null
},
dialogVisible: false, //
activeStep: 1, //
//
form: {},
//
@ -246,6 +276,14 @@ export default {
this.loading = false;
});
},
handleClose() {
//
this.dialogVisible = false;
},
handleDialog(row) {
this.dialogVisible = true;
},
//
cancel() {
this.open = false;

Loading…
Cancel
Save