Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 months ago
parent
commit
b1da36dcbf
  1. 75
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/common/service/ICommonService.java
  3. 42
      ruoyi-admin/src/main/java/com/ruoyi/common/service/impl/CommonServiceImpl.java
  4. 44
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java
  5. 12
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java
  6. 73
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  7. 25
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysAttachFile.java
  8. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysAttachFileMapper.java
  9. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysAttachFileService.java
  10. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysAttachFileServiceImpl.java
  11. 13
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  12. 2
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  13. 20
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml
  14. 15
      ruoyi-admin/src/main/resources/mapper/system/SysAttachFileMapper.xml
  15. 4
      ruoyi-admin/src/main/resources/templates/erp/material/material.html
  16. 0
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmb.html
  17. 0
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmbDetail.html
  18. 0
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsd.html
  19. 2
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsdDetail.html
  20. 334
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/beforeAuditInvoiceRmbDetail.html
  21. 330
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/beforeAuditInvoiceUsdDetail.html
  22. 35
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html
  23. 9
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRmb.html
  24. 193
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRmbDetail.html
  25. 434
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceUsd.html
  26. 529
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceUsdDetail.html

75
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

@ -140,6 +140,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setCreateBy(loginName);
complaintNoticeDetail.setCreateTime(DateUtils.getNowDate());
String makeNo = complaintNoticeDetail.getMakeNo();
int enterpriseSum = 0;
//保存信息到AftersalesComplaintNotice数据表中
complaintNotice.setComplaintNoticeCode(newCode);
complaintNotice.setCreateBy(loginName);
@ -171,10 +172,13 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum());
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
complaintNotice.setEnterpriseSum(enterpriseSum);
}
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
return 1;
}
@ -191,6 +195,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
{
AftersalesComplaintNotice aftersalesComplaintNotice = new AftersalesComplaintNotice();
String loginName = ShiroUtils.getLoginName();
int enterpriseSum = 0;
//更新主表内容
aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode());
aftersalesComplaintNotice.setUpdateBy(loginName);
@ -201,44 +206,48 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
aftersalesComplaintNotice.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
aftersalesComplaintNotice.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
aftersalesComplaintNotice.setClosingProcedures(aftersalesComplaintNoticeDetail.getClosingProcedures());
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
String complaintNoticeCode = aftersalesComplaintNoticeDetail.getComplaintNoticeCode();
List<AftersalesMaterialVO> aftersalesMaterialVOs = aftersalesComplaintNoticeDetail.getAftersalesMaterialVOs();
//如果前面相关物料信息为空
if (StringUtils.isEmpty(aftersalesMaterialVOs)){
//删除子表中的数据
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
return result;
}
//如果有物料信息
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
AftersalesComplaintNoticeDetail complaintNoticeDetail = new AftersalesComplaintNoticeDetail();
complaintNoticeDetail.setComplaintNoticeCode(complaintNoticeCode);
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
complaintNoticeDetail.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
complaintNoticeDetail.setRemark(aftersalesComplaintNoticeDetail.getRemark());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}else{
//如果有物料信息
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
AftersalesComplaintNoticeDetail complaintNoticeDetail = new AftersalesComplaintNoticeDetail();
complaintNoticeDetail.setComplaintNoticeCode(complaintNoticeCode);
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
complaintNoticeDetail.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
complaintNoticeDetail.setRemark(aftersalesComplaintNoticeDetail.getRemark());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
aftersalesComplaintNotice.setEnterpriseSum(enterpriseSum);
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
return 1;
}

5
ruoyi-admin/src/main/java/com/ruoyi/common/service/ICommonService.java

@ -18,4 +18,9 @@ public interface ICommonService {
AjaxResult delete(Long id);
void deleteByIds(List<String> ids);
/**
* 通用不分文件类型的单文件上传请求
*/
AjaxResult uploadSingleAllClassFile(MultipartFile file);
}

42
ruoyi-admin/src/main/java/com/ruoyi/common/service/impl/CommonServiceImpl.java

