Преглед на файлове

报销数电发票功能调整

user5 преди 8 месеца
родител
ревизия
2ac44df401
променени са 24 файла, в които са добавени 3918 реда и са изтрити 953 реда
  1. 106 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java
  2. 48 0
      src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java
  3. 9 0
      src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientAttachmentDao.java
  4. 102 0
      src/main/java/com/jeeplus/modules/workreimbursement/entity/ReimbursementVATTax.java
  5. 24 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementAllService.java
  6. 54 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementNewService.java
  7. 80 1
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java
  8. 39 0
      src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml
  9. 249 1
      src/main/webapp/static/oss/ossupload.js
  10. 2 2
      src/main/webapp/webpage/include/head.jsp
  11. 1 1
      src/main/webapp/webpage/include/ossTools.jsp
  12. 1 1
      src/main/webapp/webpage/modules/projectcontentinfo/achievementFileDataForm.jsp
  13. 1 1
      src/main/webapp/webpage/modules/projectcontentinfo/basedDataForm.jsp
  14. 501 184
      src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormAdd.jsp
  15. 193 32
      src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormDetail.jsp
  16. 508 189
      src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllModifyApply.jsp
  17. 191 31
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewAudit.jsp
  18. 506 186
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewFormAdd.jsp
  19. 504 193
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewModifyApply.jsp
  20. 1 1
      src/main/webapp/webpage/modules/workreimbursement/replenish/workReimbursementReplenishCwAudit.jsp
  21. 236 20
      src/main/webapp/webpage/modules/workreimbursement/specific/workReimbursementSpecificAudit.jsp
  22. 556 106
      src/main/webapp/webpage/modules/workreimbursement/specific/workReimbursementSpecificModifyApply.jsp
  23. 3 2
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp
  24. 3 2
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

+ 106 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -3,6 +3,7 @@ package com.jeeplus.modules.ruralprojectrecords.web;
 import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
+import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.utils.FreemarkerUtil;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.common.utils.StringUtils;
@@ -33,6 +34,8 @@ import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workinvoice.entity.TemporaryInvoiceInfo;
 import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
+import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import org.activiti.engine.HistoryService;
@@ -45,7 +48,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -93,6 +100,9 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     @Autowired
     private WorkInvoiceService workInvoiceService;
 
+    @Autowired
+    private WorkReimbursementService workReimbursementService;
+
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
     private final static String apptoken = Global.getConfig("apptoken");
@@ -772,4 +782,100 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         return map;
     }
 
+
+
+    /**
+     * 数电发票老数据处理
+     * @return
+     */
+    @RequestMapping(value = "/vattaxReimbursementDataDispose")
+    @ResponseBody
+    @Transactional(readOnly = false)
+    public Map<String,Object> vattaxReimbursementDataDispose(){
+        //查询所有数电发票上传的文件信息
+        WorkClientAttachment workClientInvoiceAttachment = new WorkClientAttachment();
+        workClientInvoiceAttachment.setAttachmentFlag("workInvoiceReimbursement");
+        List<WorkClientAttachment> workInvoiceReimbursementList = workattachmentService.getExistProjectAttachmentList(workClientInvoiceAttachment);
+        Map<String,Object> resultMap = new HashMap<>();
+        resultMap.put("count",workInvoiceReimbursementList.size());
+        //遍历附件信息,将附件信息下载后重新
+        long l1 = System.currentTimeMillis();
+        for (WorkClientAttachment attachment : workInvoiceReimbursementList) {
+            Map<String,Object> map = new HashMap<>();
+            File srcFile = null;
+            try{
+                //下载审定单文件
+                String path = null;
+                if(System.getProperty("os.name").toLowerCase().contains("win")){
+                    path = "D:/attachment-file/";
+                }else{
+                    path = "/attachment-file/";
+                }
+                String file = attachment.getUrl();
+                file = file.replace("amp;","");
+                String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+                String aliyunUrl = Global.getAliyunUrl();
+                String aliDownloadUrl = Global.getAliDownloadUrl();
+                String cons = "";
+                if (file.contains(aliyunUrl)){
+                    cons = aliyunUrl;
+                }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                    cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+                }else {
+                    cons = aliDownloadUrl;
+                }
+                String ossKey = file.split(cons+"/")[1];
+                new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                //将下载下来的文件转换为file文件
+                srcFile = new File(path+fileName);
+
+                // 创建一个 DocumentBuilderFactory
+                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                // 使用工厂创建一个 DocumentBuilder
+                DocumentBuilder builder = factory.newDocumentBuilder();
+                // 使用 DocumentBuilder 解析 XML 文件
+                Document document = builder.parse(srcFile);
+                // 获取所有header节点的集合
+                NodeList headerList = document.getElementsByTagName("Header");
+                // 获取所有eInvoiceDataList节点的集合
+                NodeList eInvoiceDataList = document.getElementsByTagName("EInvoiceData");
+                // 获取所有taxSupervisionInfo节点的集合
+                NodeList taxSupervisionInfoList = document.getElementsByTagName("TaxSupervisionInfo");
+
+                Map<String,String> map1 = workReimbursementService.xmlNodeListDataDispose(headerList, document);
+                Map<String,String> map2 = workReimbursementService.xmlNodeListDataDispose(eInvoiceDataList, document);
+                Map<String,String> map3 = workReimbursementService.xmlNodeListDataDispose(taxSupervisionInfoList, document);
+                map.putAll(map1);
+                map.putAll(map2);
+                map.putAll(map3);
+
+
+
+                //对处理后的数据根据发票号进行数据库查询,查看是否存在已报销的电子发票数据
+                if (null != map && map.get("InvoiceNumber") != null && StringUtils.isNotBlank(map.get("InvoiceNumber").toString())) {
+                    attachment.setProjectId(map.get("InvoiceNumber").toString());
+                    workattachmentService.updateOnWorkClientAttachment(attachment);
+                }
+
+            } catch (Exception e) {
+                e.printStackTrace();
+                map.put("message","上传的数电发票格式错误,请确认后重新上传");
+                return map;
+            } finally {
+                //删除本地文件
+                if (!srcFile.isDirectory()) {
+                    srcFile.delete();
+                }
+            }
+
+        }
+
+
+        resultMap.put("msgMonth","数电发票处理完成");
+        long l2 = System.currentTimeMillis();
+        resultMap.put("msgdate",(l2-l1));
+        return resultMap;
+    }
+
+
 }

+ 48 - 0
src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java

@@ -537,6 +537,15 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 	 * @param workattachment
 	 */
 	@Transactional(readOnly = false)
+	public void updateOnWorkClientAttachmentProjectId(WorkClientAttachment workattachment) {
+		workClientAttachmentDao.updateOnWorkClientAttachmentProjectId(workattachment);
+	}
+
+	/**
+	 * 修改附件
+	 * @param workattachment
+	 */
+	@Transactional(readOnly = false)
 	public void updateOnExterWorkAttachment(ExternalUnitWorkClientAttachment workattachment) {
 		//字符处理
 		workattachment.setUrl(decodeHtmlEntities(workattachment.getUrl()));
@@ -585,6 +594,45 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 	}
 
 	/**
+	 * 获取附件信息
+	 * @param workClientAttachment
+	 * @return
+	 */
+	public List<WorkClientAttachment> getExistProjectAttachmentList(WorkClientAttachment workClientAttachment){
+		List<WorkClientAttachment> list = workClientAttachmentDao.getExistProjectAttachmentList(workClientAttachment);
+		CollectAccessoryInfo cAInfo = new CollectAccessoryInfo();
+		User loginUser = UserUtils.getUser();
+		if(StringUtils.isNotBlank(loginUser.getId())){
+			cAInfo.setOfficeId(loginUser.getOffice().getId());
+			cAInfo.setCompanyId(loginUser.getCompany().getId());
+			cAInfo.setCreateBy(loginUser);
+		}
+		//遍历附件信息,判定改附件信息是否被收藏
+		for (WorkClientAttachment info: list) {
+			cAInfo.setUrl(info.getUrl());
+			CollectAccessoryInfo collectAccessoryInfo = projectAccessoryDao.getCollectAccessoryInfo1(cAInfo);
+			if(null != collectAccessoryInfo){
+				info.setCollectFlag("1");
+			}else{
+				info.setCollectFlag("0");
+			}
+		}
+		//数据处理
+		workClientAttachmentManage(list);
+		return list;
+	}
+
+	/**
+	 * 获取附件信息
+	 * @param workClientAttachment
+	 * @return
+	 */
+	public List<WorkClientAttachment> getNotDisposeAttachmentList(WorkClientAttachment workClientAttachment){
+		List<WorkClientAttachment> list = workClientAttachmentDao.findList(workClientAttachment);
+		return list;
+	}
+
+	/**
 	 * 获取附件信息(外部单位-意见反馈)
 	 * @param workClientAttachment
 	 * @return

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientAttachmentDao.java

@@ -22,6 +22,9 @@ public interface WorkClientAttachmentDao extends CrudDao<WorkClientAttachment> {
 
     List<WorkClientAttachment> getList(WorkClientAttachment attchment);
 
+
+    List<WorkClientAttachment> getExistProjectAttachmentList(WorkClientAttachment attchment);
+
     /**
      * 批量查询数据信息(项目文件专用)
      * @param attchment
@@ -63,4 +66,10 @@ public interface WorkClientAttachmentDao extends CrudDao<WorkClientAttachment> {
     void deleteExterunit(ExternalUnitWorkClientAttachment workClientAttachment);
 
     List<ExternalUnitWorkClientAttachment> findListFeedback(ExternalUnitWorkClientAttachment workClientAttachment);
+
+    /**
+     * 修改projectId
+     * @param attchment
+     */
+    void updateOnWorkClientAttachmentProjectId(WorkClientAttachment attchment);
 }

+ 102 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/ReimbursementVATTax.java

