Browse Source

[feat]财务管理

修改审核国税发票-国外前端页面,修改formId
国税发票实体类,新增附件Id字段
国税发票Controller新增:上传国税发票弹窗后端接口;新保存上传国税发票后端接口
修改国税发票Mapper.xml文件:新增fileIdStr字段,修改查询方法,修改新增方法和更新方法
新增 上传国税发票后端接口:多表操作增加事务;关联附件文件表和附件文件业务表;关联国税发票历史表
修改国税发票列表前端页面:新增上传发票和审核发票按钮添加上币种条件判断,区分国内外;新增上传发票前端js方法和按钮
新增 上传国税发票-国内前端页面:新增上传附件操作;新增附件前端预览操作,新增附件删除操作
dev
liuxiaoxu 3 months ago
parent
commit
7c190fa3e8
  1. 33
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java
  4. 71
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  5. 6
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml
  6. 4
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html
  7. 113
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html
  8. 426
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRMB.html

33
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java

@ -123,6 +123,39 @@ public class FinancialTaxInvoiceController extends BaseController
} }
/**
* 上传国税发票弹窗页面
*/
@GetMapping("/uploadInvoice/{taxInvoiceId}")
public String uploadInvoice(@PathVariable("taxInvoiceId") Long taxInvoiceId, ModelMap mmap)
{
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceById(taxInvoiceId);
String commonCurrency = taxInvoice.getCommonCurrency();
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(commonCurrency)){
return prefix + "/uploadInvoiceRMB";
}else {
return prefix + "/uploadInvoiceUSD";
}
}
/**
* 上传国税发票
*/
@RequiresPermissions("financial:taxInvoice:uploadInvoice")
@Log(title = "国税发票", businessType = BusinessType.INSERT)
@PostMapping("/uploadInvoice")
@ResponseBody
public AjaxResult uploadInvoiceSave(FinancialTaxInvoice financialTaxInvoice,@RequestParam("taxInvoiceStatus") String taxInvoiceStatus)
{
return toAjax(financialTaxInvoiceService.uploadInvoiceFinancialTaxInvoice(financialTaxInvoice,taxInvoiceStatus));
}
/** /**
* 国税发票物料列表展示 * 国税发票物料列表展示
*/ */

13
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java

@ -177,6 +177,10 @@ public class FinancialTaxInvoice extends BaseEntity
private String delFlag; private String delFlag;
/** 图片上传id */
private String fileIdStr;
/** 国税发票物料集合*/ /** 国税发票物料集合*/
private List<FinancialTaxInvoiceMaterial> invoiceMaterialList; private List<FinancialTaxInvoiceMaterial> invoiceMaterialList;
@ -577,6 +581,15 @@ public class FinancialTaxInvoice extends BaseEntity
this.invoiceMaterialList = invoiceMaterialList; this.invoiceMaterialList = invoiceMaterialList;
} }
public String getFileIdStr() {
return fileIdStr;
}
public void setFileIdStr(String fileIdStr) {
this.fileIdStr = fileIdStr;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

5
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java

@ -92,4 +92,9 @@ public interface IFinancialTaxInvoiceService
* 审核国税发票 * 审核国税发票
*/ */
int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus); int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus);
/**
* 上传国税发票
*/
int uploadInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus);
} }

71
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java