@ -115,6 +115,48 @@ public class CommonServiceImpl implements ICommonService {
}
}
/**
* 通用不分文件类型的单文件上传请求
*/
@Override
public AjaxResult uploadSingleAllClassFile(MultipartFile file) {
try
{
String loginName = ShiroUtils.getLoginName();
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
String originalFilename = file.getOriginalFilename();
String fileExt = originalFilename.substring(originalFilename.lastIndexOf(".")+1);
Long fileSize = file.getSize();
// 保存文件信息
SysAttachFile sysAttachFile = new SysAttachFile();
sysAttachFile.setName(originalFilename);
sysAttachFile.setUrl(url);
sysAttachFile.setSize(fileSize);
sysAttachFile.setExt(fileExt);
sysAttachFile.setPath(fileName);
sysAttachFile.setCreateBy(loginName);
sysAttachFile.setCreateTime(DateUtils.getNowDate());
attachFileService.insertSysAttachFile(sysAttachFile);
Long attachId = sysAttachFile.getAttachId();
//创建一个ajax结果,这个ajax继承map集合,相当于一个map集合
AjaxResult ajax = new AjaxResult();
ajax.put("url",url);
ajax.put("name", originalFilename);
ajax.put("attachId",attachId);
ajax.put("fileName", fileName);
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
@Override
public AjaxResult delete(Long id) {
SysAttachFile attachFile = attachFileService.selectSysAttachFileById(id);

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

@ -102,9 +102,9 @@ public class FinancialTaxInvoiceController extends BaseController
String commonCurrency = taxInvoice.getCommonCurrency();
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(commonCurrency)){
return prefix + "/auditInvoiceRMB";
return prefix + "/auditInvoiceRmb";
}else {
return prefix + "/auditInvoiceUSD";
return prefix + "/auditInvoiceUsd";
}
}
@ -133,9 +133,9 @@ public class FinancialTaxInvoiceController extends BaseController
String commonCurrency = taxInvoice.getCommonCurrency();
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(commonCurrency)){
return prefix + "/uploadInvoiceRMB";
return prefix + "/uploadInvoiceRmb";
}else {
return prefix + "/uploadInvoiceUSD";
return prefix + "/uploadInvoiceUsd";
}
}
@ -163,9 +163,9 @@ public class FinancialTaxInvoiceController extends BaseController
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceById(taxInvoiceId);
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(taxInvoice.getCommonCurrency())){
return prefix + "/auditInvoiceRMBDetail";
return prefix + "/auditInvoiceRmbDetail";
}else {
return prefix + "/auditInvoiceUSDDetail";
return prefix + "/auditInvoiceUsdDetail";
}
}
@ -190,9 +190,9 @@ public class FinancialTaxInvoiceController extends BaseController
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceWithAttachById(taxInvoiceId);
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(taxInvoice.getCommonCurrency())){
return prefix + "/uploadInvoiceRMBDetail";
return prefix + "/uploadInvoiceRmbDetail";
}else {
return prefix + "/uploadInvoiceUSDDetail";
return prefix + "/uploadInvoiceUsdDetail";
}
}
@ -210,6 +210,34 @@ public class FinancialTaxInvoiceController extends BaseController
}
/**
* 国税发票待审核详情
*/
@GetMapping("/beforeAuditInvoiceDetail/{taxInvoiceId}")
public String beforeAuditInvoiceDetail(@PathVariable("taxInvoiceId") Long taxInvoiceId, ModelMap mmap){
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceById(taxInvoiceId);
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(taxInvoice.getCommonCurrency())){
return prefix + "/beforeAuditInvoiceRmbDetail";
}else {
return prefix + "/beforeAuditInvoiceUsdDetail";
}
}
/**
* 保存国税发票待审核详情
*/
@Log(title = "国税发票", businessType = BusinessType.UPDATE)
@PostMapping("/beforeAuditInvoiceDetail")
@ResponseBody
public AjaxResult beforeAuditInvoiceDetailSave(FinancialTaxInvoice financialTaxInvoice)
{
return toAjax(financialTaxInvoiceService.detailFinancialTaxInvoice(financialTaxInvoice));
}
/**
* 国税发票物料列表展示
*/

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

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.domain.SysAttachFile;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -186,6 +187,9 @@ public class FinancialTaxInvoice extends BaseEntity
/** 国税发票物料集合*/
private List<FinancialTaxInvoiceMaterial> invoiceMaterialList;
private List<SysAttachFile> sysAttachFiles;
public void setTaxInvoiceId(Long taxInvoiceId)
{
this.taxInvoiceId = taxInvoiceId;
@ -600,6 +604,14 @@ public class FinancialTaxInvoice extends BaseEntity
this.photoAttachId = photoAttachId;
}
public List<SysAttachFile> getSysAttachFiles() {
return sysAttachFiles;
}
public void setSysAttachFiles(List<SysAttachFile> sysAttachFiles) {
this.sysAttachFiles = sysAttachFiles;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@ -17,6 +17,7 @@ import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import com.ruoyi.system.domain.SysAttach;
import com.ruoyi.system.domain.SysAttachFile;
import com.ruoyi.system.domain.SysCustomerVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.mapper.SysCustomerMapper;
@ -317,35 +318,50 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setUpdateTime(new Date());
financialTaxInvoice.setUpdateBy(loginName);
Long taxInvoiceId = financialTaxInvoice.getTaxInvoiceId();
//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 (StringUtils.isNotEmpty(fileIdStr)){
//获取业务的id
Long taxInvoiceId = financialTaxInvoice.getTaxInvoiceId();
//根据文件的id拿到在数据库中的那条文件数据
SysAttachFile sysAttachFile = attachFileService.selectSysAttachFileById(Long.valueOf(fileIdStr));
sysAttachFile.setBusinessKey("financialTaxInvoice");
//把文件数据中的业务Id属性赋值
sysAttachFile.setBusinessId(taxInvoiceId);
sysAttachFile.setUpdateBy(loginName);
sysAttachFile.setUpdateTime(new Date());
//更新文件数据库中的这条信息
attachFileService.updateSysAttachFile(sysAttachFile);
}
// 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);
@ -376,7 +392,12 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
*/
@Override
public FinancialTaxInvoice selectFinancialTaxInvoiceWithAttachById(Long taxInvoiceId) {
FinancialTaxInvoice financialTaxInvoice = financialTaxInvoiceMapper.selectFinancialTaxInvoiceWithAttachById(taxInvoiceId);
FinancialTaxInvoice financialTaxInvoice = financialTaxInvoiceMapper.selectFinancialTaxInvoiceById(taxInvoiceId);
Long businessId = taxInvoiceId;
List<SysAttachFile> attachFileList = attachFileService.selectSysAttachFileByBusinessId(businessId);
financialTaxInvoice.setSysAttachFiles(attachFileList);
return financialTaxInvoice;
}
}