@@ -44,6 +44,20 @@ public class ReimbursementVATTax extends DataEntity<ReimbursementVATTax> {
 
 	private String remarks;
 
+
+	private String url;
+	private String fileName;
+	private String attachmentId;
+	private String temporaryUrl;
+	private String attachmentName;
+	private String createById;
+	private String type;
+	private String attachmentFlag;
+	private String fileSize;
+	private String divIdType;
+	private String workAttachmentId;
+
+
 	@ExcelField(title="金额", align=2, sort=7)
 	public BigDecimal getMoney() {
 		return money;
@@ -237,4 +251,92 @@ public class ReimbursementVATTax extends DataEntity<ReimbursementVATTax> {
 	public void setHandlingPerson(String handlingPerson) {
 		this.handlingPerson = handlingPerson;
 	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public String getFileName() {
+		return fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	public String getAttachmentId() {
+		return attachmentId;
+	}
+
+	public void setAttachmentId(String attachmentId) {
+		this.attachmentId = attachmentId;
+	}
+
+	public String getTemporaryUrl() {
+		return temporaryUrl;
+	}
+
+	public void setTemporaryUrl(String temporaryUrl) {
+		this.temporaryUrl = temporaryUrl;
+	}
+
+	public String getAttachmentName() {
+		return attachmentName;
+	}
+
+	public void setAttachmentName(String attachmentName) {
+		this.attachmentName = attachmentName;
+	}
+
+	public String getCreateById() {
+		return createById;
+	}
+
+	public void setCreateById(String createById) {
+		this.createById = createById;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getAttachmentFlag() {
+		return attachmentFlag;
+	}
+
+	public void setAttachmentFlag(String attachmentFlag) {
+		this.attachmentFlag = attachmentFlag;
+	}
+
+	public String getFileSize() {
+		return fileSize;
+	}
+
+	public void setFileSize(String fileSize) {
+		this.fileSize = fileSize;
+	}
+
+	public String getDivIdType() {
+		return divIdType;
+	}
+
+	public void setDivIdType(String divIdType) {
+		this.divIdType = divIdType;
+	}
+
+	public String getWorkAttachmentId() {
+		return workAttachmentId;
+	}
+
+	public void setWorkAttachmentId(String workAttachmentId) {
+		this.workAttachmentId = workAttachmentId;
+	}
 }

+ 24 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementAllService.java

@@ -197,6 +197,30 @@ public class WorkReimbursementAllService extends CrudService<WorkReimbursementDa
             WorkClientAttachment workClientInvoiceAttachment = new WorkClientAttachment();
             workClientInvoiceAttachment.setAttachmentId(id);
             workClientInvoiceAttachment.setAttachmentFlag("workInvoiceReimbursement");
+            List<WorkClientAttachment> workInvoiceReimbursementList = workattachmentService.getAttachmentList(workClientInvoiceAttachment);
+            if(workInvoiceReimbursementList.size()>0){
+                workattachmentService.clientAttachmentManageOnUrl(workInvoiceReimbursementList);
+
+                for (WorkClientAttachment clientAttachment : workInvoiceReimbursementList) {
+                    if(StringUtils.isNotBlank(clientAttachment.getProjectId())){
+                        for (ReimbursementVATTax reimbursementElectronicInvoiceVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                            if(clientAttachment.getProjectId().equals(reimbursementElectronicInvoiceVATTax.getInvoiceNumber())){
+                                reimbursementElectronicInvoiceVATTax.setUrl(clientAttachment.getUrl());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentName(clientAttachment.getAttachmentName());
+                                reimbursementElectronicInvoiceVATTax.setDivIdType(clientAttachment.getDivIdType());
+                                reimbursementElectronicInvoiceVATTax.setType(clientAttachment.getType());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentId(clientAttachment.getAttachmentId());
+                                reimbursementElectronicInvoiceVATTax.setFileSize(clientAttachment.getFileSize());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentFlag(clientAttachment.getAttachmentFlag());
+                                reimbursementElectronicInvoiceVATTax.setCreateBy(clientAttachment.getCreateBy());
+                                reimbursementElectronicInvoiceVATTax.setTemporaryUrl(clientAttachment.getTemporaryUrl());
+                                reimbursementElectronicInvoiceVATTax.setWorkAttachmentId(clientAttachment.getId());
+                            }
+                        }
+                    }
+                }
+            }
+
             workReimbursement.setWorkAttachmentInvoiceReimbursements(workattachmentService.getAttachmentList(workClientInvoiceAttachment));
             //暂存状态不操作流程
 		/*if(!"1".equals(workReimbursement.getStatus())){

+ 54 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementNewService.java

@@ -1107,6 +1107,40 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
                     workAccountDao.delete(workAccount);
                 }
             }
+        List<WorkClientAttachment> disposeAttachmentList = Lists.newArrayList();
+        //处理数电发票附件信息
+        List<ReimbursementVATTax> reimbursementElectronicInvoiceVATTaxes = workReimbursement.getReimbursementElectronicInvoiceVATTaxes();
+        if(reimbursementElectronicInvoiceVATTaxes.size()>0){
+            for(int i = 0; i < reimbursementElectronicInvoiceVATTaxes.size(); i ++){
+                ReimbursementVATTax reimbursementVATTax = reimbursementElectronicInvoiceVATTaxes.get(i);
+                //判定有没有附件url
+                if(StringUtils.isNotBlank(reimbursementVATTax.getUrl()) && !"1".equals(reimbursementVATTax.getDelFlag())){
+                    WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+                    workClientAttachment.setUrl(reimbursementVATTax.getUrl());
+                    workClientAttachment.setAttachmentName(reimbursementVATTax.getAttachmentName());
+                    workClientAttachment.setDivIdType(reimbursementVATTax.getDivIdType());
+                    workClientAttachment.setType(reimbursementVATTax.getType());
+                    workClientAttachment.setAttachmentId(workReimbursement.getId());
+                    workClientAttachment.setProjectId(reimbursementVATTax.getInvoiceNumber());
+                    workClientAttachment.setFileSize(reimbursementVATTax.getFileSize());
+                    workClientAttachment.setAttachmentFlag(reimbursementVATTax.getAttachmentFlag());
+                    workClientAttachment.setSort(String.valueOf(i +1));
+                    workClientAttachment.setDelFlag("0");
+                    if(StringUtils.isNotBlank(reimbursementVATTax.getWorkAttachmentId())){
+                        workClientAttachment.setId(reimbursementVATTax.getWorkAttachmentId());
+                    }else{
+                        workClientAttachment.setId("");
+                    }
+
+                    disposeAttachmentList.add(workClientAttachment);
+                }
+            }
+        }
+
+        if(disposeAttachmentList.size()>0){
+            workReimbursement.getWorkAttachments().addAll(disposeAttachmentList);
+        }
+
             if("0".equals(workReimbursement.getReimbursementType())){
                 for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
                     reimbursementVATTaxDao.delete(reimbursementVATTax);
@@ -1167,6 +1201,26 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
                     workClientAttachmentDao.delete(workClientAttachment);
                 }
             }
+        //查询数电发票上传得文件信息和disposeAttachmentList进行比对,如果查出来的不存在于disposeAttachmentList中,则表示数据被删除,应该从数据库中进行删除
+        if(disposeAttachmentList.size()>0){
+            WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+            String attachmentFlag = disposeAttachmentList.get(0).getAttachmentFlag();
+            workClientAttachment.setAttachmentId(workReimbursement.getId());
+            workClientAttachment.setAttachmentFlag(attachmentFlag);
+            List<WorkClientAttachment> attachmentList = workattachmentService.getNotDisposeAttachmentList(workClientAttachment);
+            List<String> workAttachmentUrlList = Lists.newArrayList();
+            for (WorkClientAttachment clientAttachment : disposeAttachmentList) {
+                workAttachmentUrlList.add(clientAttachment.getUrl());
+            }
+            String workAttachmentUrls = String.join(", ", workAttachmentUrlList);
+
+            for (WorkClientAttachment clientAttachment : attachmentList) {
+                //如果本次保存的文件url不存在在数据库表中,则进行删除
+                if(!workAttachmentUrls.contains(clientAttachment.getUrl())){
+                    workClientAttachmentDao.delete(clientAttachment);
+                }
+            }
+        }
             if(workReimbursement.getReimbursementBackList()!=null&&workReimbursement.getReimbursementBackList().size()>0){
                 WorkReimbursementBack w=new WorkReimbursementBack();
                 w.setAchivesId(workReimbursement.getAchivesId());

+ 80 - 1
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java

@@ -228,6 +228,29 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
             WorkClientAttachment workClientInvoiceAttachment = new WorkClientAttachment();
             workClientInvoiceAttachment.setAttachmentId(id);
             workClientInvoiceAttachment.setAttachmentFlag("workInvoiceReimbursement");
+            List<WorkClientAttachment> workInvoiceReimbursementList = workattachmentService.getAttachmentList(workClientInvoiceAttachment);
+            if(workInvoiceReimbursementList.size()>0){
+                workattachmentService.clientAttachmentManageOnUrl(workInvoiceReimbursementList);
+
+                for (WorkClientAttachment clientAttachment : workInvoiceReimbursementList) {
+                    if(StringUtils.isNotBlank(clientAttachment.getProjectId())){
+                        for (ReimbursementVATTax reimbursementElectronicInvoiceVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                            if(clientAttachment.getProjectId().equals(reimbursementElectronicInvoiceVATTax.getInvoiceNumber())){
+                                reimbursementElectronicInvoiceVATTax.setUrl(clientAttachment.getUrl());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentName(clientAttachment.getAttachmentName());
+                                reimbursementElectronicInvoiceVATTax.setDivIdType(clientAttachment.getDivIdType());
+                                reimbursementElectronicInvoiceVATTax.setType(clientAttachment.getType());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentId(clientAttachment.getAttachmentId());
+                                reimbursementElectronicInvoiceVATTax.setFileSize(clientAttachment.getFileSize());
+                                reimbursementElectronicInvoiceVATTax.setAttachmentFlag(clientAttachment.getAttachmentFlag());
+                                reimbursementElectronicInvoiceVATTax.setCreateBy(clientAttachment.getCreateBy());
+                                reimbursementElectronicInvoiceVATTax.setTemporaryUrl(clientAttachment.getTemporaryUrl());
+                                reimbursementElectronicInvoiceVATTax.setWorkAttachmentId(clientAttachment.getId());
+                            }
+                        }
+                    }
+                }
+            }
             workReimbursement.setWorkAttachmentInvoiceReimbursements(workattachmentService.getAttachmentList(workClientInvoiceAttachment));
             //暂存状态不操作流程
 		/*if(!"1".equals(workReimbursement.getStatus())){
@@ -721,6 +744,40 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                 }
             }
 
+            List<WorkClientAttachment> disposeAttachmentList = Lists.newArrayList();
+            //处理数电发票附件信息
+            List<ReimbursementVATTax> reimbursementElectronicInvoiceVATTaxes = workReimbursement.getReimbursementElectronicInvoiceVATTaxes();
+            if(reimbursementElectronicInvoiceVATTaxes.size()>0){
+                for(int i = 0; i < reimbursementElectronicInvoiceVATTaxes.size(); i ++){
+                    ReimbursementVATTax reimbursementVATTax = reimbursementElectronicInvoiceVATTaxes.get(i);
+                    //判定有没有附件url
+                    if(StringUtils.isNotBlank(reimbursementVATTax.getUrl()) && !"1".equals(reimbursementVATTax.getDelFlag())){
+                        WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+                        workClientAttachment.setUrl(reimbursementVATTax.getUrl());
+                        workClientAttachment.setAttachmentName(reimbursementVATTax.getAttachmentName());
+                        workClientAttachment.setDivIdType(reimbursementVATTax.getDivIdType());
+                        workClientAttachment.setType(reimbursementVATTax.getType());
+                        workClientAttachment.setAttachmentId(workReimbursement.getId());
+                        workClientAttachment.setProjectId(reimbursementVATTax.getInvoiceNumber());
+                        workClientAttachment.setFileSize(reimbursementVATTax.getFileSize());
+                        workClientAttachment.setAttachmentFlag(reimbursementVATTax.getAttachmentFlag());
+                        workClientAttachment.setSort(String.valueOf(i +1));
+                        workClientAttachment.setDelFlag("0");
+                        if(StringUtils.isNotBlank(reimbursementVATTax.getWorkAttachmentId())){
+                            workClientAttachment.setId(reimbursementVATTax.getWorkAttachmentId());
+                        }else{
+                            workClientAttachment.setId("");
+                        }
+
+                        disposeAttachmentList.add(workClientAttachment);
+                    }
+                }
+            }
+
+            if(disposeAttachmentList.size()>0){
+                workReimbursement.getWorkAttachments().addAll(disposeAttachmentList);
+            }
+
             if("0".equals(workReimbursement.getReimbursementType())){
                 for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
                     reimbursementVATTaxDao.delete(reimbursementVATTax);
@@ -783,6 +840,28 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     workClientAttachmentDao.delete(workClientAttachment);
                 }
             }
+
+            //查询数电发票上传得文件信息和disposeAttachmentList进行比对,如果查出来的不存在于disposeAttachmentList中,则表示数据被删除,应该从数据库中进行删除
+            if(disposeAttachmentList.size()>0){
+                WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+                String attachmentFlag = disposeAttachmentList.get(0).getAttachmentFlag();
+                workClientAttachment.setAttachmentId(workReimbursement.getId());
+                workClientAttachment.setAttachmentFlag(attachmentFlag);
+                List<WorkClientAttachment> attachmentList = workattachmentService.getNotDisposeAttachmentList(workClientAttachment);
+                List<String> workAttachmentUrlList = Lists.newArrayList();
+                for (WorkClientAttachment clientAttachment : disposeAttachmentList) {
+                    workAttachmentUrlList.add(clientAttachment.getUrl());
+                }
+                String workAttachmentUrls = String.join(", ", workAttachmentUrlList);
+
+                for (WorkClientAttachment clientAttachment : attachmentList) {
+                    //如果本次保存的文件url不存在在数据库表中,则进行删除
+                    if(!workAttachmentUrls.contains(clientAttachment.getUrl())){
+                        workClientAttachmentDao.delete(clientAttachment);
+                    }
+                }
+            }
+
             if(workReimbursement.getReimbursementBackList()!=null&&workReimbursement.getReimbursementBackList().size()>0){
                 WorkReimbursementBack w=new WorkReimbursementBack();
                 w.setAchivesId(workReimbursement.getAchivesId());
@@ -2128,7 +2207,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
 
     /**
      * 根据id修改报销详情中喝项目的关联关系信息
-     * @param id
+     * @param invoiceNumber
      * @return
      */
     @Transactional(readOnly = false)

+ 39 - 0
src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml

@@ -68,6 +68,36 @@
         </choose>
     </select>
 
+    <select id="getExistProjectAttachmentList" resultType="WorkClientAttachment" >
+        SELECT
+        <include refid="workClientAttachmentColumns"/>
+        ,a.project_id as projectId
+        FROM work_attachment a
+        <include refid="workClientAttachmentJoins"/>
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            <if test="attachmentId != null and attachmentId != ''">
+                AND a.attachment_id = #{attachmentId}
+            </if>
+            <if test="attachmentFlag != null and attachmentFlag != ''">
+                AND attachment_flag = #{attachmentFlag}
+            </if>
+            <if test="divIdType != null and divIdType != ''">
+                AND div_id_type = #{divIdType}
+            </if>
+            and a.project_id is null
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+        limit 500
+    </select>
+
 
     <select id="findListFeedback" resultType="ExternalUnitWorkClientAttachment" >
         SELECT
@@ -274,6 +304,15 @@
         <if test="divIdType != null and divIdType != ''">
             ,div_id_type = #{divIdType}
         </if>
+        <if test="projectId != null and projectId != ''">
+            ,project_id = #{projectId}
+        </if>
+        WHERE id = #{id}
+    </update>
+
+    <update id="updateOnWorkClientAttachmentProjectId">
+        UPDATE work_attachment SET
+        project_id = #{projectId}
         WHERE id = #{id}
     </update>
 

+ 249 - 1
src/main/webapp/static/oss/ossupload.js

@@ -2977,4 +2977,252 @@ function multiTypeTest (ossClient, storeAs, file,attachmentId,attachmentFlag,upl
         console.log("err------ err:");
         console.log(err);
     });
-};
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size, cpt, idx, prefix, currentUser) {
+    return new Promise((resolve, reject) => {  // 返回一个 Promise
+
+        // 处理文件名
+        file.name.replace(" ", "");
+        file.name.replace(/—/g, "");
+        var fileName = file.name;
+        // 将单引号‘’都转换成',将双引号“”都转换成"
+        fileName = fileName.replace(/\’|\‘/g, "'").replace(/\“|\”/g, "");
+        // 将中括号【】转换成[],将大括号{}转换成{}
+        fileName = fileName.replace(/\【/g, "(").replace(/\】/g, ")").replace(/\{/g, "(").replace(/\}/g, ")");
+        fileName = fileName.replace(/\[/g, "(").replace(/\]/g, ")").replace(/\{/g, "(").replace(/\}/g, ")");
+        // 将逗号,转换成,,将:转换成:
+        fileName = fileName.replace(/,/g, ",").replace(/:/g, ":");
+        //将中文——转换为英文-
+        fileName = fileName.replace(/—/g, "-");
+        fileName = fileName.replace(/……/g, "");
+        fileName = fileName.replace(/±/g, "");
+        fileName = fileName.replace(/#/g, "");
+        fileName = fileName.replace(/%/g, "");
+        fileName = fileName.replace(/Π/g, "");
+        fileName = fileName.replace(/π/g, "");
+        fileName = fileName.replace(/·/g, ".");
+        var dfl = new File([file], fileName, { type: file.type });
+        file = dfl;
+
+        requestUrl = realPath + "/previewController/getAccess";
+        OSS.urllib.request(requestUrl, { method: 'GET' }, function (err, response) {
+            if (err) {
+                console.log(err);
+                $.ajax({
+                    type: "post",
+                    url: realPath + "/previewController/saveJSError",
+                    data: { object: err.toString() },
+                    async: false,
+                    success: function (data) { }
+                });
+                return reject(err);  // 发生错误时,reject Promise
+            }
+            try {
+                result = JSON.parse(response);
+            } catch (e) {
+                errmsg = 'parse sts response info error: ' + e.message;
+                return reject(errmsg);  // 发生错误时,reject Promise
+            }
+
+            let timeout;
+            if (file.size <= 10 * 1024 * 1024) { // 小于10MB
+                timeout = 10000; // 10秒
+            } else if (file.size <= 100 * 1024 * 1024) { // 小于100MB
+                timeout = 30000; // 30秒
+            } else { // 大于100MB
+                timeout = 60000; // 60秒
+            }
+
+            client = new OSS.Wrapper({
+                accessKeyId: result.AccessKeyId,
+                accessKeySecret: result.AccessKeySecret,
+                stsToken: result.SecurityToken,
+                bucket: result.Bucket,
+                endpoint: result.Endpoint,
+                timeout: timeout
+            });
+
+            storeAs = "attachment-file/" + storeAs + "/" + today + new Date().getTime() + file.name;
+
+            // 继续调用上传操作,并确保 Promise 被 resolve
+            invoiceReimbursementMultitests(client, storeAs, file, attachmentId, attachmentFlag, uploadPath.replace('http://dmtest-test.oss-cn-shanghai.aliyuncs.com', result.AliyunUrl), divId, size, cpt)
+                .then(map => {
+                    resolve(map);  // 成功时 resolve
+                }).catch(error => {
+                reject(error);  // 如果上传失败,reject
+            });
+        });
+    });
+}
+
+function invoiceReimbursementMultitests(ossClient, storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size, cpt) {
+    return new Promise((resolve, reject) => {
+        let map = new Map();
+        // 根据文件大小动态配置 parallel
+        let parallel;
+        if (file.size < 50 * 1024 * 1024) { // 小于 50 MB
+            parallel = 1;
+        } else if (file.size < 200 * 1024 * 1024) { // 50 MB 到 200 MB
+            parallel = 3;
+        } else if (file.size < 1024 * 1024 * 1024) { // 200 MB 到 1 GB
+            parallel = 5;
+        } else { // 大于 1 GB
+            parallel = 8;
+        }
+        var names = storeAs.split("/");
+        var name = names[names.length - 1];
+
+        // 上传文件
+        ossClient.multipartUpload(storeAs, file, {
+            partSize: 1 * 1024 * 1024,
+            parallel: parallel,
+            progress: function* (percent, cpt) {
+                var p = Math.floor(percent * 100);
+                $("#jindutiao" + divId).attr("style", "width: " + p + "%");
+                $("#jindutiao" + divId).attr("aria-valuenow", p + "%");
+                $("#baifenbi" + divId).html(p + "%");
+                $("#fileName" + divId).html(file.name);
+                checkpoint_temp = cpt;
+            }
+        }).then(function (result) {
+            var fileLocation = "";
+            var lookUrl = "";
+            //获取文件存储位置(0:本地;1:百度云;2:阿里云)
+            $.ajax({
+                type: "get",
+                url: realPath + "/bos/getFileStorageLocation",
+                async: false,
+                success: function (data) {
+                    fileLocation = data.fileLocation;
+                }
+            });
+
+            returnUrl = realPath + "/sys/workattachment/saveAttachment";
+            $.ajax({
+                type: 'post',
+                url: returnUrl,
+                data: {
+                    "attachmentName": file['name'],
+                    "attachmentId": attachmentId,
+                    "attachmentFlag": attachmentFlag,
+                    "fileSize": file['size'],
+                    "url": "/" + storeAs,
+                    "divIdType": divId
+                },
+                success: function (data) {
+                    var lowerType = data.type.toLowerCase();
+                    if (data.status == "Success") {
+                        parent.layer.msg("上传成功!", { icon: 1 });
+                        var lenght = $(".trIdAdds").length;
+                        if (size != 0) {
+                            lenght += size;
+                        }
+                        var addFile = "addFile" + divId;
+                        var str = '<tr class="trIdAdds">' +
+                            '<td class="text-center">';
+
+                        var fileUrl = '';
+                        if(2 == fileLocation){
+                            $.ajax({
+                                type:"post",
+                                async:false,
+                                url:realPath+"/workfullmanage/workFullManage/getFileTemporaryLookUrl",
+                                data:{"file":data.url,},
+                                success:function(result){
+                                    lookUrl = result.lookUrl;
+                                    if (isContains("jpg,png,gif,bmp,jpeg",lowerType)){
+                                        fileUrl = '<img src="'+lookUrl+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+ '/a/sys/picturepreview/picturePreview?url=' +lookUrl+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+                                    }else if(isContains("pdf",lowerType)){
+                                        fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+lookUrl+'\',1)">'+data.attachmentName+'</a>';
+                                    }else if(isContains("rar,zip,jar,7z",lowerType)){
+                                        fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+lookUrl+'\',3)">'+data.attachmentName+'</a>';
+                                    }else if(isContains("avi,wmv,mpg,mpeg,mov,rm,ram,swf,flv,mp4,rmvb",lowerType)){
+                                        fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openDialogView(\'预览\',\''+ '/a/sys/picturepreview/videoPreview?url=' +lookUrl+ '\',\'90%\',\'90%\')">'+data.attachmentName+'</a>';
+                                    }else {
+                                        fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+lookUrl+'\',2)">'+data.attachmentName+'</a>';
+                                    }
+                                }
+                            });
+
+                        }else{
+                            if (isContains("jpg,png,gif,bmp,jpeg",lowerType)){
+                                fileUrl = '<img src="'+data.url+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+realPath+ '/a/sys/picturepreview/picturePreview?url=' +data.url+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+                            }else if(isContains("pdf",lowerType)){
+                                fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+data.url+'\',1)">'+data.attachmentName+'</a>';
+                            }else if(isContains("rar,zip,jar,7z",lowerType)){
+                                fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+data.url+'\',3)">'+data.attachmentName+'</a>';
+                            }else if(isContains("avi,wmv,mpg,mpeg,mov,rm,ram,swf,flv,mp4,rmvb",lowerType)){
+                                fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openDialogView(\'预览\',\''+ '/a/sys/picturepreview/videoPreview?url=' +lookUrl+ '\',\'90%\',\'90%\')">'+data.attachmentName+'</a>';
+                            }else {
+                                fileUrl = '<a class="attention-info" href="javascript:void(0)" onclick="openPreview(\''+data.url+'\',2)">'+data.attachmentName+'</a>';
+                            }
+                        }
+                        // 更新map并返回
+                        map.set('fileName', file['name']);
+
+                        map.set("fileUrl",fileUrl)
+                        map.set("createByName",data.createByName)
+                        map.set("createDate",data.createDate)
+                        map.set("attachmentId",data.attachmentId)
+                        map.set("url",data.url)
+                        map.set("temporaryUrl",data.temporaryUrl)
+                        map.set("attachmentName",data.attachmentName)
+                        map.set("createBy",data.createBy)
+                        map.set("type",data.type)
+                        map.set("attachmentFlag",data.attachmentFlag)
+                        map.set("fileSize",data.fileSize)
+                        map.set("divIdType",data.divIdType)
+
+                        if(2 == fileLocation){
+                            if(isContains("pdf",lowerType)){
+                                download = '<a href="'+lookUrl+'" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                            }else{
+                                download =  '<a href="javascript:location.href=\'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                            }
+                        }else{
+                            download =  '<a href="javascript:location.href=\'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';
+                        }
+                        map.set("download",download)
+
+                        del = '<a href="javascript:void(0)" onclick="deleteFileFromAliyunByInvoiceReimbursement(this,\''+realPath+'/sys/workattachment/deleteFileFromAliyunByInvoiceReimbursement?url='+encodeURIComponent(data.url)+'&id='+data.id+'&type=2\',\''+addFile+'\',\''+divId+'\')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>';
+                        map.set("del",del)
+
+                        resolve(map);  // 完成操作,resolve map
+                    } else {
+                        parent.layer.msg("上传失败!", { icon: 2 });
+                    }
+                }
+            });
+
+        }).catch(function (err) {
+            reject(err);  // 上传失败,reject Promise
+        });
+    });
+}
+
+
+
+
+
+
+
+
+
+

+ 2 - 2
src/main/webapp/webpage/include/head.jsp

@@ -99,7 +99,7 @@
         {
              document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
             document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?14"><\/script>');
+            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?15"><\/script>');
             /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
         }
     }
@@ -107,7 +107,7 @@
     {
          document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
         document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?14"><\/script>');
+        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?15"><\/script>');
         /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
     }
 

+ 1 - 1
src/main/webapp/webpage/include/ossTools.jsp

@@ -9,4 +9,4 @@
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/plupload.dev.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/upload.js"></script>
-<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?14"></script>
+<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?15"></script>

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/achievementFileDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?14"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?15"></script>
 	<style>
 		label.error{
 			top:40px;

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/basedDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?14"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?15"></script>
 	<style>
 		label.error{
 			top:40px;

+ 501 - 184
src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormAdd.jsp

@@ -193,16 +193,24 @@
 
                 var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
                 if(electronicInvoiceArr.length>0){
-                    var leng = $("#file_attachment_InvoiceReimbursement tr").length;
+                    for(var i = 0;i < electronicInvoiceArr.length;i++) {
+                        var fileName = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(9).val();
+                        if(!fileName){
+                            var row = i+1;
+                            parent.layer.msg("第" + row + "行数电发票文件上传错误,请重新上传", {icon: 5});
+                            flags= false;
+                        }
+                    }
+                    /*var leng = $("#file_attachment_InvoiceReimbursement tr").length;
                     if(leng != electronicInvoiceArr.length){
                         parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
                         flags= false;
-                    }
+                    }*/
                 }
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -211,7 +219,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){
@@ -450,6 +459,44 @@
                 $(obj).html("&times;").attr("title", "删除");
                 $(obj).parent().parent().removeClass("error");
             }
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var invoiceVATTaxesDelFlag = $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val()
+                if("1" != invoiceVATTaxesDelFlag){
+
+                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                    if (moneys!=undefined && isNumber(moneys)){
+                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                        }
+                    }
+                    if (taxAmount!=undefined && isNumber(taxAmount)){
+                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                        }
+                    }
+                    if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                        }
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
         function urlRedict(file,attach){
             parent.layer.confirm('确定删除吗?', {
@@ -490,171 +537,248 @@
 
         }
 
-        function insertTitleInvoiceReimbursement(tValue){
+        async function insertTitleInvoiceReimbursement(tValue) {
             var id = "${workReimbursement.id}";
             var list = "${workReimbursement.workAttachmentInvoiceReimbursements}";
-            var size = (list.split('url')).length-1;
+            var size = (list.split('url')).length - 1;
             var files = $("#attachment_InvoiceReimbursement_file")[0].files;
-            //判断报销类型是否为电子报销
-            for(var i = 0;i<files.length;i++) {
+
+            // 判断报销类型是否为电子报销
+            for (var i = 0; i < files.length; i++) {
                 var file = files[i];
-                //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+
+                // 如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
                 const spliceLength2 = file.name.lastIndexOf(".");
                 var fileNameSuffix = file.name.slice(spliceLength2 + 1);
-                if(fileNameSuffix === "xml" ) {
+                if (fileNameSuffix === "xml") {
                     var formdata = new FormData();
-                    formdata.append("multipartFile",file);
-                    formdata.append("id",id);
-                    $.ajax({
-                        type:'post',
-                        url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
-                        data:formdata,
-                        contentType: false,
-                        async: false,
-                        processData: false,
-                        success:function (data) {
-                            if(data.flag){
-                                top.layer.msg(data.message,{icon:2});
-                            }else{
-                                //获取专用发票信息 行数
-                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
-                                var includeFlag = false;
-                                //xml文件处理
-                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
-                                //获取专用发票信息 行数
-                                for(var i = 0;i < trlen;i++){
-                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
-
-                                    if(invoiceNumber === data.InvoiceNumber && data.InvoiceNumber){
-                                        includeFlag = true
-                                        //数据处理
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
-                                        $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val("0")
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).show();
-                                        break;
-                                    }
-                                }
-                                //若发票号不存在。则新增行将对应信息添加进去
-                                if(!includeFlag  && data.InvoiceNumber){
-                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
-
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(0).val("");
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(1).val(0);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).find("input").eq(0).val("");
-
-                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    formdata.append("multipartFile", file);
+                    formdata.append("id", id);
+
+                    try {
+                        // 使用 async/await 等待 AJAX 请求完成
+                        const data = await uploadXmlFile(formdata);
+
+                        if (data.flag) {
+                            top.layer.msg(data.message, { icon: 2 });
+                        } else {
+                            // 获取专用发票信息 行数
+                            var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                            var includeFlag = false;
+
+                            // xml文件处理
+                            // 首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                            for (var j = 0; j < trlen; j++) {
+                                var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(j).find("td").eq(3).find("input").eq(0).val();
+
+                                if (invoiceNumber === data.InvoiceNumber && data.InvoiceNumber) {
+                                    includeFlag = true;
+                                    // 数据处理
+                                    updateInvoiceRow(j, data);
+                                    // 检查文件是否已上传
+                                    await handleFileUpload(file, size, j);
+                                    break;
                                 }
+                            }
 
-                                var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
-                                var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
-                                var fileName = "";
-                                var fileNameFlag = true;
-                                for(var i = 0 ; i<attachmentFileLength; i++){
-                                    // 获取当前行中的第一个<td>元素
-                                    var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
-                                    // 检查第一个<td>元素是否存在
-                                    if (firstTd) {
-                                        // 获取第一个<td>元素中的第一个<a>标签
-                                        var firstA = firstTd.getElementsByTagName("a")[0];
-                                        // 检查第一个<a>标签是否存在
-                                        if (firstA) {
-                                            // 获取<a>标签中的文本信息
-                                            fileName = firstA.textContent || firstA.innerText;
-                                        } else {
-                                            console.log("在当前行中的第一个<td>元素中未找到<a>标签");
-                                        }
-                                    } else {
-                                        console.log("在当前行中未找到<td>元素");
-                                    }
-
-                                    if(fileName == file.name){
-                                        fileNameFlag = false;
-                                        break;
-                                    }
+                            // 若发票号不存在,则新增行将对应信息添加进去
+                            if (!includeFlag && data.InvoiceNumber) {
+                                addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+                                updateInvoiceRow(trlen, data);
+                                // 检查文件是否已上传
+                                await handleFileUpload(file, size, trlen);
+                                reimbursementElectronicInvoiceVATTaxesRowIdx++;
+                            }
 
-                                }
+                        }
+                    } catch (error) {
+                        console.error('文件上传失败', error);
+                        parent.layer.msg("文件上传失败,请重试!", { icon: 5 });
+                        return false;
+                    }
+                } else {
+                    parent.layer.msg("请上传xml格式文件!", { icon: 5 });
+                    return false;
+                }
+            }
+        }
 
-                                if(fileNameFlag){
-                                    var attachmentId = "";
-                                    var attachmentFlag = "workInvoiceReimbursement";
-                                    var timestamp=new Date().getTime();
-
-                                    var storeAs = "workInvoiceReimbursement";
-                                    var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-                                    var divId = "_attachment_InvoiceReimbursement";
-                                    $("#addFile"+divId).show();
-                                    invoiceReimbursementMultipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
-                                }else{
-                                    parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", {icon: 5});
-                                    return false;
-                                }
+        // 上传 XML 文件的异步函数
+        function uploadXmlFile(formdata) {
+            return new Promise((resolve, reject) => {
+                $.ajax({
+                    type: 'POST',
+                    url: "${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                    data: formdata,
+                    contentType: false,
+                    async: true,
+                    processData: false,
+                    success: function (data) {
+                        resolve(data); // 成功返回数据
+                    },
+                    error: function (error) {
+                        reject(error); // 发生错误时拒绝
+                    }
+                });
+            });
+        }
 
+        // 更新发票行数据
+        function updateInvoiceRow(index, data) {
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(9).find("input").eq(0).val("");
+            $("#reimbursementElectronicInvoiceVATTaxes" + index + "_delFlag").val("0");
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).show();
+        }
 
-                                var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                var reimbursementElectronicInvoiceVATTaxesMoneys = "";
-                                var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
-                                var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
-                                for(var i = 0;i < invoiceVATTaxes;i++){
-                                    var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
-                                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
-                                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
-                                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
-
-                                    if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
-                                        }
-                                    }
-                                    if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
-                                        }
-                                    }
-                                    if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
-                                        }
-                                    }
-                                }
-                                $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
-                                $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
-                                $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
-                            }
+        // 处理文件上传
+        async function handleFileUpload(file, size, trlen) {
+            var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
+            var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
+            var fileName = "";
+            var fileNameFlag = true;
+
+            // 检查文件是否已上传
+            for (var i = 0; i < attachmentFileLength; i++) {
+                var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
+                if (firstTd) {
+                    var firstA = firstTd.getElementsByTagName("a")[0];
+                    if (firstA) {
+                        fileName = firstA.textContent || firstA.innerText;
+                    }
+                }
 
-                        }
-                    });
+                if (fileName == file.name) {
+                    fileNameFlag = false;
+                    break;
                 }
-                else{
-                    parent.layer.msg("请上传xml格式文件!", {icon: 5});
-                    return false;
+            }
+
+            if (fileNameFlag) {
+                // 确保所有变量在使用之前都已初始化
+                let attachmentId = "";
+                let attachmentFlag = "workInvoiceReimbursement";  // 确保这里初始化变量
+                let timestamp = new Date().getTime();
+                let storeAs = "workInvoiceReimbursement";
+                let uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+
+                $("#addFile_attachment_InvoiceReimbursement").show();
+
+                try {
+                    // 调用文件上传函数
+                    const map = await invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, "_attachment_InvoiceReimbursement", size);
+
+                    // 获取上传返回的参数
+                    const fileUrl = map.get("fileUrl");
+                    const createByName = map.get("createByName");
+                    const createDate = map.get("createDate");
+
+                    // 确保 attachmentId 在此时被赋值
+                    attachmentId = map.get("attachmentId");
+
+                    const download = map.get("download");
+                    const del = map.get("del");
+
+                    // 更新页面上的文件信息
+                    // 清空指定的单元格内容
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).empty();
+                    // 添加新的数据
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).append(fileUrl);
+
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).append(createByName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).append(createDate);
+                    // 定位到目标 td 并清除其中的所有 a 标签
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).find("a").remove();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).prepend(download);
+
+
+                    // 获取其他上传的文件信息
+                    const url = map.get("url");
+                    const fileName = map.get("fileName");
+                    const temporaryUrl = map.get("temporaryUrl");
+                    const attachmentName = map.get("attachmentName");
+                    const createById = map.get("createBy");
+                    const type = map.get("type");
+                    const fileSize = map.get("fileSize");
+                    const divIdType = map.get("divIdType");
+
+                    // 更新表格中的文件信息
+                    // 清空 input 的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val('');
+                    // 设置新的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val(url);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val(fileName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val(attachmentId);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val(temporaryUrl);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val(attachmentName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val(createById);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val(type);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val(attachmentFlag);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val(fileSize);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val(divIdType);
+
+                } catch (error) {
+                    console.error('文件上传失败', error);
                 }
