Browse Source

[feat] 新增:字典新增借方科目:下拉选项为0 银行存款,1 为现金。开户银行:0表示 中行基本户,1表示建行一般户

修改:财务应付框创建收款凭证(销售订单),
修改开户银行,从input输入框改为下拉选项,提供选择。
导出是@excel注解新增@Excel(name = "借方科目", readConverterExp="0=银行存款,1=现金"),修改mapper.xml
插入SQL语句新增字段debitaccount。
新增:收款凭证导出方法excelReceivablesVoucher().
dev
zhangsiqi 3 months ago
parent
commit
f27c124cc1
  1. 66
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java
  2. 40
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java
  5. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java
  6. 14
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java
  7. 60
      ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml
  8. 2
      ruoyi-admin/src/main/resources/templates/financial/receivables/addFinancialReceivables.html
  9. 110
      ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucher.html
  10. 82
      ruoyi-admin/src/main/resources/templates/financial/receivables/addReceivablesVoucherNoSales.html

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

@ -1,11 +1,24 @@
package com.ruoyi.financial.controller; package com.ruoyi.financial.controller;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.ruoyi.financial.domain.FinancialReceivablesRecords; import com.ruoyi.financial.domain.FinancialReceivablesRecords;
import com.ruoyi.financial.service.IFinancialReceivablesRecordsService; import com.ruoyi.financial.service.IFinancialReceivablesRecordsService;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -17,6 +30,12 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
/** /**
* 财务应收账款Controller * 财务应收账款Controller
@ -28,6 +47,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping("/financial/receivables") @RequestMapping("/financial/receivables")
public class FinancialReceivablesController extends BaseController public class FinancialReceivablesController extends BaseController
{ {
private static final String CHARSET_UTF8 = "utf-8";
private String prefix = "financial/receivables"; private String prefix = "financial/receivables";
@Autowired @Autowired
@ -127,6 +147,49 @@ public class FinancialReceivablesController extends BaseController
} }
return prefix + "/addReceivablesVoucher"; return prefix + "/addReceivablesVoucher";
} }
/**导出收款凭证*/
@RequiresPermissions("financial:receivables:export")
@Log(title = "财务应收账款凭证", businessType = BusinessType.EXPORT)
@GetMapping("/excelReceivablesVoucher/{financialReceivablesId}")
public void excelReceivablesVoucher(@PathVariable("financialReceivablesId") Long financialReceivablesId,HttpServletResponse response) throws IOException {
FinancialReceivables financialReceivables = financialReceivablesService.selectFinancialReceivablesById(financialReceivablesId);
// 模版位置
String name = "FinancialReceiptVoucherTemplate.xlsx";
// 设置响应头,指定文件名和文件类型
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("FinancialReceiptVoucher.xlsx", "UTF-8"));
response.setContentType("application/octet-stream");
InputStream inputStream = null;
try {
// 获取模板文件的输入流
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
if (inputStream == null) {
throw new FileNotFoundException("模板文件未找到:" + name);
}
// 创建一个ExcelWriterBuilder对象,并指定输出流和输入流
ExcelWriterBuilder writerBuilder = EasyExcel.write(response.getOutputStream());
// 创建一个WriteSheet对象,并指定模板中的Sheet编号
WriteSheet writeSheet = EasyExcel.writerSheet(0).build();
// 将数据写入Excel文件
writerBuilder.withTemplate(inputStream).sheet("sheet1").doFill(financialReceivables);
} finally {
// 关闭输入流
if (inputStream != null) {
inputStream.close();
}
}
// 刷新输出流
response.flushBuffer();
}
/** /**
* 新增保存销售订单创建收款凭证 * 新增保存销售订单创建收款凭证
@ -241,4 +304,7 @@ public class FinancialReceivablesController extends BaseController
return getDataTable(financialReceivablesRecords); return getDataTable(financialReceivablesRecords);
} }
} }

40
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java

@ -6,10 +6,12 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.financial.domain.VO.FinancialReceivablesRecordsVO; import com.ruoyi.financial.domain.VO.FinancialReceivablesRecordsVO;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/** /**
* 财务应收账款对象 financial_receivables * 财务应收账款对象 financial_receivables
@ -17,6 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author 刘晓旭 * @author 刘晓旭
* @date 2024-05-08 * @date 2024-05-08
*/ */
@Data
public class FinancialReceivables extends BaseEntity public class FinancialReceivables extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -35,6 +38,9 @@ public class FinancialReceivables extends BaseEntity
/** 关联销售订单号 */ /** 关联销售订单号 */
@Excel(name = "关联销售订单号") @Excel(name = "关联销售订单号")
private String salesOrderCode; private String salesOrderCode;
/*借方科目*/
@Excel(name = "借方科目", readConverterExp="0=银行存款,1=现金")
private String debitAccount;
/** 贷方科目 */ /** 贷方科目 */
@Excel(name = "贷方科目") @Excel(name = "贷方科目")
@ -45,7 +51,7 @@ public class FinancialReceivables extends BaseEntity
private String creditDetail; private String creditDetail;
/** 开户银行 */ /** 开户银行 */
@Excel(name = "开户银行") @Excel(name = "开户银行",readConverterExp="0=中行基本户,建行一般户")
private String openBank; private String openBank;
/** 开户账号 */ /** 开户账号 */
@ -113,10 +119,41 @@ public class FinancialReceivables extends BaseEntity
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operatingTime; private Date operatingTime;
/*年*/
private String year;
/*月*/
private String month;
/*日*/
private String day;
/** 收款备注 */ /** 收款备注 */
@Excel(name = "收款备注") @Excel(name = "收款备注")
private String receivablesRemark; private String receivablesRemark;
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
/** 收款记录集合 */ /** 收款记录集合 */
List<FinancialReceivablesRecords> receivablesRecordsList; List<FinancialReceivablesRecords> receivablesRecordsList;
@ -354,7 +391,6 @@ public class FinancialReceivables extends BaseEntity
public void setReceivablesRecordsVOList(List<FinancialReceivablesRecordsVO> receivablesRecordsVOList) { public void setReceivablesRecordsVOList(List<FinancialReceivablesRecordsVO> receivablesRecordsVOList) {
this.receivablesRecordsVOList = receivablesRecordsVOList; this.receivablesRecordsVOList = receivablesRecordsVOList;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

12
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java

@ -51,8 +51,18 @@ public class FinancialReceivablesRecords extends BaseEntity
/** 收款备注 */ /** 收款备注 */
@Excel(name = "收款备注") @Excel(name = "收款备注")
private String receivablesRemark; private String receivablesRemark;
/*获取当前登录的账号*/
private String operatingPerson;
public void setReceivablesRecordsId(Long receivablesRecordsId) public String getOperatingPerson() {
return operatingPerson;
}
public void setOperatingPerson(String operatingPerson) {
this.operatingPerson = operatingPerson;
}
public void setReceivablesRecordsId(Long receivablesRecordsId)
{ {
this.receivablesRecordsId = receivablesRecordsId; this.receivablesRecordsId = receivablesRecordsId;
} }

2
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java

@ -47,3 +47,5 @@ public class FinancialReceivablesRecordsVO extends BaseEntity {
@Excel(name = "收款备注") @Excel(name = "收款备注")
private String receivablesRemark; private String receivablesRemark;
} }

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

@ -1,6 +1,8 @@
package com.ruoyi.financial.service; package com.ruoyi.financial.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.financial.domain.FinancialReceivables; import com.ruoyi.financial.domain.FinancialReceivables;
/** /**
@ -87,4 +89,9 @@ public interface IFinancialReceivablesService
* 销售订单审批完成后根据销售单号生成财务应收账款 * 销售订单审批完成后根据销售单号生成财务应收账款
* */ * */
int generateReceivablesBySalesOrderCode(String salesOrderCode); int generateReceivablesBySalesOrderCode(String salesOrderCode);
/**
* 查询导出收款凭证
*/
Map<String, Object> exportReceivables(FinancialReceivables financialReceivables);
} }

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