25
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysAttachFile.java

@ -45,6 +45,14 @@ public class SysAttachFile extends BaseEntity
@Excel(name = "文件路径")
private String path;
/** 某个业务的Id */
private Long businessId;
/** 某个业务的key */
private String businessKey;
public void setId(Long id)
{
this.id = id;
@ -117,6 +125,23 @@ public class SysAttachFile extends BaseEntity
this.path = path;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public String getBusinessKey() {
return businessKey;
}
public void setBusinessKey(String businessKey) {
this.businessKey = businessKey;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysAttachFileMapper.java

@ -64,4 +64,9 @@ public interface SysAttachFileMapper
List<SysAttachFile> selectListByAttachId(Long attachId);
int updateAttachIdByIdList(@Param("attachId")Long attachId,@Param("idList")List<String> idList);
/**
* 通过业务id查询附件集合
* */
List<SysAttachFile> selectSysAttachFileByBusinessId(Long businessId);
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysAttachFileService.java

@ -65,4 +65,10 @@ public interface ISysAttachFileService
int delFileAndAttachById(Long id);
int updateAttachIdByIdList(Long attachId,List<String> idList);
/**
* 通过业务id查询附件集合
* */
List<SysAttachFile> selectSysAttachFileByBusinessId(Long businessId);
}

9
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysAttachFileServiceImpl.java

@ -127,4 +127,13 @@ public class SysAttachFileServiceImpl implements ISysAttachFileService
public int updateAttachIdByIdList(Long attachId,List<String> idList) {
return sysAttachFileMapper.updateAttachIdByIdList(attachId,idList);
}
/**
* 通过业务id查询附件集合
* */
@Override
public List<SysAttachFile> selectSysAttachFileByBusinessId(Long businessId) {
return sysAttachFileMapper.selectSysAttachFileByBusinessId(businessId);
}
}