+            } else {
+                parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", { icon: 5 });
+                return false;
             }
 
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
 
 
@@ -889,6 +1013,10 @@
             padding-left: 0px;
             padding-right: 0px;
         }
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -1213,23 +1341,27 @@
 
         <div class="form-group layui-row count2">
             <div class="form-group-label"><h2>数电发票信息<span style="color: red;font-size: 14px"> (可通过上传数电发票xml格式的附件自动获取发票信息)</span></h2></div>
+            <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <div class="layui-item nav-btns">
                 <%--<a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>--%>
                 <a id="attachment_btn_xml" class="nav-btn nav-btn-add" title="上传数电发票xml文件"><i class="fa fa-plus"></i>&nbsp;上传xml文件</a>
             </div>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr>
-                        <th width="150px"><font color="red">*</font>发票类型</th>
-                        <th width="200px"><font color="red">*</font>发票项目名</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>开票日期</th>
-                        <th width="200px"><font color="red">*</font>开票单位</th>
-                        <th width="150px"><font color="red">*</font>金额</th>
-                        <th width="150px"><font color="red">*</font>税额</th>
-                        <th width="150px"><font color="red">*</font>价税合计</th>
-                        <th width="200px">备注</th>
+                        <th width="100px"><font color="red">*</font>发票类型</th>
+                        <th width="150px"><font color="red">*</font>发票项目名</th>
+                        <th width="150px"><font color="red">*</font>发票号</th>
+                        <th width="150px"><font color="red">*</font>开票日期</th>
+                        <th width="150px"><font color="red">*</font>开票单位</th>
+                        <th width="100px"><font color="red">*</font>金额</th>
+                        <th width="100px"><font color="red">*</font>税额</th>
+                        <th width="100px"><font color="red">*</font>价税合计</th>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                        <th width="100px">上传人</th>
+                        <th width="150px">上传时间</th>
+                        <th width="200px">操作<th>
                         <%--<th width="150px">操作</th>--%>
                     </tr>
                     </thead>
@@ -1242,6 +1374,18 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}"/>
 
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_url" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].url" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.url}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentId}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].temporaryUrl" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_createById" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].createById" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.createById}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_type" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].type" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.type}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentFlag" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentFlag}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileSize" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileSize}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].divIdType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.divIdType}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_workAttachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].workAttachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.workAttachmentId}"/>
+
                                 </td>
                                     <%--发票类型--%>
                                 <td>
@@ -1276,8 +1420,158 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                                 </td>
                                     <%--备注--%>
-                                <td>
-                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
+                                <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                        ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                    <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+                                </td>
+                                <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                        <%--附件下载删除--%>
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                    <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                                 </td>
                                     <%--<td class="text-center op-td">
                                         <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -1287,24 +1581,27 @@
                     </c:if>
                     </tbody>
                 </table>
-                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr >
-                        <td width="150px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="150px" style="border: 0px">
+                        <td width="100px">费用汇总(元):</td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="100px" style="border: 0px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="200px"></td>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                        <th width="100px"></th>
+                        <th width="150px"></th>
+                        <th width="200px"><th>
                     </tr>
                     </thead>
                 </table>
@@ -1314,6 +1611,18 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_id" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" type="hidden" value="{{row.invoiceType}}"/>
+
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_url" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].url" type="hidden" value="{{row.url}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileName" type="hidden" value="{{row.fileName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentId" type="hidden" value="{{row.attachmentId}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].temporaryUrl" type="hidden" value="{{row.temporaryUrl}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentName" type="hidden" value="{{row.attachmentName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_createById" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_type" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentFlag" type="hidden" value="{{row.attachmentFlag}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileSize" type="hidden" value="{{row.fileSize}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].divIdType" type="hidden" value="{{row.divIdType}}"/>
+
                         </td>
                             <%--发票类型--%>
                         <td>
@@ -1348,12 +1657,20 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                         </td>
                             <%--备注--%>
-                         <td>
-                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>
+                         <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                        <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                            <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                         </td>
-                        <%--<td class="text-center op-td">
-                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
-                        </td>--%>
                     </tr>//-->
                 </script>
                 <script type="text/javascript">
@@ -1376,14 +1693,14 @@
             </div>
         </div>
 
-        <div class="form-group layui-row count2">
+        <%--<div class="form-group layui-row count2">
             <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <span id="attachment_title"></span>
             <div class="layui-item layui-col-xs12" style="padding:0 16px;">
                 <table id="listAttachment" class="table table-bordered table-condensed details">
                     <thead>
                     <tr>
-                            <%-- <th>序号</th>--%>
+                            &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                         <th>数电发票文件预览</th>
                         <th>上传人</th>
                         <th>上传时间</th>
@@ -1394,7 +1711,7 @@
                     <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                         <tr>
 
-                                <%-- <td>${status.index + 1}</td>--%>
+                                &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                             <c:choose>
                                 <c:when test="${workReimbursement.uploadMode == 2}">
                                     <c:choose>
@@ -1517,7 +1834,7 @@
                             <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                             <td class="op-td">
                                 <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
+                                        &lt;%&ndash;附件下载删除&ndash;%&gt;
                                     <c:choose>
                                         <c:when test="${workReimbursement.uploadMode == 2}">
                                             <c:choose>
@@ -1552,7 +1869,7 @@
                 </table>
             </div>
         </div>
-
+--%>
 
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>附件信息</h2></div>

+ 193 - 32
src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormDetail.jsp

@@ -118,6 +118,11 @@
         .query .layui-input-block {
             margin-left: 116px;
         }
+
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -518,19 +523,22 @@
 
     <div class="form-group layui-row count2">
         <div class="form-group-label"><h2>数电发票信息</h2></div>
-        <div class="layui-item layui-col-xs12 form-table-container">
-            <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+        <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+            <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                 <thead>
                 <tr>
-                    <th width="200px"><font color="red">*</font>发票类型</th>
-                    <th width="200px"><font color="red">*</font>发票项目名</th>
-                    <th width="200px"><font color="red">*</font>发票号</th>
-                    <th width="200px"><font color="red">*</font>开票日期</th>
-                    <th width="200px"><font color="red">*</font>开票单位</th>
-                    <th width="200px"><font color="red">*</font>金额</th>
-                    <th width="200px"><font color="red">*</font>税额</th>
-                    <th width="200px"><font color="red">*</font>价税合计</th>
-                    <th width="200px">备注</th>
+                    <th width="100px"><font color="red">*</font>发票类型</th>
+                    <th width="150px"><font color="red">*</font>发票项目名</th>
+                    <th width="150px"><font color="red">*</font>发票号</th>
+                    <th width="150px"><font color="red">*</font>开票日期</th>
+                    <th width="150px"><font color="red">*</font>开票单位</th>
+                    <th width="100px"><font color="red">*</font>金额</th>
+                    <th width="100px"><font color="red">*</font>税额</th>
+                    <th width="100px"><font color="red">*</font>价税合计</th>
+                    <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                    <th width="100px">上传人</th>
+                    <th width="150px">上传时间</th>
+                    <th width="200px">操作<th>
                 </tr>
                 </thead>
                 <tbody id="reimbursementElectronicInvoiceVATTaxes">
