Browse Source

[feat] 编辑公司成本页面新增页面编辑,修改compantCost 为companyCost,新增costYear,costMonth,新增字典sys_month月份。

dev
zhangsiqi 4 months ago
parent
commit
8c2c64609a
  1. 35
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/CompanyCostController.java
  2. 24
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java
  3. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/CompanyCostMapper.java
  4. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/ICompanyCostService.java
  5. 6
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/CompanyCostServiceImpl.java
  6. 69
      ruoyi-admin/src/main/resources/mapper/financial/CompanyCostMapper.xml
  7. 221
      ruoyi-admin/src/main/resources/templates/financial/companyCost/add.html
  8. 33
      ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html
  9. 181
      ruoyi-admin/src/main/resources/templates/financial/companyCost/edit.html

35
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/CompanyCostController.java

@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.financial.domain.CompanyCost;
@ -34,17 +30,17 @@ public class CompanyCostController extends BaseController
@Autowired
private ICompanyCostService companyCostService;
@RequiresPermissions("financial:companCost:view")
@RequiresPermissions("financial:companyCost:view")
@GetMapping()
public String compantCost()
{
return prefix + "/compantCost";
return prefix + "/companyCost";
}
/**
* 查询公司成本列表
*/
@RequiresPermissions("financial:companCost:list")
@RequiresPermissions("financial:companyCost:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(CompanyCost companyCost)
@ -57,7 +53,7 @@ public class CompanyCostController extends BaseController
/**
* 导出公司成本列表
*/
@RequiresPermissions("financial:companCost:export")
@RequiresPermissions("financial:companyCost:export")
@Log(title = "公司成本", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
@ -80,7 +76,7 @@ public class CompanyCostController extends BaseController
/**
* 新增保存公司成本
*/
@RequiresPermissions("financial:companCost:add")
@RequiresPermissions("financial:companyCost:add")
@Log(title = "公司成本", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
@ -103,7 +99,7 @@ public class CompanyCostController extends BaseController
/**
* 修改保存公司成本
*/
@RequiresPermissions("financial:companCost:edit")
@RequiresPermissions("financial:companyCost:edit")
@Log(title = "公司成本", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
@ -115,7 +111,7 @@ public class CompanyCostController extends BaseController
/**
* 删除公司成本
*/
@RequiresPermissions("financial:companCost:remove")
@RequiresPermissions("financial:companyCost:remove")
@Log(title = "公司成本", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
@ -127,7 +123,7 @@ public class CompanyCostController extends BaseController
/**
* 作废公司成本
*/
@RequiresPermissions("financial:companCost:cancel")
@RequiresPermissions("financial:companyCost:cancel")
@Log(title = "公司成本", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
@ -138,7 +134,7 @@ public class CompanyCostController extends BaseController
/**
* 恢复公司成本
*/
@RequiresPermissions("financial:companCost:restore")
@RequiresPermissions("financial:companyCost:restore")
@Log(title = "公司成本", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
@ -146,6 +142,15 @@ public class CompanyCostController extends BaseController
{
return toAjax(companyCostService.restoreCompanyCostById(id));
}
/**
* 恢复公司成本
*/
@RequiresPermissions("financial:companyCost:add")
@PostMapping( "/checkCompanyCostByYearMonth")
@ResponseBody
public Integer checkCompanyCostByYearMonth(CompanyCost companyCost)
{
return companyCostService.checkCompanyByYearMonth(companyCost);
}
}

24
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java

@ -25,11 +25,11 @@ public class CompanyCost extends BaseEntity
/** 年份 */
@Excel(name = "年份")
private Long year;
private Long costYear;
/** 月份 */
@Excel(name = "月份")
private Long month;
private Long costMonth;
/** 经营成本 */
@Excel(name = "经营成本")
@ -101,23 +101,23 @@ public class CompanyCost extends BaseEntity
{
return ctcId;
}
public void setYear(Long year)
public void setCostYear(Long costYear)
{
this.year = year;
this.costYear = costYear;
}
public Long getYear()
public Long getCostYear()
{
return year;
return costYear;
}
public void setMonth(Long month)
public void setCostMonth(Long costMonth)
{
this.month = month;
this.costMonth = costMonth;
}
public Long getMonth()
public Long getCostMonth()
{
return month;
return costMonth;
}
public void setOperatingCosts(Long operatingCosts)
{
@ -242,8 +242,8 @@ public class CompanyCost extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("ctcId", getCtcId())
.append("year", getYear())
.append("month", getMonth())
.append("costYear", getCostYear())
.append("costMonth", getCostMonth())
.append("operatingCosts", getOperatingCosts())
.append("salaryExpenses", getSalaryExpenses())
.append("factoryRentalFees", getFactoryRentalFees())

7
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/CompanyCostMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.financial.mapper;
import java.util.List;
import com.ruoyi.financial.domain.CompanyCost;
import io.swagger.models.auth.In;
/**
* 公司成本Mapper接口
@ -96,4 +97,10 @@ public interface CompanyCostMapper
* @return 结果
*/
public int restoreCompanyCostById(Long id);
/**
* 根据年份和月份查询
* @return
*/
public int checkCompanyByYearMonth(CompanyCost companyCost);
}

7
ruoyi-admin/src/main/java/com/ruoyi/financial/service/ICompanyCostService.java

@ -94,4 +94,11 @@ public interface ICompanyCostService
* @return
*/
int restoreCompanyCostById(Long id);
/**
* 验证年月是否重复
* @return
*/
int checkCompanyByYearMonth(CompanyCost companyCost);
}

6
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/CompanyCostServiceImpl.java

@ -145,4 +145,10 @@ public class CompanyCostServiceImpl implements ICompanyCostService
{
return companyCostMapper.restoreCompanyCostById(id);
}
@Override
public int checkCompanyByYearMonth(CompanyCost companyCost) {
int count = companyCostMapper.checkCompanyByYearMonth(companyCost);
return count > 0 ? 1 : 0;
}
}

69
ruoyi-admin/src/main/resources/mapper/financial/CompanyCostMapper.xml

@ -4,32 +4,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.financial.mapper.CompanyCostMapper">
<resultMap type="CompanyCost" id="CompanyCostResult">
<result property="id" column="id" />
<result property="ctcId" column="ctc_id" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="operatingCosts" column="operating_costs" />
<result property="salaryExpenses" column="salary_expenses" />
<result property="factoryRentalFees" column="factory_rental_fees" />
<result property="taxExpenses" column="tax_expenses" />
<result property="factoryElectricityFees" column="factory_electricity_fees" />
<result property="ohterExpenses" column="ohter_expenses" />
<result property="businessCost" column="business_cost" />
<result property="transportationCosts" column="transportation_costs" />
<result property="promotionExpenses" column="promotion_expenses" />
<result property="packagingCost" column="packaging_cost" />
<result property="businessExpenses" column="business_expenses" />
<result property="afterSalesExpenses" column="after_sales_expenses" />
<result property="businessCommission" column="business_commission" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
<result property="id" column="id" />
<result property="ctcId" column="ctc_id" />
<result property="costYear" column="cost_year" />
<result property="costMonth" column="cost_month" />
<result property="operatingCosts" column="operating_costs" />
<result property="salaryExpenses" column="salary_expenses" />
<result property="factoryRentalFees" column="factory_rental_fees" />
<result property="taxExpenses" column="tax_expenses" />
<result property="factoryElectricityFees" column="factory_electricity_fees" />
<result property="ohterExpenses" column="ohter_expenses" />
<result property="businessCost" column="business_cost" />
<result property="transportationCosts" column="transportation_costs" />
<result property="promotionExpenses" column="promotion_expenses" />
<result property="packagingCost" column="packaging_cost" />
<result property="businessExpenses" column="business_expenses" />
<result property="afterSalesExpenses" column="after_sales_expenses" />
<result property="businessCommission" column="business_commission" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectCompanyCostVo">
select id, ctc_id, year, month, operating_costs, salary_expenses,
select id, ctc_id, cost_year, cost_month, operating_costs, salary_expenses,
factory_rental_fees, tax_expenses, factory_electricity_fees,
ohter_expenses, business_cost, transportation_costs, promotion_expenses,
packaging_cost, business_expenses, after_sales_expenses, business_commission,
@ -41,12 +41,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectCompanyCostVo"/>
<where>
<if test="ctcId != null and ctcId != ''"> and ctc_id = #{ctcId}</if>
<if test="year != null "> and year = #{year}</if>
<if test="month != null "> and month = #{month}</if>
<if test="costYear != null "> and cost_year = #{costYear}</if>
<if test="costMonth != null "> and cost_month = #{costMonth}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
<select id="checkCompanyByYearMonth" parameterType="CompanyCost" resultType="int">
select count(*) from financial_company_cost
where cost_year = #{costYear} and cost_month = #{costMonth}
</select>
<select id="selectCompanyCostById" parameterType="Long" resultMap="CompanyCostResult">
<include refid="selectCompanyCostVo"/>
where id = #{id}
@ -55,13 +58,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectCompanyCostVo"/>
where id = #{id}
</select>
<insert id="insertCompanyCost" parameterType="CompanyCost">
<insert id="insertCompanyCost" parameterType="CompanyCost" useGeneratedKeys="true" keyProperty="id">
insert into financial_company_cost
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="ctcId != null">ctc_id,</if>
<if test="year != null">year,</if>
<if test="month != null">month,</if>
<if test="costYear != null">cost_year,</if>
<if test="costMonth != null">cost_month,</if>
<if test="operatingCosts != null">operating_costs,</if>
<if test="salaryExpenses != null">salary_expenses,</if>
<if test="factoryRentalFees != null">factory_rental_fees,</if>
@ -84,8 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="ctcId != null">#{ctcId},</if>
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="costYear != null">#{costYear},</if>
<if test="costMonth != null">#{costMonth},</if>
<if test="operatingCosts != null">#{operatingCosts},</if>
<if test="salaryExpenses != null">#{salaryExpenses},</if>
<if test="factoryRentalFees != null">#{factoryRentalFees},</if>
@ -111,8 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update financial_company_cost
<trim prefix="SET" suffixOverrides=",">
<if test="ctcId != null">ctc_id = #{ctcId},</if>
<if test="year != null">year = #{year},</if>
<if test="month != null">month = #{month},</if>
<if test="costYear != null">cost_year = #{costYear},</if>
<if test="costMonth != null">cost_month = #{costMonth},</if>
<if test="operatingCosts != null">operating_costs = #{operatingCosts},</if>
<if test="salaryExpenses != null">salary_expenses = #{salaryExpenses},</if>
<if test="factoryRentalFees != null">factory_rental_fees = #{factoryRentalFees},</if>

221
ruoyi-admin/src/main/resources/templates/financial/companyCost/add.html

@ -1,127 +1,202 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增公司成本')" />
<th:block th:include="include :: header('修改公司成本')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-compantCost-add">
<div class="form-group">
<label class="col-sm-3 control-label">公司成本ID:</label>
<div class="col-sm-8">
<input name="ctcId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-companyCost-add">
<div class="container">
<h2><strong>公司成本</strong></h2>
<div class="form-group">
<label class="col-sm-3 control-label">年份:</label>
<div class="col-sm-8">
<input name="year" class="form-control" type="text">
<input id="cost_add_year" name="costYear" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">月份:</label>
<div class="col-sm-8">
<input name="month" class="form-control" type="text">
<select id="cost_add_month" name="costMonth" class="form-control">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
</div>
<div class="container">
<h2><strong>经营成本</strong></h2>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">经营成本:</label>
<div class="col-sm-8">
<input name="operatingCosts" class="form-control" type="text">
<input id="operatingCosts" name="operatingCosts" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group" >
<label class="col-sm-3 control-label">工资费用:</label>
<div class="col-sm-8">
<input name="salaryExpenses" class="form-control" type="text">
<input name="salaryExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">厂租费用:</label>
<div class="col-sm-8">
<input name="factoryRentalFees" class="form-control" type="text">
<input name="factoryRentalFees" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税金费用:</label>
<div class="col-sm-8">
<input name="taxExpenses" class="form-control" type="text">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税金费用:</label>
<div class="col-sm-8">
<input name="taxExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工厂电费:</label>
<div class="col-sm-8">
<input name="factoryElectricityFees" class="form-control" type="text">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工厂电费:</label>
<div class="col-sm-8">
<input name="factoryElectricityFees" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">其他费用:</label>
<div class="col-sm-8">
<input name="ohterExpenses" class="form-control" type="text">
<input name="ohterExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
</div>
<div class="container">
<h2><strong>业务成本</strong></h2>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">业务成本:</label>
<div class="col-sm-8">
<input name="businessCost" class="form-control" type="text">
<input id="businessCost" name="businessCost" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">运输费用:</label>
<div class="col-sm-8">
<input name="transportationCosts" class="form-control" type="text">
<input name="transportationCosts" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">推广费用:</label>
<div class="col-sm-8">
<input name="promotionExpenses" class="form-control" type="text">
<input name="promotionExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">包装费用:</label>
<div class="col-sm-8">
<input name="packagingCost" class="form-control" type="text">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">包装费用:</label>
<div class="col-sm-8">
<input name="packagingCost" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务费用:</label>
<div class="col-sm-8">
<input name="businessExpenses" class="form-control" type="text">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务费用:</label>
<div class="col-sm-8">
<input name="businessExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">售后费用:</label>
<div class="col-sm-8">
<input name="afterSalesExpenses" class="form-control" type="text">
<input name="afterSalesExpenses" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">业务提成:</label>
<div class="col-sm-8">
<input name="businessCommission" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "compantCost/compantCost"
$("#form-compantCost-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-compantCost-add').serialize());
}
<input name="businessCommission" class="form-control" type="number">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "financial/companyCost";
// 获取当前年份
let currentYear = new Date().getFullYear();
// 计算当前世纪
let currentCentury = Math.floor((currentYear - 1) / 100) + 1;
// 计算当前世纪中最大的年份
let maxYearInCurrentCentury = currentCentury * 100;
$.validator.addMethod('validYear', function(value, element) {
return isValidYear(value);
}, '请输入1900至2100之间的四位数年份')
function isValidYear(year) {
// 检查年份是否在合理范围内
return year >= 1900 && year <= maxYearInCurrentCentury;
}
$("#form-companyCost-add").validate({
onkeyup: false,
rules:{
costYear:{
isInteger: true,
validYear: true,
remote: {
url: prefix + "/checkCompanyCostByYearMonth",
type: "post",
dataType: "json",
data: {
"costMonth": $.common.trim($("#cost_add_month").val())
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
},
messages: {
costYear: {
required: "请输入年份",
validYear: "请输入1900至2100之间的四位数年份",
remote: "该年月已存在"
},
},
focusCleanup: true
});
//经营成本的经营成本内容的总和计算
$("#form-companyCost-add").on('keyup', 'input', function () {
let salaryExpenses = parseFloat($("input[name='salaryExpenses']").val()) || 0;
let factoryRentalFees = parseFloat($("input[name='factoryRentalFees']").val()) || 0;
let taxExpenses = parseFloat($("input[name='taxExpenses']").val()) || 0;
let factoryElectricityFees = parseFloat($("input[name='factoryElectricityFees']").val()) || 0;
let ohterExpenses = parseFloat($("input[name='ohterExpenses']").val()) || 0;
$("#operatingCosts").val(salaryExpenses + factoryRentalFees + taxExpenses + factoryElectricityFees + ohterExpenses);
});
//业务成本的业务成本的总和计算
$("#form-companyCost-add").on('keyup', 'input', function () {
let transportationCosts = parseFloat($("input[name='transportationCosts']").val()) || 0;
let promotionExpenses = parseFloat($("input[name='promotionExpenses']").val()) || 0;
let packagingCost = parseFloat($("input[name='packagingCost']").val()) || 0;
let businessExpenses = parseFloat($("input[name='businessExpenses']").val()) || 0;
let afterSalesExpenses = parseFloat($("input[name='afterSalesExpenses']").val()) || 0;
let businessCommission = parseFloat($("input[name='businessCommission']").val()) || 0;
$("#businessCost").val(transportationCosts + promotionExpenses + packagingCost + businessExpenses + afterSalesExpenses + businessCommission);
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-companyCost-add').serialize());
}
</script>
}
</script>
</body>
</html>

33
ruoyi-admin/src/main/resources/templates/financial/companyCost/compantCost.html → ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html

@ -16,11 +16,14 @@
</li>
<li>
<label>年份:</label>
<input type="text" name="year"/>
<input type="number" name="costYear"/>
</li>
<li>
<label>月份:</label>
<input type="text" name="month"/>
<select class="form-control" name="costMonth">
<option value="">请选择</option>
<option th:each="item : ${@dict.getType('sys_month')}" th:text="${item.dictLabel}" th:value="${item.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>录入时间:</label>
@ -38,18 +41,9 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="compantCost:compantCost:add">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="financial:companyCost:add">
<i class="fa fa-plus"></i> 添加
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="compantCost:compantCost:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="compantCost:compantCost:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="compantCost:compantCost:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
@ -58,11 +52,9 @@
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('compantCost:compantCost:edit')}]];
var removeFlag = [[${@permission.hasPermi('compantCost:compantCost:remove')}]];
var cancelFlag = [[${@permission.hasPermi('compantCost:compantCost:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('compantCost:compantCost:restore')}]];
var prefix = ctx + "compantCost/compantCost";
var editFlag = [[${@permission.hasPermi('financial:companyCost:edit')}]];
var removeFlag = [[${@permission.hasPermi('financial:companyCost:remove')}]];
var prefix = ctx + "financial/companyCost";
$(function() {
var options = {
@ -70,16 +62,15 @@
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
detailUrl: prefix + "/detail/{id}",
exportUrl: prefix + "/export",
modalName: "公司成本",
columns: [
{checkbox: true},
{title: '索引', field: 'id', visible: false},
{title: '公司成本ID', field: 'ctcId',},
{title: '年份', field: 'year',},
{title: '月份', field: 'month',},
{title: '年份', field: 'costYear',},
{title: '月份', field: 'costMonth',},
{title: '经营成本', field: 'operatingCosts',},
{title: '工资费用', field: 'salaryExpenses'},
{title: '厂租费用', field: 'factoryRentalFees',visible: false},

181
ruoyi-admin/src/main/resources/templates/financial/companyCost/edit.html

@ -5,122 +5,127 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-compantCost-edit" th:object="${companyCost}">
<form class="form-horizontal m" id="form-companyCost-edit" th:object="${companyCost}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">公司成本ID:</label>
<div class="col-sm-8">
<input name="ctcId" th:field="*{ctcId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">年份:</label>
<div class="col-sm-8">
<input name="year" th:field="*{year}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">月份:</label>
<div class="col-sm-8">
<input name="month" th:field="*{month}" class="form-control" type="text">
<input name="ctcId" th:field="*{ctcId}" class="form-control" type="hidden">
<div class="container">
<div class="form-group">
<label class="col-sm-3 control-label">年份:</label>
<div class="col-sm-8">
<input name="costYear" th:field="*{costYear}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">月份:</label>
<div class="col-sm-8">
<select name="costMonth" th:field="*{costMonth}" class="form-control">
<option th:each="item : ${@dict.getType('sys_month')}" th:text="${item.dictLabel}" th:value="${item.dictValue}" th:field="*{costMonth}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">经营成本:</label>
<div class="col-sm-8">
<input name="operatingCosts" th:field="*{operatingCosts}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工资费用:</label>
<div class="col-sm-8">
<input name="salaryExpenses" th:field="*{salaryExpenses}" class="form-control" type="text">
<div class="container">
<h3>经营成本</h3>
<div class="form-group">
<label class="col-sm-3 control-label">工资费用:</label>
<div class="col-sm-8">
<input name="salaryExpenses" th:field="*{salaryExpenses}" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">厂租费用:</label>
<div class="col-sm-8">
<input name="factoryRentalFees" th:field="*{factoryRentalFees}" class="form-control" type="text">
<div class="form-group">
<label class="col-sm-3 control-label">厂租费用:</label>
<div class="col-sm-8">
<input name="factoryRentalFees" th:field="*{factoryRentalFees}" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税金费用:</label>
<div class="col-sm-8">
<input name="taxExpenses" th:field="*{taxExpenses}" class="form-control" type="text">
<div class="form-group">
<label class="col-sm-3 control-label">税金费用:</label>
<div class="col-sm-8">
<input name="taxExpenses" th:field="*{taxExpenses}" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工厂电费:</label>
<div class="col-sm-8">
<input name="factoryElectricityFees" th:field="*{factoryElectricityFees}" class="form-control" type="text">
<div class="form-group">
<label class="col-sm-3 control-label">工厂电费:</label>
<div class="col-sm-8">
<input name="factoryElectricityFees" th:field="*{factoryElectricityFees}" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">其他费用:</label>
<div class="col-sm-8">
<input name="ohterExpenses" th:field="*{ohterExpenses}" class="form-control" type="text">
<div class="form-group">
<label class="col-sm-3 control-label">其他费用:</label>
<div class="col-sm-8">
<input name="ohterExpenses" th:field="*{ohterExpenses}" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">业务成本:</label>
<div class="col-sm-8">
<input name="businessCost" th:field="*{businessCost}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">运输费用:</label>
<div class="col-sm-8">
<input name="transportationCosts" th:field="*{transportationCosts}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">推广费用:</label>
<div class="col-sm-8">
<input name="promotionExpenses" th:field="*{promotionExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">包装费用:</label>
<div class="col-sm-8">
<input name="packagingCost" th:field="*{packagingCost}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务费用:</label>
<div class="col-sm-8">
<input name="businessExpenses" th:field="*{businessExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后费用:</label>
<div class="col-sm-8">
<input name="afterSalesExpenses" th:field="*{afterSalesExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务提成:</label>
<div class="col-sm-8">
<input name="businessCommission" th:field="*{businessCommission}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
<div class="container">
<h3>业务成本</h3>
<div class="form-group">
<label class="col-sm-3 control-label">运输费用:</label>
<div class="col-sm-8">
<input name="transportationCosts" th:field="*{transportationCosts}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">推广费用:</label>
<div class="col-sm-8">
<input name="promotionExpenses" th:field="*{promotionExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">包装费用:</label>
<div class="col-sm-8">
<input name="packagingCost" th:field="*{packagingCost}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务费用:</label>
<div class="col-sm-8">
<input name="businessExpenses" th:field="*{businessExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后费用:</label>
<div class="col-sm-8">
<input name="afterSalesExpenses" th:field="*{afterSalesExpenses}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务提成:</label>
<div class="col-sm-8">
<input name="businessCommission" th:field="*{businessCommission}" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "compantCost/compantCost";
$("#form-compantCost-edit").validate({
focusCleanup: true
});
var prefix = ctx + "financial/companyCost";
$("#form-companyCost-edit").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-compantCost-edit').serialize());
$.operate.save(prefix + "/edit", $('#form-companyCost-edit').serialize());
}
}
</script>

Loading…
Cancel
Save