13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@ -106,6 +106,19 @@ public class CommonController
return ajaxResult;
}
/**
* 通用不分文件类型的单文件上传请求
*/
@PostMapping("/uploadSingleAllClassFile")
@ResponseBody
public AjaxResult uploadSingleAllClassFile(@RequestParam("file") MultipartFile file) throws Exception
{
AjaxResult ajaxResult = commonService.uploadSingleAllClassFile(file);
return ajaxResult;
}
/**
* 删除文件
*/

2
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierId != null and supplierId != ''"> and erp.supplier_id = #{supplierId}</if>
<if test="businessMembers != null and businessMembers != ''"> and erp.business_members = #{businessMembers}</if>
</where>
order by erp.create_time desc
order by erp.audit_status asc, erp.create_time desc
</select>
<select id="selectErpMaterialById" parameterType="Long" resultMap="ErpMaterialResult">

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

@ -55,8 +55,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" />
<result property="fileIdStr" column="fileId_str"/>
<result property="photoAttachId" column="photo_attach_id"/>
<!-- <collection property="sysAttachFiles" column="business_id" ofType="com.ruoyi.system.domain.SysAttachFile" resultMap="SysAttachFileResult"/>-->
</resultMap>
<!-- <resultMap type="com.ruoyi.system.domain.SysAttachFile" id="SysAttachFileResult">-->
<!-- <result property="id" column="id" />-->
<!-- <result property="delFlag" column="del_flag" />-->
<!-- <result property="createBy" column="create_by" />-->
<!-- <result property="createTime" column="create_time" />-->
<!-- <result property="updateBy" column="update_by" />-->
<!-- <result property="updateTime" column="update_time" />-->
<!-- <result property="remark" column="remark" />-->
<!-- <result property="attachId" column="attach_id" />-->
<!-- <result property="name" column="name" />-->
<!-- <result property="ext" column="ext" />-->
<!-- <result property="size" column="size" />-->
<!-- <result property="url" column="url" />-->
<!-- <result property="path" column="path" />-->
<!-- <result property="businessId" column="business_id"/>-->
<!-- <result property="businessKey" column="business_key"/>-->
<!-- </resultMap>-->
<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, fileId_str, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice
</sql>

15
ruoyi-admin/src/main/resources/mapper/system/SysAttachFileMapper.xml