@@ -569,47 +577,200 @@
                             <td>
                                 <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control"/>
                             </td>
-                                <%--备注--%>
-                            <td>
-                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
-                            </td>
+                                        <%--备注--%>
+                                    <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                        <c:choose>
+                                            <c:when test="${workReimbursement.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                        <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                        <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                                <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <c:choose>
+                                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                            </c:when>
+                                                                                            <c:otherwise>
+                                                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                            </c:otherwise>
+                                                                                        </c:choose>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                                <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                        <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <c:choose>
+                                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                            </c:when>
+                                                                                            <c:otherwise>
+                                                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                            </c:otherwise>
+                                                                                        </c:choose>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </td>
+                                        <%--备注--%>
+                                    <td style="text-align: center; vertical-align: middle; ">
+                                            ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+                                    </td>
+                                        <%--备注--%>
+                                    <td style="text-align: center; vertical-align: middle; ">
+                                        <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+                                    </td>
+                                    <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                            <%--附件下载删除--%>
+                                        <c:choose>
+                                            <c:when test="${workReimbursement.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                        <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                            </c:otherwise>
+                                        </c:choose>
+                                            <%--<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>--%>
+                                    </td>
                         </tr>
                     </c:forEach>
                 </c:if>
                 </tbody>
             </table>
-            <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+            <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                 <thead>
                 <tr >
-                    <td width="200px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-                    <td width="200px"></td>
-                    <td width="200px"></td>
-                    <td width="200px"></td>
-                    <td width="200px"></td>
-                    <td width="200px" style="border: 0px">
+                    <td width="100px">费用汇总(元):</td>
+                    <td width="150px"></td>
+                    <td width="150px"></td>
+                    <td width="150px"></td>
+                    <td width="150px"></td>
+                    <td width="100px" style="border: 0px">
                         <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
                     </td>
-                    <td width="200px">
+                    <td width="100px">
                         <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
                     </td>
-                    <td width="200px">
+                    <td width="100px">
                         <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
                     </td>
-                    <td width="200px"></td>
+                    <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                    <th width="100px"></th>
+                    <th width="150px"></th>
+                    <th width="200px"><th>
                 </tr>
                 </thead>
             </table>
         </div>
     </div>
 
-    <div class="form-group layui-row count2">
+    <%--<div class="form-group layui-row count2">
         <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
         <span id="attachment_title"></span>
         <div class="layui-item layui-col-xs12" style="padding:0 16px;">
             <table id="listAttachment" class="table table-bordered table-condensed details">
                 <thead>
                 <tr>
-                        <%-- <th>序号</th>--%>
+                        &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                     <th>数电发票文件预览</th>
                     <th>上传人</th>
                     <th>上传时间</th>
@@ -620,7 +781,7 @@
                 <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                     <tr>
 
-                            <%-- <td>${status.index + 1}</td>--%>
+                            &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                         <c:choose>
                             <c:when test="${workReimbursement.uploadMode == 2}">
                                 <c:choose>
@@ -743,7 +904,7 @@
                         <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                         <td class="op-td">
                             <div class="op-btn-box" >
-                                    <%--附件下载删除--%>
+                                    &lt;%&ndash;附件下载删除&ndash;%&gt;
                                 <c:choose>
                                     <c:when test="${workReimbursement.uploadMode == 2}">
                                         <c:choose>
@@ -766,9 +927,9 @@
                                         <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                     </c:otherwise>
                                 </c:choose>
-                                <%--<c:if test="${workClientAttachment.collectFlag != 1}">
+                                &lt;%&ndash;<c:if test="${workClientAttachment.collectFlag != 1}">
                                     <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                </c:if>--%>
+                                </c:if>&ndash;%&gt;
 
                             </div>
                         </td>
@@ -777,7 +938,7 @@
                 </tbody>
             </table>
         </div>
-    </div>
+    </div>--%>
 
     <div class="form-group layui-row">
         <div class="form-group-label"><h2>附件</h2></div>

+ 508 - 189
src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllModifyApply.jsp

@@ -197,11 +197,19 @@
 
             var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
             if(electronicInvoiceArr.length>0){
-                var leng = $("#file_attachment_InvoiceReimbursement tr").length;
+                for(var i = 0;i < electronicInvoiceArr.length;i++) {
+                    var fileName = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(9).val();
+                    if(!fileName){
+                        var row = i+1;
+                        parent.layer.msg("第" + row + "行数电发票文件上传错误,请重新上传", {icon: 5});
+                        flags= false;
+                    }
+                }
+                /*var leng = $("#file_attachment_InvoiceReimbursement tr").length;
                 if(leng != electronicInvoiceArr.length){
                     parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
                     flags= false;
-                }
+                }*/
             }
 
             var trlen = $("#workAccountList tr").length;
@@ -236,7 +244,7 @@
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -245,7 +253,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){
@@ -519,6 +528,47 @@
                 $(obj).html("&times;").attr("title", "删除");
                 $(obj).parent().parent().removeClass("error");
             }
+            console.log(123123123)
+
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+
+                var invoiceVATTaxesDelFlag = $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val()
+                if("1" != invoiceVATTaxesDelFlag){
+
+                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                    if (moneys!=undefined && isNumber(moneys)){
+                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                        }
+                    }
+                    if (taxAmount!=undefined && isNumber(taxAmount)){
+                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                        }
+                    }
+                    if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                        }
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
         function urlRedict(file,attach){
             parent.layer.confirm('确定删除吗?', {
@@ -557,169 +607,248 @@
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
         }
 
-        function insertTitleInvoiceReimbursement(tValue){
+        async function insertTitleInvoiceReimbursement(tValue) {
+            var id = "${workReimbursement.id}";
             var list = "${workReimbursement.workAttachmentInvoiceReimbursements}";
-            var size = (list.split('url')).length-1;
+            var size = (list.split('url')).length - 1;
             var files = $("#attachment_InvoiceReimbursement_file")[0].files;
-            //判断报销类型是否为电子报销
-            for(var i = 0;i<files.length;i++) {
+
+            // 判断报销类型是否为电子报销
+            for (var i = 0; i < files.length; i++) {
                 var file = files[i];
-                //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+
+                // 如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
                 const spliceLength2 = file.name.lastIndexOf(".");
                 var fileNameSuffix = file.name.slice(spliceLength2 + 1);
-                if(fileNameSuffix === "xml" ) {
+                if (fileNameSuffix === "xml") {
                     var formdata = new FormData();
-                    formdata.append("multipartFile",file);
-                    $.ajax({
-                        type:'post',
-                        url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
-                        data:formdata,
-                        contentType: false,
-                        async: false,
-                        processData: false,
-                        success:function (data) {
-                            console.log(data)
-                            if(data.flag){
-                                top.layer.msg(data.message,{icon:2});
-                            }else{
-                                //获取专用发票信息 行数
-                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                console.log("trlen:" , trlen)
-                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
-                                var includeFlag = false;
-                                //xml文件处理
-                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
-                                //获取专用发票信息 行数
-                                for(var i = 0;i < trlen;i++){
-                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
-
-                                    if(invoiceNumber === data.InvoiceNumber && data.InvoiceNumber){
-                                        includeFlag = true
-                                        //数据处理
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
-                                        $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val("0")
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).show();
-                                    }
-                                }
-                                //若发票号不存在。则新增行将对应信息添加进去
-                                if(!includeFlag  && data.InvoiceNumber){
-                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
-
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(0).val("");
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(1).val(0);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).find("input").eq(0).val("");
-
-                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
-                                }
-                                var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
-                                var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
-                                var fileName = "";
-                                var fileNameFlag = true;
-                                for(var i = 0 ; i<attachmentFileLength; i++){
-                                    // 获取当前行中的第一个<td>元素
-                                    var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
-                                    // 检查第一个<td>元素是否存在
-                                    if (firstTd) {
-                                        // 获取第一个<td>元素中的第一个<a>标签
-                                        var firstA = firstTd.getElementsByTagName("a")[0];
-                                        // 检查第一个<a>标签是否存在
-                                        if (firstA) {
-                                            // 获取<a>标签中的文本信息
-                                            fileName = firstA.textContent || firstA.innerText;
-                                        } else {
-                                            console.log("在当前行中的第一个<td>元素中未找到<a>标签");
-                                        }
-                                    } else {
-                                        console.log("在当前行中未找到<td>元素");
-                                    }
-
-                                    if(fileName == file.name){
-                                        fileNameFlag = false;
-                                        break;
-                                    }
-
-                                }
-
-                                if(fileNameFlag){
-                                    var attachmentId = "";
-                                    var attachmentFlag = "workInvoiceReimbursement";
-                                    var timestamp=new Date().getTime();
-
-                                    var storeAs = "workInvoiceReimbursement";
-                                    var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-                                    var divId = "_attachment_InvoiceReimbursement";
-                                    $("#addFile"+divId).show();
-                                    console.log(file)
-                                    invoiceReimbursementMultipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
-                                }else{
-                                    parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", {icon: 5});
-                                    return false;
+                    formdata.append("multipartFile", file);
+                    formdata.append("id", id);
+
+                    try {
+                        // 使用 async/await 等待 AJAX 请求完成
+                        const data = await uploadXmlFile(formdata);
+
+                        if (data.flag) {
+                            top.layer.msg(data.message, { icon: 2 });
+                        } else {
+                            // 获取专用发票信息 行数
+                            var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                            var includeFlag = false;
+
+                            // xml文件处理
+                            // 首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                            for (var j = 0; j < trlen; j++) {
+                                var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(j).find("td").eq(3).find("input").eq(0).val();
+
+                                if (invoiceNumber === data.InvoiceNumber && data.InvoiceNumber) {
+                                    includeFlag = true;
+                                    // 数据处理
+                                    updateInvoiceRow(j, data);
+                                    // 检查文件是否已上传
+                                    await handleFileUpload(file, size, j);
+                                    break;
                                 }
+                            }
 
-                                var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                var reimbursementElectronicInvoiceVATTaxesMoneys = "";
-                                var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
-                                var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
-                                for(var i = 0;i < invoiceVATTaxes;i++){
-                                    var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
-                                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
-                                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
-                                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
-
-                                    if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
-                                        }
-                                    }
-                                    if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
-                                        }
-                                    }
-                                    if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
-                                        }
-                                    }
-                                }
-                                $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
-                                $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
-                                $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+                            // 若发票号不存在,则新增行将对应信息添加进去
+                            if (!includeFlag && data.InvoiceNumber) {
+                                addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+                                updateInvoiceRow(trlen, data);
+                                // 检查文件是否已上传
+                                await handleFileUpload(file, size, trlen);
+                                reimbursementElectronicInvoiceVATTaxesRowIdx++;
                             }
 
                         }
-                    });
-                }
-                else{
-                    parent.layer.msg("请上传xml格式文件!", {icon: 5});
+                    } catch (error) {
+                        console.error('文件上传失败', error);
+                        parent.layer.msg("文件上传失败,请重试!", { icon: 5 });
+                        return false;
+                    }
+                } else {
+                    parent.layer.msg("请上传xml格式文件!", { icon: 5 });
                     return false;
                 }
             }
+        }
+
+        // 上传 XML 文件的异步函数
+        function uploadXmlFile(formdata) {
+            return new Promise((resolve, reject) => {
+                $.ajax({
+                    type: 'POST',
+                    url: "${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                    data: formdata,
+                    contentType: false,
+                    async: true,
+                    processData: false,
+                    success: function (data) {
+                        resolve(data); // 成功返回数据
+                    },
+                    error: function (error) {
+                        reject(error); // 发生错误时拒绝
+                    }
+                });
+            });
+        }
 
+        // 更新发票行数据
+        function updateInvoiceRow(index, data) {
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(9).find("input").eq(0).val("");
+            $("#reimbursementElectronicInvoiceVATTaxes" + index + "_delFlag").val("0");
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).show();
+        }
+
+        // 处理文件上传
+        async function handleFileUpload(file, size, trlen) {
+            var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
+            var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
+            var fileName = "";
+            var fileNameFlag = true;
+
+            // 检查文件是否已上传
+            for (var i = 0; i < attachmentFileLength; i++) {
+                var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
+                if (firstTd) {
+                    var firstA = firstTd.getElementsByTagName("a")[0];
+                    if (firstA) {
+                        fileName = firstA.textContent || firstA.innerText;
+                    }
+                }
+
+                if (fileName == file.name) {
+                    fileNameFlag = false;
+                    break;
+                }
+            }
+
+            if (fileNameFlag) {
+                // 确保所有变量在使用之前都已初始化
+                let attachmentId = "";
+                let attachmentFlag = "workInvoiceReimbursement";  // 确保这里初始化变量
+                let timestamp = new Date().getTime();
+                let storeAs = "workInvoiceReimbursement";
+                let uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+
+                $("#addFile_attachment_InvoiceReimbursement").show();
+
+                try {
+                    // 调用文件上传函数
+                    const map = await invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, "_attachment_InvoiceReimbursement", size);
+
+                    // 获取上传返回的参数
+                    const fileUrl = map.get("fileUrl");
+                    const createByName = map.get("createByName");
+                    const createDate = map.get("createDate");
+
+                    // 确保 attachmentId 在此时被赋值
+                    attachmentId = map.get("attachmentId");
+
+                    const download = map.get("download");
+                    const del = map.get("del");
+
+                    // 更新页面上的文件信息
+                    // 清空指定的单元格内容
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).empty();
+                    // 添加新的数据
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).append(fileUrl);
+
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).append(createByName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).append(createDate);
+                    // 定位到目标 td 并清除其中的所有 a 标签
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).find("a").remove();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).prepend(download);
+
+
+                    // 获取其他上传的文件信息
+                    const url = map.get("url");
+                    const fileName = map.get("fileName");
+                    const temporaryUrl = map.get("temporaryUrl");
+                    const attachmentName = map.get("attachmentName");
+                    const createById = map.get("createBy");
+                    const type = map.get("type");
+                    const fileSize = map.get("fileSize");
+                    const divIdType = map.get("divIdType");
+
+                    // 更新表格中的文件信息
+                    // 清空 input 的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val('');
+                    // 设置新的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val(url);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val(fileName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val(attachmentId);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val(temporaryUrl);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val(attachmentName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val(createById);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val(type);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val(attachmentFlag);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val(fileSize);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val(divIdType);
+
+                } catch (error) {
+                    console.error('文件上传失败', error);
+                }
+            } else {
+                parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", { icon: 5 });
+                return false;
+            }
+
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
 
 
@@ -967,6 +1096,10 @@
             padding-left: 0px;
             padding-right: 0px;
         }
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -1480,25 +1613,29 @@
 
         <div class="form-group layui-row count2">
             <div class="form-group-label"><h2>数电发票信息<span style="color: red;font-size: 14px"> (可通过上传数电发票xml格式的附件自动获取发票信息)</span></h2></div>
+            <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <%--<div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
             </div>--%>
             <div class="layui-item nav-btns">
                 <a id="attachment_btn_InvoiceReimbursement" class="nav-btn nav-btn-add" title="上传数电发票xml文件"><i class="fa fa-plus"></i>&nbsp;上传xml文件</a>
             </div>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr>
-                        <th width="150px"><font color="red">*</font>发票类型</th>
-                        <th width="200px"><font color="red">*</font>发票项目名</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>开票日期</th>
-                        <th width="200px"><font color="red">*</font>开票单位</th>
-                        <th width="150px"><font color="red">*</font>金额</th>
-                        <th width="150px"><font color="red">*</font>税额</th>
-                        <th width="150px"><font color="red">*</font>价税合计</th>
-                        <th width="200px">备注</th>
+                        <th width="100px"><font color="red">*</font>发票类型</th>
+                        <th width="150px"><font color="red">*</font>发票项目名</th>
+                        <th width="150px"><font color="red">*</font>发票号</th>
+                        <th width="150px"><font color="red">*</font>开票日期</th>
+                        <th width="150px"><font color="red">*</font>开票单位</th>
+                        <th width="100px"><font color="red">*</font>金额</th>
+                        <th width="100px"><font color="red">*</font>税额</th>
+                        <th width="100px"><font color="red">*</font>价税合计</th>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                        <th width="100px">上传人</th>
+                        <th width="150px">上传时间</th>
+                        <th width="200px">操作<th>
                         <%--<th width="150px">操作</th>--%>
                     </tr>
                     </thead>
@@ -1511,6 +1648,18 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}"/>
 
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_url" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].url" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.url}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentId}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].temporaryUrl" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_createById" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].createById" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.createById}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_type" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].type" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.type}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentFlag" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentFlag}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileSize" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileSize}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].divIdType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.divIdType}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_workAttachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].workAttachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.workAttachmentId}"/>
+
                                 </td>
                                     <%--发票类型--%>
                                 <td>
@@ -1545,35 +1694,185 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                                 </td>
                                     <%--备注--%>
-                                <td>
-                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
+                                <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                        ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                    <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
                                 </td>
-                                <%--<td class="text-center op-td">
+                                <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                        <%--附件下载删除--%>
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                    <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        </c:otherwise>
+                                    </c:choose>
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                </td>--%>
+                                </td>
                             </tr>
                         </c:forEach>
                     </c:if>
                     </tbody>
                 </table>
-                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr >
-                        <td width="150px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="150px" style="border: 0px">
+                        <td width="100px">费用汇总(元):</td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="100px" style="border: 0px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="200px"></td>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                        <th width="100px"></th>
+                        <th width="150px"></th>
+                        <th width="200px"><th>
                     </tr>
                     </thead>
                 </table>