@ -1,6 +1,7 @@
package com.ruoyi.financial.service.impl; package com.ruoyi.financial.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -9,14 +10,18 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import com.ruoyi.system.domain.SysAttach;
import com.ruoyi.system.domain.SysCustomerVo; import com.ruoyi.system.domain.SysCustomerVo;
import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.mapper.SysCustomerMapper; import com.ruoyi.system.mapper.SysCustomerMapper;
import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMapper;
@ -53,6 +58,11 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired
private ISysAttachService attachService;
@Autowired
private ISysAttachFileService attachFileService;
/** /**
* 查询国税发票 * 查询国税发票
@ -291,4 +301,65 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
} }
} }
/**
* 上传国税发票
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int uploadInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus) {
String loginName = ShiroUtils.getLoginName();
String taxInvoiceCode = financialTaxInvoice.getTaxInvoiceCode();
FinancialTaxInvoiceHistory invoiceHistory = invoiceHistoryMapper.selectInvoiceHistoryByInvoiceCode(taxInvoiceCode);
invoiceHistory.setUpdateTime(new Date());
invoiceHistory.setUpdateBy(loginName);
financialTaxInvoice.setUpdateTime(new Date());
financialTaxInvoice.setUpdateBy(loginName);
Long taxInvoiceId = financialTaxInvoice.getTaxInvoiceId();
String fileIdStr = financialTaxInvoice.getFileIdStr();
Long attachId = null;
if (StringUtils.isNotEmpty(fileIdStr)) {
SysAttach tempAttach = new SysAttach();
tempAttach.setSourceType("taxInvoice");
tempAttach.setRelId(taxInvoiceId);
List<SysAttach> sysAttaches = attachService.selectSysAttachList(tempAttach);
if (CollectionUtils.isEmpty(sysAttaches)){
//保存新的文件附件关联
SysAttach sysAttach = new SysAttach();
sysAttach.setSourceType("taxInvoice");
sysAttach.setRelId(taxInvoiceId);
sysAttach.setCreateTime(new Date());
sysAttach.setCreateBy(loginName);
attachService.insertSysAttach(sysAttach);
attachId = sysAttach.getId();
}else {
SysAttach sysAttach = sysAttaches.get(0);
sysAttach.setUpdateBy(loginName);
sysAttach.setUpdateTime(new Date());
attachService.updateSysAttach(sysAttach);
attachId = sysAttach.getId();
}
//更新附件与文件关联
List<String> fileIdList = Arrays.asList(fileIdStr.split(","));
attachFileService.updateAttachIdByIdList(attachId,fileIdList);
}
if ("2".equals(taxInvoiceStatus)) {
//审核通过
invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus);
invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory);
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
} else {
//审核拒绝
invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus);
invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory);
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
}
}
} }

6
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml

@ -53,10 +53,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="fileIdStr" column="fileId_str"/>
</resultMap> </resultMap>
<sql id="selectFinancialTaxInvoiceVo"> <sql id="selectFinancialTaxInvoiceVo">
select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, fileId_str, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice
</sql> </sql>
<select id="selectFinancialTaxInvoiceList" parameterType="FinancialTaxInvoice" resultMap="FinancialTaxInvoiceResult"> <select id="selectFinancialTaxInvoiceList" parameterType="FinancialTaxInvoice" resultMap="FinancialTaxInvoiceResult">
@ -125,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="invoiceData != null">invoice_data,</if> <if test="invoiceData != null">invoice_data,</if>
<if test="invoiceCode != null">invoice_code,</if> <if test="invoiceCode != null">invoice_code,</if>
<if test="invoicePhone != null">invoice_phone,</if> <if test="invoicePhone != null">invoice_phone,</if>
<if test="fileIdStr != null">fileId_str,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -174,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="invoiceData != null">#{invoiceData},</if> <if test="invoiceData != null">#{invoiceData},</if>
<if test="invoiceCode != null">#{invoiceCode},</if> <if test="invoiceCode != null">#{invoiceCode},</if>
<if test="invoicePhone != null">#{invoicePhone},</if> <if test="invoicePhone != null">#{invoicePhone},</if>
<if test="fileIdStr != null">#{fileIdStr},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -227,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="invoiceData != null">invoice_data = #{invoiceData},</if> <if test="invoiceData != null">invoice_data = #{invoiceData},</if>
<if test="invoiceCode != null">invoice_code = #{invoiceCode},</if> <if test="invoiceCode != null">invoice_code = #{invoiceCode},</if>
<if test="invoicePhone != null">invoice_phone = #{invoicePhone},</if> <if test="invoicePhone != null">invoice_phone = #{invoicePhone},</if>
<if test="fileIdStr != null">fileId_str = #{fileIdStr},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>

4
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html

@ -6,7 +6,7 @@
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-auditRmb" th:object="${taxInvoice}"> <form class="form-horizontal m" id="form-taxInvoice-auditUsd" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden"> <input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<div class="form-group"> <div class="form-group">
@ -229,7 +229,7 @@
var taxInvoice = [[${taxInvoice}]]; var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice"; var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({ $("#form-taxInvoice-auditUsd").validate({
focusCleanup: true focusCleanup: true
}); });

113
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html

@ -100,7 +100,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('financial:taxInvoice:edit')}]]; var editFlag = [[${@permission.hasPermi('financial:taxInvoice:edit')}]];
var auditInvoiceFlag = [[${@permission.hasPermi('financial:taxInvoice:auditInvoice')}]]; var auditInvoiceFlag = [[${@permission.hasPermi('financial:taxInvoice:auditInvoice')}]];
var uploadInvoiceFlag = [[${@permission.hasPermi('financial:taxInvoice:uploadInvoice')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]]; var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var salesOrderTypeDatas = [[${@dict.getType('sys_order_type')}]]; var salesOrderTypeDatas = [[${@dict.getType('sys_order_type')}]];
@ -262,9 +262,19 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.taxInvoiceStatus=="0"){ if (row.taxInvoiceStatus=="0" && row.commonCurrency=="1"){
actions.push('<a class="btn btn-success btn-xs ' + auditInvoiceFlag + '" href="javascript:void(0)" onclick="auditInvoice(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>审核</a>'); actions.push('<a class="btn btn-success btn-xs ' + auditInvoiceFlag + '" href="javascript:void(0)" onclick="auditInvoiceRmb(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>审核</a>');
}
if (row.taxInvoiceStatus=="0" && row.commonCurrency=="2"){
actions.push('<a class="btn btn-success btn-xs ' + auditInvoiceFlag + '" href="javascript:void(0)" onclick="auditInvoiceUsd(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>审核</a>');
}
if (row.taxInvoiceStatus=="1" && row.commonCurrency=="1"){
actions.push('<a class="btn btn-success btn-xs ' + uploadInvoiceFlag + '" href="javascript:void(0)" onclick="uploadInvoiceRmb(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>上传发票</a>');
} }
if (row.taxInvoiceStatus=="1" && row.commonCurrency=="2"){
actions.push('<a class="btn btn-success btn-xs ' + uploadInvoiceFlag + '" href="javascript:void(0)" onclick="uploadInvoiceUsd(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>上传发票</a>');
}
return actions.join(''); return actions.join('');
} }
}] }]
@ -275,7 +285,7 @@
//审核页面 //审核页面
function auditInvoice(taxInvoiceId) { function auditInvoiceRmb(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 审核通过', '<i class="fa fa-remove"></i> 审核拒绝', '<i class="fa fa-close"></i> 关闭']; var btn = ['<i class="fa fa-check"></i> 审核通过', '<i class="fa fa-remove"></i> 审核拒绝', '<i class="fa fa-close"></i> 关闭'];
var options = { var options = {
title: '审核发票', title: '审核发票',
@ -306,6 +316,101 @@
$.modal.openOptions(options); $.modal.openOptions(options);
} }
function auditInvoiceUsd(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 审核通过', '<i class="fa fa-remove"></i> 审核拒绝', '<i class="fa fa-close"></i> 关闭'];
var options = {
title: '审核发票',
url: prefix + "/auditInvoice/" + taxInvoiceId,
btn: btn,
yes: function (index, layero) { // 审核通过按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditUsd').serialize();
var taxInvoiceStatus = "1";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 true 表示审核通过
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false
},
btn2: function (index, layero) { // 审核拒绝按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditUsd').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false;
}
};
$.modal.openOptions(options);
}
//上传发票页面
function uploadInvoiceRmb(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 完成开票', '<i class="fa fa-remove"></i> 拒绝开票', '<i class="fa fa-close"></i> 关闭'];
var options = {
title: '审核发票',
url: prefix + "/uploadInvoice/" + taxInvoiceId,
btn: btn,
yes: function (index, layero) { // 审核通过按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-uploadRmb').serialize();
var taxInvoiceStatus = "2";
var url= prefix + "/uploadInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 true 表示审核通过
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false
},
btn2: function (index, layero) { // 审核拒绝按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-uploadRmb').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false;
}
};
$.modal.openOptions(options);
}
function uploadInvoiceUsd(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 完成开票', '<i class="fa fa-remove"></i> 拒绝开票', '<i class="fa fa-close"></i> 关闭'];
var options = {
title: '审核发票',
url: prefix + "/uploadInvoice/" + taxInvoiceId,
btn: btn,
yes: function (index, layero) { // 审核通过按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-uploadUsd').serialize();
var taxInvoiceStatus = "2";
var url= prefix + "/uploadInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 true 表示审核通过
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false
},
btn2: function (index, layero) { // 审核拒绝按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-uploadUsd').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false;
}
};
$.modal.openOptions(options);
}
</script> </script>
</body> </body>
</html> </html>

426
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRMB.html

@ -0,0 +1,426 @@
<!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-fileinput-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-uploadRmb" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<!-- 添加隐藏的输入框 -->
<input id="fileIdStr" th:field="*{fileIdStr}" name="fileIdStr" type="text" hidden>
<div class="form-group">
<label class="col-sm-5 control-label">发票单号:</label>
<div class="col-sm-7">
<input name="taxInvoiceCode" th:field="*{taxInvoiceCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">销售订单编号:</label>
<div class="col-sm-7">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">订单类型:</label>
<div class="col-sm-7">
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">报价币种:</label>
<div class="col-sm-7">
<select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{commonCurrency}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户代码/ID:</label>
<div class="col-sm-7">
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户名称:</label>
<div class="col-sm-7">
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">联系电话:</label>
<div class="col-sm-7">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司地址:</label>
<div class="col-sm-7">
<input name="enterpriseAddress" th:field="*{enterpriseAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司名称:</label>
<div class="col-sm-7">
<input name="invoiceCompanyName" th:field="*{invoiceCompanyName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司税号:</label>
<div class="col-sm-7">
<input name="invoiceCompanyCode" th:field="*{invoiceCompanyCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户行:</label>
<div class="col-sm-7">
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户账号:</label>
<div class="col-sm-7">
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">税率:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required" >发票种类:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}">
<input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}" disabled>
<label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票类型:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}">
<input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}" disabled>
<label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票抬头:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}">
<input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}" disabled>
<label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">邮箱:</label>
<div class="col-sm-7">
<input name="invoiceEmail" th:field="*{invoiceEmail}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">业务备注:</label>
<div class="col-sm-7">
<input name="businessRemark" th:field="*{businessRemark}" class="form-control" type="text" readonly>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票物料</h4>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-material"></table>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票额度</h4>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">不含税总价(RMB):</label>
<div class="col-sm-7">
<input name="noRmbSum" th:field="*{noRmbSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">含税总价(RMB):</label>
<div class="col-sm-7">
<input name="rmbTaxSum" th:field="*{rmbTaxSum}" class="form-control" type="text" id="rmbTaxSumInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">物料数合计:</label>
<div class="col-sm-7">
<input name="materialSum" th:field="*{materialSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">数量合计:</label>
<div class="col-sm-7">
<input name="enterpriseSum" th:field="*{enterpriseSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票额度比例:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text" id="invoiceQuotaRatioInput" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票金额(RMB):</label>
<div class="col-sm-7">
<input name="invoiceAmountRmb" th:field="*{invoiceAmountRmb}" class="form-control" type="text" id="invoiceAmountRmbInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票用途:</label>
<div class="col-sm-7">
<input name="invoicePurpose" th:field="*{invoicePurpose}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">实际开票金额(RMB):</label>
<div class="col-sm-7">
<input name="actualInvoiceAmountRmb" th:field="*{actualInvoiceAmountRmb}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票备注:</label>
<div class="col-sm-7">
<input name="invoiceRemark" th:field="*{invoiceRemark}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">开票日期:</label>
<div class="col-sm-7">
<div class="input-group date">
<input name="invoiceData" th:value="${#dates.format(taxInvoice.invoiceData, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">发票代码:</label>
<div class="col-sm-7">
<input name="invoiceCode" th:field="*{invoiceCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">发票号码:</label>
<div class="col-sm-7">
<input name="invoicePhone" th:field="*{invoicePhone}" class="form-control" type="text">
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">导入发票:</h4>
</div>
<div class="file-loading col-sm-8">
<input class="file-upload" id="singleFile" name="file" type="file">
</div>
</div>
<!-- 用户评价 -->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-4 control-label">导入发票:</label>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script th:inline="javascript">
var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({
focusCleanup: true
});
$("input[name='invoiceData']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//开票物料
$(function() {
var options = {
id: 'bootstrap-table-material',
url: prefix + "/getInvoiceMaterialListByCode",
queryParams: function(params) {
return {
taxInvoiceCode: $("#taxInvoiceCode").val(),
}
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "国税发票物料",
columns: [{
checkbox: true
},
{
title: '国税发票物料ID',
field: 'invoiceMaterialId',
visible: false
},
{
title: '物料编号',
field: 'materialCode',
},
{
title: '物料名称',
field: 'materialName',
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialProcessMethodDatas, value);
}
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料图片',
field: 'materialPhotourl',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料的数量',
field: 'materialNum',
},
{
title: '物料的含税单价(RMB)',
field: 'taxRmb',
},
{
title: '物料的不含税单价(RMB)',
field: 'noTaxRmb',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
$(document).ready(function () {
// 单图上传
$(".file-upload").fileinput({
uploadUrl: ctx + "common/uploadSingleFile",
maxFileCount: 1,
autoReplace: true,
showUpload: false, // 不显示上传按钮
showCaption: false, // 不显示标题
showRemove: true, // 显示移除按钮
browseClass: "btn btn-primary", // 浏览按钮样式
removeClass: "btn btn-danger", // 移除按钮样式
removeIcon: "<i class='fa fa-trash'></i>", // 移除按钮图标
browseLabel: "选择文件", // 浏览按钮文本
removeLabel: "删除", // 移除按钮文本
layoutTemplates: {
main2: "{preview}\n" +
"{remove}\n" +
"{browse}"
}
}).on('filepreupload', function (event, data, previewId, index) {
// 在文件上传前的处理
// 可以在这里设置一些上传前的逻辑
}).on('fileuploaded', function (event, data, previewId, index) {
log.info("data:" + JSON.stringify(data))
var response = data.response;
var attachFileId = response.data.id;
if (response.code === web_status.SUCCESS) {
$('#fileIdStr').val(attachFileId);
$.modal.msgSuccess("上传成功");
} else {
$.modal.alertError(response.msg);
}
}).on('filebatchremoved', function (event, id, index) {
$("#fileIdStr").val('');
});
// 添加清除输入框值的功能
$(".file-upload").on('fileclear', function (event) {
$("#fileIdStr").val('');
});
});
</script>
</body>
</html>
Loading…
Cancel
Save