@ -4,7 +4,9 @@ import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
@ -198,6 +200,18 @@ public class FinancialReceivablesServiceImpl implements IFinancialReceivablesSer
} }
@Override
public Map<String, Object> exportReceivables(FinancialReceivables financialReceivables) {
//获取应收账款列表
FinancialReceivables financialReceivablesList = financialReceivablesMapper.selectFinancialReceivablesById(financialReceivables.getFinancialReceivablesId());
FinancialReceivablesRecords financialReceivablesRecords = new FinancialReceivablesRecords();
financialReceivablesRecords.setFinancialReceivablesCode(financialReceivablesList.getFinancialReceivablesCode());
//再获取对应应收账款的收款凭证列表
List<FinancialReceivablesRecords> financialReceivablesRecordsList = receivablesRecordsMapper.selectFinancialReceivablesRecordsList(financialReceivablesRecords);
Map<String, Object> map = new HashMap<>();
return map;
}
/** /**
* 删除财务应收账款对象 * 删除财务应收账款对象

60
ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml

@ -5,34 +5,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.financial.mapper.FinancialReceivablesMapper"> <mapper namespace="com.ruoyi.financial.mapper.FinancialReceivablesMapper">
<resultMap type="FinancialReceivables" id="FinancialReceivablesResult"> <resultMap type="FinancialReceivables" id="FinancialReceivablesResult">
<result property="financialReceivablesId" column="financial_receivables_id" /> <result property="financialReceivablesId" column="financial_receivables_id" />
<result property="financialReceivablesCode" column="financial_receivables_code" /> <result property="financialReceivablesCode" column="financial_receivables_code" />
<result property="receivablesClosingStatus" column="receivables_closing_status" /> <result property="receivablesClosingStatus" column="receivables_closing_status" />
<result property="salesOrderCode" column="sales_order_code" /> <result property="salesOrderCode" column="sales_order_code" />
<result property="creditAccount" column="credit_account" /> <result property="debitAccount" column="debit_account" />
<result property="creditDetail" column="credit_detail" /> <result property="creditAccount" column="credit_account" />
<result property="openBank" column="open_bank" /> <result property="creditDetail" column="credit_detail" />
<result property="openAccount" column="open_account" /> <result property="openBank" column="open_bank" />
<result property="customerId" column="customer_id" /> <result property="openAccount" column="open_account" />
<result property="customerName" column="customer_name" /> <result property="customerId" column="customer_id" />
<result property="contractNumber" column="contract_number" /> <result property="customerName" column="customer_name" />
<result property="currencyType" column="currency_type" /> <result property="contractNumber" column="contract_number" />
<result property="priceExcludingTax" column="price_excluding_tax" /> <result property="currencyType" column="currency_type" />
<result property="priceIncludesTax" column="price_includes_tax" /> <result property="priceExcludingTax" column="price_excluding_tax" />
<result property="paymentCondition" column="payment_condition" /> <result property="priceIncludesTax" column="price_includes_tax" />
<result property="receivedIncludesTax" column="received_includes_tax" /> <result property="paymentCondition" column="payment_condition" />
<result property="notReceivedIncludesTax" column="not_received_includes_tax" /> <result property="receivedIncludesTax" column="received_includes_tax" />
<result property="businessMembers" column="business_members" /> <result property="notReceivedIncludesTax" column="not_received_includes_tax" />
<result property="financialDeliverStatus" column="financial_deliver_status" /> <result property="businessMembers" column="business_members" />
<result property="receivablesDate" column="receivables_date" /> <result property="financialDeliverStatus" column="financial_deliver_status" />
<result property="receivablesPrice" column="receivables_price" /> <result property="receivablesDate" column="receivables_date" />
<result property="receivablesAbstract" column="receivables_abstract" /> <result property="receivablesPrice" column="receivables_price" />
<result property="operatingTime" column="operating_time" /> <result property="receivablesAbstract" column="receivables_abstract" />
<result property="receivablesRemark" column="receivables_remark" /> <result property="operatingTime" column="operating_time" />
<result property="createTime" column="create_time" /> <result property="receivablesRemark" column="receivables_remark" />
<result property="createBy" column="create_by" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<sql id="selectFinancialReceivablesVo"> <sql id="selectFinancialReceivablesVo">
@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="financialReceivablesCode != null">financial_receivables_code,</if> <if test="financialReceivablesCode != null">financial_receivables_code,</if>
<if test="receivablesClosingStatus != null">receivables_closing_status,</if> <if test="receivablesClosingStatus != null">receivables_closing_status,</if>
<if test="salesOrderCode != null">sales_order_code,</if> <if test="salesOrderCode != null">sales_order_code,</if>
<if test="creditAccount != null">debit_account,</if>
<if test="creditAccount != null">credit_account,</if> <if test="creditAccount != null">credit_account,</if>
<if test="creditDetail != null">credit_detail,</if> <if test="creditDetail != null">credit_detail,</if>
<if test="openBank != null">open_bank,</if> <if test="openBank != null">open_bank,</if>
@ -99,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="financialReceivablesCode != null">#{financialReceivablesCode},</if> <if test="financialReceivablesCode != null">#{financialReceivablesCode},</if>
<if test="receivablesClosingStatus != null">#{receivablesClosingStatus},</if> <if test="receivablesClosingStatus != null">#{receivablesClosingStatus},</if>
<if test="salesOrderCode != null">#{salesOrderCode},</if> <if test="salesOrderCode != null">#{salesOrderCode},</if>
<if test="creditAccount != null">#{debitAccount},</if>
<if test="creditAccount != null">#{creditAccount},</if> <if test="creditAccount != null">#{creditAccount},</if>
<if test="creditDetail != null">#{creditDetail},</if> <if test="creditDetail != null">#{creditDetail},</if>
<if test="openBank != null">#{openBank},</if> <if test="openBank != null">#{openBank},</if>
@ -132,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="financialReceivablesCode != null">financial_receivables_code = #{financialReceivablesCode},</if> <if test="financialReceivablesCode != null">financial_receivables_code = #{financialReceivablesCode},</if>
<if test="receivablesClosingStatus != null">receivables_closing_status = #{receivablesClosingStatus},</if> <if test="receivablesClosingStatus != null">receivables_closing_status = #{receivablesClosingStatus},</if>
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if> <if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="creditAccount != null">debit_account = #{debitAccount},</if>
<if test="creditAccount != null">credit_account = #{creditAccount},</if> <if test="creditAccount != null">credit_account = #{creditAccount},</if>
<if test="creditDetail != null">credit_detail = #{creditDetail},</if> <if test="creditDetail != null">credit_detail = #{creditDetail},</if>
<if test="openBank != null">open_bank = #{openBank},</if> <if test="openBank != null">open_bank = #{openBank},</if>

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

@ -31,7 +31,7 @@
<input name="openAccount" class="form-control" type="text"> <input name="openAccount" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"><label class="col-sm-3 control-label">币种:</label> <div class="form-group"><label class="col-sm-3 control-label is-required">收款币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}">
<input type="radio" <input type="radio"

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

@ -15,6 +15,15 @@
<input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly> <input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">借方科目:</label>
<div class="col-sm-8">
<select name="debitAccount" th:field="*{debitAccount}" class="form-control" th:with="type=${@dict.getType('receivables_debit_entry')}">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{debitAccount}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收款状态:</label> <label class="col-sm-3 control-label">收款状态:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -44,7 +53,11 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label> <label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="openBank" th:field="*{openBank}" class="form-control" type="text"> <select name="openBank" th:field="*{openBank}" class="form-control" th:with="type=${@dict.getType('receivables_bank')}">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{openBank}"></option>
</select>
<!-- <input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly>-->
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -53,13 +66,13 @@
<input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly> <input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">客户ID:</label> <label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly> <input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">合同编号:</label> <label class="col-sm-3 control-label">合同编号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly> <input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly>
@ -92,6 +105,12 @@
</div> </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="paymentCond" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">发货状态:</label> <label class="col-sm-3 control-label">发货状态:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="financialDeliverStatus" class="form-control m-b" th:with="type=${@dict.getType('financial_deliver_status')}" readonly disabled> <select name="financialDeliverStatus" class="form-control m-b" th:with="type=${@dict.getType('financial_deliver_status')}" readonly disabled>
@ -99,7 +118,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">业务员:</label> <label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly> <input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly>
@ -142,9 +161,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var financialReceivables = [[${financialReceivables}]]; var financialReceivables = [[${financialReceivables}]];
var prefix = ctx + "financial/receivables"; var prefix = ctx + "financial/receivables";
$("#form-receivables-edit").validate({ $("#form-receivables-edit").validate({focusCleanup: true});
focusCleanup: true
});
function submitHandler() { function submitHandler() {
// 获取表单数据 // 获取表单数据
@ -208,35 +225,17 @@
showSearch:false, showSearch:false,
queryParams:queryParams, queryParams:queryParams,
columns: [ columns: [
{ {title: '财务应收账款记录id', field: 'receivablesRecordsId', visible: false},
title: '财务应收账款记录id', {title: '操作时间', field: 'operatingTime',},
field: 'receivablesRecordsId', {title: '摘要', field: 'receivablesAbstract',},
visible: false {title: '收款金额', field: 'receivablesPrice',
},
{
title: '操作时间',
field: 'operatingTime',
},
{
title: '摘要',
field: 'receivablesAbstract',
},
{
title: '收款金额',
field: 'receivablesPrice',
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 格式化收款金额为保留两位小数的字符串 // 格式化收款金额为保留两位小数的字符串
return parseFloat(value).toFixed(2); return parseFloat(value).toFixed(2);
} }
}, },
{ {title: '收款日期', field: 'receivablesDate',},
title: '收款日期', {title: '收款备注', field: 'receivablesRemark',},
field: 'receivablesDate',
},
{
title: '收款备注',
field: 'receivablesRemark',
},
] ]
}; };
$.table.init(options); $.table.init(options);
@ -277,47 +276,22 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false {checkbox: false},
}, {title: '财务应收账款记录id', field: 'receivablesRecordsId', visible: false},
{ {title: '收款日期', field: 'receivablesDate',
title: '财务应收账款记录id', editable : {type: 'date', clear: false, title: '请选择日期:'}
field: 'receivablesRecordsId',
visible: false
},
{
title: '收款日期',
field: 'receivablesDate',
editable : {
type: 'date',
clear: false,
title: '请选择日期:'
}
}, },
{ {title: '收款金额', field: 'receivablesPrice',
title: '收款金额', editable: {type: 'text',},
field: 'receivablesPrice',
editable: {
type: 'text', // 表示该列可以被编辑为文本
},
}, },
{ {title: '收款摘要', field: 'receivablesAbstract',
title: '收款摘要', editable: {type: 'text',},
field: 'receivablesAbstract',
editable: {
type: 'text', // 表示该列可以被编辑为文本
},
}, },
{ {title: '收款备注', field: 'receivablesRemark',
title: '收款备注', editable: {type: 'text', },
field: 'receivablesRemark',
editable: {
type: 'text', // 表示该列可以被编辑为文本
},
}, },
{ {title: '操作', align: 'center',
title: '操作',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> ');

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

@ -15,6 +15,15 @@
<input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly> <input name="financialReceivablesCode" th:field="*{financialReceivablesCode}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">借方科目:</label>
<div class="col-sm-8">
<select name="debitAccount" th:field="*{debitAccount}" class="form-control" th:with="type=${@dict.getType('receivables_debit_entry')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{debitAccount}"></option>
</select>
<!-- <input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly>-->
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收款状态:</label> <label class="col-sm-3 control-label">收款状态:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -38,7 +47,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label> <label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly> <select name="openBank" th:field="*{openBank}" class="form-control" th:with="type=${@dict.getType('receivables_bank')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{openBank}"></option>
</select>
<!-- <input name="openBank" th:field="*{openBank}" class="form-control" type="text" readonly>-->
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -47,7 +59,7 @@
<input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly> <input name="openAccount" th:field="*{openAccount}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">合同编号:</label> <label class="col-sm-3 control-label">合同编号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly> <input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text" readonly>
@ -79,6 +91,12 @@
<input name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text" readonly> <input name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">已收金额:</label>
<div class="col-sm-8">
<input name="remarks" class="form-control" type="text" readonly>
</div>
</div>
</form> </form>
<div class="container"> <div class="container">
<!-- 收款记录 --> <!-- 收款记录 -->
@ -116,10 +134,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var financialReceivables = [[${financialReceivables}]]; var financialReceivables = [[${financialReceivables}]];
var prefix = ctx + "financial/receivables"; var prefix = ctx + "financial/receivables";
$("#form-receivables-edit").validate({ $("#form-receivables-edit").validate({focusCleanup: true});
focusCleanup: true
});
function submitHandler() { function submitHandler() {
// 获取表单数据 // 获取表单数据
const financialReceivablesData = $("#form-receivables-edit").serializeArray().reduce((obj, item) => { const financialReceivablesData = $("#form-receivables-edit").serializeArray().reduce((obj, item) => {
@ -153,20 +168,6 @@
$.operate.saveJson(prefix + "/addReceivablesVoucherNoSales", jsonData); $.operate.saveJson(prefix + "/addReceivablesVoucherNoSales", jsonData);
} }
$("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() { $(function() {
var options = { var options = {
@ -239,31 +240,12 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false {checkbox: false},
}, {title: '财务应收账款记录id', field: 'receivablesRecordsId', visible: false},
{ {title: '收款摘要', field: 'receivablesAbstract', editable: {type: 'text',},},
title: '财务应收账款记录id', {title: '收款金额', field: 'receivablesPrice', editable: {type: 'text',},},
field: 'receivablesRecordsId', {title: '操作', align: 'center',
visible: false
},
{
title: '收款摘要',
field: 'receivablesAbstract',
editable: {
type: 'text', // 表示该列可以被编辑为文本
},
},
{
title: '收款金额',
field: 'receivablesPrice',
editable: {
type: 'text', // 表示该列可以被编辑为文本
},
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.receivablesRecordsId + '\')"><i class="fa fa-remove"></i>删除</a> ');
@ -285,6 +267,16 @@
values: receivablesRecordsId values: receivablesRecordsId
}); });
} }
$("input[name='operatingTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='receivablesDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save