@@ -1583,6 +1882,18 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_id" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" type="hidden" value="{{row.invoiceType}}"/>
+
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_url" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].url" type="hidden" value="{{row.url}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileName" type="hidden" value="{{row.fileName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentId" type="hidden" value="{{row.attachmentId}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].temporaryUrl" type="hidden" value="{{row.temporaryUrl}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentName" type="hidden" value="{{row.attachmentName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_createById" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_type" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentFlag" type="hidden" value="{{row.attachmentFlag}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileSize" type="hidden" value="{{row.fileSize}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].divIdType" type="hidden" value="{{row.divIdType}}"/>
+
                         </td>
                             <%--发票类型--%>
                         <td>
@@ -1617,12 +1928,20 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                         </td>
                             <%--备注--%>
-                         <td>
-                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>
+                         <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                        <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                            <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                         </td>
-                        <%--<td class="text-center op-td">
-                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
-                        </td>--%>
                     </tr>//-->
                 </script>
                 <script type="text/javascript">
@@ -1645,14 +1964,14 @@
             </div>
         </div>
 
-        <div class="form-group layui-row count2">
+        <%--<div class="form-group layui-row count2">
             <input id="attachment_InvoiceReimbursement_file" name="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <span id="attachment_title"></span>
             <div class="layui-item layui-col-xs12" style="padding:0 16px;">
                 <table id="listAttachment" class="table table-bordered table-condensed details">
                     <thead>
                     <tr>
-                            <%-- <th>序号</th>--%>
+                            &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                         <th>数电发票文件预览</th>
                         <th>上传人</th>
                         <th>上传时间</th>
@@ -1663,7 +1982,7 @@
                     <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                         <tr>
 
-                                <%-- <td>${status.index + 1}</td>--%>
+                                &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                             <c:choose>
                                 <c:when test="${workReimbursement.uploadMode == 2}">
                                     <c:choose>
@@ -1786,7 +2105,7 @@
                             <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                             <td class="op-td">
                                 <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
+                                        &lt;%&ndash;附件下载删除&ndash;%&gt;
                                     <c:choose>
                                         <c:when test="${workReimbursement.uploadMode == 2}">
                                             <c:choose>
@@ -1809,9 +2128,9 @@
                                             <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                         </c:otherwise>
                                     </c:choose>
-                                    <%--<c:if test="${workClientAttachment.collectFlag != 1}">
+                                    &lt;%&ndash;<c:if test="${workClientAttachment.collectFlag != 1}">
                                         <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                    </c:if>--%>
+                                    </c:if>&ndash;%&gt;
                                     <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
                                         <a href="javascript:void(0)" onclick="deleteFileFromAliyunByInvoiceReimbursement(this,'${ctx}/sys/workattachment/deleteFileFromAliyunByInvoiceReimbursement?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment_InvoiceReimbursement','_attachment_InvoiceReimbursement')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
                                     </c:if>
@@ -1823,7 +2142,7 @@
                     </tbody>
                 </table>
             </div>
-        </div>
+        </div>--%>
 
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>附件信息</h2></div>

+ 191 - 31
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewAudit.jsp

@@ -118,6 +118,10 @@
 		.query .layui-input-block {
 			margin-left: 116px;
 		}
+		#reimbursementElectronicInvoiceVATTaxes td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
 	</style>
 </head>
 <body>
@@ -452,19 +456,22 @@
 		</div>
 		<div class="form-group layui-row count2">
 			<div class="form-group-label"><h2>数电发票信息</h2></div>
-			<div class="layui-item layui-col-xs12 form-table-container">
-				<table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
 					<thead>
 					<tr>
-						<th width="200px"><font color="red">*</font>发票类型</th>
-						<th width="200px"><font color="red">*</font>发票项目名</th>
-						<th width="200px"><font color="red">*</font>发票号</th>
-						<th width="200px"><font color="red">*</font>开票日期</th>
-						<th width="200px"><font color="red">*</font>开票单位</th>
-						<th width="200px"><font color="red">*</font>金额</th>
-						<th width="200px"><font color="red">*</font>税额</th>
-						<th width="200px"><font color="red">*</font>价税合计</th>
-						<th width="200px">备注</th>
+						<th width="100px"><font color="red">*</font>发票类型</th>
+						<th width="150px"><font color="red">*</font>发票项目名</th>
+						<th width="150px"><font color="red">*</font>发票号</th>
+						<th width="150px"><font color="red">*</font>开票日期</th>
+						<th width="150px"><font color="red">*</font>开票单位</th>
+						<th width="100px"><font color="red">*</font>金额</th>
+						<th width="100px"><font color="red">*</font>税额</th>
+						<th width="100px"><font color="red">*</font>价税合计</th>
+						<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+						<th width="100px">上传人</th>
+						<th width="150px">上传时间</th>
+						<th width="200px">操作<th>
 					</tr>
 					</thead>
 					<tbody id="reimbursementElectronicInvoiceVATTaxes">
@@ -504,39 +511,192 @@
 									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control"/>
 								</td>
 									<%--备注--%>
-								<td>
-									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
-								</td>
+										<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+											<c:choose>
+												<c:when test="${workReimbursement.uploadMode == 2}">
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+															<img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																	<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																</c:when>
+																<c:otherwise>
+																	<c:choose>
+																		<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																			<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																		</c:when>
+																		<c:otherwise>
+																			<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																		</c:otherwise>
+																	</c:choose>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+															<img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																	<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																</c:when>
+																<c:otherwise>
+																	<c:choose>
+																		<c:when test="${workReimbursement.uploadMode == 2}">
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+																					<img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																							<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																						</c:when>
+																						<c:otherwise>
+																							<c:choose>
+																								<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:when>
+																								<c:otherwise>
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:otherwise>
+																							</c:choose>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:when>
+																		<c:otherwise>
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+																					<img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																							<a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																						</c:when>
+																						<c:otherwise>
+																							<c:choose>
+																								<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:when>
+																								<c:otherwise>
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:otherwise>
+																							</c:choose>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:otherwise>
+																	</c:choose>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</td>
+											<%--备注--%>
+										<td style="text-align: center; vertical-align: middle; ">
+												${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+										</td>
+											<%--备注--%>
+										<td style="text-align: center; vertical-align: middle; ">
+											<fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+										</td>
+										<td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+												<%--附件下载删除--%>
+											<c:choose>
+												<c:when test="${workReimbursement.uploadMode == 2}">
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+															<a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+																	<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																</c:when>
+																<c:otherwise>
+																	<a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:when>
+												<c:otherwise>
+													<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:otherwise>
+											</c:choose>
+											<%--<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>--%>
+										</td>
 							</tr>
 						</c:forEach>
 					</c:if>
 					</tbody>
 				</table>
-				<table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+				<table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
 					<thead>
 					<tr >
-						<td width="200px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-						<td width="200px"></td>
-						<td width="200px"></td>
-						<td width="200px"></td>
-						<td width="200px"></td>
-						<td width="200px" style="border: 0px">
+						<td width="100px">费用汇总(元):</td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="100px" style="border: 0px">
 							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
 						</td>
-						<td width="200px">
+						<td width="100px">
 							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
 						</td>
-						<td width="200px">
+						<td width="100px">
 							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
 						</td>
-						<td width="200px"></td>
+						<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+						<th width="100px"></th>
+						<th width="150px"></th>
+						<th width="200px"><th>
 					</tr>
 					</thead>
 				</table>
 			</div>
 		</div>
 
-		<div class="form-group layui-row count2">
+		<%--<div class="form-group layui-row count2">
 			<div class="form-group-label"><h2>数电发票附件信息</h2></div>
 			<div id="addFile_attachment_InvoiceReimbursement" style="display: none" class="upload-progress">
 				<span id="fileName_attachment_InvoiceReimbursement" ></span>
@@ -552,7 +712,7 @@
 				<table id="listAttachment" class="table table-bordered table-condensed details">
 					<thead>
 					<tr>
-							<%-- <th>序号</th>--%>
+							&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 						<th>数电发票文件预览</th>
 						<th>上传人</th>
 						<th>上传时间</th>
@@ -563,7 +723,7 @@
 					<c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
 						<tr>
 
-								<%-- <td>${status.index + 1}</td>--%>
+								&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 							<c:choose>
 								<c:when test="${workReimbursement.uploadMode == 2}">
 									<c:choose>
@@ -686,7 +846,7 @@
 							<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
 							<td class="op-td">
 								<div class="op-btn-box" >
-										<%--附件下载删除--%>
+										&lt;%&ndash;附件下载删除&ndash;%&gt;
 									<c:choose>
 										<c:when test="${workReimbursement.uploadMode == 2}">
 											<c:choose>
@@ -709,9 +869,9 @@
 											<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
 										</c:otherwise>
 									</c:choose>
-									<%--<c:if test="${workClientAttachment.collectFlag != 1}">
+									&lt;%&ndash;<c:if test="${workClientAttachment.collectFlag != 1}">
 										<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-									</c:if>--%>
+									</c:if>&ndash;%&gt;
 
 								</div>
 							</td>
@@ -720,7 +880,7 @@
 					</tbody>
 				</table>
 			</div>
-		</div>
+		</div>--%>
 
 		<div class="form-group layui-row">
 			<div class="form-group-label"><h2>附件</h2></div>

+ 506 - 186
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewFormAdd.jsp

@@ -193,16 +193,25 @@
 
                 var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
                 if(electronicInvoiceArr.length>0){
-                    var leng = $("#file_attachment_InvoiceReimbursement tr").length;
+
+                    for(var i = 0;i < electronicInvoiceArr.length;i++) {
+                        var fileName = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(9).val();
+                        if(!fileName){
+                            var row = i+1;
+                            parent.layer.msg("第" + row + "行数电发票文件上传错误,请重新上传", {icon: 5});
+                            flags= false;
+                        }
+                    }
+                    /*var leng = $("#file_attachment_InvoiceReimbursement tr").length;
                     if(leng != electronicInvoiceArr.length){
                         parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
                         flags= false;
-                    }
+                    }*/
                 }
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -211,7 +220,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){
@@ -450,6 +460,46 @@
                 $(obj).html("&times;").attr("title", "删除");
                 $(obj).parent().parent().removeClass("error");
             }
+
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var invoiceVATTaxesDelFlag = $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val()
+                if("1" != invoiceVATTaxesDelFlag){
+
+                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                    if (moneys!=undefined && isNumber(moneys)){
+                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                        }
+                    }
+                    if (taxAmount!=undefined && isNumber(taxAmount)){
+                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                        }
+                    }
+                    if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                        }
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+
         }
         function urlRedict(file,attach){
             parent.layer.confirm('确定删除吗?', {
@@ -490,174 +540,254 @@
 
         }
 
-        function insertTitleInvoiceReimbursement(tValue){
+        async function insertTitleInvoiceReimbursement(tValue) {
             var id = "${workReimbursement.id}";
             var list = "${workReimbursement.workAttachmentInvoiceReimbursements}";
-            var size = (list.split('url')).length-1;
+            var size = (list.split('url')).length - 1;
             var files = $("#attachment_InvoiceReimbursement_file")[0].files;
-            //判断报销类型是否为电子报销
-            for(var i = 0;i<files.length;i++) {
+
+            // 判断报销类型是否为电子报销
+            for (var i = 0; i < files.length; i++) {
                 var file = files[i];
-                //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+
+                // 如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
                 const spliceLength2 = file.name.lastIndexOf(".");
                 var fileNameSuffix = file.name.slice(spliceLength2 + 1);
-                if(fileNameSuffix === "xml" ) {
+                if (fileNameSuffix === "xml") {
                     var formdata = new FormData();
-                    formdata.append("multipartFile",file);
-                    formdata.append("id",id);
-                    $.ajax({
-                        type:'post',
-                        url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
-                        data:formdata,
-                        contentType: false,
-                        async: false,
-                        processData: false,
-                        success:function (data) {
-                            if(data.flag){
-                                top.layer.msg(data.message,{icon:2});
-                            }else{
-                                //获取专用发票信息 行数
-                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
-                                var includeFlag = false;
-                                //xml文件处理
-                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
-                                //获取专用发票信息 行数
-                                for(var i = 0;i < trlen;i++){
-                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
-
-                                    if(invoiceNumber === data.InvoiceNumber && data.InvoiceNumber){
-                                        includeFlag = true
-                                        //数据处理
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
-                                        $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val("0")
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).show();
-                                        break;
-                                    }
-                                }
-                                //若发票号不存在。则新增行将对应信息添加进去
-                                if(!includeFlag  && data.InvoiceNumber){
-                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
-
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(0).val("");
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(1).val(0);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).find("input").eq(0).val("");
-
-                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    formdata.append("multipartFile", file);
+                    formdata.append("id", id);
+
+                    try {
+                        // 使用 async/await 等待 AJAX 请求完成
+                        const data = await uploadXmlFile(formdata);
+
+                        if (data.flag) {
+                            top.layer.msg(data.message, { icon: 2 });
+                        } else {
+                            // 获取专用发票信息 行数
+                            var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                            var includeFlag = false;
+
+                            // xml文件处理
+                            // 首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                            for (var j = 0; j < trlen; j++) {
+                                var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(j).find("td").eq(3).find("input").eq(0).val();
+
+                                if (invoiceNumber === data.InvoiceNumber && data.InvoiceNumber) {
+                                    includeFlag = true;
+                                    // 数据处理
+                                    updateInvoiceRow(j, data);
+                                    // 检查文件是否已上传
+                                    await handleFileUpload(file, size, j);
+                                    break;
                                 }
+                            }
 
-                                var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
-                                var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
-                                var fileName = "";
-                                var fileNameFlag = true;
-                                for(var i = 0 ; i<attachmentFileLength; i++){
-                                    // 获取当前行中的第一个<td>元素
-                                    var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
-                                    // 检查第一个<td>元素是否存在
-                                    if (firstTd) {
-                                        // 获取第一个<td>元素中的第一个<a>标签
-                                        var firstA = firstTd.getElementsByTagName("a")[0];
-                                        // 检查第一个<a>标签是否存在
-                                        if (firstA) {
-                                            // 获取<a>标签中的文本信息
-                                            fileName = firstA.textContent || firstA.innerText;
-                                        } else {
-                                            console.log("在当前行中的第一个<td>元素中未找到<a>标签");
-                                        }
-                                    } else {
-                                        console.log("在当前行中未找到<td>元素");
-                                    }
-
-                                    if(fileName == file.name){
-                                        fileNameFlag = false;
-                                        break;
-                                    }
+                            // 若发票号不存在,则新增行将对应信息添加进去
+                            if (!includeFlag && data.InvoiceNumber) {
+                                addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+                                updateInvoiceRow(trlen, data);
+                                // 检查文件是否已上传
+                                await handleFileUpload(file, size, trlen);
+                                reimbursementElectronicInvoiceVATTaxesRowIdx++;
+                            }
 
-                                }
+                        }
+                    } catch (error) {
+                        console.error('文件上传失败', error);
+                        parent.layer.msg("文件上传失败,请重试!", { icon: 5 });
+                        return false;
+                    }
+                } else {
+                    parent.layer.msg("请上传xml格式文件!", { icon: 5 });
+                    return false;
+                }
+            }
+        }
 
-                                if(fileNameFlag){
-                                    var attachmentId = "";
-                                    var attachmentFlag = "workInvoiceReimbursement";
-                                    var timestamp=new Date().getTime();
-
-                                    var storeAs = "workInvoiceReimbursement";
-                                    var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-                                    var divId = "_attachment_InvoiceReimbursement";
-                                    $("#addFile"+divId).show();
-                                    invoiceReimbursementMultipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
-                                }else{
-                                    parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", {icon: 5});
-                                    return false;
-                                }
+        // 上传 XML 文件的异步函数
+        function uploadXmlFile(formdata) {
+            return new Promise((resolve, reject) => {
+                $.ajax({
+                    type: 'POST',
+                    url: "${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                    data: formdata,
+                    contentType: false,
+                    async: true,
+                    processData: false,
+                    success: function (data) {
+                        resolve(data); // 成功返回数据
+                    },
+                    error: function (error) {
+                        reject(error); // 发生错误时拒绝
+                    }
+                });
+            });
+        }
 
+        // 更新发票行数据
+        function updateInvoiceRow(index, data) {
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(9).find("input").eq(0).val("");
+            $("#reimbursementElectronicInvoiceVATTaxes" + index + "_delFlag").val("0");
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).show();
+        }
 
-                                var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                var reimbursementElectronicInvoiceVATTaxesMoneys = "";
-                                var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
-                                var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
-                                for(var i = 0;i < invoiceVATTaxes;i++){
-                                    var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
-                                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
-                                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
-                                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
-
-                                    if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
-                                        }
-                                    }
-                                    if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
-                                        }
-                                    }
-                                    if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
-                                        }
-                                    }
-                                }
-                                $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
-                                $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
-                                $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
-                            }
+        // 处理文件上传
+        async function handleFileUpload(file, size, trlen) {
+            var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
+            var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
+            var fileName = "";
+            var fileNameFlag = true;
+
+            // 检查文件是否已上传
+            for (var i = 0; i < attachmentFileLength; i++) {
+                var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
+                if (firstTd) {
+                    var firstA = firstTd.getElementsByTagName("a")[0];
+                    if (firstA) {
+                        fileName = firstA.textContent || firstA.innerText;
+                    }
+                }
 
-                        }
-                    });
+                if (fileName == file.name) {
+                    fileNameFlag = false;
+                    break;
                 }