@ -18,10 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="size" column="size" />
<result property="url" column="url" />
<result property="path" column="path" />
<result property="businessId" column="business_id"/>
<result property="businessKey" column="business_key"/>
</resultMap>
<sql id="selectSysAttachFileVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, attach_id, name, ext, size, url,path from sys_attach_file
select id, del_flag, create_by, create_time, update_by, update_time, remark, attach_id, name, ext, size, url,path, business_id, business_key from sys_attach_file
</sql>
<select id="selectSysAttachFileList" parameterType="SysAttachFile" resultMap="SysAttachFileResult">
@ -44,6 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where attach_id = #{attachId}
</select>
<select id="selectSysAttachFileByBusinessId" parameterType="Long" resultMap="SysAttachFileResult">
<include refid="selectSysAttachFileVo"/>
where business_id = #{businessId}
</select>
<insert id="insertSysAttachFile" parameterType="SysAttachFile" useGeneratedKeys="true" keyProperty="id">
insert into sys_attach_file
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -59,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="size != null ">size,</if>
<if test="url != null and url != ''">url,</if>
<if test="path != null and path != ''">path,</if>
<if test="businessId != null ">business_id,</if>
<if test="businessKey != null ">business_key,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
@ -73,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="size != null ">#{size},</if>
<if test="url != null and url != ''">#{url},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="businessId != null ">#{businessId},</if>
<if test="businessKey != null ">#{businessKey},</if>
</trim>
</insert>
@ -91,6 +102,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="size != null ">size = #{size},</if>
<if test="url != null and url != ''">url = #{url},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="businessId != null ">business_id = #{businessId},</if>
<if test="businessKey != null ">business_key = #{businessKey},</if>
</trim>
where id = #{id}
</update>

4
ruoyi-admin/src/main/resources/templates/erp/material/material.html

@ -126,6 +126,8 @@
pageList: [10, 25, 50],
pageSize: 10,
showColumns: true,
sortable: true, // 是否启用排序
sortStable: true,
modalName: "物料信息",
fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, // 冻结右列个数
@ -151,7 +153,7 @@
{title: '<span style="color: red;">申请人</span>',field: 'applyUserName',
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';}
},
{title: '申请时间',field: 'applyTime',},
{title: '申请时间',field: 'applyTime',sortable: true,},
{title: '上次更新时间',field: 'updateTime',},
{title: '当前状态',field: 'taskName',align: 'center',
formatter: function(value, row, index) {

0
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmb.html

0
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMBDetail.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmbDetail.html

0
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsd.html

2
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSDDetail.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsdDetail.html

@ -236,7 +236,7 @@
function submitHandler() {
$.operate.save(prefix + "/auditInvoiceDetail", $('#form-taxInvoice-form-taxInvoice-auditUsdDetail').serialize());
$.operate.save(prefix + "/auditInvoiceDetail", $('#form-taxInvoice-auditUsdDetail').serialize());
}

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

@ -0,0 +1,334 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-beforeAuditUsdDetail" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="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>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-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-beforeAuditUsdDetail").validate({
focusCleanup: true
});
function submitHandler() {
$.operate.save(prefix + "/beforeAuditInvoiceDetail", $('#form-taxInvoice-beforeAuditUsdDetail').serialize());
}
//开票物料
$(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);
});
</script>
</body>
</html>

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

@ -0,0 +1,330 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-auditUsdDetail" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="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">不含税总价(美元):</label>
<div class="col-sm-7">
<input name="noUsdSum" th:field="*{noUsdSum}" 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="usdTaxSum" th:field="*{usdTaxSum}" class="form-control" type="text" id="usdTaxSumInput" 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">开票金额(美元):</label>
<div class="col-sm-7">
<input name="invoiceAmountUsd" th:field="*{invoiceAmountUsd}" class="form-control" type="text" id="invoiceAmountUsdInput" 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>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-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-auditUsdDetail").validate({
focusCleanup: true
});
function submitHandler() {
$.operate.save(prefix + "/auditInvoiceDetail", $('#form-taxInvoice-auditUsdDetail').serialize());
}
//开票物料
$(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: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
</script>
</body>
</html>

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

@ -261,23 +261,40 @@
align: 'center',
formatter: function(value, row, index) {
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"){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="beforeAuditInvoiceDetail(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>详情</a>');
}
if (row.taxInvoiceStatus=="0" && row.commonCurrency=="1"){
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>');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="auditInvoiceDetail(\'' + 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>');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="auditInvoiceDetail(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>详情</a>');
}
//审核详情
if (row.taxInvoiceStatus=="1"){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="auditInvoiceDetail(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>详情</a>');
}
// if (row.taxInvoiceStatus=="1" ){
// actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="auditInvoiceDetail(\'' + 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>');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="uploadInvoiceDetail(\'' + 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>');
}
//上传发票详情
if (row.taxInvoiceStatus=="2" ){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="uploadInvoiceDetail(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>详情</a>');
}
return actions.join('');
}
}]
@ -285,6 +302,12 @@
$.table.init(options);
});
//待审核页面详情
function beforeAuditInvoiceDetail(taxInvoiceId){
var url = prefix + "/beforeAuditInvoiceDetail/" + taxInvoiceId;
$.modal.open("详情",url);
}
//审核页面详情
@ -416,7 +439,7 @@
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-uploadUsd').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
var url= prefix + "/uploadInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格

