Browse Source

[feat]财务管理:

新增详情功能
新增含有销售订单receivablesVoucherDetail.html详情页面
新增不含有销售订单receivablesVoucherNoSalesDetail.html详情页面
dev
liuxiaoxu 7 months ago
parent
commit
66752e11df
  1. 58
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java
  3. 16
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java
  4. 5
      ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucher.html
  5. 5
      ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucherNoSales.html
  6. 8
      ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html
  7. 207
      ruoyi-admin/src/main/resources/templates/financial/receivables/receivablesVoucherDetail.html
  8. 172
      ruoyi-admin/src/main/resources/templates/financial/receivables/receivablesVoucherNoSalesDetail.html

58
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java

@ -115,7 +115,7 @@ public class FinancialReceivablesController extends BaseController
/**
* 新增销售订单创建收款凭证
* 新增创建收款凭证
*/
@GetMapping("/addReceivablesVoucher/{financialReceivablesId}")
public String addReceivablesVoucher(@PathVariable("financialReceivablesId") Long financialReceivablesId, ModelMap mmap)
@ -128,6 +128,19 @@ public class FinancialReceivablesController extends BaseController
return prefix + "/addReceivablesVoucher";
}
/**
* 新增保存销售订单创建收款凭证
*/
@RequiresPermissions("financial:receivables:addReceivablesVoucher")
@Log(title = "财务应收账款", businessType = BusinessType.UPDATE)
@PostMapping("/addReceivablesVoucher")
@ResponseBody
public AjaxResult addReceivablesVoucherSave(@RequestBody FinancialReceivables financialReceivables)
{
return toAjax(financialReceivablesService.updateFinancialReceivables(financialReceivables));
}
/**
* 新增保存非销售订单创建收款凭证
*/
@ -176,39 +189,44 @@ public class FinancialReceivablesController extends BaseController
return toAjax(financialReceivablesService.closingFinancialReceivablesById(financialReceivablesId));
}
/**
* 删除财务应收账款
* 应收款账单详情
*/
@RequiresPermissions("financial:receivables:remove")
@Log(title = "财务应收账款", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
@GetMapping("/receivablesVoucherDetail/{financialReceivablesId}")
public String receivablesVoucherDetail(@PathVariable("financialReceivablesId") Long financialReceivablesId, ModelMap mmap)
{
return toAjax(financialReceivablesService.deleteFinancialReceivablesByIds(ids));
FinancialReceivables financialReceivables = financialReceivablesService.selectFinancialReceivablesById(financialReceivablesId);
mmap.put("financialReceivables", financialReceivables);
if (financialReceivables.getSalesOrderCode()==null){
return prefix + "/receivablesVoucherNoSalesDetail";
}
return prefix + "/receivablesVoucherDetail";
}
/**
* 作废财务应收账款
* 应收账款详情
*/
@RequiresPermissions("financial:receivables:cancel")
@Log(title = "财务应收账款", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@RequiresPermissions("financial:receivables:receivablesVoucherDetail")
@Log(title = "财务应收账款", businessType = BusinessType.UPDATE)
@PostMapping("/receivablesVoucherDetail")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(financialReceivablesService.cancelFinancialReceivablesById(id));
public AjaxResult receivablesVoucherDetailSave(FinancialReceivables financialReceivables)
{
return toAjax(financialReceivablesService.financialReceivablesDetail(financialReceivables));
}
/**
* 恢复财务应收账款
* 删除财务应收账款
*/
@RequiresPermissions("financial:receivables:restore")
@Log(title = "财务应收账款", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@RequiresPermissions("financial:receivables:remove")
@Log(title = "财务应收账款", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
public AjaxResult remove(String ids)
{
return toAjax(financialReceivablesService.restoreFinancialReceivablesById(id));
return toAjax(financialReceivablesService.deleteFinancialReceivablesByIds(ids));
}
/**

4
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java

@ -78,4 +78,8 @@ public interface IFinancialReceivablesService
* */
int closingFinancialReceivablesById(Long financialReceivablesId);
/*
* 应收账款详情
* */
int financialReceivablesDetail(FinancialReceivables financialReceivables);
}

16
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java

@ -122,6 +122,22 @@ public class FinancialReceivablesServiceImpl implements IFinancialReceivablesSer
return financialReceivablesMapper.updateFinancialReceivables(financialReceivables);
}
/**
* 财务应收账款详情
*
* @param financialReceivables 财务应收账款
* @return 结果
*/
@Transactional
@Override
public int financialReceivablesDetail(FinancialReceivables financialReceivables)
{
return financialReceivablesMapper.updateFinancialReceivables(financialReceivables);
}
/**
* 删除财务应收账款对象
*

5
ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucher.html

@ -134,11 +134,6 @@
<table id="bootstrap-receivablesVoucher-table"></table>
</div>
</div>
<div id="totalReceivablesAmount" class="col-sm-12 d-flex align-items-center mt-3">
<span style="font-family: Arial, sans-serif; font-size: 10px;">收款合计:</span>
<span id="totalAmountDisplay">0.00</span>
</div>
</div>
</div>
<th:block th:include="include :: footer" />

5
ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucherNoSales.html

@ -108,11 +108,6 @@
<table id="bootstrap-receivablesVoucher-table"></table>
</div>
</div>
<div id="totalReceivablesAmount" class="col-sm-12 d-flex align-items-center mt-3">
<span style="font-family: Arial, sans-serif; font-size: 10px;">收款合计:</span>
<span id="totalAmountDisplay">0.00</span>
</div>
</div>
</div>
<th:block th:include="include :: footer" />

8
ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html

@ -102,6 +102,7 @@
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('financial:receivables:edit')}]];
var closingFlag = [[${@permission.hasPermi('financial:receivables:receivablesClosing')}]];
var receivablesVoucherDetailFlag = [[${@permission.hasPermi('financial:receivables:receivablesVoucherDetail')}]];
var addReceivablesVoucherFlag=[[${@permission.hasPermi('financial:receivables:addReceivablesVoucher')}]];
var receivablesClosingStatusDatas = [[${@dict.getType('receivables_closing_status')}]];
var currencyTypeDatas = [[${@dict.getType('sys_common_currency')}]];
@ -224,6 +225,7 @@
if (row.receivablesClosingStatus !== '2') {
actions.push('<a class="btn btn-success btn-xs ' + closingFlag + '" href="javascript:void(0)" onclick="confirmAndClose(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + receivablesVoucherDetailFlag + '" href="javascript:void(0)" onclick="receivablesVoucherDetail(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]
@ -243,6 +245,12 @@
$.modal.open("创建收款凭证",url);
}
//应收款账单详情
function receivablesVoucherDetail(financialReceivablesId){
var url = ctx+'financial/receivables/receivablesVoucherDetail/'+financialReceivablesId;
$.modal.open("应收款账单详情",url);
}
//结案
function confirmAndClose(financialReceivablesId) {
// 使用layer.confirm替代alert,以实现确认功能

207
ruoyi-admin/src/main/resources/templates/financial/receivables/receivablesVoucherDetail.html

@ -0,0 +1,207 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('收款凭据详情(销售订单)')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-receivables-edit" th:object="${financialReceivables}">
<input name="financialReceivablesId" th:field="*{financialReceivablesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">应收单号:</label>
<div class="col-sm-8">
<input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收款状态:</label>
<div class="col-sm-8">
<select name="receivablesClosingStatus" class="form-control m-b" th:with="type=${@dict.getType('receivables_closing_status')}" readonly disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{receivablesClosingStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贷方科目:</label>
<div class="col-sm-8">
<input name="creditAccount" th:field="*{creditAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贷方明细:</label>
<div class="col-sm-8">
<input name="creditDetail" th:field="*{creditDetail}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8">
<input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户账号:</label>
<div class="col-sm-8">
<input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">合同编号:</label>
<div class="col-sm-8">
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8">
<select name="currencyType" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{currencyType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">不含税金额:</label>
<div class="col-sm-8">
<input name="priceExcludingTax" th:field="*{priceExcludingTax}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税金额:</label>
<div class="col-sm-8">
<input name="priceIncludesTax" th:field="*{priceIncludesTax}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">发货状态:</label>
<div class="col-sm-8">
<select name="financialDeliverStatus" class="form-control m-b" th:with="type=${@dict.getType('financial_deliver_status')}" readonly disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{financialDeliverStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly>
</div>
</div>
</form>
<div class="container">
<!-- 收款记录 -->
<div class="row">
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">收款记录</h3>
<table id="bootstrap-receivablesRecords-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var financialReceivables = [[${financialReceivables}]];
var prefix = ctx + "financial/receivables";
$("#form-receivables-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/receivablesVoucherDetail", $('#form-receivables-edit').serialize());
}
}
$("input[name='receivablesDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='operatingTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*根据收款编号对应的收款明细*/
$(function() {
var options = {
id:"bootstrap-receivablesRecords-table",
url: prefix + "/getReceivablesRecords",
modalName: "收款记录",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [
{
title: '财务应收账款记录id',
field: 'receivablesRecordsId',
visible: false
},
{
title: '操作时间',
field: 'operatingTime',
},
{
title: '摘要',
field: 'receivablesAbstract',
},
{
title: '收款金额',
field: 'receivablesPrice',
formatter: function(value, row, index) {
// 格式化收款金额为保留两位小数的字符串
return parseFloat(value).toFixed(2);
}
},
{
title: '收款日期',
field: 'receivablesDate',
},
{
title: '收款备注',
field: 'receivablesRemark',
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
financialReceivablesCode: financialReceivables.financialReceivablesCode
};
return curParams;
}
</script>
</body>
</html>

172
ruoyi-admin/src/main/resources/templates/financial/receivables/receivablesVoucherNoSalesDetail.html

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('创建收款凭据(非销售订单)')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-receivables-edit" th:object="${financialReceivables}">
<input name="financialReceivablesId" th:field="*{financialReceivablesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">应收单号:</label>
<div class="col-sm-8">
<input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收款状态:</label>
<div class="col-sm-8">
<select name="receivablesClosingStatus" class="form-control m-b" th:with="type=${@dict.getType('receivables_closing_status')}" readonly disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{receivablesClosingStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贷方科目:</label>
<div class="col-sm-8">
<input name="creditAccount" th:field="*{creditAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贷方明细:</label>
<div class="col-sm-8">
<input name="creditDetail" th:field="*{creditDetail}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8">
<input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户账号:</label>
<div class="col-sm-8">
<input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">合同编号:</label>
<div class="col-sm-8">
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8">
<select name="currencyType" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{currencyType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">不含税金额:</label>
<div class="col-sm-8">
<input name="priceExcludingTax" th:field="*{priceExcludingTax}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税金额:</label>
<div class="col-sm-8">
<input name="priceIncludesTax" th:field="*{priceIncludesTax}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text" readonly>
</div>
</div>
</form>
<div class="container">
<!-- 收款记录 -->
<div class="row">
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">收款记录</h3>
<table id="bootstrap-receivablesRecords-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var financialReceivables = [[${financialReceivables}]];
var prefix = ctx + "financial/receivables";
$("#form-receivables-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/receivablesVoucherDetail", $('#form-receivables-edit').serialize());
}
}
$("input[name='receivablesDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='operatingTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*根据收款编号对应的收款明细*/
$(function() {
var options = {
id:"bootstrap-receivablesRecords-table",
url: prefix + "/getReceivablesRecords",
modalName: "收款记录",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [
{
title: '财务应收账款记录id',
field: 'receivablesRecordsId',
visible: false
},
{
title: '操作时间',
field: 'operatingTime',
},
{
title: '摘要',
field: 'receivablesAbstract',
},
{
title: '收款金额',
field: 'receivablesPrice',
formatter: function(value, row, index) {
// 格式化收款金额为保留两位小数的字符串
return parseFloat(value).toFixed(2);
}
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
financialReceivablesCode: financialReceivables.financialReceivablesCode
};
return curParams;
}
</script>
</body>
</html>
Loading…
Cancel
Save