-                else{
-                    parent.layer.msg("请上传xml格式文件!", {icon: 5});
-                    return false;
+            }
+
+            if (fileNameFlag) {
+                // 确保所有变量在使用之前都已初始化
+                let attachmentId = "";
+                let attachmentFlag = "workInvoiceReimbursement";  // 确保这里初始化变量
+                let timestamp = new Date().getTime();
+                let storeAs = "workInvoiceReimbursement";
+                let uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+
+                $("#addFile_attachment_InvoiceReimbursement").show();
+
+                try {
+                    // 调用文件上传函数
+                    const map = await invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, "_attachment_InvoiceReimbursement", size);
+
+                    // 获取上传返回的参数
+                    const fileUrl = map.get("fileUrl");
+                    const createByName = map.get("createByName");
+                    const createDate = map.get("createDate");
+
+                    // 确保 attachmentId 在此时被赋值
+                    attachmentId = map.get("attachmentId");
+
+                    const download = map.get("download");
+                    const del = map.get("del");
+
+                    // 更新页面上的文件信息
+                    // 清空指定的单元格内容
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).empty();
+                    // 添加新的数据
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).append(fileUrl);
+
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).append(createByName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).append(createDate);
+                    // 定位到目标 td 并清除其中的所有 a 标签
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).find("a").remove();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).prepend(download);
+
+
+                    // 获取其他上传的文件信息
+                    const url = map.get("url");
+                    const fileName = map.get("fileName");
+                    const temporaryUrl = map.get("temporaryUrl");
+                    const attachmentName = map.get("attachmentName");
+                    const createById = map.get("createBy");
+                    const type = map.get("type");
+                    const fileSize = map.get("fileSize");
+                    const divIdType = map.get("divIdType");
+
+                    // 更新表格中的文件信息
+                    // 清空 input 的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val('');
+                    // 设置新的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val(url);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val(fileName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val(attachmentId);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val(temporaryUrl);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val(attachmentName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val(createById);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val(type);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val(attachmentFlag);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val(fileSize);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val(divIdType);
+
+                } catch (error) {
+                    console.error('文件上传失败', error);
                 }
+            } else {
+                parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", { icon: 5 });
+                return false;
             }
 
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
 
 
+
+
+
         function deleteInvoiceReimbursementByNumber(number){
             if (number){
                 //xml文件处理
@@ -889,6 +1019,10 @@
             padding-left: 0px;
             padding-right: 0px;
         }
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -1213,23 +1347,27 @@
 
         <div class="form-group layui-row count2">
             <div class="form-group-label"><h2>数电发票信息<span style="color: red;font-size: 14px"> (可通过上传数电发票xml格式的附件自动获取发票信息)</span></h2></div>
+            <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <div class="layui-item nav-btns">
                 <%--<a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>--%>
                 <a id="attachment_btn_xml" class="nav-btn nav-btn-add" title="上传数电发票xml文件"><i class="fa fa-plus"></i>&nbsp;上传xml文件</a>
             </div>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr>
-                        <th width="150px"><font color="red">*</font>发票类型</th>
-                        <th width="200px"><font color="red">*</font>发票项目名</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>开票日期</th>
-                        <th width="200px"><font color="red">*</font>开票单位</th>
-                        <th width="150px"><font color="red">*</font>金额</th>
-                        <th width="150px"><font color="red">*</font>税额</th>
-                        <th width="150px"><font color="red">*</font>价税合计</th>
-                        <th width="200px">备注</th>
+                        <th width="100px"><font color="red">*</font>发票类型</th>
+                        <th width="150px"><font color="red">*</font>发票项目名</th>
+                        <th width="150px"><font color="red">*</font>发票号</th>
+                        <th width="150px"><font color="red">*</font>开票日期</th>
+                        <th width="150px"><font color="red">*</font>开票单位</th>
+                        <th width="100px"><font color="red">*</font>金额</th>
+                        <th width="100px"><font color="red">*</font>税额</th>
+                        <th width="100px"><font color="red">*</font>价税合计</th>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                        <th width="100px">上传人</th>
+                        <th width="150px">上传时间</th>
+                        <th width="200px">操作<th>
                         <%--<th width="150px">操作</th>--%>
                     </tr>
                     </thead>
@@ -1242,6 +1380,18 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}"/>
 
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_url" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].url" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.url}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentId}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].temporaryUrl" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_createById" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].createById" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.createById}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_type" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].type" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.type}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentFlag" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentFlag}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileSize" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileSize}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].divIdType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.divIdType}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_workAttachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].workAttachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.workAttachmentId}"/>
+
                                 </td>
                                     <%--发票类型--%>
                                 <td>
@@ -1276,35 +1426,185 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                                 </td>
                                     <%--备注--%>
-                                <td>
-                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
+                                <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                        <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                        <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                    <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                        </c:when>
+                                        <c:otherwise>
+                                        <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                    </c:choose>
+                                    </c:otherwise>
+                                    </c:choose>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                        <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                        <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                    </c:choose>
                                 </td>
-                                    <%--<td class="text-center op-td">
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                        ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                    <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+                                </td>
+                                    <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                            <%--附件下载删除--%>
+                                        <c:choose>
+                                            <c:when test="${workReimbursement.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                        <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                            </c:otherwise>
+                                        </c:choose>
                                         <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                    </td>--%>
+                                    </td>
                             </tr>
                         </c:forEach>
                     </c:if>
                     </tbody>
                 </table>
-                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr >
-                        <td width="150px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="150px" style="border: 0px">
+                        <td width="100px">费用汇总(元):</td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="100px" style="border: 0px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="200px"></td>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                        <th width="100px"></th>
+                        <th width="150px"></th>
+                        <th width="200px"><th>
                     </tr>
                     </thead>
                 </table>
@@ -1314,6 +1614,18 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_id" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" type="hidden" value="{{row.invoiceType}}"/>
+
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_url" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].url" type="hidden" value="{{row.url}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileName" type="hidden" value="{{row.fileName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentId" type="hidden" value="{{row.attachmentId}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].temporaryUrl" type="hidden" value="{{row.temporaryUrl}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentName" type="hidden" value="{{row.attachmentName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_createById" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_type" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentFlag" type="hidden" value="{{row.attachmentFlag}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileSize" type="hidden" value="{{row.fileSize}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].divIdType" type="hidden" value="{{row.divIdType}}"/>
+
                         </td>
                             <%--发票类型--%>
                         <td>
@@ -1348,12 +1660,20 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                         </td>
                             <%--备注--%>
-                         <td>
-                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>
+                         <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                        <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                            <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                         </td>
-                        <%--<td class="text-center op-td">
-                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
-                        </td>--%>
                     </tr>//-->
                 </script>
                 <script type="text/javascript">
@@ -1376,14 +1696,14 @@
             </div>
         </div>
 
-        <div class="form-group layui-row count2">
+        <%--<div class="form-group layui-row count2">
             <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <span id="attachment_title"></span>
             <div class="layui-item layui-col-xs12" style="padding:0 16px;">
                 <table id="listAttachment" class="table table-bordered table-condensed details">
                     <thead>
                     <tr>
-                            <%-- <th>序号</th>--%>
+                            &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                         <th>数电发票文件预览</th>
                         <th>上传人</th>
                         <th>上传时间</th>
@@ -1394,7 +1714,7 @@
                     <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                         <tr>
 
-                                <%-- <td>${status.index + 1}</td>--%>
+                                &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                             <c:choose>
                                 <c:when test="${workReimbursement.uploadMode == 2}">
                                     <c:choose>
@@ -1517,7 +1837,7 @@
                             <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                             <td class="op-td">
                                 <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
+                                        &lt;%&ndash;附件下载删除&ndash;%&gt;
                                     <c:choose>
                                         <c:when test="${workReimbursement.uploadMode == 2}">
                                             <c:choose>
@@ -1551,7 +1871,7 @@
                     </tbody>
                 </table>
             </div>
-        </div>
+        </div>--%>
 
 
         <div class="form-group layui-row">

+ 504 - 193
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewModifyApply.jsp

@@ -197,10 +197,13 @@
 
             var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
             if(electronicInvoiceArr.length>0){
-                var leng = $("#file_attachment_InvoiceReimbursement tr").length;
-                if(leng != electronicInvoiceArr.length){
-                    parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
-                    flags= false;
+                for(var i = 0;i < electronicInvoiceArr.length;i++) {
+                    var fileName = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(9).val();
+                    if(!fileName){
+                        var row = i+1;
+                        parent.layer.msg("第" + row + "行数电发票文件上传错误,请重新上传", {icon: 5});
+                        flags= false;
+                    }
                 }
             }
 
@@ -235,7 +238,7 @@
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -244,7 +247,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){
@@ -519,6 +523,45 @@
                 $(obj).html("&times;").attr("title", "删除");
                 $(obj).parent().parent().removeClass("error");
             }
+
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var invoiceVATTaxesDelFlag = $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val()
+                if("1" != invoiceVATTaxesDelFlag){
+
+                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                    if (moneys!=undefined && isNumber(moneys)){
+                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                        }
+                    }
+                    if (taxAmount!=undefined && isNumber(taxAmount)){
+                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                        }
+                    }
+                    if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                        }
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
         function urlRedict(file,attach){
             parent.layer.confirm('确定删除吗?', {
@@ -557,169 +600,248 @@
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
         }
 
-        function insertTitleInvoiceReimbursement(tValue){
+        async function insertTitleInvoiceReimbursement(tValue) {
+            var id = "${workReimbursement.id}";
             var list = "${workReimbursement.workAttachmentInvoiceReimbursements}";
-            var size = (list.split('url')).length-1;
+            var size = (list.split('url')).length - 1;
             var files = $("#attachment_InvoiceReimbursement_file")[0].files;
-            //判断报销类型是否为电子报销
-            for(var i = 0;i<files.length;i++) {
+
+            // 判断报销类型是否为电子报销
+            for (var i = 0; i < files.length; i++) {
                 var file = files[i];
-                //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+
+                // 如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
                 const spliceLength2 = file.name.lastIndexOf(".");
                 var fileNameSuffix = file.name.slice(spliceLength2 + 1);
-                if(fileNameSuffix === "xml" ) {
+                if (fileNameSuffix === "xml") {
                     var formdata = new FormData();
-                    formdata.append("multipartFile",file);
-                    $.ajax({
-                        type:'post',
-                        url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
-                        data:formdata,
-                        contentType: false,
-                        async: false,
-                        processData: false,
-                        success:function (data) {
-                            console.log(data)
-                            if(data.flag){
-                                top.layer.msg(data.message,{icon:2});
-                            }else{
-                                //获取专用发票信息 行数
-                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                console.log("trlen:" , trlen)
-                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
-                                var includeFlag = false;
-                                //xml文件处理
-                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
-                                //获取专用发票信息 行数
-                                for(var i = 0;i < trlen;i++){
-                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
-
-                                    if(invoiceNumber === data.InvoiceNumber && data.InvoiceNumber){
-                                        includeFlag = true
-                                        //数据处理
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
-                                        $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val("0")
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).show();
-                                    }
-                                }
-                                //若发票号不存在。则新增行将对应信息添加进去
-                                if(!includeFlag  && data.InvoiceNumber){
-                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
-
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(0).val("");
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(1).val(0);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).find("input").eq(0).val("");
-
-                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
-                                }
-                                var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
-                                var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
-                                var fileName = "";
-                                var fileNameFlag = true;
-                                for(var i = 0 ; i<attachmentFileLength; i++){
-                                    // 获取当前行中的第一个<td>元素
-                                    var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
-                                    // 检查第一个<td>元素是否存在
-                                    if (firstTd) {
-                                        // 获取第一个<td>元素中的第一个<a>标签
-                                        var firstA = firstTd.getElementsByTagName("a")[0];
-                                        // 检查第一个<a>标签是否存在
-                                        if (firstA) {
-                                            // 获取<a>标签中的文本信息
-                                            fileName = firstA.textContent || firstA.innerText;
-                                        } else {
-                                            console.log("在当前行中的第一个<td>元素中未找到<a>标签");
-                                        }
-                                    } else {
-                                        console.log("在当前行中未找到<td>元素");
-                                    }
-
-                                    if(fileName == file.name){
-                                        fileNameFlag = false;
-                                        break;
-                                    }
-
-                                }
-
-                                if(fileNameFlag){
-                                    var attachmentId = "";
-                                    var attachmentFlag = "workInvoiceReimbursement";
-                                    var timestamp=new Date().getTime();
-
-                                    var storeAs = "workInvoiceReimbursement";
-                                    var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-                                    var divId = "_attachment_InvoiceReimbursement";
-                                    $("#addFile"+divId).show();
-                                    console.log(file)
-                                    invoiceReimbursementMultipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
-                                }else{
-                                    parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", {icon: 5});
-                                    return false;
+                    formdata.append("multipartFile", file);
+                    formdata.append("id", id);
+
+                    try {
+                        // 使用 async/await 等待 AJAX 请求完成
+                        const data = await uploadXmlFile(formdata);
+
+                        if (data.flag) {
+                            top.layer.msg(data.message, { icon: 2 });
+                        } else {
+                            // 获取专用发票信息 行数
+                            var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                            var includeFlag = false;
+
+                            // xml文件处理
+                            // 首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                            for (var j = 0; j < trlen; j++) {
+                                var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(j).find("td").eq(3).find("input").eq(0).val();
+
+                                if (invoiceNumber === data.InvoiceNumber && data.InvoiceNumber) {
+                                    includeFlag = true;
+                                    // 数据处理
+                                    updateInvoiceRow(j, data);
+                                    // 检查文件是否已上传
+                                    await handleFileUpload(file, size, j);
+                                    break;
                                 }
+                            }
 
-                                var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                var reimbursementElectronicInvoiceVATTaxesMoneys = "";
-                                var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
-                                var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
-                                for(var i = 0;i < invoiceVATTaxes;i++){
-                                    var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
-                                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
-                                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
-                                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
-
-                                    if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
-                                        }
-                                    }
-                                    if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
-                                        }
-                                    }
-                                    if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
-                                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
-                                        }else {
-                                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
-                                        }
-                                    }
-                                }
-                                $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
-                                $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
-                                $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+                            // 若发票号不存在,则新增行将对应信息添加进去
+                            if (!includeFlag && data.InvoiceNumber) {
+                                addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+                                updateInvoiceRow(trlen, data);
+                                // 检查文件是否已上传
+                                await handleFileUpload(file, size, trlen);
+                                reimbursementElectronicInvoiceVATTaxesRowIdx++;
                             }
 
                         }
-                    });
-                }
-                else{
-                    parent.layer.msg("请上传xml格式文件!", {icon: 5});
+                    } catch (error) {
+                        console.error('文件上传失败', error);
+                        parent.layer.msg("文件上传失败,请重试!", { icon: 5 });
+                        return false;
+                    }
+                } else {
+                    parent.layer.msg("请上传xml格式文件!", { icon: 5 });
                     return false;
                 }
             }
+        }
+
+        // 上传 XML 文件的异步函数
+        function uploadXmlFile(formdata) {
+            return new Promise((resolve, reject) => {
+                $.ajax({
+                    type: 'POST',
+                    url: "${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                    data: formdata,
+                    contentType: false,
+                    async: true,
+                    processData: false,
+                    success: function (data) {
+                        resolve(data); // 成功返回数据
+                    },
+                    error: function (error) {
+                        reject(error); // 发生错误时拒绝
+                    }
+                });
+            });
+        }
+
+        // 更新发票行数据
+        function updateInvoiceRow(index, data) {
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(9).find("input").eq(0).val("");
+            $("#reimbursementElectronicInvoiceVATTaxes" + index + "_delFlag").val("0");
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).show();
+        }
+
+        // 处理文件上传
+        async function handleFileUpload(file, size, trlen) {
+            var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
+            var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
+            var fileName = "";
+            var fileNameFlag = true;
+
+            // 检查文件是否已上传
+            for (var i = 0; i < attachmentFileLength; i++) {
+                var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
+                if (firstTd) {
+                    var firstA = firstTd.getElementsByTagName("a")[0];
+                    if (firstA) {
+                        fileName = firstA.textContent || firstA.innerText;
+                    }
+                }
+
+                if (fileName == file.name) {
+                    fileNameFlag = false;
+                    break;
+                }
+            }
 
+            if (fileNameFlag) {
+                // 确保所有变量在使用之前都已初始化
+                let attachmentId = "";
+                let attachmentFlag = "workInvoiceReimbursement";  // 确保这里初始化变量
+                let timestamp = new Date().getTime();
+                let storeAs = "workInvoiceReimbursement";
+                let uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+
+                $("#addFile_attachment_InvoiceReimbursement").show();
+
+                try {
+                    // 调用文件上传函数
+                    const map = await invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, "_attachment_InvoiceReimbursement", size);
+
+                    // 获取上传返回的参数
+                    const fileUrl = map.get("fileUrl");
+                    const createByName = map.get("createByName");
+                    const createDate = map.get("createDate");
+
+                    // 确保 attachmentId 在此时被赋值
+                    attachmentId = map.get("attachmentId");
+
+                    const download = map.get("download");
+                    const del = map.get("del");
+
+                    // 更新页面上的文件信息
+                    // 清空指定的单元格内容
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).empty();
+                    // 添加新的数据
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).append(fileUrl);
+
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).append(createByName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).append(createDate);
+                    // 定位到目标 td 并清除其中的所有 a 标签
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).find("a").remove();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).prepend(download);
+
+
+                    // 获取其他上传的文件信息
+                    const url = map.get("url");
+                    const fileName = map.get("fileName");
+                    const temporaryUrl = map.get("temporaryUrl");
+                    const attachmentName = map.get("attachmentName");
+                    const createById = map.get("createBy");
+                    const type = map.get("type");
+                    const fileSize = map.get("fileSize");
+                    const divIdType = map.get("divIdType");
+
+                    // 更新表格中的文件信息
+                    // 清空 input 的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val('');
+                    // 设置新的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val(url);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val(fileName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val(attachmentId);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val(temporaryUrl);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val(attachmentName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val(createById);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val(type);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val(attachmentFlag);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val(fileSize);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val(divIdType);
+
+                } catch (error) {
+                    console.error('文件上传失败', error);
+                }
+            } else {
+                parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", { icon: 5 });
+                return false;
+            }
+
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
 
 
@@ -967,6 +1089,10 @@
             padding-left: 0px;
             padding-right: 0px;
         }
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -985,7 +1111,6 @@
     <form:hidden id="flag" path="act.flag"/>
         <input type="hidden" id="numberFlag" value="${workReimbursement.number}" />
         <input id="wId" type="hidden" value="${workReimbursement.id}">
-        <input id="wId" type="hidden" value="${workReimbursement.reimbursementType}">
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
             <%--<div class="layui-item layui-col-sm6">