9
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRMB.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRmb.html

@ -273,7 +273,7 @@
var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({
$("#form-taxInvoice-uploadRmb").validate({
focusCleanup: true
});
@ -380,6 +380,8 @@
uploadUrl: ctx + "common/uploadSingleFile",
maxFileCount: 1,
autoReplace: true,
allowedFileExtensions: ['bmp', 'gif', 'jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'txt', 'text', 'rar', 'zip', 'gz', 'bz2', 'pdf', 'bpmn', 'bar', 'db'],
previewFileType: ['image', 'txt', 'text', 'pdf', 'bpmn', 'bar', 'db',"doc","docx"],
showUpload: false, // 不显示上传按钮
showCaption: false, // 不显示标题
showRemove: true, // 显示移除按钮
@ -398,8 +400,9 @@
// 可以在这里设置一些上传前的逻辑
}).on('fileuploaded', function (event, data, previewId, index) {
log.info("data:" + JSON.stringify(data))
var response = data.response;
var response = data.response;
// var rsp = data.response;
// document.getElementById('attachFileId').value = rsp.attachFileId;
var attachFileId = response.data.id;
if (response.code === web_status.SUCCESS) {
$('#fileIdStr').val(attachFileId);

193
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRMBDetail.html → ruoyi-admin/src/main/resources/templates/financial/taxInvoice/uploadInvoiceRmbDetail.html

@ -7,10 +7,10 @@
</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}">
<form class="form-horizontal m" id="form-taxInvoice-uploadRmbDetail" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<!-- 添加隐藏的输入框 -->
<input id="fileIdStr" th:field="*{fileIdStr}" name="fileIdStr" type="text" hidden>
<input id="fileIdStr" name="fileIdStr" type="text" hidden>
<div class="form-group">
<label class="col-sm-5 control-label">发票单号:</label>
<div class="col-sm-7">
@ -251,7 +251,6 @@
</div>
<div class="file-loading col-sm-8">
<input class="file-upload" id="singleFile" name="file" type="file">
<input id="photoAttachId" readonly name = "photoAttachId" hidden th:field="*{photoAttachId}">
</div>
</div>
<!-- 用户评价 -->
@ -274,7 +273,7 @@
var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({
$("#form-taxInvoice-uploadRmbDetail").validate({
focusCleanup: true
});
@ -284,6 +283,108 @@
autoclose: true
});
function submitHandler() {
$.operate.save(prefix + "/uploadInvoiceDetail", $('#form-taxInvoice-uploadRmbDetail').serialize());
}
$(document).ready(function () {
var initialPreview = [];
var initialPreviewConfig = [];
var initialPreviewFileType = [];
var sysAttachFiles = taxInvoice.sysAttachFiles || []; // 确保 sysAttachFiles 是一个数组
// 遍历 sysAttachFiles 并构建 initialPreview 和 initialPreviewConfig
if (sysAttachFiles.length > 0) {
for (var i = 0; i < sysAttachFiles.length; i++) {
var sysAttachFile = sysAttachFiles[i];
if (sysAttachFile) {
var delSysAttachFile = generFilDel(sysAttachFile);
initialPreview.push(sysAttachFile.url);
initialPreviewConfig.push(delSysAttachFile);
}
}
}
// 单图上传
$("#singleFile").fileinput({
uploadUrl: ctx + "common/uploadSingleFile",
dropZoneTitle: '可以将文件拖放到这里,支持文件上传',
language: 'zh',
allowedFileExtensions: ['bmp', 'gif', 'jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'txt', 'text', 'rar', 'zip', 'gz', 'bz2', 'pdf', 'bpmn', 'bar', 'db'],
showPreview: true, // 是否显示预览
showCaption: false, // 是否显示标题
fileSizeGetter: true,
previewFileType: ['image', 'txt', 'text','pdf'],
validateInitialCount: true,
preferIconicPreview: true, // 这将强制缩略图按照以下文件扩展名的图标显示
maxFileCount: 1,
autoReplace: true, // 自动替换
initialPreview: initialPreview,
initialPreviewConfig: initialPreviewConfig,
initialPreviewFileType: initialPreviewFileType,
initialPreviewAsData: true, // 默认为数据
}).on('filebatchselected', function (event, data, previewId, index) {
// 当文件被选中时,开始上传
$(this).fileinput("upload");
}).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('');
});
// 生成文件删除配置
function generFilDel(file) {
if (file) {
var type = file.url.substr(file.url.lastIndexOf('.') + 1);
return {
type: getTypeByExtension(type),
size: file.size,
caption: file.name,
url: prefix + "/deletePic",
key: file.id,
downloadUrl: file.url
};
}
}
// 根据文件扩展名获取文件类型
function getTypeByExtension(extension) {
switch (extension) {
case 'pdf':
return "pdf";
case 'text':
return "text";
case 'mp4':
return {type: "video", filetype: "video/mp4"};
case 'txt':
return "txt";
case 'db':
return "db";
default:
return "";
}
}
});
//开票物料
$(function() {
var options = {
@ -375,95 +476,11 @@
});
$(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('');
});
// 绑定详情按钮点击事件
var photoAttachId = $('#photoAttachId').val();
if (photoAttachId) {
$.ajax({
type: "GET",
url: ctx + "system/attach/file/getListByAttachId",
data: {attachId: photoAttachId},
cache: false,
async: false, // 设置成同步
dataType: 'json',
success: function (result) {
if (result.code === web_status.SUCCESS) {
var fileList = result.data.map(function (item) {
return {
caption: item.name,
url: item.url,
key: item.id,
extra: {
attachFileId: item.id,
isBind: true
}
};
});
// 清除现有的文件信息
$(".file-upload").fileinput("clear");
// 使用获取的文件信息初始化文件上传组件
$(".file-upload").fileinput("batchAdd", fileList);
$.modal.msgSuccess("文件信息加载成功");
} else {
$.modal.alertError(result.msg);
}
},
error: function (error) {
$.modal.msgError("获取附件失败。");
}
});
} else {
$.modal.msgError("没有文件信息可以显示。");
}
});
// var attachId = $("#photoAttachId").val();
// var fileIdList=[];

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

