Merge remote-tracking branch 'origin/main'
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,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>
|
@ -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>
|
Loading…
Reference in New Issue