@@ -1480,25 +1605,29 @@
 
         <div class="form-group layui-row count2">
             <div class="form-group-label"><h2>数电发票信息<span style="color: red;font-size: 14px"> (可通过上传数电发票xml格式的附件自动获取发票信息)</span></h2></div>
-            <%--<div class="layui-item nav-btns">
+            <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
+        <%--<div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
             </div>--%>
             <div class="layui-item nav-btns">
                 <a id="attachment_btn_InvoiceReimbursement" class="nav-btn nav-btn-add" title="上传数电发票xml文件"><i class="fa fa-plus"></i>&nbsp;上传xml文件</a>
             </div>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin">
+            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr>
-                        <th width="150px"><font color="red">*</font>发票类型</th>
-                        <th width="200px"><font color="red">*</font>发票项目名</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>开票日期</th>
-                        <th width="200px"><font color="red">*</font>开票单位</th>
-                        <th width="150px"><font color="red">*</font>金额</th>
-                        <th width="150px"><font color="red">*</font>税额</th>
-                        <th width="150px"><font color="red">*</font>价税合计</th>
-                        <th width="200px">备注</th>
+                        <th width="100px"><font color="red">*</font>发票类型</th>
+                        <th width="150px"><font color="red">*</font>发票项目名</th>
+                        <th width="150px"><font color="red">*</font>发票号</th>
+                        <th width="150px"><font color="red">*</font>开票日期</th>
+                        <th width="150px"><font color="red">*</font>开票单位</th>
+                        <th width="100px"><font color="red">*</font>金额</th>
+                        <th width="100px"><font color="red">*</font>税额</th>
+                        <th width="100px"><font color="red">*</font>价税合计</th>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                        <th width="100px">上传人</th>
+                        <th width="150px">上传时间</th>
+                        <th width="200px">操作<th>
                         <%--<th width="150px">操作</th>--%>
                     </tr>
                     </thead>
@@ -1511,6 +1640,18 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}"/>
 
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_url" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].url" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.url}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentId}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].temporaryUrl" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_createById" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].createById" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.createById}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_type" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].type" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.type}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentFlag" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentFlag}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileSize" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileSize}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].divIdType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.divIdType}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_workAttachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].workAttachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.workAttachmentId}"/>
+
                                 </td>
                                     <%--发票类型--%>
                                 <td>
@@ -1545,35 +1686,185 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                                 </td>
                                     <%--备注--%>
-                                <td>
-                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
+                                <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                        ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
                                 </td>
-                                <%--<td class="text-center op-td">
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                    <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+                                </td>
+                                <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                        <%--附件下载删除--%>
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                    <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        </c:otherwise>
+                                    </c:choose>
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                </td>--%>
+                                </td>
                             </tr>
                         </c:forEach>
                     </c:if>
                     </tbody>
                 </table>
-                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin">
+                <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr >
-                        <td width="150px" style="vertical-align:middle;text-align: center;"><label>费用汇总(元):</label></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="200px"></td>
-                        <td width="150px" style="border: 0px">
+                        <td width="100px">费用汇总(元):</td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="150px"></td>
+                        <td width="100px" style="border: 0px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="150px">
+                        <td width="100px">
                             <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
                         </td>
-                        <td width="200px"></td>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                        <th width="100px"></th>
+                        <th width="150px"></th>
+                        <th width="200px"><th>
                     </tr>
                     </thead>
                 </table>
@@ -1583,6 +1874,18 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_id" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" type="hidden" value="{{row.invoiceType}}"/>
+
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_url" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].url" type="hidden" value="{{row.url}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileName" type="hidden" value="{{row.fileName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentId" type="hidden" value="{{row.attachmentId}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].temporaryUrl" type="hidden" value="{{row.temporaryUrl}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentName" type="hidden" value="{{row.attachmentName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_createById" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_type" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentFlag" type="hidden" value="{{row.attachmentFlag}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileSize" type="hidden" value="{{row.fileSize}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].divIdType" type="hidden" value="{{row.divIdType}}"/>
+
                         </td>
                             <%--发票类型--%>
                         <td>
@@ -1617,12 +1920,20 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                         </td>
                             <%--备注--%>
-                         <td>
-                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>
+                         <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                        <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                            <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                         </td>
-                        <%--<td class="text-center op-td">
-                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
-                        </td>--%>
                     </tr>//-->
                 </script>
                 <script type="text/javascript">
@@ -1645,14 +1956,14 @@
             </div>
         </div>
 
-        <div class="form-group layui-row count2">
+        <%--<div class="form-group layui-row count2">
             <input id="attachment_InvoiceReimbursement_file" name="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <span id="attachment_title"></span>
             <div class="layui-item layui-col-xs12" style="padding:0 16px;">
                 <table id="listAttachment" class="table table-bordered table-condensed details">
                     <thead>
                     <tr>
-                            <%-- <th>序号</th>--%>
+                            &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                         <th>数电发票文件预览</th>
                         <th>上传人</th>
                         <th>上传时间</th>
@@ -1663,7 +1974,7 @@
                     <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                         <tr>
 
-                                <%-- <td>${status.index + 1}</td>--%>
+                                &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                             <c:choose>
                                 <c:when test="${workReimbursement.uploadMode == 2}">
                                     <c:choose>
@@ -1786,7 +2097,7 @@
                             <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                             <td class="op-td">
                                 <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
+                                        &lt;%&ndash;附件下载删除&ndash;%&gt;
                                     <c:choose>
                                         <c:when test="${workReimbursement.uploadMode == 2}">
                                             <c:choose>
@@ -1809,9 +2120,9 @@
                                             <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                         </c:otherwise>
                                     </c:choose>
-                                    <%--<c:if test="${workClientAttachment.collectFlag != 1}">
+                                    &lt;%&ndash;<c:if test="${workClientAttachment.collectFlag != 1}">
                                         <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                    </c:if>--%>
+                                    </c:if>&ndash;%&gt;
                                     <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
                                         <a href="javascript:void(0)" onclick="deleteFileFromAliyunByInvoiceReimbursement(this,'${ctx}/sys/workattachment/deleteFileFromAliyunByInvoiceReimbursement?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment_InvoiceReimbursement','_attachment_InvoiceReimbursement')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
                                     </c:if>
@@ -1823,7 +2134,7 @@
                     </tbody>
                 </table>
             </div>
-        </div>
+        </div>--%>
 
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>附件信息</h2></div>

+ 1 - 1
src/main/webapp/webpage/modules/workreimbursement/replenish/workReimbursementReplenishCwAudit.jsp

@@ -228,7 +228,7 @@
 				if(electronicInvoiceArr.length>0){
 					var numberArr = [];
 					for(var i = 0;i < electronicInvoiceArr.length;i++) {
-						var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+						var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
 						numberArr.push(number)
 					}
 					//判定数据是否已经被发起或已完成报销申请

+ 236 - 20
src/main/webapp/webpage/modules/workreimbursement/specific/workReimbursementSpecificAudit.jsp

@@ -70,6 +70,41 @@
 					}
 				}
 			});
+			var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+			var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+			var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+			var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+			for(var i = 0;i < invoiceVATTaxes;i++){
+				var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val();
+				var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+				var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+
+				if (moneys!=undefined && !isNaN(moneys)){
+					if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+						reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+					}else {
+						reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+					}
+				}
+				if (taxAmount!=undefined && !isNaN(taxAmount)){
+					if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+						reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+					}else {
+						reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+					}
+				}
+				if (rsumMoney!=undefined && !isNaN(rsumMoney)){
+					if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+						reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+					}else {
+						reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+					}
+				}
+			}
+			$("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+			$("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+			$("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+
 		});
 	</script>
 	<style>
@@ -81,6 +116,10 @@
 		.query .layui-input-block {
 			margin-left: 116px;
 		}
+		#reimbursementElectronicInvoiceVATTaxes td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
 	</style>
 </head>
 <body>
@@ -413,19 +452,22 @@
 		</div>
 		<div class="form-group layui-row count2">
 			<div class="form-group-label"><h2>数电发票信息</h2></div>
-			<div class="layui-item layui-col-xs12 form-table-container">
-				<table id="contentTable3" class="table table-bordered table-condensed can-edit">
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
 					<thead>
 					<tr>
-						<th width="200px"><font color="red">*</font>发票类型</th>
-						<th width="200px"><font color="red">*</font>发票项目名</th>
-						<th width="200px"><font color="red">*</font>发票号</th>
-						<th width="200px"><font color="red">*</font>开票日期</th>
-						<th width="200px"><font color="red">*</font>开票单位</th>
-						<th width="200px"><font color="red">*</font>金额</th>
-						<th width="200px"><font color="red">*</font>税额</th>
-						<th width="200px"><font color="red">*</font>价税合计</th>
-						<th width="200px">备注</th>
+						<th width="100px"><font color="red">*</font>发票类型</th>
+						<th width="150px"><font color="red">*</font>发票项目名</th>
+						<th width="150px"><font color="red">*</font>发票号</th>
+						<th width="150px"><font color="red">*</font>开票日期</th>
+						<th width="150px"><font color="red">*</font>开票单位</th>
+						<th width="100px"><font color="red">*</font>金额</th>
+						<th width="100px"><font color="red">*</font>税额</th>
+						<th width="100px"><font color="red">*</font>价税合计</th>
+						<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+						<th width="100px">上传人</th>
+						<th width="150px">上传时间</th>
+						<th width="200px">操作<th>
 					</tr>
 					</thead>
 					<tbody id="reimbursementElectronicInvoiceVATTaxes">
@@ -464,19 +506,193 @@
 								<td>
 									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control"/>
 								</td>
-									<%--备注--%>
-								<td>
-									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
-								</td>
+											<%--备注--%>
+										<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+											<c:choose>
+												<c:when test="${workReimbursement.uploadMode == 2}">
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+															<img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																	<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																</c:when>
+																<c:otherwise>
+																	<c:choose>
+																		<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																			<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																		</c:when>
+																		<c:otherwise>
+																			<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																		</c:otherwise>
+																	</c:choose>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+															<img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																	<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																</c:when>
+																<c:otherwise>
+																	<c:choose>
+																		<c:when test="${workReimbursement.uploadMode == 2}">
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+																					<img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																							<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																						</c:when>
+																						<c:otherwise>
+																							<c:choose>
+																								<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:when>
+																								<c:otherwise>
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:otherwise>
+																							</c:choose>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:when>
+																		<c:otherwise>
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+																					<img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+																							<a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																						</c:when>
+																						<c:otherwise>
+																							<c:choose>
+																								<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:when>
+																								<c:otherwise>
+																									<a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+																								</c:otherwise>
+																							</c:choose>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:otherwise>
+																	</c:choose>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</td>
+											<%--备注--%>
+										<td style="text-align: center; vertical-align: middle; ">
+												${reimbursementElectronicInvoiceVATTaxes.createBy.name}
+										</td>
+											<%--备注--%>
+										<td style="text-align: center; vertical-align: middle; ">
+											<fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+										</td>
+										<td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+												<%--附件下载删除--%>
+											<c:choose>
+												<c:when test="${workReimbursement.uploadMode == 2}">
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+															<a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+																	<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																</c:when>
+																<c:otherwise>
+																	<a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:when>
+												<c:otherwise>
+													<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:otherwise>
+											</c:choose>
+												<%--<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>--%>
+										</td>
 							</tr>
 						</c:forEach>
 					</c:if>
 					</tbody>
 				</table>
+				<table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr >
+						<td width="100px">费用汇总(元):</td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="150px"></td>
+						<td width="100px" style="border: 0px">
+							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
+						</td>
+						<td width="100px">
+							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
+						</td>
+						<td width="100px">
+							<input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
+						</td>
+						<td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+						<th width="100px"></th>
+						<th width="150px"></th>
+						<th width="200px"><th>
+					</tr>
+					</thead>
+				</table>
 			</div>
 		</div>
 
-		<div class="form-group layui-row count2">
+		<%--<div class="form-group layui-row count2">
 			<div class="form-group-label"><h2>数电发票附件信息</h2></div>
 			<div id="addFile_attachment_InvoiceReimbursement" style="display: none" class="upload-progress">
 				<span id="fileName_attachment_InvoiceReimbursement" ></span>
@@ -492,7 +708,7 @@
 				<table id="listAttachment" class="table table-bordered table-condensed details">
 					<thead>
 					<tr>
-							<%-- <th>序号</th>--%>
+							&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 						<th>文件预览</th>
 						<th>上传人</th>
 						<th>上传时间</th>
@@ -503,7 +719,7 @@
 					<c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
 						<tr>
 
-								<%-- <td>${status.index + 1}</td>--%>
+								&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 							<c:choose>
 								<c:when test="${workReimbursement.uploadMode == 2}">
 									<c:choose>
@@ -626,7 +842,7 @@
 							<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
 							<td class="op-td">
 								<div class="op-btn-box" >
-										<%--附件下载删除--%>
+										&lt;%&ndash;附件下载删除&ndash;%&gt;
 									<c:choose>
 										<c:when test="${workReimbursement.uploadMode == 2}">
 											<c:choose>
@@ -660,7 +876,7 @@
 					</tbody>
 				</table>
 			</div>
-		</div>
+		</div>--%>
 
 		<div class="form-group layui-row">
 			<div class="form-group-label"><h2>附件</h2></div>

+ 556 - 106
src/main/webapp/webpage/modules/workreimbursement/specific/workReimbursementSpecificModifyApply.jsp

@@ -136,6 +136,41 @@
                     type : 'datetime'
                 });
             }*/
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys)){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount)){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+
 
         });
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
@@ -156,6 +191,18 @@
                 }
             }*/
 