@ -0,0 +1,434 @@
<!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-uploadUsd" 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="actualInvoiceAmountUsd" th:field="*{actualInvoiceAmountUsd}" 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-uploadUsd").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: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{
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,
allowedFileExtensions: ['bmp', 'gif', 'jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'txt', 'text', 'rar', 'zip', 'gz', 'bz2', 'pdf', 'bpmn', 'bar', 'db'],
previewFileType: ['image', 'txt', 'text', 'pdf', 'bpmn', 'bar', 'db',"doc","docx"],
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 rsp = data.response;
// document.getElementById('attachFileId').value = rsp.attachFileId;
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>

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

@ -0,0 +1,529 @@
<!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-uploadUsdDetail" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<!-- 添加隐藏的输入框 -->
<input id="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">不含税总价(美元):</label>
<div class="col-sm-7">
<input name="noUsdSum" th:field="*{noUsdSum}" 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="usdTaxSum" th:field="*{usdTaxSum}" class="form-control" type="text" id="usdTaxSumInput" 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">开票金额(美元):</label>
<div class="col-sm-7">
<input name="invoiceAmountUsd" th:field="*{invoiceAmountUsd}" class="form-control" type="text" id="invoiceAmountUsdInput" 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 readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">实际开票金额(美元):</label>
<div class="col-sm-7">
<input name="actualInvoiceAmountUsd" th:field="*{actualInvoiceAmountUsd}" class="form-control" type="text" required readonly>
</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" readonly>
</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" readonly>
<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" readonly>
</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" readonly>
</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-uploadUsdDetail").validate({
focusCleanup: true
});
$("input[name='invoiceData']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
$.operate.save(prefix + "/uploadInvoiceDetail", $('#form-taxInvoice-uploadUsdDetail').serialize());
}
//开票物料
$(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: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
$(document).ready(function () {
var initialPreview = [];
var initialPreviewConfig = [];
var initialPreviewFileType = [];
var sysAttachFiles = taxInvoice.sysAttachFiles || []; // 确保 sysAttachFiles 是一个数组
// 遍历 sysAttachFiles 并构建 initialPreview 和 initialPreviewConfig
if (sysAttachFiles.length > 0) {
for (var i = 0; i < sysAttachFiles.length; i++) {
var sysAttachFile = sysAttachFiles[i];
if (sysAttachFile) {
var delSysAttachFile = generFilDel(sysAttachFile);
initialPreview.push(sysAttachFile.url);
initialPreviewConfig.push(delSysAttachFile);
}
}
}
// 单图上传
$("#singleFile").fileinput({
uploadUrl: ctx + "common/uploadSingleFile",
dropZoneTitle: '可以将文件拖放到这里,支持文件上传',
language: 'zh',
allowedFileExtensions: ['bmp', 'gif', 'jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'txt', 'text', 'rar', 'zip', 'gz', 'bz2', 'pdf', 'bpmn', 'bar', 'db'],
showPreview: true, // 是否显示预览
fileSizeGetter: true,
previewFileType: ['image', 'txt', 'text','pdf'],
validateInitialCount: true,
preferIconicPreview: true, // 这将强制缩略图按照以下文件扩展名的图标显示
maxFileCount: 1,
autoReplace: true, // 自动替换
showUpload: false, // 不显示上传按钮
showCaption: false, // 不显示标题
showRemove: false, // 显示移除按钮
initialPreview: initialPreview,
initialPreviewConfig: initialPreviewConfig,
initialPreviewFileType: initialPreviewFileType,
initialPreviewAsData: true, // 默认为数据
}).on('filebatchselected', function (event, data, previewId, index) {
// 当文件被选中时,开始上传
$(this).fileinput("upload");
}).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('');
});
// 生成文件删除配置
function generFilDel(file) {
if (file) {
var type = file.url.substr(file.url.lastIndexOf('.') + 1);
return {
type: getTypeByExtension(type),
size: file.size,
caption: file.name,
url: prefix + "/deletePic",
key: file.id,
downloadUrl: file.url
};
}
}
// 根据文件扩展名获取文件类型
function getTypeByExtension(extension) {
switch (extension) {
case 'pdf':
return "pdf";
case 'text':
return "text";
case 'mp4':
return {type: "video", filetype: "video/mp4"};
case 'txt':
return "txt";
case 'db':
return "db";
default:
return "";
}
}
});
// var attachId = $("#photoAttachId").val();
// var fileIdList=[];
// var fileList=[];
// if(attachId){
// $.ajax({
// type: "get",
// url: ctx + "system/attach/file/getListByAttachId",
// data: {attachId:attachId},
// cache: false,
// async: false, // 设置成同步
// dataType: 'json',
// success: function(result) {
// if (result.code == web_status.SUCCESS) {
// result.data.forEach((item) => {
// fileIdList.push(item.id);
// fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true});
// });
// } else {
// $.modal.msgError(result.msg);
// }
// },
// error: function(error) {
// $.modal.msgError("获取附件失败。");
// }
// });
// }
</script>
</body>
</html>
Loading…
Cancel
Save