+            var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
+            if(electronicInvoiceArr.length>0){
+                for(var i = 0;i < electronicInvoiceArr.length;i++) {
+                    var fileName = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(9).val();
+                    if(!fileName){
+                        var row = i+1;
+                        parent.layer.msg("第" + row + "行数电发票文件上传错误,请重新上传", {icon: 5});
+                        flags= false;
+                    }
+                }
+            }
+
             /*var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
             if(electronicInvoiceArr.length>0){
                 var flag = false;
@@ -227,7 +274,7 @@
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -236,7 +283,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){
@@ -510,6 +558,45 @@
                 $(obj).html("&times;").attr("title", "删除");
                 $(obj).parent().parent().removeClass("error");
             }
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var invoiceVATTaxesDelFlag = $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val()
+                if("1" != invoiceVATTaxesDelFlag){
+
+                    var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                    var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                    var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                    if (moneys!=undefined && isNumber(moneys)){
+                        if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                            reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                        }
+                    }
+                    if (taxAmount!=undefined && isNumber(taxAmount)){
+                        if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                        }
+                    }
+                    if (rsumMoney!=undefined && isNumber(rsumMoney)){
+                        if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                        }else {
+                            reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                        }
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
+
         }
         function urlRedict(file,attach){
             parent.layer.confirm('确定删除吗?', {
@@ -548,99 +635,248 @@
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
         }
 
-        function insertTitleInvoiceReimbursement(tValue){
+        async function insertTitleInvoiceReimbursement(tValue) {
+            var id = "${workReimbursement.id}";
             var list = "${workReimbursement.workAttachmentInvoiceReimbursements}";
-            var size = (list.split('url')).length-1;
+            var size = (list.split('url')).length - 1;
             var files = $("#attachment_InvoiceReimbursement_file")[0].files;
-            //判断报销类型是否为电子报销
-            for(var i = 0;i<files.length;i++) {
+
+            // 判断报销类型是否为电子报销
+            for (var i = 0; i < files.length; i++) {
                 var file = files[i];
-                //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+
+                // 如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
                 const spliceLength2 = file.name.lastIndexOf(".");
                 var fileNameSuffix = file.name.slice(spliceLength2 + 1);
-                if(fileNameSuffix === "xml" ) {
+                if (fileNameSuffix === "xml") {
                     var formdata = new FormData();
-                    formdata.append("multipartFile",file);
-                    $.ajax({
-                        type:'post',
-                        url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
-                        data:formdata,
-                        contentType: false,
-                        async: false,
-                        processData: false,
-                        success:function (data) {
-                            console.log(data)
-                            if(data.flag){
-                                top.layer.msg(data.message,{icon:2});
-                            }else{
-                                //获取专用发票信息 行数
-                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
-                                console.log("trlen:" , trlen)
-                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
-                                var includeFlag = false;
-                                //xml文件处理
-                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
-                                //获取专用发票信息 行数
-                                for(var i = 0;i < trlen;i++){
-                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
-
-                                    if(invoiceNumber === data.InvoiceNumber && data.InvoiceNumber){
-                                        includeFlag = true
-                                        //数据处理
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
-                                        $("#reimbursementElectronicInvoiceVATTaxes" + i + "_delFlag").val("0")
-                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).show();
-                                    }
-                                }
-                                //若发票号不存在。则新增行将对应信息添加进去
-                                if(!includeFlag  && data.InvoiceNumber){
-                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
-
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(0).val("");
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(1).val(0);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
-                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).find("input").eq(0).val("");
-
-                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    formdata.append("multipartFile", file);
+                    formdata.append("id", id);
+
+                    try {
+                        // 使用 async/await 等待 AJAX 请求完成
+                        const data = await uploadXmlFile(formdata);
+
+                        if (data.flag) {
+                            top.layer.msg(data.message, { icon: 2 });
+                        } else {
+                            // 获取专用发票信息 行数
+                            var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                            var includeFlag = false;
+
+                            // xml文件处理
+                            // 首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                            for (var j = 0; j < trlen; j++) {
+                                var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(j).find("td").eq(3).find("input").eq(0).val();
+
+                                if (invoiceNumber === data.InvoiceNumber && data.InvoiceNumber) {
+                                    includeFlag = true;
+                                    // 数据处理
+                                    updateInvoiceRow(j, data);
+                                    // 检查文件是否已上传
+                                    await handleFileUpload(file, size, j);
+                                    break;
                                 }
-                                var attachmentId = "";
-                                var attachmentFlag = "workInvoiceReimbursement";
-                                var timestamp=new Date().getTime();
-
-                                var storeAs = "workInvoiceReimbursement";
-                                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-                                var divId = "_attachment_InvoiceReimbursement";
-                                $("#addFile"+divId).show();
-                                console.log(file)
-                                invoiceReimbursementMultipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
+                            }
+
+                            // 若发票号不存在,则新增行将对应信息添加进去
+                            if (!includeFlag && data.InvoiceNumber) {
+                                addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+                                updateInvoiceRow(trlen, data);
+                                // 检查文件是否已上传
+                                await handleFileUpload(file, size, trlen);
+                                reimbursementElectronicInvoiceVATTaxesRowIdx++;
                             }
 
                         }
-                    });
-                }
-                else{
-                    parent.layer.msg("请上传xml格式文件!", {icon: 5});
+                    } catch (error) {
+                        console.error('文件上传失败', error);
+                        parent.layer.msg("文件上传失败,请重试!", { icon: 5 });
+                        return false;
+                    }
+                } else {
+                    parent.layer.msg("请上传xml格式文件!", { icon: 5 });
                     return false;
                 }
             }
+        }
+
+        // 上传 XML 文件的异步函数
+        function uploadXmlFile(formdata) {
+            return new Promise((resolve, reject) => {
+                $.ajax({
+                    type: 'POST',
+                    url: "${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                    data: formdata,
+                    contentType: false,
+                    async: true,
+                    processData: false,
+                    success: function (data) {
+                        resolve(data); // 成功返回数据
+                    },
+                    error: function (error) {
+                        reject(error); // 发生错误时拒绝
+                    }
+                });
+            });
+        }
+
+        // 更新发票行数据
+        function updateInvoiceRow(index, data) {
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(0).find("input").eq(2).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(1).find("input").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(4).find("input").eq(0).val(data.IssueTime);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(5).find("input").eq(0).val(data.SellerInformationSellerName);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(6).find("input").eq(0).val(data.BasicInformationTotalAmWithoutTax);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(7).find("input").eq(0).val(data.BasicInformationTotalTaxAm);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(8).find("input").eq(0).val(data.BasicInformationTotalTaxincludedAmount);
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).find("td").eq(9).find("input").eq(0).val("");
+            $("#reimbursementElectronicInvoiceVATTaxes" + index + "_delFlag").val("0");
+            $("#reimbursementElectronicInvoiceVATTaxes tr").eq(index).show();
+        }
+
+        // 处理文件上传
+        async function handleFileUpload(file, size, trlen) {
+            var attachmentFileLength = $("#file_attachment_InvoiceReimbursement tr").length;
+            var attachmentFile = $("#file_attachment_InvoiceReimbursement tr");
+            var fileName = "";
+            var fileNameFlag = true;
+
+            // 检查文件是否已上传
+            for (var i = 0; i < attachmentFileLength; i++) {
+                var firstTd = attachmentFile[i].getElementsByTagName("td")[0];
+                if (firstTd) {
+                    var firstA = firstTd.getElementsByTagName("a")[0];
+                    if (firstA) {
+                        fileName = firstA.textContent || firstA.innerText;
+                    }
+                }
+
+                if (fileName == file.name) {
+                    fileNameFlag = false;
+                    break;
+                }
+            }
+
+            if (fileNameFlag) {
+                // 确保所有变量在使用之前都已初始化
+                let attachmentId = "";
+                let attachmentFlag = "workInvoiceReimbursement";  // 确保这里初始化变量
+                let timestamp = new Date().getTime();
+                let storeAs = "workInvoiceReimbursement";
+                let uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+
+                $("#addFile_attachment_InvoiceReimbursement").show();
+
+                try {
+                    // 调用文件上传函数
+                    const map = await invoiceReimbursementMultipartUploadWithStss(storeAs, file, attachmentId, attachmentFlag, uploadPath, "_attachment_InvoiceReimbursement", size);
+
+                    // 获取上传返回的参数
+                    const fileUrl = map.get("fileUrl");
+                    const createByName = map.get("createByName");
+                    const createDate = map.get("createDate");
+
+                    // 确保 attachmentId 在此时被赋值
+                    attachmentId = map.get("attachmentId");
+
+                    const download = map.get("download");
+                    const del = map.get("del");
+
+                    // 更新页面上的文件信息
+                    // 清空指定的单元格内容
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).empty();
+                    // 添加新的数据
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(9).append(fileUrl);
+
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(10).append(createByName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).empty();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(11).append(createDate);
+                    // 定位到目标 td 并清除其中的所有 a 标签
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).find("a").remove();
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(12).prepend(download);
+
+
+                    // 获取其他上传的文件信息
+                    const url = map.get("url");
+                    const fileName = map.get("fileName");
+                    const temporaryUrl = map.get("temporaryUrl");
+                    const attachmentName = map.get("attachmentName");
+                    const createById = map.get("createBy");
+                    const type = map.get("type");
+                    const fileSize = map.get("fileSize");
+                    const divIdType = map.get("divIdType");
+
+                    // 更新表格中的文件信息
+                    // 清空 input 的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val('');
+                    // 设置新的值
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(3).val(url);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(4).val(fileName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(5).val(attachmentId);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(6).val(temporaryUrl);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(7).val(attachmentName);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(8).val(createById);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(9).val(type);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(10).val(attachmentFlag);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(11).val(fileSize);
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val('');
+                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(trlen).find("td").eq(0).find("input").eq(12).val(divIdType);
+
+                } catch (error) {
+                    console.error('文件上传失败', error);
+                }
+            } else {
+                parent.layer.msg("该电子发票xml文件已经上传,无法重复上传!", { icon: 5 });
+                return false;
+            }
 
+            var invoiceVATTaxes = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+            var reimbursementElectronicInvoiceVATTaxesMoneys = "";
+            var reimbursementElectronicInvoiceVATTaxesTaxAmount = "";
+            var reimbursementElectronicInvoiceVATTaxesSumMoney = "";
+            for(var i = 0;i < invoiceVATTaxes;i++){
+                var delFalg = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                var moneys = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
+                var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                var rsumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                if (moneys!=undefined && isNumber(moneys) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesMoneys==""){
+                        reimbursementElectronicInvoiceVATTaxesMoneys = parseFloat(moneys).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesMoneys = (parseFloat(reimbursementElectronicInvoiceVATTaxesMoneys) + parseFloat(moneys)).toFixed(2);
+                    }
+                }
+                if (taxAmount!=undefined && isNumber(taxAmount) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesTaxAmount==""){
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = parseFloat(taxAmount).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesTaxAmount = (parseFloat(reimbursementElectronicInvoiceVATTaxesTaxAmount) + parseFloat(taxAmount)).toFixed(2);
+                    }
+                }
+                if (rsumMoney!=undefined && isNumber(rsumMoney) && 1 != delFalg){
+                    if(reimbursementElectronicInvoiceVATTaxesSumMoney==""){
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = parseFloat(rsumMoney).toFixed(2);
+                    }else {
+                        reimbursementElectronicInvoiceVATTaxesSumMoney = (parseFloat(reimbursementElectronicInvoiceVATTaxesSumMoney) + parseFloat(rsumMoney)).toFixed(2);
+                    }
+                }
+            }
+            $("#reimbursementElectronicInvoiceVATTaxesMoneys").val(reimbursementElectronicInvoiceVATTaxesMoneys);
+            $("#reimbursementElectronicInvoiceVATTaxesTaxAmount").val(reimbursementElectronicInvoiceVATTaxesTaxAmount);
+            $("#reimbursementElectronicInvoiceVATTaxesSumMoney").val(reimbursementElectronicInvoiceVATTaxesSumMoney);
         }
 
 
@@ -840,6 +1076,10 @@
             padding-left: 0px;
             padding-right: 0px;
         }
+        #reimbursementElectronicInvoiceVATTaxes td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
     </style>
 </head>
 <body>
@@ -1353,22 +1593,29 @@
 
         <div class="form-group layui-row count2">
             <div class="form-group-label"><h2>数电发票信息<span style="color: red;font-size: 14px"> 可通过上传数电发票xml格式的附件自动获取发票信息</span></h2></div>
+            <input id="attachment_InvoiceReimbursement_file" type="file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitleInvoiceReimbursement(this.value);"/>
             <%--<div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
             </div>--%>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable3" class="table table-bordered table-condensed can-edit">
+            <div class="layui-item nav-btns">
+                <a id="attachment_btn_InvoiceReimbursement" class="nav-btn nav-btn-add" title="上传数电发票xml文件"><i class="fa fa-plus"></i>&nbsp;上传xml文件</a>
+            </div>
+            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                <table id="contentTable3" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                     <thead>
                     <tr>
-                        <th width="150px"><font color="red">*</font>发票类型</th>
-                        <th width="200px"><font color="red">*</font>发票项目名</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>开票日期</th>
-                        <th width="200px"><font color="red">*</font>开票单位</th>
-                        <th width="150px"><font color="red">*</font>金额</th>
-                        <th width="150px"><font color="red">*</font>税额</th>
-                        <th width="150px"><font color="red">*</font>价税合计</th>
-                        <th width="200px">备注</th>
+                        <th width="100px"><font color="red">*</font>发票类型</th>
+                        <th width="150px"><font color="red">*</font>发票项目名</th>
+                        <th width="150px"><font color="red">*</font>发票号</th>
+                        <th width="150px"><font color="red">*</font>开票日期</th>
+                        <th width="150px"><font color="red">*</font>开票单位</th>
+                        <th width="100px"><font color="red">*</font>金额</th>
+                        <th width="100px"><font color="red">*</font>税额</th>
+                        <th width="100px"><font color="red">*</font>价税合计</th>
+                        <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">文件预览</th>
+                        <th width="100px">上传人</th>
+                        <th width="150px">上传时间</th>
+                        <th width="200px">操作<th>
                         <%--<th width="150px">操作</th>--%>
                     </tr>
                     </thead>
@@ -1381,6 +1628,18 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}"/>
 
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_url" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].url" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.url}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentId}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].temporaryUrl" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentName" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentName}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_createById" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].createById" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.createById}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_type" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].type" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.type}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].attachmentFlag" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.attachmentFlag}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].fileSize" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.fileSize}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].divIdType" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.divIdType}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_workAttachmentId" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].workAttachmentId" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.workAttachmentId}"/>
+
                                 </td>
                                     <%--发票类型--%>
                                 <td>
@@ -1415,16 +1674,187 @@
                                     <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_sumMoney" onmouseover="this.title=this.value" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.sumMoney}"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                                 </td>
                                     <%--备注--%>
-                                <td>
-                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_remarks" onmouseover="this.title=this.value" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].remarks" type="text" maxlength="255" value="${reimbursementElectronicInvoiceVATTaxes.remarks}"    class="form-control input"/>
+                                <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                    <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpg')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'png')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'gif')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'bmp')
+                                                       or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jpeg')}">
+                                                                            <img src="${reimbursementElectronicInvoiceVATTaxes.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${reimbursementElectronicInvoiceVATTaxes.url}','90%','90%')" alt="${reimbursementElectronicInvoiceVATTaxes.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                                                    <a href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',1)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'rar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'zip')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'jar')
+                                                           or fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'7z')}">
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',3)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${reimbursementElectronicInvoiceVATTaxes.url}',2)">${reimbursementElectronicInvoiceVATTaxes.attachmentName}</a>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </td>
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                        ${reimbursementElectronicInvoiceVATTaxes.createBy.name}
                                 </td>
-                                <%--<td class="text-center op-td">
+                                    <%--备注--%>
+                                <td style="text-align: center; vertical-align: middle; ">
+                                    <fmt:formatDate value="${reimbursementElectronicInvoiceVATTaxes.createDate}" type="both"/>
+                                </td>
+                                <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                                        <%--附件下载删除--%>
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'pdf')}">
+                                                    <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(reimbursementElectronicInvoiceVATTaxes.attachmentName,'xml')}">
+                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${reimbursementElectronicInvoiceVATTaxes.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${reimbursementElectronicInvoiceVATTaxes.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        </c:otherwise>
+                                    </c:choose>
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                </td>--%>
+                                </td>
                             </tr>
                         </c:forEach>
                     </c:if>
                     </tbody>
+                    <table id="contentTable4" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr >
+                            <td width="100px">费用汇总(元):</td>
+                            <td width="150px"></td>
+                            <td width="150px"></td>
+                            <td width="150px"></td>
+                            <td width="150px"></td>
+                            <td width="100px" style="border: 0px">
+                                <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesMoneys" name="reimbursementElectronicInvoiceVATTaxesMoneys" readonly="true" class="form-control layui-input" value=""/>
+                            </td>
+                            <td width="100px">
+                                <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesTaxAmount" name="reimbursementElectronicInvoiceVATTaxesTaxAmount" readonly="true" class="form-control layui-input" value=""/>
+                            </td>
+                            <td width="100px">
+                                <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="reimbursementElectronicInvoiceVATTaxesSumMoney" name="reimbursementElectronicInvoiceVATTaxesSumMoney" readonly="true" class="form-control layui-input" value=""/>
+                            </td>
+                            <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></td>
+                            <th width="100px"></th>
+                            <th width="150px"></th>
+                            <th width="200px"><th>
+                        </tr>
+                        </thead>
+                    </table>
                 </table>
                 <script type="text/template" id="reimbursementElectronicInvoiceVATTaxesTpl">//<!--
                     <tr id="reimbursementElectronicInvoiceVATTaxes{{idx}}">
@@ -1432,6 +1862,18 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_id" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" type="hidden" value="{{row.invoiceType}}"/>
+
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_url" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].url" type="hidden" value="{{row.url}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileName" type="hidden" value="{{row.fileName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentId" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentId" type="hidden" value="{{row.attachmentId}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_temporaryUrl" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].temporaryUrl" type="hidden" value="{{row.temporaryUrl}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentName" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentName" type="hidden" value="{{row.attachmentName}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_createById" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_type" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_attachmentFlag" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].attachmentFlag" type="hidden" value="{{row.attachmentFlag}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_fileSize" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].fileSize" type="hidden" value="{{row.fileSize}}"/>
+                           <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_divIdType" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].divIdType" type="hidden" value="{{row.divIdType}}"/>
+
                         </td>
                             <%--发票类型--%>
                         <td>
@@ -1466,12 +1908,20 @@
                             <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  onmouseover="this.title=this.value" class="form-control number judgment sumMoney"/>
                         </td>
                             <%--备注--%>
-                         <td>
-                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>
+                         <td style="width: 200px; max-width: 200px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                            <%--备注--%>
+                         <td style="text-align: center; vertical-align: middle;">
+                            <%--<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_remarks"  name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].remarks" type="text" value="{{row.remarks}}" maxlength="255"  onmouseover="this.title=this.value" class="form-control"/>--%>
+                        </td>
+                        <td class="text-center op-td" style="display: flex; align-items: center; justify-content: center;">
+                            <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
                         </td>
-                        <%--<td class="text-center op-td">
-                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementElectronicInvoiceVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
-                        </td>--%>
                     </tr>//-->
                 </script>
                 <script type="text/javascript">
@@ -1494,7 +1944,7 @@
             </div>
         </div>
 
-        <div class="form-group layui-row count2">
+        <%--<div class="form-group layui-row count2">
             <div class="form-group-label"><h2><span class="require-item">*</span>数电发票附件信息<span style="color: red;font-size: 14px"> 上传报销的数电发票xml文件</span></h2></div>
             <div class="layui-item nav-btns">
                 <a id="attachment_btn_InvoiceReimbursement" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -1513,7 +1963,7 @@
                 <table id="listAttachment" class="table table-bordered table-condensed details">
                     <thead>
                     <tr>
-                            <%-- <th>序号</th>--%>
+                            &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                         <th>文件预览</th>
                         <th>上传人</th>
                         <th>上传时间</th>
@@ -1524,7 +1974,7 @@
                     <c:forEach items="${workReimbursement.workAttachmentInvoiceReimbursements}" var = "workClientAttachment" varStatus="status">
                         <tr>
 
-                                <%-- <td>${status.index + 1}</td>--%>
+                                &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                             <c:choose>
                                 <c:when test="${workReimbursement.uploadMode == 2}">
                                     <c:choose>
@@ -1647,7 +2097,7 @@
                             <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                             <td class="op-td">
                                 <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
+                                        &lt;%&ndash;附件下载删除&ndash;%&gt;
                                     <c:choose>
                                         <c:when test="${workReimbursement.uploadMode == 2}">
                                             <c:choose>
@@ -1684,7 +2134,7 @@
                     </tbody>
                 </table>
             </div>
-        </div>
+        </div>--%>
 
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>附件信息</h2></div>

+ 3 - 2
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -194,7 +194,7 @@
                 if(electronicInvoiceArr.length>0){
                     var numberArr = [];
                     for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                        var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(5).val();
+                        var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                         numberArr.push(number)
                     }
                     //判定数据是否已经被发起或已完成报销申请
@@ -203,7 +203,8 @@
                         async: false,
                         url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                         data:{
-                            "invoiceVATTaxesNumber":numberArr.join(",")
+                            "invoiceVATTaxesNumber":numberArr.join(","),
+                            "reimbursementId": $("#wId").val()
                         },
                         success:function(data){
                             if(!data.success){

+ 3 - 2
src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

@@ -155,7 +155,7 @@
             if(electronicInvoiceArr.length>0){
                 var numberArr = [];
                 for(var i = 0;i < electronicInvoiceArr.length;i++) {
-                    var number = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("input").eq(3).val();
+                    var number = $("#reimbursementElectronicInvoiceVATTaxes" + i +"_invoiceNumber").val();
                     numberArr.push(number)
                 }
                 //判定数据是否已经被发起或已完成报销申请
@@ -164,7 +164,8 @@
                     async: false,
                     url:'${ctx}/workreimbursement/workReimbursement/decideInvoiceVATTaxesByNumbers',
                     data:{
-                        "invoiceVATTaxesNumber":numberArr.join(",")
+                        "invoiceVATTaxesNumber":numberArr.join(","),
+                        "reimbursementId": $("#wId").val()
                     },
                     success:function(data){
                         if(!data.success){