فهرست منبع

报销添加电子发票报销功能

user5 1 سال پیش
والد
کامیت
c123a80f3e
27فایلهای تغییر یافته به همراه5987 افزوده شده و 139 حذف شده
  1. 42 0
      src/main/java/com/jeeplus/common/utils/FtlUtils.java
  2. 6 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java
  3. 119 4
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  4. 109 0
      src/main/java/com/jeeplus/modules/workreimbursement/entity/ReimbursementElectronicInvoiceVATTaxes.java
  5. 56 0
      src/main/java/com/jeeplus/modules/workreimbursement/entity/ReimbursementVATTax.java
  6. 35 0
      src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursement.java
  7. 621 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementNewService.java
  8. 53 1
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java
  9. 158 14
      src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java
  10. 69 3
      src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementNewController.java
  11. 21 4
      src/main/resources/mappings/modules/workreimbursement/ReimbursementVATTaxDao.xml
  12. 9 3
      src/main/resources/mappings/modules/workreimbursement/WorkReimbursementDao.xml
  13. 5 1
      src/main/webapp/static/common/js/common.js
  14. 1 1
      src/main/webapp/webpage/modules/workcontractinfo/newWorkContract/workContractAudit.jsp
  15. 2 2
      src/main/webapp/webpage/modules/workcontractinfo/workContractInfoLookForm.jsp
  16. 907 0
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementCWElectronicInvoiceReimbursementAudit.jsp
  17. 8 1
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementCWNewAudit.jsp
  18. 635 0
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementElectronicInvoiceAudit.jsp
  19. 1373 0
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementElectronicInvoiceReimbursementModifyApply.jsp
  20. 90 4
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewAudit.jsp
  21. 369 23
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewFormAdd.jsp
  22. 369 18
      src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewModifyApply.jsp
  23. 87 4
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementAudit.jsp
  24. 383 32
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp
  25. 92 4
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormDetail.jsp
  26. 2 2
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementList.jsp
  27. 366 18
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

+ 42 - 0
src/main/java/com/jeeplus/common/utils/FtlUtils.java

@@ -8,6 +8,7 @@ import org.dom4j.Element;
 import org.dom4j.io.OutputFormat;
 import org.dom4j.io.SAXReader;
 import org.dom4j.io.XMLWriter;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.*;
 import java.util.ArrayList;
@@ -204,4 +205,45 @@ public class FtlUtils {
         return bos.toString("UTF-8");
     }
 
+    /**
+     * MultipartFile转File
+     * @param file
+     * @return
+     * @throws IOException
+     */
+    public static File transformMultipartFile( MultipartFile file) throws IOException {
+        File srcFile = null;
+        //MultipartFile转File
+        if (file.equals("") || file.getSize() <= 0) {
+            file = null;
+        } else {
+            InputStream ins = null;
+            ins = file.getInputStream();
+            srcFile = new File(file.getOriginalFilename());
+            inputStreamToFile(ins, srcFile);
+            ins.close();
+        }
+        return srcFile;
+    }
+
+    /**
+     * 获取流文件
+     * @param ins
+     * @param file
+     */
+    public static void inputStreamToFile(InputStream ins, File file) {
+        try {
+            OutputStream os = new FileOutputStream(file);
+            int bytesRead = 0;
+            byte[] buffer = new byte[8192];
+            while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            ins.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
 }

+ 6 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java

@@ -1422,6 +1422,12 @@ public class WorkInvoiceAllTwoController extends BaseController {
 				break;
 			}
 		}
+
+		//获取发票开户银行信息
+		String bankName = invoiceService.getBankNameByNameOrId(workInvoice.getBank());
+		if(StringUtils.isNotBlank(bankName)){
+			workInvoice.setBank(bankName);
+		}
 		model.addAttribute("workInvoice", workInvoice);
 		model.addAttribute("view", workInvoice.getHome());
 		return "modules/workinvoice/workInvoiceModifyInfo";

+ 119 - 4
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -205,6 +205,7 @@ import com.jeeplus.modules.workregularapply.service.WorkRegularApplyService;
 import com.jeeplus.modules.workregularapply.service.WorkRegularScoreService;
 import com.jeeplus.modules.workreimbur.entity.WorkReimbur;
 import com.jeeplus.modules.workreimbur.service.WorkReimburService;
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
 import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
 import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
@@ -1336,14 +1337,37 @@ public class WorkProjectNotifyController extends BaseController {
 					}else{
 						model.addAttribute("isShow", '0');
 					}
+
+					switch (workReimbursement.getReimbursementType()){
+						case "0" :
+							workReimbursement.setReimbursementTypeStr("普通报销");
+							break;
+						case "1" :
+							workReimbursement.setReimbursementTypeStr("电子发票报销");
+							break;
+
+					}
+
+					if(null != workReimbursement.getReimbursementElectronicInvoiceVATTaxes() && workReimbursement.getReimbursementElectronicInvoiceVATTaxes().size()>0){
+						//获取专业类型
+						List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("invoiceReimbursementType");
+						for (ReimbursementVATTax vatTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+							for (MainDictDetail dictDetail : certificateMajor) {
+								if(dictDetail.getValue().equals(vatTax.getInvoiceType())){
+									vatTax.setInvoiceTypeStr(dictDetail.getLabel());
+								}
+							}
+						}
+					}
+
 					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
 						return "modules/workreimbursement/workReimbursementFormDetail";
 					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
 						model.addAttribute("identification","workreimbursement");
 						model.addAttribute("identificationName","报销审核意见");
-						if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
+						/*if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
 							return "modules/workreimbursement/workReimbursementCWAudit";
-						}
+						}*/
 						return "modules/workreimbursement/workReimbursementAudit";
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
 						User user=UserUtils.getUser();
@@ -1376,14 +1400,37 @@ public class WorkProjectNotifyController extends BaseController {
 					}else{
 						model.addAttribute("isShow", '0');
 					}
+
+					switch (workReimbursement.getReimbursementType()){
+						case "0" :
+							workReimbursement.setReimbursementTypeStr("普通报销");
+							break;
+						case "1" :
+							workReimbursement.setReimbursementTypeStr("电子发票报销");
+							break;
+
+					}
+
+					if(null != workReimbursement.getReimbursementElectronicInvoiceVATTaxes() && workReimbursement.getReimbursementElectronicInvoiceVATTaxes().size()>0){
+						//获取专业类型
+						List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("invoiceReimbursementType");
+						for (ReimbursementVATTax vatTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+							for (MainDictDetail dictDetail : certificateMajor) {
+								if(dictDetail.getValue().equals(vatTax.getInvoiceType())){
+									vatTax.setInvoiceTypeStr(dictDetail.getLabel());
+								}
+							}
+						}
+					}
+
 					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
 						return "modules/workreimbursement/workReimbursementFormDetail";
 					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
 						model.addAttribute("identification","workreimbursement");
 						model.addAttribute("identificationName","报销审核意见");
-						if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
+						/*if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
 							return "modules/workreimbursement/new/workReimbursementCWNewAudit";
-						}
+						}*/
 						return "modules/workreimbursement/new/workReimbursementNewAudit";
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
 						User user=UserUtils.getUser();
@@ -1393,6 +1440,10 @@ public class WorkProjectNotifyController extends BaseController {
 						return "modules/workreimbursement/workReimbursementFormDetail";
 					}
 
+				}else if (workProjectNotify.getType().equals("106")) {    //电子发票报销
+
+					return this.workReimbursementElectronicInvoiceAudit(workProjectNotify,model);
+
 				} else if (workProjectNotify.getType().equals("16")) {    //合同管理
 					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
 					if(StringUtils.isNotBlank(workContractInfo.getChargeCriterion())){
@@ -9746,4 +9797,68 @@ public class WorkProjectNotifyController extends BaseController {
 		return "modules/businessQuestions/businessQuestionsForm";
 	}
 
+	private String workReimbursementElectronicInvoiceAudit(WorkProjectNotify workProjectNotify,Model model) {
+		WorkReimbursement workReimbursement = workReimbursementService.get(workProjectNotify.getNotifyId());
+		//判断报销类型状态并添加报销类型信息数据
+		if(StringUtils.isNotBlank(workReimbursement.getType())){
+			WorkReimbursementTypeInfo workReimbursementTypeInfo = workReimbursementTypeService.get(workReimbursement.getType());
+			workReimbursement.setWorkReimbursementTypeInfo(workReimbursementTypeInfo);
+			if(StringUtils.isNotBlank(workReimbursementTypeInfo.getStandardDetail())){
+				workReimbursement.setTypeName(workReimbursementTypeInfo.getStandardDetail());
+			}
+		}
+		workReimbursement.setAct(getByAct(workReimbursement.getProcessInstanceId()));
+		if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+			workReimbursement.setHome(workProjectNotify.getHome());
+		}else{
+			workReimbursement.setHome("home");
+		}
+		model.addAttribute("workReimbursement", workReimbursement);
+		String param=UserUtils.getSysParam("check_subjects",UserUtils.getUser());
+		if("是".equals(param)){
+			model.addAttribute("isShow", '1');
+		}else{
+			model.addAttribute("isShow", '0');
+		}
+
+		switch (workReimbursement.getReimbursementType()){
+			case "0" :
+				workReimbursement.setReimbursementTypeStr("普通报销");
+				break;
+			case "1" :
+				workReimbursement.setReimbursementTypeStr("电子发票报销");
+				break;
+
+		}
+
+		if(null != workReimbursement.getReimbursementElectronicInvoiceVATTaxes() && workReimbursement.getReimbursementElectronicInvoiceVATTaxes().size()>0){
+			//获取专业类型
+			List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("invoiceReimbursementType");
+			for (ReimbursementVATTax vatTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+				for (MainDictDetail dictDetail : certificateMajor) {
+					if(dictDetail.getValue().equals(vatTax.getInvoiceType())){
+						vatTax.setInvoiceTypeStr(dictDetail.getLabel());
+					}
+				}
+			}
+		}
+
+		if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+			return "modules/workreimbursement/workReimbursementFormDetail";
+		}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+			model.addAttribute("identification","workreimbursement");
+			model.addAttribute("identificationName","报销审核意见");
+			/*if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
+				return "modules/workreimbursement/new/workReimbursementCWNewAudit";
+			}*/
+			return "modules/workreimbursement/new/workReimbursementNewAudit";
+		} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+			User user=UserUtils.getUser();
+			model.addAttribute("user", user);
+			return "modules/workreimbursement/new/workReimbursementNewModifyApply";
+		} else {
+			return "modules/workreimbursement/workReimbursementFormDetail";
+		}
+	}
+
 }

+ 109 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/ReimbursementElectronicInvoiceVATTaxes.java

@@ -0,0 +1,109 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workreimbursement.entity;
+
+
+import com.jeeplus.common.persistence.DataEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 财务报销Entity
+ * @author 孟祥越
+ * @version 2017-05-02
+ */
+public class ReimbursementElectronicInvoiceVATTaxes extends DataEntity<ReimbursementElectronicInvoiceVATTaxes> {
+
+	private static final long serialVersionUID = 1L;
+	private String invoiceType;		// 发票类型
+	private String invoiceNumber;		// 发票号
+	private Date invoiceDate;		// 开票日期
+	private String invoiceUnit;		// 开票单位
+	private String projectName;		// 项目名称
+	private BigDecimal money;		// 金额
+	private BigDecimal taxAmount;		// 税额
+	private BigDecimal sumMoney;		// 价税合计
+
+	public BigDecimal getMoney() {
+		return money;
+	}
+
+	public void setMoney(BigDecimal money) {
+		this.money = money;
+	}
+
+	public BigDecimal getSumMoney() {
+		return sumMoney;
+	}
+
+	public void setSumMoney(BigDecimal sumMoney) {
+		this.sumMoney = sumMoney;
+	}
+
+	private WorkReimbursement workReimbursement;		// 报销单主键 父类
+
+	public ReimbursementElectronicInvoiceVATTaxes() {
+		super();
+	}
+	public ReimbursementElectronicInvoiceVATTaxes(WorkReimbursement workReimbursement){
+		this.workReimbursement = workReimbursement;
+	}
+
+	public String getInvoiceNumber() {
+		return invoiceNumber;
+	}
+
+	public void setInvoiceNumber(String invoiceNumber) {
+		this.invoiceNumber = invoiceNumber;
+	}
+
+	public BigDecimal getTaxAmount() {
+		return taxAmount;
+	}
+
+	public void setTaxAmount(BigDecimal taxAmount) {
+		this.taxAmount = taxAmount;
+	}
+
+	public WorkReimbursement getWorkReimbursement() {
+		return workReimbursement;
+	}
+
+	public void setWorkReimbursement(WorkReimbursement workReimbursement) {
+		this.workReimbursement = workReimbursement;
+	}
+
+	public String getInvoiceType() {
+		return invoiceType;
+	}
+
+	public void setInvoiceType(String invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+
+	public Date getInvoiceDate() {
+		return invoiceDate;
+	}
+
+	public void setInvoiceDate(Date invoiceDate) {
+		this.invoiceDate = invoiceDate;
+	}
+
+	public String getInvoiceUnit() {
+		return invoiceUnit;
+	}
+
+	public void setInvoiceUnit(String invoiceUnit) {
+		this.invoiceUnit = invoiceUnit;
+	}
+
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+}

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

@@ -7,6 +7,7 @@ package com.jeeplus.modules.workreimbursement.entity;
 import com.jeeplus.common.persistence.DataEntity;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 财务报销Entity
@@ -22,6 +23,13 @@ public class ReimbursementVATTax extends DataEntity<ReimbursementVATTax> {
 	private BigDecimal money;		// 发票号
 	private BigDecimal sumMoney;		// 税额
 
+	private String invoiceType;		// 发票类型
+	private String invoiceTypeStr;		// 发票类型
+	private Date invoiceDate;		// 开票日期
+	private String invoiceDateStr;		// 开票日期Str
+	private String invoiceUnit;		// 开票单位
+	private String reimbursementType;		// 报销类型(0:普通报销,1:电子发票报销)
+
 	public BigDecimal getMoney() {
 		return money;
 	}
@@ -78,4 +86,52 @@ public class ReimbursementVATTax extends DataEntity<ReimbursementVATTax> {
 	public void setWorkReimbursement(WorkReimbursement workReimbursement) {
 		this.workReimbursement = workReimbursement;
 	}
+
+	public String getInvoiceType() {
+		return invoiceType;
+	}
+
+	public void setInvoiceType(String invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+
+	public Date getInvoiceDate() {
+		return invoiceDate;
+	}
+
+	public void setInvoiceDate(Date invoiceDate) {
+		this.invoiceDate = invoiceDate;
+	}
+
+	public String getInvoiceUnit() {
+		return invoiceUnit;
+	}
+
+	public void setInvoiceUnit(String invoiceUnit) {
+		this.invoiceUnit = invoiceUnit;
+	}
+
+	public String getReimbursementType() {
+		return reimbursementType;
+	}
+
+	public void setReimbursementType(String reimbursementType) {
+		this.reimbursementType = reimbursementType;
+	}
+
+	public String getInvoiceDateStr() {
+		return invoiceDateStr;
+	}
+
+	public void setInvoiceDateStr(String invoiceDateStr) {
+		this.invoiceDateStr = invoiceDateStr;
+	}
+
+	public String getInvoiceTypeStr() {
+		return invoiceTypeStr;
+	}
+
+	public void setInvoiceTypeStr(String invoiceTypeStr) {
+		this.invoiceTypeStr = invoiceTypeStr;
+	}
 }

+ 35 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursement.java

@@ -75,6 +75,8 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	private Date accomplishDate;		//审核通过时间
 	private String sourceType;		// 报销类型
 	private String comment; // 意见
+	private String reimbursementType; // 报销类型
+	private String reimbursementTypeStr; // 报销类型Str
 
 	public String getComment() {
 		return comment;
@@ -138,6 +140,7 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	private String bankNo;//银行账号
 	private List<WorkAccount> workAccountList = Lists.newArrayList();		// 子表列表
 	private List<ReimbursementVATTax> reimbursementVATTaxes = Lists.newArrayList();		// 子表列表
+	private List<ReimbursementVATTax> reimbursementElectronicInvoiceVATTaxes = Lists.newArrayList();		// 子表列表
 	private List<WorkReimbursementBack> reimbursementBackList = Lists.newArrayList();		// 子表列表
 	public String getUserName() {
 		return userName;
@@ -337,6 +340,14 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 		this.reimbursementVATTaxes = reimbursementVATTaxes;
 	}
 
+	public List<ReimbursementVATTax> getReimbursementElectronicInvoiceVATTaxes() {
+		return reimbursementElectronicInvoiceVATTaxes;
+	}
+
+	public void setReimbursementElectronicInvoiceVATTaxes(List<ReimbursementVATTax> reimbursementElectronicInvoiceVATTaxes) {
+		this.reimbursementElectronicInvoiceVATTaxes = reimbursementElectronicInvoiceVATTaxes;
+	}
+
 	public String getProcessInstanceId() {
 		return processInstanceId;
 	}
@@ -630,4 +641,28 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	public void setSourceType(String sourceType) {
 		this.sourceType = sourceType;
 	}
+
+	public String getReimbursementType() {
+		return reimbursementType;
+	}
+
+	public void setReimbursementType(String reimbursementType) {
+		this.reimbursementType = reimbursementType;
+	}
+
+	public String getAccountType() {
+		return accountType;
+	}
+
+	public void setAccountType(String accountType) {
+		this.accountType = accountType;
+	}
+
+	public String getReimbursementTypeStr() {
+		return reimbursementTypeStr;
+	}
+
+	public void setReimbursementTypeStr(String reimbursementTypeStr) {
+		this.reimbursementTypeStr = reimbursementTypeStr;
+	}
 }

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

@@ -410,6 +410,182 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
                 ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
         return "";
     }
+
+
+
+    /**
+     * 电子发票报销保存方法
+     * @param workReimbursement
+     * @param variables
+     */
+    @Transactional(readOnly = false)
+    public String electronicInvoiceReimbursementSave(WorkReimbursement workReimbursement,Map<String, Object> variables,String processInstanceId) {
+        User user = UserUtils.getUser();
+        if (StringUtils.isBlank(workReimbursement.getNumber())) {
+            synchronized (SYN_BYTE) {
+                workReimbursement.setNumber(serialNumTplService.genSerialNum(user.getCompany(), WorkReimbursement.SERIAL_BIZCODE));
+            }
+        }
+        super.save(workReimbursement);
+        String str = "";
+        Office office = officeService.get(workReimbursement.getOfficeId());
+
+        str = "报销【" + workReimbursement.getNumber() + "】申请待审批,经办人:" + user.getName()+",总金额:"+workReimbursement.getMoney();
+        String title = "报销【" + workReimbursement.getNumber() + "】申请待审批";
+        updateWorkReimbursementInfo(workReimbursement);
+        // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+        identityService.setAuthenticatedUserId(user.getId());
+        // 启动流程
+        String businessKey = workReimbursement.getId().toString();
+        WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea93555c750906", office);
+        // 启动流程
+        String processType = workActivityMenu.getProcessType();
+        StringBuffer buffer = new StringBuffer();
+        Activity activity = new Activity();
+        WorkProjectNotify workProjectNotify = UtilNotify
+                .saveNotify(workReimbursement.getId(),
+                        null,
+                        workReimbursement.getCompanyId(),
+                        title,
+                        str,
+                        "106",
+                        "0",
+                        "待审批",
+                        ""
+                );
+        List<User> users = new ArrayList<>();
+        //部门主任
+        List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"8",workReimbursement.getCreateBy());
+
+        //判定当前登陆人的部门是否是工程一部或者为工程一部的子部门,如果是,则审核人均为工程一部部门主任
+        if("7f776d072d7b4c839cef4e63ce6dbfa5".equals(office.getId()) || office.getParentIds().contains("7f776d072d7b4c839cef4e63ce6dbfa5")){
+            bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,"7f776d072d7b4c839cef4e63ce6dbfa5","8",workReimbursement.getCreateBy());
+        }
+
+        //财务主任(雷主任)
+        List<User> cws = UserUtils.getByRoleActivityEnname("cwzg",3,office.getId(),"8",workReimbursement.getCreateBy());
+        //财务员工
+        List<User> fpglys = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workReimbursement.getCreateBy());
+        //出纳
+        //List<User> cns = UserUtils.getByRoleActivityEnname("cn",3,office.getId(),"8",workReimbursement.getCreateBy());
+        //总经办负责人
+        //List<User> gsldList = UserUtils.getByRoleActivityEnname("zjbfzribvf",3,office.getId(),"8",workReimbursement.getCreateBy());
+        if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+            workProjectNotify.setNotifyRole("");
+            workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+            List<Activity> activities = workActivityMenu.getActivities();
+            for (Activity a : activities) {
+                String encount = a.getEncount();
+                String enlist = a.getEnlist();
+                if (a.getRole()!=null && StringUtils.isNotBlank(a.getRole().getEnname())){
+                    List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"8",workReimbursement.getCreateBy());
+                    if (enusers.size()==0){
+                        workReimbursement.setStatus("1");
+                        super.save(workReimbursement);
+                        return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+                    }
+                    variables.put(enlist, enusers);
+                    variables.put(encount, enusers.size());
+                }
+                if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                    activity = a;
+                }
+            }
+            buffer.append(activity.getRole().getEnname());
+            if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+                //角色审批
+                if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                    users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"8",workReimbursement.getCreateBy());
+                }
+                //人员审批
+                if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                    users.add(activity.getUser());
+                }
+            }
+            workProjectNotify.setId("");
+        } else {
+            if (bmzrs.size()==0 ){
+                workReimbursement.setStatus("1");
+                super.save(workReimbursement);
+            }
+            if (bmzrs.size()==0){
+                return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
+            }
+           /* if (fglds.size()==0){
+                return "流程审批人不能为空,角色分管领导下无用户,请联系管理员!";
+            }
+            if (cws.size()==0){
+                return "流程审批人不能为空,角色财务主管下无用户,请联系管理员!";
+            }
+            if (zjls.size()==0){
+                return "流程审批人不能为空,角色总经理下无用户,请联系管理员!";
+            }
+            if (cwzjs.size()==0){
+                return "流程审批人不能为空,角色财务分管领导下无用户,请联系管理员!";
+            }
+            if (cns.size()==0){
+                return "流程审批人不能为空,角色出纳下无用户,请联系管理员!";
+            }*/
+            variables.put("bmzrcount",bmzrs.size());
+            variables.put("bmzrList",bmzrs);
+            processType = "electronicInvoiceReimbursement";
+            users.addAll(bmzrs);
+        }
+        for (User u : users){
+            workProjectNotify.setUser(u);
+            workProjectNotify.setId("");
+            workProjectNotify.setNotifyRole("部门负责人审批");
+            workProjectNotifyService.save(workProjectNotify);
+            Map<String,Object> extras = new HashMap<>();
+            extras.put("type","7002");
+            extras.put("id",workProjectNotify.getId());
+            extras.put("procDefKey","106");
+            UserUtils.pushInfoToApp(title,str,extras,u.getId());
+            UserUtils.pushIm(u.getId(),str);
+        }
+        variables.put("type", processType);
+        variables.put("busId", businessKey);
+        variables.put("title", "审批单:" + workReimbursement.getNumber());//设置标题;
+
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+        workReimbursement.setProcessInstance(processInstance);
+        if (StringUtils.isNotBlank(processInstanceId)) {
+            workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+            workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+            workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+        }
+        // 更新流程实例ID
+        workReimbursement.setProcessInstanceId(processInstance.getId());
+        workReimbursementDao.updateProcessInstanceId(workReimbursement);
+        //通知添加流程实例ID
+        workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotifyService.save(workProjectNotify);
+        List<Activity> list = workActivityMenu.getActivities();
+        if (list != null && list.size() != 0) {
+            workActivityProcessService.saveList(list, processInstance.getId());
+        } else {
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessKey("electronicInvoiceReimbursement");
+            workActivityProcess.setCount(1);
+            workActivityProcess.setProcessInstanceId(processInstance.getId());
+            workActivityProcess.setIsApproval("0");
+            workActivityProcessService.save(workActivityProcess);
+            workActivityProcess.setCount(2);
+            workActivityProcess.setId("");
+            workActivityProcessService.save(workActivityProcess);
+            workActivityProcess.setCount(3);
+            workActivityProcess.setId("");
+            workActivityProcessService.save(workActivityProcess);
+            workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+            workActivityProcessService.insertAuditsByType(cws,processInstance.getId(),2,0);
+            workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),3,0);
+        }
+        logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{
+                ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
+        return "";
+    }
+
+
     @Transactional(readOnly = false)
     public void updateWorkReimbursementInfo(WorkReimbursement workReimbursement) {
         try {
@@ -460,7 +636,18 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
                     workAccountDao.delete(workAccount);
                 }
             }
+            if("0".equals(workReimbursement.getReimbursementType())){
+                for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }else if("1".equals(workReimbursement.getReimbursementType())){
+                for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementVATTaxes()) {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }
             for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementVATTaxes()) {
+                //普通报销 发票信息
+                reimbursementVATTax.setReimbursementType("0");
                 if (ReimbursementVATTax.DEL_FLAG_NORMAL.equals(reimbursementVATTax.getDelFlag())) {
                     reimbursementVATTax.setWorkReimbursement(workReimbursement);
                     if (StringUtils.isBlank(reimbursementVATTax.getId()) && StringUtils.isNotBlank(reimbursementVATTax.getInvoiceCode())) {
@@ -474,6 +661,23 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
                     reimbursementVATTaxDao.delete(reimbursementVATTax);
                 }
             }
+
+            for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                //电子发票报销 发票信息
+                reimbursementVATTax.setReimbursementType("1");
+                if (ReimbursementVATTax.DEL_FLAG_NORMAL.equals(reimbursementVATTax.getDelFlag())) {
+                    reimbursementVATTax.setWorkReimbursement(workReimbursement);
+                    if (StringUtils.isBlank(reimbursementVATTax.getId()) && StringUtils.isNotBlank(reimbursementVATTax.getInvoiceNumber())) {
+                        reimbursementVATTax.preInsert();
+                        reimbursementVATTaxDao.insert(reimbursementVATTax);
+                    } else {
+                        reimbursementVATTax.preUpdate();
+                        reimbursementVATTaxDao.update(reimbursementVATTax);
+                    }
+                } else {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }
             //附件信息
             for (WorkClientAttachment workClientAttachment : workReimbursement.getWorkAttachments()) {
                 if (workClientAttachment.getId() == null) {
@@ -1028,4 +1232,421 @@ public class WorkReimbursementNewService extends CrudService<WorkReimbursementDa
         workReimbursementDao.update(workReimbursement);
         return "保存审核意见成功!";
     }
+
+    /**
+     * 审核流程(电子发票报销)
+     * @param workReimbursement
+     */
+    @Transactional(readOnly = false)
+    public String electronicInvoiceReimbursementAuditSave(WorkReimbursement workReimbursement,List<User> auditUsers) {
+        String str = "";
+        String userName = UserUtils.get(workReimbursement.getCreateBy().getId()).getName();
+        Office office = officeService.get(workReimbursement.getOfficeId());
+        String title = "报销人:"+userName;
+        if (workReimbursement.getProject()!= null && StringUtils.isNotBlank(workReimbursement.getProject().getId())){
+            str =  "报销申请编号:"+workReimbursement.getNumber()+",报销项目:"+workReimbursement.getProject().getProjectName()+",报销费用合计:"+workReimbursement.getMoney()+",报销人:"+userName+",所属部门:"+office.getName();
+        }else {
+            str =  "报销申请编号:"+workReimbursement.getNumber()+",非项目报销,报销费用合计:"+workReimbursement.getMoney()+",报销人:"+userName+",所属部门:"+office.getName();
+        }
+        // 对不同环节的业务逻辑进行操作
+        String taskDefKey = workReimbursement.getAct().getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") && !taskDefKey.contains("cw") ) {
+            actTaskService.claim(workReimbursement.getAct().getTaskId(), UserUtils.getUser().getId());
+        }else if(taskDefKey.contains("cw")) {
+            //updateWorkReimbursementInfo(workReimbursement);
+        }else{
+            workReimbursement.getAct().setFlag("yes");
+            if("modifyApply".equals(taskDefKey)) {
+                updateWorkReimbursementInfo(workReimbursement);
+            }
+        }
+        String comment = "";
+        if (workReimbursement.getStatus().equals("4")){
+            comment = ("yes".equals(workReimbursement.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(workReimbursement.getAct().getFlag())?"[同意] ":"[驳回] ")+workReimbursement.getAct().getComment();
+        }
+        //yes 的时候状态为审核通过 否则为未通过
+        //1 审核中 2 未通过
+        workReimbursement.setStatus(("yes".equals(workReimbursement.getAct().getFlag()) ? "2" : "4"));
+        Map<String, Object> vars = Maps.newHashMap();
+        //业务逻辑对应的条件表达式
+        String exp = "";
+        String taskCount = "";
+        String notifyRole = "";
+        int key = 0;
+        String enname = "";
+        List<Activity> activitieList = activityService.getByProcessInstanceId(workReimbursement.getProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            Iterator<Activity> iterator = activitieList.iterator();
+            while (iterator.hasNext()){
+                Activity activityInfo = iterator.next();
+                if (!"electronicInvoiceReimbursement".equals(activityInfo.getProcessKey())){
+                    iterator.remove();
+                }
+            }
+            workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            workActivityMenu.setActivities(activitieList);
+        }
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(workReimbursement.getProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("electronicInvoiceReimbursement")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    exp = "pass";
+                    if (!"yes".equals(workReimbursement.getAct().getFlag())) {
+                        workReimbursement.setStatus("4");
+                        workActivityProcess.setIsApproval("2");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                notifyRole = activity.getName();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                }else if(taskDefKey.equals("modifyApply")){
+                    notifyRole = "调整报销";
+                    taskCount = "0";
+                    exp = "pass";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(workReimbursement.getAct().getFlag())) {
+                        workReimbursement.setStatus("3");
+                        workActivityProcess.setIsApproval("2");
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                }
+            }
+        } else {
+            workActivityMenu.setProcessType("electronicInvoiceReimbursement");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = activityProcess.getCount() + "";
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+                    taskCount = "1";
+                    exp = "pass";
+                    if ("yes".equals(workReimbursement.getAct().getFlag())) {
+                        workActivityProcessService.insertAuditsByType(auditUsers,workReimbursement.getProcessInstanceId(),2,1);
+                        notifyRole = "财务主管审核";
+                        workActivityProcess.setIsApproval("1");
+                        enname = "cw";
+                        vars.put("cwList", auditUsers);
+                        vars.put("cwcount",auditUsers.size());
+                    } else {
+                        notifyRole = "调整报销";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("cw".equals(taskDefKey) && count.contains("2")) {
+                    taskCount = "2";
+                    exp = "pass";
+                    if ("yes".equals(workReimbursement.getAct().getFlag())) {
+                        workActivityProcessService.insertAuditsByType(auditUsers,workReimbursement.getProcessInstanceId(),3,1);
+                        notifyRole = "财务员工审核";
+                        workActivityProcess.setIsApproval("1");
+                        enname = "fpglys";
+                        vars.put("fpglysList", auditUsers);
+                        vars.put("fpglyscount",auditUsers.size());
+                    } else {
+                        notifyRole = "调整报销";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("fpglys".equals(taskDefKey) && count.contains("3")) {
+                    taskCount = "3";
+                    exp = "pass";
+                    if ("yes".equals(workReimbursement.getAct().getFlag())) {
+                        notifyRole = "审批通过";
+                        workActivityProcess.setIsApproval("1");
+                    } else {
+                        notifyRole = "调整报销";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+                    taskCount = "0";
+                    notifyRole = "部门负责人审批";
+                    exp = "pass";
+                    workActivityProcess.setCount(0);
+                    enname = "bmzr";
+                    if (!"yes".equals(workReimbursement.getAct().getFlag())) {
+                        workReimbursement.setStatus("3");
+                    }
+                    break;
+                } else if ("apply_end".equals(taskDefKey)) {
+                }
+
+            }
+        }
+        // 设置意见
+        workReimbursement.getAct().setComment(("yes".equals(workReimbursement.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workReimbursement.getAct().getComment());
+        workReimbursement.preUpdate();
+        // 提交流程任务
+        vars.put(exp, "yes".equals(workReimbursement.getAct().getFlag()) ? true : false);
+        vars.put("passs", true);
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workReimbursement.getProcessInstanceId(),taskDefKey,"modifyApply",workReimbursement.getAct().getFlag(),comment, activities);
+        // 提交流程任务
+        actTaskService.complete(workReimbursement.getAct().getTaskId(), workReimbursement.getAct().getProcInsId(), workReimbursement.getAct().getComment(), vars);
+        workReimbursement.setLimitCond("1");
+        boolean state = actTaskService.isProcessEnd(workReimbursement.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if (!state) {
+            title =  "报销【" + workReimbursement.getNumber() + "】申请通过";
+            str = "报销【" + workReimbursement.getNumber() + "】申请通过,经办人:" + userName+",总金额:"+workReimbursement.getMoney();
+            users.add(workReimbursement.getCreateBy());
+            if ("yes".equals(workReimbursement.getAct().getFlag())) {
+
+                Set<String> set = new HashSet();
+                //添加经办人人员id
+                set.add(workReimbursement.getCreateBy().getId());
+                //判断是否含有有效的报销信息
+                if(null != workReimbursement.getWorkAccountList()) {
+                    //添加报销人人员id
+                    for (WorkAccount account : workReimbursement.getWorkAccountList()) {
+                        set.add(account.getReimbursementUserId());
+                    }
+                }
+                //获取通知需要的经办人和报销人人员信息
+                List<User> informUser = Lists.newArrayList();
+                for (String userId: set) {
+                    informUser.add(UserUtils.get(userId));
+                }
+
+                workReimbursement.setStatus("5");
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(workReimbursement.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                //遍历需要通知的人员信息 进行通知(经办人和报销人员)
+                for (User user: informUser) {
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(workReimbursement.getId(),
+                                            user,
+                                            workReimbursement.getCompanyId(),
+                                            title,
+                                            str,
+                                            "106",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+
+                //修改还款
+                if(workReimbursement.getReimbursementBackList()!=null&&workReimbursement.getReimbursementBackList().size()>0){
+                    for(WorkReimbursementBack workReimbursementBack:workReimbursement.getReimbursementBackList()){
+                        if(StringUtils.isNotBlank(workReimbursementBack.getMoney())||!"0".equals(workReimbursementBack.getMoney())){
+                            WorkLoan loan=new WorkLoan();
+                            double backMoney=Double.parseDouble(workReimbursementBack.getMoney());//本次还款
+                            WorkLoan workLoan =workLoanDao.get(workReimbursementBack.getWorkLoan().getId());
+                            loan.setId(workLoan.getId());
+                            loan.setUpdateBy(UserUtils.getUser());
+                            loan.setUpdateDate(new Date());
+                            if(workLoan.getRepay()==null){
+                                workLoan.setRepay("0");
+                            }
+                            double repay=Double.parseDouble(workLoan.getRepay());//还款金额
+                            double money=Double.parseDouble(workLoan.getMoney());//借款金额
+                            if(!"1".equals(workLoan.getRepayState())){//未还款
+                                if((backMoney+repay)>=money){
+                                    loan.setRepay(String.valueOf(money));
+                                    loan.setRepayState("1");
+
+                                }else{
+                                    loan.setRepay(String.valueOf(repay+backMoney));
+                                    loan.setRepayState("2");
+
+                                }
+                                workLoanDao.updateReay(loan);
+                                workRepayDao.updateReay(workReimbursementBack.getWorkLoan().getId(),workReimbursement.getId());
+                            }
+                        }
+                    }
+                }
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(workReimbursement.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                if (StringUtils.isNotBlank(workReimbursement.getStatus()) && !workReimbursement.getStatus().equals("3")){
+                    workReimbursement.setStatus("4");
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(workReimbursement.getId(),
+                                            workReimbursement.getCreateBy(),
+                                            workReimbursement.getCompanyId(),
+                                            title,
+                                            str,
+                                            "106",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(workReimbursement.getProcessInstanceId());
+        } else {
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("electronicInvoiceReimbursement")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(workReimbursement.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.addAll(userList);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(workReimbursement.getId(),
+                                new User(),
+                                workReimbursement.getCompanyId(),
+                                title,
+                                str,
+                                "106",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        workReimbursement.getAct().getFlag(),
+                        taskCount,
+                        workReimbursement.getCreateBy(),
+                        workReimbursement.getOfficeId(),
+                        "8");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService
+                            .save(workProjectNotify1);
+                    if (!"modifyApply".equals(taskDefKey)){
+                        Map<String,Object> extras = new HashMap<>();
+                        if ("cw".equals(taskDefKey) || "cn".equals(taskDefKey) ){
+                            extras.put("type","7001");
+                        }else {
+                            extras.put("type","7002");
+                        }
+                        extras.put("id",workProjectNotify.getId());
+                        extras.put("procDefKey","106");
+                        UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+
+                    }
+                }
+
+            } else {
+                if (!"yes".equals(workReimbursement.getAct().getFlag())) {//驳回待办
+                    title =  "报销【" + workReimbursement.getNumber() + "】申请被驳回";
+                    str = "报销【" + workReimbursement.getNumber() + "】申请被驳回,请选择重新申请或作废";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(workReimbursement.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    //users.addAll(userList);
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(workReimbursement.getId(),
+                                            workReimbursement.getCreateBy(),
+                                            workReimbursement.getCompanyId(),
+                                            title,
+                                            str,
+                                            "106",
+                                            "0",
+                                            "重新申请",
+                                            notifyRole));
+                    users.add( workReimbursement.getCreateBy());
+                } else {
+                    if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+                        title =  "报销【" + workReimbursement.getNumber() + "】申请待审批";
+                        str = "报销【" + workReimbursement.getNumber() + "】申请待审批,经办人:" + userName+",总金额:"+workReimbursement.getMoney();
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(workReimbursement.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        //users.addAll(userList1);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(workReimbursement.getId(),
+                                        new User(),
+                                        workReimbursement.getCompanyId(),
+                                        title,
+                                        str,
+                                        "106",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        users.addAll(auditUsers);
+                        for (User user1:auditUsers){
+                            workProjectNotify.setId("");
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService
+                                    .save(workProjectNotify);
+                            if (!"modifyApply".equals(taskDefKey)){
+                                Map<String,Object> extras = new HashMap<>();
+                                if ("cw".equals(taskDefKey) || "cn".equals(taskDefKey) ){
+                                    extras.put("type","7001");
+                                }else {
+                                    extras.put("type","7002");
+                                }
+                                extras.put("id",workProjectNotify.getId());
+                                extras.put("procDefKey","106");
+                                UserUtils.pushInfoToApp(title,str,extras,user1.getId());
+
+                            }
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(workReimbursement.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.addAll(userList);
+                        users.add(workReimbursement.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(workReimbursement.getId(),
+                                                workReimbursement.getCreateBy(),
+                                                workReimbursement.getCompanyId(),
+                                                title,
+                                                str,
+                                                "106",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+        if (users!=null && users.size()!=0) {
+            for (User u : users) {
+                UserUtils.pushIm(u.getId(),str);
+            }
+        }
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+
+        workReimbursementDao.update(workReimbursement);
+        return "保存审核意见成功!";
+    }
 }

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

@@ -62,6 +62,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -157,7 +158,27 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                 }
             }
             workReimbursement.setWorkAccountList(workAccounts);
-            workReimbursement.setReimbursementVATTaxes(reimbursementVATTaxDao.findList(new ReimbursementVATTax(workReimbursement)));
+            List<ReimbursementVATTax> vatTaxDaoList = reimbursementVATTaxDao.findList(new ReimbursementVATTax(workReimbursement));
+            List<ReimbursementVATTax> vatTaxList = Lists.newArrayList();
+            List<ReimbursementVATTax> electronicInvoiceVATTaxesList = Lists.newArrayList();
+            for (ReimbursementVATTax vatTax : vatTaxDaoList) {
+                switch (vatTax.getReimbursementType()){
+                    case "0":
+                        vatTaxList.add(vatTax);
+                        break;
+                    case "1":
+                        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        if(null != vatTax.getInvoiceDate()){
+                            String dateString = formatter.format(vatTax.getInvoiceDate());
+                            vatTax.setInvoiceDateStr(dateString);
+                        }
+                        electronicInvoiceVATTaxesList.add(vatTax);
+                        break;
+
+                }
+            }
+            workReimbursement.setReimbursementVATTaxes(vatTaxList);
+            workReimbursement.setReimbursementElectronicInvoiceVATTaxes(electronicInvoiceVATTaxesList);
             WorkClientAttachment workClientAttachment = new WorkClientAttachment();
             workClientAttachment.setAttachmentId(id);
             workClientAttachment.setAttachmentFlag(VarStr.attachmentFlag[1]);
@@ -647,8 +668,21 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     workAccountDao.delete(workAccount);
                 }
             }
+
+            if("0".equals(workReimbursement.getReimbursementType())){
+                for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }else if("1".equals(workReimbursement.getReimbursementType())){
+                for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementVATTaxes()) {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }
+
             for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementVATTaxes()) {
                 if (ReimbursementVATTax.DEL_FLAG_NORMAL.equals(reimbursementVATTax.getDelFlag())) {
+                    //普通报销 发票信息
+                    reimbursementVATTax.setReimbursementType("0");
                     reimbursementVATTax.setWorkReimbursement(workReimbursement);
                     if (StringUtils.isBlank(reimbursementVATTax.getId()) && StringUtils.isNotBlank(reimbursementVATTax.getInvoiceCode())) {
                         reimbursementVATTax.preInsert();
@@ -661,6 +695,24 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     reimbursementVATTaxDao.delete(reimbursementVATTax);
                 }
             }
+
+
+            for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+                //电子发票报销 发票信息
+                reimbursementVATTax.setReimbursementType("1");
+                if (ReimbursementVATTax.DEL_FLAG_NORMAL.equals(reimbursementVATTax.getDelFlag())) {
+                    reimbursementVATTax.setWorkReimbursement(workReimbursement);
+                    if (StringUtils.isBlank(reimbursementVATTax.getId()) && StringUtils.isNotBlank(reimbursementVATTax.getInvoiceNumber())) {
+                        reimbursementVATTax.preInsert();
+                        reimbursementVATTaxDao.insert(reimbursementVATTax);
+                    } else {
+                        reimbursementVATTax.preUpdate();
+                        reimbursementVATTaxDao.update(reimbursementVATTax);
+                    }
+                } else {
+                    reimbursementVATTaxDao.delete(reimbursementVATTax);
+                }
+            }
             //附件信息
             for (WorkClientAttachment workClientAttachment : workReimbursement.getWorkAttachments()) {
                 if (workClientAttachment.getId() == null) {

+ 158 - 14
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java

@@ -10,9 +10,7 @@ import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.mapper.JsonMapper;
 import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.utils.DateUtils;
-import com.jeeplus.common.utils.MyBeanUtils;
-import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.*;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
@@ -22,10 +20,12 @@ import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.sysmtree.entity.SysMtree;
 import com.jeeplus.modules.sysmtree.service.SysMtreeService;
@@ -37,8 +37,10 @@ import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
 import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
 import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
+import com.jeeplus.modules.workreimbursement.service.WorkReimbursementNewService;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementTypeService;
 import com.jeeplus.modules.workreimbursement.utils.VarStr;
@@ -53,23 +55,28 @@ import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.dom4j.io.SAXReader;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
-import java.io.UnsupportedEncodingException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.*;
 import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 财务报销Controller
@@ -118,6 +125,8 @@ public class WorkReimbursementController extends BaseController {
 	protected WorkProjectNotifyService workProjectNotifyService;
 	@Autowired
 	protected HistoryService historyService;
+	@Autowired
+	protected WorkReimbursementNewService workReimbursementNewService;
 
 	@ModelAttribute
 	public WorkReimbursement get(@RequestParam(required=false) String id) {
@@ -170,19 +179,20 @@ public class WorkReimbursementController extends BaseController {
 		List<String> typeList= jersey.repackaged.com.google.common.collect.Lists.newArrayList();
 		typeList.add("13");
 		typeList.add("102");
+		typeList.add("106");
 		String types = org.apache.commons.lang3.StringUtils.join(typeList,',');
 		workProjectNotify.setTypes(types);
 		//添加发票对应编号
 		//workProjectNotify.setType("13");
 		//查询所有需要当前登录人进行处理的项目信息
-		//List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+		List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
 
-		/*//添加发票对应编号
+		//添加发票对应编号
 		workProjectNotify.setType("102");
 		//查询所有需要当前登录人进行处理的项目信息
-		List<WorkProjectNotify> newNotifyList = workProjectNotifyService.findList(workProjectNotify);*/
+		List<WorkProjectNotify> newNotifyList = workProjectNotifyService.findList(workProjectNotify);
 
-		/*for (WorkReimbursement info: list) {
+		for (WorkReimbursement info: list) {
 			for (WorkProjectNotify notify: notifyList) {
 				if(notify.getNotifyId().equals(info.getId()) && "13".equals(notify.getType())){
 					info.setNotifyId(notify.getId());
@@ -205,8 +215,19 @@ public class WorkReimbursementController extends BaseController {
 					}
 					break;
 				}
+				//报告归档资料缺失说明修改权限处理
+				if(notify.getNotifyId().equals(info.getId()) && "106".equals(notify.getType())){
+					info.setNotifyId(notify.getId());
+					if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
+						info.setNotifyFlag(4);
+					}
+					if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
+						info.setNotifyFlag(3);
+					}
+					break;
+				}
 			}
-		}*/
+		}
 		model.addAttribute("page", page);
 		return "modules/workreimbursement/workReimbursementList";
 	}
@@ -253,6 +274,27 @@ public class WorkReimbursementController extends BaseController {
 			}
 		}
 		if("1".equals(tabId)){
+			switch (workReimbursement.getReimbursementType()){
+				case "0" :
+					workReimbursement.setReimbursementTypeStr("普通报销");
+					break;
+				case "1" :
+					workReimbursement.setReimbursementTypeStr("电子发票报销");
+					break;
+
+			}
+
+			if(null != workReimbursement.getReimbursementElectronicInvoiceVATTaxes() && workReimbursement.getReimbursementElectronicInvoiceVATTaxes().size()>0){
+				//获取专业类型
+				List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("invoiceReimbursementType");
+				for (ReimbursementVATTax vatTax : workReimbursement.getReimbursementElectronicInvoiceVATTaxes()) {
+					for (MainDictDetail dictDetail : certificateMajor) {
+						if(dictDetail.getValue().equals(vatTax.getInvoiceType())){
+							vatTax.setInvoiceType(dictDetail.getLabel());
+						}
+					}
+				}
+			}
 			view = "workReimbursementFormDetail";
 		}else if("3".equals(tabId)){
 			ProcessInstance processInstance = actTaskService.getProcIns(workReimbursement.getProcessInstanceId());
@@ -382,7 +424,12 @@ public class WorkReimbursementController extends BaseController {
 			Map<String, Object> variables = Maps.newHashMap();
 			workReimbursement.setCompanyId(UserUtils.getSelectCompany().getId());
 			workReimbursement.setCreateOffice(UserUtils.getSelectOffice().getId());
-			String str = workReimbursementService.save(workReimbursement, variables,processInstanceId);
+			String str = "报销类型未选择";
+			if("0".equals(workReimbursement.getReimbursementType())){
+				str = workReimbursementService.save(workReimbursement, variables,processInstanceId);
+			}else if("1".equals(workReimbursement.getReimbursementType())){
+				str = workReimbursementNewService.electronicInvoiceReimbursementSave(workReimbursement, variables,processInstanceId);
+			}
 			if (StringUtils.isNotBlank(str)){
 				addMessage(redirectAttributes, "报销申请提交失败:"+str);
 			}else {
@@ -969,4 +1016,101 @@ public class WorkReimbursementController extends BaseController {
 		model.addAttribute("page",page);
 		return "modules/sys/gridReimburProjectList";
 	}
+
+
+	@RequestMapping(value = "disposeXmlFile", method=RequestMethod.POST)
+	@ResponseBody
+	public Map disposeXmlFile(HttpServletRequest request, MultipartFile multipartFile){
+		Map map = new HashMap();
+		//创建DOM4J解析器对象
+		try {
+			//MultipartFile转File
+			File file = FtlUtils.transformMultipartFile(multipartFile);
+			// 创建一个 DocumentBuilderFactory
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			// 使用工厂创建一个 DocumentBuilder
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			// 使用 DocumentBuilder 解析 XML 文件
+			Document document = builder.parse(file);
+			// 获取所有header节点的集合
+			NodeList headerList = document.getElementsByTagName("Header");
+			// 获取所有eInvoiceDataList节点的集合
+			NodeList eInvoiceDataList = document.getElementsByTagName("EInvoiceData");
+			// 获取所有taxSupervisionInfo节点的集合
+			NodeList taxSupervisionInfoList = document.getElementsByTagName("TaxSupervisionInfo");
+
+			Map map1 = xmlNodeListDataDispose(headerList, document);
+			Map map2 = xmlNodeListDataDispose(eInvoiceDataList, document);
+			Map map3 = xmlNodeListDataDispose(taxSupervisionInfoList, document);
+			map.putAll(map1);
+			map.putAll(map2);
+			map.putAll(map3);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return map;
+	}
+
+	/**
+	 * 对节点集合进行遍历,并获取每个节点下的参数信息
+	 * @param nodeList
+	 * @param document
+	 * @return
+	 */
+	public Map<String,String> xmlNodeListDataDispose(NodeList nodeList,Document document){
+		Map<String,String> map = new HashMap<>();
+		if(null != nodeList && nodeList.getLength()>0){
+			//遍历每一个header节点
+			for (int i = 0; i < nodeList.getLength(); i++) {
+				//通过 item(i)方法 获取一个header节点,nodelist的索引值从0开始
+				Node header = nodeList.item(i);
+				//解析定义节点的子节点
+				NodeList childNodes = header.getChildNodes();
+				//节点数据处理
+				Map<String,String> map1 = xmlDataDispose(childNodes, document);
+				map.putAll(map1);
+			}
+		}
+		return map;
+	}
+
+	/**
+	 * 子节点遍历获取参数,若其下还有子节点,则循环调用 xmlNodeListDataDispose 方法
+	 * @param childNodes
+	 * @param document
+	 * @return
+	 */
+	public Map<String,String> xmlDataDispose(NodeList childNodes,Document document){
+		Map<String,String> map = new HashMap<>();
+		for (int k = 0; k < childNodes.getLength(); k++) {
+			// 区分出text类型的node以及element类型的node
+			if (childNodes.item(k).getNodeType() == Node.ELEMENT_NODE) {
+				Node firstChild = childNodes.item(k).getFirstChild();
+				if(null != firstChild){
+					if(StringUtils.isBlank(childNodes.item(k).getFirstChild().getNodeValue())){
+						// 获取所有header节点的集合
+						NodeList childList = document.getElementsByTagName(childNodes.item(k).getNodeName());
+
+						String parentName = childNodes.item(k).getNodeName();
+						//循环调用,获取最低级节点数据信息
+						Map<String,String> map1 = xmlNodeListDataDispose(childList, document);
+						Map<String,String> map2 = new HashMap<>();
+						if(map1.size()>0){
+							//将获取到的数据进行遍历,添加父节点的参数信息,防止子节点key键相同,导致数据被覆盖
+							for (String key : map1.keySet()) {
+								map2.put(parentName + key,map1.get(key));
+							}
+						}
+						map.putAll(map2);
+					}
+					//判定key 和value 值均存在,则进行储存,否则不进行储存
+					if(StringUtils.isNotBlank(childNodes.item(k).getNodeName()) && StringUtils.isNotBlank(childNodes.item(k).getFirstChild().getNodeValue())){
+						map.put(childNodes.item(k).getNodeName(),childNodes.item(k).getFirstChild().getNodeValue());
+					}
+				}
+			}
+		}
+		return map;
+	}
 }

+ 69 - 3
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementNewController.java

@@ -185,7 +185,12 @@ public class WorkReimbursementNewController extends BaseController {
 			Map<String, Object> variables = Maps.newHashMap();
 			workReimbursement.setCompanyId(UserUtils.getSelectCompany().getId());
 			workReimbursement.setCreateOffice(UserUtils.getSelectOffice().getId());
-			String str = workReimbursementNewService.save(workReimbursement, variables,processInstanceId);
+			String str = "报销类型未选择";
+			if("0".equals(workReimbursement.getReimbursementType())){
+				str = workReimbursementNewService.save(workReimbursement, variables,processInstanceId);
+			}else if("1".equals(workReimbursement.getReimbursementType())){
+				str = workReimbursementNewService.electronicInvoiceReimbursementSave(workReimbursement, variables,processInstanceId);
+			}
 			if (StringUtils.isNotBlank(str)){
 				addMessage(redirectAttributes, "报销申请提交失败:"+str);
 			}else {
@@ -221,12 +226,20 @@ public class WorkReimbursementNewController extends BaseController {
 				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
 				if (users==null )
 					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
-				users = UserUtils.getByRoleActivityEnname("zjbfzribvf",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+				if("0".equals(workReimbursement.getReimbursementType())){
+					users = UserUtils.getByRoleActivityEnname("zjbfzribvf",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+				}else if ("1".equals(workReimbursement.getReimbursementType())){
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+				}
 			}else  if ("gsld".equals(taskDefKey)){
 				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
 				if (users==null )
 					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
 				//users = UserUtils.getByRoleActivityEnname("zjl",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+			}else  if ("fpglys".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
 			}/*else  if ("zjl".equals(taskDefKey)){
 				*//*users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),5);
 				if (users==null )
@@ -245,7 +258,60 @@ public class WorkReimbursementNewController extends BaseController {
             if ("yes".equals(flag) &&(users==null || users.size()==0)){
 				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
 			}else {
-				String str = workReimbursementNewService.auditSave(workReimbursement,users);
+				String str = "";
+				if("0".equals(workReimbursement.getReimbursementType())){
+					str = workReimbursementNewService.auditSave(workReimbursement,users);
+				}else if ("1".equals(workReimbursement.getReimbursementType())){
+					str = workReimbursementNewService.electronicInvoiceReimbursementAuditSave(workReimbursement,users);
+				}
+				addMessage(redirectAttributes, str);
+			}
+		}catch (Exception e){
+			logger.info("Exception e:"+e);
+			addMessage(redirectAttributes, "审批失败");
+		}
+		if (StringUtils.isNotBlank(workReimbursement.getHome()) && "home".equals(workReimbursement.getHome())) {
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workReimbursement.getHome()) && "notifyList".equals(workReimbursement.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		} else {
+			return "redirect:" + Global.getAdminPath() + "/workreimbursement/workReimbursement/?repage";
+		}
+	}
+
+	/**
+	 * 工单执行(完成任务)(电子发票报销审核方法)
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "electronicInvoiceReimbursementSaveAudit")
+	public String electronicInvoiceReimbursementSaveAudit(WorkReimbursement workReimbursement, Model model,
+							RedirectAttributes redirectAttributes) {
+		try {
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workReimbursement.getAct().getTaskDefKey();
+			List<User> users = null;
+			if ("bmzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),2);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwzg", 3, workReimbursement.getOfficeId(), "8", workReimbursement.getCreateBy());
+			}else  if ("cw".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+				users = UserUtils.getByRoleActivityEnname("cwygevod",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+			}else  if ("fpglys".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+			}
+            String flag = workReimbursement.getAct().getFlag();
+            if ("yes".equals(flag) &&(users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = workReimbursementNewService.electronicInvoiceReimbursementAuditSave(workReimbursement,users);
 				addMessage(redirectAttributes, str);
 			}
 		}catch (Exception e){

+ 21 - 4
src/main/resources/mappings/modules/workreimbursement/ReimbursementVATTaxDao.xml

@@ -15,7 +15,12 @@
 		a.remarks AS "remarks",
 		a.del_flag AS "delFlag",
 		a.money AS "money",
-		a.sum_money AS "sumMoney"
+		a.sum_money AS "sumMoney",
+		a.invoice_type AS "invoiceType",
+		a.invoice_date AS "invoiceDate",
+		a.invoice_unit AS "invoiceUnit",
+		a.reimbursement_type AS "reimbursementType",
+		a.remarks AS "remarks"
 	</sql>
 	
 	<sql id="ReimbursementVATTaxJoins">
@@ -83,7 +88,11 @@
 			remarks,
 			del_flag,
 			money,
-			sum_money
+			sum_money,
+			invoice_type,
+			invoice_date,
+			invoice_unit,
+			reimbursement_type
 		) VALUES (
 			#{id},
 			#{invoiceCode},
@@ -97,7 +106,11 @@
 			#{remarks},
 			#{delFlag},
 			#{money},
-			#{sumMoney}
+			#{sumMoney},
+			#{invoiceType},
+			#{invoiceDate},
+			#{invoiceUnit},
+			#{reimbursementType}
 		)
 	</insert>
 	
@@ -111,7 +124,11 @@
 			update_date = #{updateDate},
 			remarks = #{remarks},
 			money = #{money},
-			sum_money = #{sumMoney}
+			sum_money = #{sumMoney},
+			invoice_type = #{invoiceType},
+			invoice_date = #{invoiceDate},
+			invoice_unit = #{invoiceUnit},
+			reimbursement_type = #{reimbursementType}
 		WHERE id = #{id}
 	</update>
 	

+ 9 - 3
src/main/resources/mappings/modules/workreimbursement/WorkReimbursementDao.xml

@@ -33,7 +33,8 @@
 		a.bank_card AS "bankCard",
 		a.ext AS "ext",
 		a.create_office as "createOffice",
-		a.type as "type"
+		a.type as "type",
+		a.reimbursement_type as "reimbursementType"
 	</sql>
 
 	<sql id="workReimbursementJoins">
@@ -304,7 +305,8 @@
 			backmoneys,
 			checkMoneys,
             create_office,
-            type
+            type,
+            reimbursement_type
 		) VALUES (
 			#{id},
 			#{number},
@@ -336,7 +338,8 @@
 			#{backmoneys},
 			#{checkMoneys},
 			#{createOffice},
-			#{type}
+			#{type},
+			#{reimbursementType}
 
 		)
 	</insert>
@@ -354,6 +357,9 @@
 			<if test="accomplishDate != null and accomplishDate !=''">
 				accomplish_date = #{accomplishDate},
 			</if>
+			<if test="reimbursementType != null and reimbursementType !=''">
+				reimbursement_type = #{reimbursementType},
+			</if>
 			<if test="limitCond != 1">
 				submitter_date = #{submitterDate},
 			</if>

+ 5 - 1
src/main/webapp/static/common/js/common.js

@@ -155,7 +155,11 @@ function openPreview(url,flag){
     if(flag ==1 ){
         var url = 'https://view.xdocin.com/xdoc?_xdoc='+encodeURIComponent(url);
     }else if(flag == 2){
-        var url = 'https://view.officeapps.live.com/op/view.aspx?src='+encodeURIComponent(url);
+        if (url.indexOf(".xml") !== -1) {
+            var url = 'https://view.xdocin.com/xdoc?_xdoc='+encodeURIComponent(url);
+        }else{
+            var url = 'https://view.officeapps.live.com/op/view.aspx?src='+encodeURIComponent(url);
+        }
     }else if(flag == 3){
         var url = 'https://view.xdocin.com/xdoc?_xdoc='+encodeURIComponent(url);
     }else if(flag == 4){

+ 1 - 1
src/main/webapp/webpage/modules/workcontractinfo/newWorkContract/workContractAudit.jsp

@@ -528,7 +528,7 @@
                                                                         <%--附件下载删除--%>
                                                                         <c:choose>
                                                                             <c:when test="${workContractInfo.uploadMode == 2}">
-                                                                                <a href="javascript:location.href='${workClientAttachment.temporaryUrl}'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                                                <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                                             </c:when>
                                                                             <c:otherwise>
                                                                                 <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>

+ 2 - 2
src/main/webapp/webpage/modules/workcontractinfo/workContractInfoLookForm.jsp

@@ -551,7 +551,7 @@
 														<%--附件下载删除--%>
 														<c:choose>
 															<c:when test="${workContractInfo.uploadMode == 2}">
-																<a href="javascript:location.href='${workClientAttachment.temporaryUrl}'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
 															</c:when>
 															<c:otherwise>
 																<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>
@@ -756,7 +756,7 @@
 																<%--附件下载删除--%>
 																<c:choose>
 																	<c:when test="${workContractInfo.uploadMode == 2}">
-																		<a href="javascript:location.href='${workClientAttachment.temporaryUrl}'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+																		<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
 																	</c:when>
 																	<c:otherwise>
 																		<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>

+ 907 - 0
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementCWElectronicInvoiceReimbursementAudit.jsp

@@ -0,0 +1,907 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>报销审核</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script type="text/javascript">
+        var validateForm;
+        var state;//考核科目显示隐藏
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+                $("#opinion").val(ss);
+                if(obj == 1){
+                    $('#flag').val('yes');
+                    var idx1 = $("#contentTable tbody").length;
+                    /*for(var i = 0;i < idx1; i++){
+                        var idx2 = $("#workAccountList"+i+" tr").length;
+                        var financialSubjectss = $("#workAccountList"+i+"_financialSubjectss").val();
+                        var financialSubjects = $("#workAccountList"+i+"_financialSubjects").val();
+                        var moneyAbstract = $("#workAccountList"+i+"_moneyAbstract").val();
+                        var totalMoney = $("#workAccountList"+i+"_money").val();
+                            if(financialSubjectss==null || financialSubjectss==''|| financialSubjectss == undefined){
+                                if(financialSubjects==null || financialSubjects==''|| financialSubjects == undefined){
+                                    parent.layer.msg("财务科目为空!", {icon: 5});
+                                    return false;
+                                }
+                            }
+                        if(moneyAbstract==null || moneyAbstract==''|| moneyAbstract == undefined){
+                            parent.layer.msg("报销费用摘要不能为空!", {icon: 5});
+                            return false;
+                        }
+                        var auditMoney = "0.00";
+                        for(var j = 0;j < idx2; j++){
+                            var checkSubjects = $("#workAccountList"+i+"_audit"+j+"_checkSubjects").val();
+                            var money = $("#workAccountList"+i+"_audit"+j+"_money").val();
+                            var u8Subjects = $("#workAccountList"+i+"_audit"+j+"_u8Subjects").val();
+                            if(state=='1'){
+                            if (checkSubjects==null || checkSubjects=='' || checkSubjects == undefined){
+                                parent.layer.msg("考核科目不能为空!", {icon: 5});
+                                return false;
+                            }
+                            }
+                            if (money==null || money==''|| money == undefined){
+                                parent.layer.msg("考核金额不能为空!", {icon: 5});
+                                return false;
+                            }
+                            if (u8Subjects==null || u8Subjects==''|| u8Subjects == undefined){
+                                parent.layer.msg("U8科目不能为空!", {icon: 5});
+                                return false;
+                            }
+                            auditMoney = (parseFloat(auditMoney) + parseFloat(money)).toFixed(2);
+                        }
+                        var s = parseFloat(totalMoney) - parseFloat(auditMoney);
+                        if (s<0){
+                            parent.layer.msg("考核金额不能超过报销金额,请确认输入!", {icon: 5});
+                            return false;
+                        }
+                        if(parseFloat($("#backmoneys").val())<0){
+                            parent.layer.msg("实际报销总额不能为负数,请确认输入!", {icon: 5});
+                            return false;
+                        }
+                    }*/
+                }else{
+                    $('#flag').val('no');
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use('form', function () {
+                var form = layui.form;
+                form.render();
+            });
+            if (${workReimbursement.ext == 0}){
+                $(".td1").removeClass("hide");
+                $(".project_reimbursement_div").show();
+                $(".not_project_reimbursement_div").hide();
+            }else {
+                $(".td1").addClass("hide");
+                $(".project_reimbursement_div").hide();
+                $(".not_project_reimbursement_div").show();
+            }
+            if (${workReimbursement.isPublic =='0'}){
+                $(".isPublic").addClass("hide");
+            }else {
+                $(".isPublic").removeClass("hide");
+            }
+            state=${isShow};
+            if (state =='0'){
+                $(".isShow").hide();
+            }else {
+                $(".isShow").show();
+            }
+            if($("#backmoney").val()==null||$("#backmoney").val()==''){
+                $("#backmoney").val('0');
+            }
+            $("#name").focus();
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+        });
+
+        function getEntity(form) {
+            var result = {};
+            $(form).find("[data-field]").each(function() {
+                var field = $(this).attr("data-field");
+                var val;
+
+                if ($(this).attr('type') == 'checkbox') {
+                    val = $(this).prop('checked');
+                } else if ($(this).attr('type') == 'radio') {
+                    val = $(this).prop('checked');
+                } else {
+                    val = $(this).val();
+                }
+                // 获取单个属性的值,并扩展到result对象里面
+                getField(field.split('.'), val, result);
+            });
+            return result;
+        }
+
+        function getField(fieldNames, value, result) {
+            if (fieldNames.length > 1) {
+                for (var i = 0; i < fieldNames.length - 1; i++) {
+                    if (result[fieldNames[i]] == undefined) {
+                        result[fieldNames[i]] = {}
+                    }
+                    result = result[fieldNames[i]];
+                }
+                result[fieldNames[fieldNames.length - 1]] = value;
+            } else {
+                result[fieldNames[0]] = value;
+            }
+        }
+
+        function addRow(list, idx, tpl, row){
+            var size = list.replace("#workAccountList","");
+            var idx1 = $("#workAccountList"+size+" tr").length;
+            tpl = tpl.replace("workAccountList[0]","workAccountList["+size+"]");
+            tpl = tpl.replace("workAccountList[0]","workAccountList["+size+"]");
+            tpl = tpl.replace("workAccountAuditList[0]","workAccountAuditList["+idx1+"]");
+            tpl = tpl.replace("workAccountAuditList[0]","workAccountAuditList["+idx1+"]");
+            tpl = tpl.replace("workAccountAuditList[0]","workAccountAuditList["+idx1+"]");
+            tpl = tpl.replace("workAccountAuditList[0]","workAccountAuditList["+idx1+"]");
+            tpl = tpl.replace(/\audit0/g,"audit"+idx1);
+            tpl = tpl.replace(/\workAccountList0/g,"workAccountList"+size);
+            var ext = $("#ext").val();
+            if(ext == 0){
+                tpl = tpl.replace("not_project_reimbursement_div","not_project_reimbursement_div\" style=\"display:none;\"");
+                tpl = tpl.replace("project_reimbursement_div\" style=\"display:none;\"","project_reimbursement_div");
+            }else {
+                tpl = tpl.replace("project_reimbursement_div","project_reimbursement_div\" style=\"display:none;\"");
+                tpl = tpl.replace("not_project_reimbursement_div\" style=\"display:none;\"","not_project_reimbursement_div\"");
+            }
+            bornTemplete(list, idx, tpl, row, idx1);
+        }
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+            if (state =='0'){
+                $(".isShow").hide();
+            }else {
+                $(".isShow").show();
+            }
+        }
+        function delRow(obj){
+            $(obj).parent().parent().remove();
+            getMoney();
+        }
+
+        function getMoney(){
+            var money = 0;
+            $(".checkMoney").each(function () {
+               if($(this).val()!=undefined && isNumber($(this).val())){
+                   money = (parseFloat(money) + parseFloat($(this).val())).toFixed(2);
+               }
+            })
+            $("#checkMoneys").val(formatNumber(money,2));
+            $("#sumcheckMoneys").val(money);
+            var a = parseFloat($("#backmoney").val());
+            var backmoneys=(parseFloat(money)-  parseFloat($("#backmoney").val())).toFixed(2);
+            if(isNaN(backmoneys)){
+                $("#backmoneys").val("");
+                $("#sumbackmoneys").val("");
+            }else{
+                $("#backmoneys").val(formatNumber(backmoneys,2));
+                $("#sumbackmoneys").val(backmoneys);
+            }
+        }
+        function isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+        }
+        //财务格式
+        function formatNumber(num, precision, separator) {
+            var parts;
+            if (!isNaN(parseFloat(num)) && isFinite(num)) {
+                num = Number(num);
+                num = (typeof precision !== 'undefined' ? num.toFixed(precision) : num).toString();
+                parts = num.split('.');
+                parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
+                return parts.join('.');
+            }
+            return NaN;
+        }
+    </script>
+    <style>
+        /*超过5个汉字,调整label的长度,以下是配套的*/
+        .layui-item .layui-form-label{
+            width:90px;
+        }
+        .form-group .layui-item .layui-input-block,
+        .query .layui-input-block {
+            margin-left: 116px;
+        }
+    </style>
+</head>
+<body>
+<div class="single-form">
+    <div class="container view-form">
+        <form:form id="inputForm" modelAttribute="workReimbursement" enctype="multipart/form-data" action="${ctx}/workReimbursementNew/workReimbursementNew/saveAudit" method="post" class="form-horizontal layui-form">
+        <form:hidden path="id"/>
+        <form:hidden path="home"/>
+        <form:hidden path="ext"/>
+        <form:hidden path="act.taskId"/>
+        <form:hidden path="act.taskName"/>
+        <form:hidden path="act.taskDefKey"/>
+        <form:hidden path="act.procInsId"/>
+        <form:hidden path="act.procDefId"/>
+        <form:hidden id="flag" path="act.flag"/>
+         <input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+            <div class="form-group layui-row first ">
+                <div class="form-group-label"><h2>基础信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="submitterName" htmlEscape="false"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <input htmlEscape="false"  readonly="true"  class="form-control layui-input" value="${workReimbursement.number}"/>
+                            <span class="input-group-btn">
+                        <label class="form-status"><c:choose><c:when test="${not empty workReimbursement.status}">${fns:getDictLabel(workReimbursement.status, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                     </span>
+                        </div>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">所属部门:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value = "${workReimbursement.officeName}"/>
+                    </div>
+                </div>
+                <%--<div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">银行卡号:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false" readonly="true"  class="form-control layui-input" value = "${workReimbursement.bankCard}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销类型:</label>
+                    <div class="layui-input-block">
+                        <input readonly="true" htmlEscape="false" class="form-control layui-input"
+                               value="<c:choose><c:when test="${workReimbursement.ext == 0}">项目报销</c:when><c:otherwise>非项目报销</c:otherwise></c:choose>"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6 td1">
+                    <label class="layui-form-label">报销项目:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.project.projectName}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销类别:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.typeName}"/>
+                    </div>
+                </div>
+                    &lt;%&ndash;<div class="layui-item layui-col-sm6 td1">
+                        <label class="layui-form-label">项目负责人:</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false"  readonly="true"  class="form-control layui-input" value="${workReimbursement.projectMasterName}"/>
+                        </div>
+                    </div>&ndash;%&gt;
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">是否对公报销:</label>
+                    <div class="layui-input-block">
+                        <input readonly="true" htmlEscape="false" class="form-control layui-input"
+                               value="<c:choose><c:when test="${workReimbursement.isPublic == '0'}">否</c:when><c:otherwise>是</c:otherwise></c:choose>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 isPublic">
+                    <label class="layui-form-label">公司名称:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.comname}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 isPublic">
+                    <label class="layui-form-label">开户行:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.bank}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 isPublic">
+                    <label class="layui-form-label">银行账号:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.bankNo}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销人:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.submitterName}"/>
+                    </div>
+                </div>--%>
+
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销日期:</label>
+                    <div class="layui-input-block">
+                        <input readonly="readonly" class="form-control layui-input" value="<fmt:formatDate value="${workReimbursement.submitterDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 with-textarea">
+                    <label class="layui-form-label ">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" htmlEscape="false" rows="4"  maxlength="255" value="${workReimbursement.remarks}"  class="form-control "/>
+                    </div>
+                </div>
+            </div>
+            <%--<div class="form-group layui-row">
+                <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">
+                        <thead>
+                        <tr>
+                            <th width="190px">借款日期</th>
+                            <th width="190px">借款类型</th>
+                            <th width="190px">借款项目</th>
+                            <th width="190px">借款金额</th>
+                            <th width="180px">未还金额</th>
+                            <th width="100px">本次还款</th>
+                            <th width="120px">借款编号</th>
+                        </tr>
+                        </thead>
+                        <tbody id="reimbursementBackList">
+                        <c:if test="${not empty workReimbursement.reimbursementBackList}">
+                            <c:forEach items="${workReimbursement.reimbursementBackList}" var="reimbursementBack" varStatus="index">
+                                <tr id="reimbursementBackList${index.index}">
+                                    <td class="hide">
+                                        <input id="reimbursementBackList${index.index}_id" name="reimbursementBackList[${index.index}].id" type="hidden" value="${reimbursementBack.id}"/>
+                                        <input id="reimbursementBackList${index.index}_workLoanId" name="reimbursementBackList[${index.index}].workLoan.id" type="hidden" value="${reimbursementBack.workLoan.id}"/>
+                                        <input id="reimbursementBackList${index.index}_delFlag" name="reimbursementBackList[${index.index}].delFlag" type="hidden" value="0"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_1"   type="text" maxlength="20"  readonly="true" class=" form-control layui-input"
+                                               value="<fmt:formatDate value="${reimbursementBack.workLoan.loanDate}" pattern="yyyy-MM-dd"/>"/>
+                                        </input>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_2"  readonly="true" type="text" value="${reimbursementBack.workLoan.type}"   class="form-control"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_3"  readonly="true" type="text" value="${reimbursementBack.workLoan.projectRecords.projectName}"   class="form-control"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_4"  readonly="true" type="text" value="${reimbursementBack.workLoan.money}"   class="form-control"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_5"  readonly="true" type="text" value="${reimbursementBack.workLoan.notRepay}"   class="form-control"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_6" readonly="true"  name="reimbursementBackList[${index.index}].money" type="text" value="${reimbursementBack.money}"   class="form-control number "/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementBackList${index.index}_7"  readonly="true" type="text" value="${reimbursementBack.workLoan.num}"   class="form-control"/>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:if>
+                        </tbody>
+                    </table>
+                    <table id="contentMoneys1" class="table table-bordered table-condensed can-edit summary">
+                        <tr>
+                            <td  style="width:190px;vertical-align:middle;text-align: center;"><label><font color="red">*</font>合计</label></td>
+                            <td  width="190px" style="vertical-align:middle;text-align: center;">
+                                -
+                            </td >
+                            <td  width="190px" style="vertical-align:middle;text-align: center;">
+                                -
+                            </td>
+                            <td  width="190px" style="vertical-align:middle;text-align: center;">
+                                -
+                            </td>
+                            <td width="180px" style="vertical-align:middle;text-align: center;">
+                                -
+                            </td>
+                            <td width="100px" style="vertical-align:middle;text-align: center;">
+                                <input  id="backmoney" value="${workReimbursement.backmoney}" name="backmoney" htmlEscape="false" readonly="true"   maxlength="12"  class="form-control "/>
+                            </td>
+                            <td  width="120px" style="vertical-align:middle;text-align: center;">
+                                -
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+            </div>--%>
+        <%--<div class="form-group layui-row">
+            <div class="form-group-label"><h2>报销详情</h2></div>
+            <div class="layui-item layui-col-xs12 form-table-container" >
+                <table id="contentTable" class="table table-bordered table-condensed no-bottom-margin can-edit">
+                    <thead>
+                    <tr>
+                        <th width="150px"><span class="require-item">*</span>财务科目</th>
+                        <th><span class="require-item">*</span>报销费用摘要</th>
+                        <th width="150px"><font color="red">*</font>发票类型</th>
+                        <th width="150px">报销费用(元)</th>
+                        <th width="80px">备注</th>
+                        <th width="150px"><span class="require-item">*</span>U8科目</th>
+                        <th width="150px" class="isShow"><span class="require-item">*</span>考核科目</th>
+                        <th width="120px"><span class="require-item">*</span>考核金额(元)</th>
+                        <th width="80px">操作</th>
+                    </tr>
+                    </thead>
+                    <c:if test="${not empty workReimbursement.workAccountList}">
+                    <c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
+                    <tbody id="workAccountList${index.index}">
+                    <tr id="workAccountList${index.index}_audit0">
+                        <td class="hide">
+                            <input id="workAccountList${index.index}_id" name="workAccountList[${index.index}].id" type="hidden" value="${workAccount.id}"/>
+                            <input id="workAccountList${index.index}_delFlag" name="workAccountList[${index.index}].delFlag" type="hidden" value="0"/>
+                            <input id="workAccountList${index.index}_money" name="workAccountList[${index.index}].money" type="hidden" value="${workAccount.money}"/>
+                        </td>
+                        <td>
+                            <div class="project_reimbursement_div">
+                                <form:select id="workAccountList${index.index}_financialSubjects" path="workAccountList[${index.index}].financialSubjects" class="form-control ">
+                                    <form:option value="" label=""/>
+                                    <form:options items="${fns:getMainDictList('project_reimbursement')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                                </form:select>
+                            </div>
+                            <div class="not_project_reimbursement_div" style="display:none;">
+                                <form:select id="workAccountList${index.index}_financialSubjectss" path="workAccountList[${index.index}].financialSubjectss" class="form-control ">
+                                    <form:option value="" label=""/>
+                                    <form:options items="${fns:getMainDictList('not_project_reimbursement')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                                </form:select>
+                            </div>
+                        </td>
+                        <td>
+                            <input id="workAccountList${index.index}_moneyAbstract"  name="workAccountList[${index.index}].moneyAbstract"  type="text" value="${workAccount.moneyAbstract}"    class="form-control "/>
+                        </td>
+                        <td style="text-align: center; vertical-align:middle;">
+                                ${workAccount.invoiceType}
+                        </td>
+                        <td style="text-align: center; vertical-align:middle;">
+                            <fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
+                        </td>
+                        <td style="text-align: center; vertical-align:middle;" title="${workAccount.remarks}">
+                                ${workAccount.remarks}
+                        </td>
+                        <td>
+                            <form:select id="workAccountList${index.index}_audit0_u8Subjects" path="workAccountList[${index.index}].workAccountAuditList[0].u8Subjects" class="form-control ">
+                                <form:option value="" label=""/>
+                                <form:options items="${fns:getMainDictList('u8_subjects')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>
+                        </td>
+                        <td class="isShow">
+                            <form:select id="workAccountList${index.index}_audit0_checkSubjects" path="workAccountList[${index.index}].workAccountAuditList[0].checkSubjects" class="form-control ">
+                                <form:option value="" label=""/>
+                                <form:options items="${fns:getMainDictList('check_subjects')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>
+                        </td>
+                        <td>
+                            <input id="workAccountList${index.index}_audit0_money" onchange="getMoney()" name="workAccountList[${index.index}].workAccountAuditList[0].checkMoney" type="text" value="${workAccount.workAccountAuditList[0].checkMoney}"  maxlength="10"  class="form-control number checkMoney"/>
+                            <input id="workAccountList${index.index}_audit0_id" name="workAccountList[${index.index}].workAccountAuditList[0].id" type="hidden" value="${workAccount.workAccountAuditList[0].id}"/>
+                        </td>
+                        <td  class="text-center op-td" >
+                            <span class="op-btn op-btn-add" onclick="addRow('#workAccountList${index.index}', workAccountListRowIdx, workAccountAuditListTpl);workAccountListRowIdx=workAccountListRowIdx+1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</span>
+                        </td>
+                    </tr>
+                    </tbody>
+                    </c:forEach>
+
+                    </c:if>
+                </table>
+                <table id="contentMoneys" class="table table-bordered table-condensed can-edit summary">
+                    <tr>
+                        <td width="150px" style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>总报销费用(元):</label></td>
+                        <td>
+                            <input htmlEscape="false" id="moneys"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${workReimbursement.money}" pattern="#,#00.00"/>"/>
+                            <input htmlEscape="false" id="summoney" name="money" type="hidden"  readonly="true" class="form-control layui-input" value="${workReimbursement.money}"/>
+                        </td>
+                        <td width="150px" style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>考核金额总额(元):</label></td>
+                        <td >
+                            <input htmlEscape="false" id="checkMoneys"  readonly="true" class="form-control layui-input"/>
+                            <input htmlEscape="false" id="sumcheckMoneys" name="checkMoneys" type="hidden"  readonly="true" class="form-control layui-input" value="${workReimbursement.checkMoneys}"/>
+                        </td>
+                        <td width="150px" style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>实际报销费用(元):</label></td>
+                        <td >
+                            <input htmlEscape="false" id="backmoneys"  readonly="true" class="form-control layui-input"/>
+                            <input htmlEscape="false" id="sumbackmoneys" name="backmoneys" type="hidden"  readonly="true" class="form-control layui-input" value="${workReimbursement.backmoneys}"/>
+                        </td>
+                    </tr>
+                </table>
+                <script type="text/template" id="workAccountAuditListTpl">//<!--
+                                    <tr id="workAccountList0_audit0">
+                                        <td class="hide">
+                                        </td>
+                                        <td>
+                                        </td>
+                                        <td>
+                                        </td>
+                                        <td>
+                                        </td>
+                                        <td>
+                                        </td>
+                                        <td>
+                                        </td>
+                                        <td>
+											<form:select id="workAccountList0_audit0_u8Subjects" path="workAccountList[0].workAccountAuditList[0].u8Subjects" class="form-control ">
+												<form:option value="" label=""/>
+												<form:options items="${fns:getMainDictList('u8_subjects')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+											</form:select>
+										</td>
+										<td class="isShow">
+											<form:select id="workAccountList0_audit0_checkSubjects" path="workAccountList[0].workAccountAuditList[0].checkSubjects" class="form-control ">
+												<form:option value="" label=""/>
+												<form:options items="${fns:getMainDictList('check_subjects')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+											</form:select>
+										</td>
+										<td>
+										<input id="workAccountList0_audit0_money" onchange="getMoney()" name="workAccountList[0].workAccountAuditList[0].checkMoney" type="text" value="${workAccount.workAccountAuditList[0].checkMoney}"    class="form-control number checkMoney"/>
+										</td>
+
+										<td class="text-center op-td" >
+										    <span class="op-btn op-btn-delete" onclick="delRow(this, '#workAccountList0')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
+										</td>
+                                    </tr>//-->
+                </script>
+                <script type="text/javascript">
+                    var workAccountListRowIdx = 0, workAccountAuditListTpl = $("#workAccountAuditListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                </script>
+            </div>
+        </div>--%>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>报销详情</h2></div>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="200px">报销人</th>
+                            <th width="200px">报销部门</th>
+                            <th width="200px">报销项目</th>
+                            <th width="200px">报告号</th>
+                            <th width="200px">报销类型</th>
+                            <th width="200px">费用(元)</th>
+                            <th width="200px">收据张数</th>
+                            <th width="200px">出差天数</th>
+                            <th width="200px">内容</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workAccountList">
+                        <c:if test="${not empty workReimbursement.workAccountList}">
+                            <c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
+                                <tr id="workAccountList${index.index}">
+                                    <td class="hide">
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle">
+                                            ${workAccount.reimbursementName}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle">
+                                            ${workAccount.officeId}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
+                                            ${workAccount.project.projectName}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">
+                                            ${workAccount.projectReportNumber}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+                                            ${workAccount.typeName}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle">
+                                        <fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.bills}">
+                                            ${workAccount.bills}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.evectionNumber}">
+                                            ${workAccount.evectionNumber}
+                                    </td>
+                                    <td style="text-align: center; vertical-align: middle" title="${workAccount.remarks}">
+                                            ${workAccount.remarks}
+                                    </td>
+                                </tr>
+                            </c:forEach>
+
+                        </c:if>
+                        </tbody>
+                    </table>
+                    <table id="contentMoneys" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr style="border: 0px">
+                            <td width="200px" style="vertical-align:middle;text-align: center;background-color: #ffffff;"><label>总报销费用(元):</label></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="border: 0px;font-weight: bold;text-align: center;background-color: #ffffff;">
+                                <fmt:formatNumber value="${workReimbursement.money}" pattern="#,#00.00"/>
+                            </td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                            <td width="200px" style="background-color: #ffffff;"></td>
+                        </tr>
+                        </thead>
+                    </table>
+                </div>
+            </div>
+        <div class="form-group layui-row">
+            <div class="form-group-label"><h2>专用发票信息</h2></div>
+            <div class="layui-item layui-col-xs12 form-table-container" >
+                <table id="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
+                    <thead>
+                    <tr>
+                        <th width="300px">发票代码</th>
+                        <th width="200px">发票号</th>
+                        <th width="200px">金额</th>
+                        <th width="200px">税额</th>
+                        <th width="200px">价税合计</th>
+                    </tr>
+                    </thead>
+                    <tbody id="reimbursementVATTaxes">
+                    <c:if test="${not empty workReimbursement.reimbursementVATTaxes}">
+                        <c:forEach items="${workReimbursement.reimbursementVATTaxes}" var="reimbursementVATTaxe" varStatus="index">
+                            <tr>
+                                <td class="hide">
+                                </td>
+                                <td>
+                                        ${reimbursementVATTaxe.invoiceCode}
+                                </td>
+
+                                <td>
+                                        ${reimbursementVATTaxe.invoiceNumber}
+                                </td>
+                                <td>
+                                        ${reimbursementVATTaxe.money}
+                                </td>
+                                <td>
+                                        ${reimbursementVATTaxe.taxAmount}
+                                </td>
+                                <td>
+                                        ${reimbursementVATTaxe.sumMoney}
+                                </td>
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+        <div class="form-group layui-row">
+            <div class="form-group-label"><h2>相关附件</h2></div>
+            <div class="layui-item layui-col-xs12 form-table-container" >
+                <table id="upTable" class="table table-bordered table-condensed details">
+                    <thead>
+                    <tr>
+                            <%-- <th>序号</th>--%>
+                        <th>文件预览</th>
+                        <th>上传人</th>
+                        <th>上传时间</th>
+                        <th width="150px">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="file_attachment">
+                    <c:forEach items="${workReimbursement.workAttachments}" var = "workClientAttachment" varStatus="status">
+                        <tr>
+                                <%-- <td>${status.index + 1}</td>--%>
+                            <c:choose>
+                                <c:when test="${workReimbursement.uploadMode == 2}">
+                                    <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                            <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </c:when>
+                                <c:otherwise>
+                                    <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </c:otherwise>
+                            </c:choose>
+
+                            <td>${workClientAttachment.createBy.name}</td>
+                            <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                            <td class="op-td">
+                                <div class="op-btn-box" >
+                                        <%--附件下载删除--%>
+                                    <c:choose>
+                                        <c:when test="${workReimbursement.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                    <a href="${workClientAttachment.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(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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('${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}">
+                                        <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 test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                    </c:if>--%>
+                                </div>
+                            </td>
+                        </tr>
+                    </c:forEach>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+<%--            <div class="form-group layui-row">--%>
+<%--                <div class="form-group-label"><h2>审批意见</h2></div>--%>
+<%--                <div class="layui-item layui-col-sm8 lw6 with-textarea">--%>
+<%--                    <div class="layui-input-block" style="margin-left:10px;position: relative">--%>
+<%--                        <form:textarea placeholder="请输入意见:" path="act.comment" id="opinion" class="form-control" rows="4" cssStyle="height: 200px;" maxlength="127" />--%>
+<%--                        <a id="clearOpinon" class="layui-btn" style="position: absolute;bottom: 10px;right: 20px;">清空</a>--%>
+<%--                        <input type="file" name="upload_files" style="display: none;">--%>
+<%--                    </div>--%>
+<%--                </div>--%>
+<%--                <div class="layui-item layui-col-sm4 lw6 with-textarea">--%>
+<%--                    <div class="layui-input-block" style="margin-left:10px;">--%>
+<%--                        <div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="同意" title="同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--                        <div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="不同意" title="不同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--                        <div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="请领导审核" title="请领导审核" style="cursor:pointer" class="apen"/></div>--%>
+<%--                        <div style="padding: 5px 0px;">--%>
+<%--                            <form:select path="act.comment" id="auditOpinion" lay-filter="opinion" lay-verify="opinion" class="form-control simple-select">--%>
+<%--                                <form:option value=""/>--%>
+<%--                                <form:options items="${fns:getMainDictListOnProjectAdvent('audit_opinion_template')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+<%--                            </form:select>--%>
+<%--                        </div>--%>
+<%--                    </div>--%>
+<%--                </div>--%>
+<%--            </div>--%>
+<%--        <div class="form-group layui-row">--%>
+<%--            <div class="form-group-label"><h2>审批意见</h2></div>--%>
+<%--            <div class="layui-item layui-col-xs12 with-textarea" >--%>
+<%--                <label class="layui-form-label">审批意见:</label>--%>
+<%--                <div class="layui-input-block">--%>
+<%--                    <form:textarea path="act.comment" class="form-control" rows="4" maxlength="127" />--%>
+<%--                    <input type="file" name="upload_files" style="display: none;">--%>
+<%--                </div>--%>
+<%--            </div>--%>
+<%--        </div>--%>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+        <div class="form-group-label">
+            <div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+            <h2>审批意见</h2>
+        </div>
+        <iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+        <div class="form-group layui-row">
+            <div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+            <div class="layui-item layui-col-xs12 form-table-container" >
+                <act:flowChart procInsId="${workReimbursement.act.procInsId}"/>
+                <act:histoicFlow procInsId="${workReimbursement.act.procInsId}"/>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    function f1(row) {
+        // window.parent.document.getElementById('opinion').value = row;
+        $("#opinion").val(row)
+    }
+    function openDialogre(title,url,width,height,target,buttons) {
+        if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+            width = 'auto';
+            height = 'auto';
+        } else {//如果是PC端,根据用户设置的width和height显示。
+        }
+        var split = buttons.split(",");
+        top.layer.open({
+            type: 2,
+            area: [width, height],
+            title: title,
+            maxmin: true, //开启最大化最小化按钮
+            skin: 'three-btns',
+            content: url,
+            btn: split,
+            btn1: function(index, layero){
+                top.layer.close(index)
+                document.getElementById('iframe').contentWindow.location.reload();
+            }
+        });
+    }
+</script>
+</body>
+</html>
+

+ 8 - 1
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementCWNewAudit.jsp

@@ -796,7 +796,14 @@
                                                     <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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>

+ 635 - 0
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementElectronicInvoiceAudit.jsp

@@ -0,0 +1,635 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>报销审核</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+			  $("#opinion").val(ss);
+		      if(obj == 1){
+                  $('#flag').val('yes');
+              }else{
+                  $('#flag').val('no');
+              }
+			  $("#inputForm").submit();
+			  return true;
+		  }else {
+              parent.layer.msg("信息未填写完整!", {icon: 5});
+          }
+
+		  return false;
+		}
+		$(document).ready(function() {
+
+			var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+			if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+            if (${workReimbursement.ext == 0}){
+                $(".td1").removeClass("hide");
+                $(".project_reimbursement_div").show();
+                $(".not_project_reimbursement_div").hide();
+            }else {
+                $(".td1").addClass("hide");
+                $(".project_reimbursement_div").hide();
+                $(".not_project_reimbursement_div").show();
+            }
+            if (${workReimbursement.isPublic =='0'}){
+                $(".isPublic").addClass("hide");
+            }else {
+                $(".isPublic").removeClass("hide");
+            }
+			$("#name").focus();
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+	<style>
+		/*超过5个汉字,调整label的长度,以下是配套的*/
+		.layui-item .layui-form-label{
+			width:90px;
+		}
+		.form-group .layui-item .layui-input-block,
+		.query .layui-input-block {
+			margin-left: 116px;
+		}
+	</style>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+	<form:form id="inputForm" modelAttribute="workReimbursement" enctype="multipart/form-data" action="${ctx}/workReimbursementNew/workReimbursementNew/saveAudit" method="post" class="form-horizontal layui-form">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="act.taskId"/>
+		<form:hidden path="act.taskName"/>
+		<form:hidden path="act.taskDefKey"/>
+		<form:hidden path="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+		<input type="hidden" id="reimbursementType" name="reimbursementType" 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">
+				<label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.reimbursementTypeStr}"/>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销编号:</label>
+				<div class="layui-input-block">
+					<div class="input-group">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true"  class="form-control layui-input" value="${workReimbursement.number}"/>
+						<span class="input-group-btn">
+                        <label class="form-status"><c:choose><c:when test="${not empty workReimbursement.status}">${fns:getDictLabel(workReimbursement.status, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                     </span>
+					</div>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销人:</label>
+				<div class="layui-input-block">
+					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">所属部门:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.officeName}"/>
+				</div>
+			</div>
+			<%--<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">银行卡号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"  class="form-control layui-input" value = "${workReimbursement.bankCard}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销类型:</label>
+				<div class="layui-input-block">
+					<input readonly="true" htmlEscape="false" class="form-control layui-input"
+						   value="<c:choose><c:when test="${workReimbursement.ext == 0}">项目报销</c:when><c:otherwise>非项目报销</c:otherwise></c:choose>"/>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6 td1">
+				<label class="layui-form-label">报销项目:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.project.projectName}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销类别:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.typeName}"/>
+				</div>
+			</div>
+				&lt;%&ndash;<div class="layui-item layui-col-sm6 td1">
+                    <label class="layui-form-label">项目负责人:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true"  class="form-control layui-input" value="${workReimbursement.projectMasterName}"/>
+                    </div>
+                </div>&ndash;%&gt;
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label double-line">是否对公报销:</label>
+				<div class="layui-input-block">
+					<input readonly="true" htmlEscape="false" class="form-control layui-input"
+						   value="<c:choose><c:when test="${workReimbursement.isPublic == '0'}">否</c:when><c:otherwise>是</c:otherwise></c:choose>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 isPublic">
+				<label class="layui-form-label">公司名称:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.comname}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 isPublic">
+				<label class="layui-form-label">开户行:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.bank}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 isPublic">
+				<label class="layui-form-label">银行账号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.bankNo}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销人:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workReimbursement.submitterName}"/>
+				</div>
+			</div>--%>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销日期:</label>
+				<div class="layui-input-block">
+					<input readonly="readonly" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workReimbursement.submitterDate}" pattern="yyyy-MM-dd"/>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 with-textarea">
+				<label class="layui-form-label ">备注:</label>
+				<div class="layui-input-block">
+					<form:textarea path="remarks" placeholder="请输入备注" htmlEscape="false" rows="4"  maxlength="255" value="${workReimbursement.remarks}"  class="form-control "/>
+				</div>
+			</div>
+		</div>
+		<%--<div class="form-group layui-row">
+			<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">
+					<thead>
+					<tr>
+						<th width="190px">借款日期</th>
+						<th width="190px">借款类型</th>
+						<th width="190px">借款项目</th>
+						<th width="190px">借款金额</th>
+						<th width="180px">未还金额</th>
+						<th width="100px">本次还款</th>
+						<th width="120px">借款编号</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementBackList">
+					<c:if test="${not empty workReimbursement.reimbursementBackList}">
+						<c:forEach items="${workReimbursement.reimbursementBackList}" var="reimbursementBack" varStatus="index">
+							<tr id="reimbursementBackList${index.index}">
+								<td class="hide">
+									<input id="reimbursementBackList${index.index}_id" name="reimbursementBackList[${index.index}].id" type="hidden" value="${reimbursementBack.id}"/>
+									<input id="reimbursementBackList${index.index}_workLoanId" name="reimbursementBackList[${index.index}].workLoan.id" type="hidden" value="${reimbursementBack.workLoan.id}"/>
+									<input id="reimbursementBackList${index.index}_delFlag" name="reimbursementBackList[${index.index}].delFlag" type="hidden" value="0"/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_1"   type="text" maxlength="20"  readonly="true" class=" form-control layui-input"
+										   value="<fmt:formatDate value="${reimbursementBack.workLoan.loanDate}" pattern="yyyy-MM-dd"/>"/>
+									</input>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_2"  readonly="true" type="text" value="${reimbursementBack.workLoan.type}"   class="form-control"/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_3"  readonly="true" type="text" value="${reimbursementBack.workLoan.projectRecords.projectName}"   class="form-control"/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_4"  readonly="true" type="text" value="${reimbursementBack.workLoan.money}"   class="form-control"/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_5"  readonly="true" type="text" value="${reimbursementBack.workLoan.notRepay}"   class="form-control"/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_6" readonly="true"  name="reimbursementBackList[${index.index}].money" type="text" value="${reimbursementBack.money}"   class="form-control number "/>
+								</td>
+								<td>
+									<input id="reimbursementBackList${index.index}_7"  readonly="true" type="text" value="${reimbursementBack.workLoan.num}"   class="form-control"/>
+								</td>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+				<table id="contentMoneys1" class="table table-bordered table-condensed can-edit summary">
+					<tr>
+						<td  style="width:190px;vertical-align:middle;text-align: center;"><label><font color="red">*</font>合计</label></td>
+						<td  width="190px" style="vertical-align:middle;text-align: center;">
+							-
+						</td >
+						<td  width="190px" style="vertical-align:middle;text-align: center;">
+							-
+						</td>
+						<td  width="190px" style="vertical-align:middle;text-align: center;">
+							-
+						</td>
+						<td width="180px" style="vertical-align:middle;text-align: center;">
+							-
+						</td>
+						<td width="100px" style="vertical-align:middle;text-align: center;">
+							<input  id="backmoney" value="${workReimbursement.backmoney}" name="backmoney" htmlEscape="false" readonly="true"   maxlength="12"  class="form-control "/>
+						</td>
+						<td  width="120px" style="vertical-align:middle;text-align: center;">
+							-
+						</td>
+					</tr>
+				</table>
+			</div>
+		</div>--%>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>报销详情</h2></div>
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px">报销人</th>
+						<th width="200px">报销部门</th>
+						<th width="200px">报销类型</th>
+						<th width="200px">报销项目</th>
+						<th width="200px">报告号</th>
+						<th width="200px">费用(元)</th>
+						<th width="200px">收据张数</th>
+						<th width="200px">出差天数</th>
+						<th width="200px">内容</th>
+					</tr>
+					</thead>
+					<tbody id="workAccountList">
+					<c:if test="${not empty workReimbursement.workAccountList}">
+						<c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
+							<tr id="workAccountList${index.index}">
+								<td class="hide">
+								</td>
+								<td style="text-align: center; vertical-align: middle">
+										${workAccount.reimbursementName}
+								</td>
+								<td style="text-align: center; vertical-align: middle">
+										${workAccount.officeId}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+										${workAccount.typeName}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
+										${workAccount.project.projectName}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">
+										${workAccount.projectReportNumber}
+								</td>
+
+								<td style="text-align: center; vertical-align: middle">
+									<fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.bills}">
+										${workAccount.bills}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.evectionNumber}">
+										${workAccount.evectionNumber}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.remarks}">
+										${workAccount.remarks}
+								</td>
+							</tr>
+						</c:forEach>
+
+					</c:if>
+					</tbody>
+				</table>
+				<table id="contentMoneys" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr style="border: 0px">
+						<td width="200px" style="vertical-align:middle;text-align: center;background-color: #ffffff;"><label>总报销费用(元):</label></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="border: 0px;font-weight: bold;text-align: center;background-color: #ffffff;">
+							<fmt:formatNumber value="${workReimbursement.money}" pattern="#,#00.00"/>
+						</td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+					</tr>
+					</thead>
+				</table>
+			</div>
+		</div>
+		<div class="form-group layui-row count1">
+			<div class="form-group-label"><h2>专用发票信息</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<table id="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="300px">发票代码</th>
+						<th width="200px">发票号</th>
+						<th width="200px">金额</th>
+						<th width="200px">税额</th>
+						<th width="200px">价税合计</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementVATTaxes">
+					<c:if test="${not empty workReimbursement.reimbursementVATTaxes}">
+						<c:forEach items="${workReimbursement.reimbursementVATTaxes}" var="reimbursementVATTaxe" varStatus="index">
+							<tr>
+								<td class="hide">
+								</td>
+								<td>
+										${reimbursementVATTaxe.invoiceCode}
+								</td>
+
+								<td>
+										${reimbursementVATTaxe.invoiceNumber}
+								</td>
+								<td>
+										${reimbursementVATTaxe.money}
+								</td>
+								<td>
+										${reimbursementVATTaxe.taxAmount}
+								</td>
+								<td>
+										${reimbursementVATTaxe.sumMoney}
+								</td>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</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">
+					<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">备注</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementElectronicInvoiceVATTaxes">
+					<c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+						<c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+							<tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+									<%--发票类型--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceTypeStr}" onmouseover="this.title=this.value"  class="form-control "/>
+								</td>
+									<%--发票号--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control "/>
+								</td>
+									<%--开票日期--%>
+								<td>
+									<input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" onmouseover="this.title=this.value" readOnly="true" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control datetime"/>
+								</td>
+									<%--开票单位--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--金额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--税额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--合计价税--%>
+								<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>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>相关附件</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<table id="upTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+							<%-- <th>序号</th>--%>
+						<th>文件预览</th>
+						<th>上传人</th>
+						<th>上传时间</th>
+						<th width="150px">操作</th>
+					</tr>
+					</thead>
+					<tbody id="file_attachment">
+						<c:forEach items="${workReimbursement.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workReimbursement.uploadMode == 2}">
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+														   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+											<%--附件下载删除--%>
+										<c:choose>
+											<c:when test="${workReimbursement.uploadMode == 2}">
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<a href="${workClientAttachment.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(workClientAttachment.attachmentName,'xml')}">
+																<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:when>
+															<c:otherwise>
+																<a href="${workClientAttachment.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('${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}">
+											<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>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
+		<div class="form-group layui-row page-end"></div>
+	</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${workReimbursement.act.procInsId}"/>
+				<act:histoicFlow procInsId="${workReimbursement.act.procInsId}"/>
+			</div>
+		</div>
+</div>
+</div>
+<script>
+	function f1(row) {
+		// window.parent.document.getElementById('opinion').value = row;
+		$("#opinion").val(row)
+	}
+	function openDialogre(title,url,width,height,target,buttons) {
+		if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+			width = 'auto';
+			height = 'auto';
+		} else {//如果是PC端,根据用户设置的width和height显示。
+		}
+		var split = buttons.split(",");
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			maxmin: true, //开启最大化最小化按钮
+			skin: 'three-btns',
+			content: url,
+			btn: split,
+			btn1: function(index, layero){
+				top.layer.close(index)
+				document.getElementById('iframe').contentWindow.location.reload();
+			}
+		});
+	}
+
+</script>
+</body>
+</html>
+

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1373 - 0
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementElectronicInvoiceReimbursementModifyApply.jsp


+ 90 - 4
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewAudit.jsp

@@ -30,6 +30,16 @@
 				var form = layui.form;
 				form.render();
 			});
+
+			var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+			if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
             if (${workReimbursement.ext == 0}){
                 $(".td1").removeClass("hide");
                 $(".project_reimbursement_div").show();
@@ -86,12 +96,14 @@
 		<form:hidden path="act.procDefId"/>
 		<form:hidden id="flag" path="act.flag"/>
 		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+		<input type="hidden" id="reimbursementType" name="reimbursementType" 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">
-				<label class="layui-form-label">报销人:</label>
+				<label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
 				<div class="layui-input-block">
-					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.reimbursementTypeStr}"/>
 				</div>
 			</div>
 			<div class="layui-item layui-col-sm6">
@@ -105,6 +117,13 @@
 					</div>
 				</div>
 			</div>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销人:</label>
+				<div class="layui-input-block">
+					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+				</div>
+			</div>
 			<div class="layui-item layui-col-sm6">
 				<label class="layui-form-label">所属部门:</label>
 				<div class="layui-input-block">
@@ -341,7 +360,7 @@
 				</table>
 			</div>
 		</div>
-		<div class="form-group layui-row">
+		<div class="form-group layui-row count1">
 			<div class="form-group-label"><h2>专用发票信息</h2></div>
 			<div class="layui-item layui-col-xs12 form-table-container" >
 				<table id="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
@@ -383,6 +402,66 @@
 				</table>
 			</div>
 		</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">
+					<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">备注</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementElectronicInvoiceVATTaxes">
+					<c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+						<c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+							<tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+									<%--发票类型--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceTypeStr}" onmouseover="this.title=this.value"  class="form-control "/>
+								</td>
+									<%--发票号--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control "/>
+								</td>
+									<%--开票日期--%>
+								<td>
+									<input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" onmouseover="this.title=this.value" readOnly="true" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control datetime"/>
+								</td>
+									<%--开票单位--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--金额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--税额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--合计价税--%>
+								<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>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
 		<div class="form-group layui-row">
 			<div class="form-group-label"><h2>相关附件</h2></div>
 			<div class="layui-item layui-col-xs12 form-table-container" >
@@ -477,7 +556,14 @@
 														<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
 													</c:when>
 													<c:otherwise>
-														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+																<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:when>
+															<c:otherwise>
+																<a href="${workClientAttachment.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>

+ 369 - 23
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewFormAdd.jsp

@@ -13,7 +13,30 @@
         $(document).ready(function() {
             layui.use(['form', 'layer'], function () {
                 var form = layui.form;
+
+
+                form.on('radio(reimbursementTypeRadio)',function (event) {
+                    var radioVal = $(this).val();
+                    if(radioVal == 0 || radioVal == "0"){
+                        $(".count2").hide();
+                        $(".count1").show();
+                    }else if(radioVal == 1 || radioVal == "1"){
+                        $(".count1").hide();
+                        $(".count2").show();
+                    }
+                    form.render();
+                })
             })
+            var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+            if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+                document.getElementsByName("reimbursementType")[0].checked = true;
+                $(".count2").hide();
+                $(".count1").show();
+            }else{
+                document.getElementsByName("reimbursementType")[1].checked = true;
+                $(".count1").hide();
+                $(".count2").show();
+            }
             if($("#submitterDate").val()==null || $("#submitterDate").val()==''){
                 $("#submitterDate").val(getNowFormatDate());
             }
@@ -73,6 +96,20 @@
             });
             // getRandom();
 
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+
+            var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};//后端获取值
+            for (var i=0; i<data.length; i++){
+                laydate.render({
+                    elem: '#reimbursementElectronicInvoiceVATTaxes' + i + '_invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                    event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                    type : 'datetime'
+                });
+            }
         });
 
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
@@ -102,6 +139,46 @@
                     parent.layer.msg("请添加报销详情!", {icon: 5});
                     flags= false;
                 }
+
+                var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
+                if(electronicInvoiceArr.length>0){
+                    var flag = false;
+                    var countFlag = 0;
+                    var list = "${workReimbursement.workAttachments}";
+                    var size = (list.split('url')).length-1;
+                    var files = $("#attachment_file")[0].files;
+                    for(var i = 0;i<files.length;i++) {
+                        var file = files[i];
+                        //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                        const spliceLength2 = file.name.lastIndexOf(".");
+                        var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                        if(fileNameSuffix === "xml" ) {
+                            flag = true;
+                            countFlag ++;
+                        }
+                    }
+                    if(!flag){
+                        var data = ${fns:toJson(workReimbursement.workAttachments)};//后端获取值
+                        for (var i=0; i<data.length; i++){
+                            //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                            const spliceLength2 = data[i].attachmentName.lastIndexOf(".");
+                            var fileNameSuffix = data[i].attachmentName.slice(spliceLength2 + 1);
+                            if(fileNameSuffix === "xml" ) {
+                                flag = true;
+                                countFlag ++;
+                            }
+                        }
+                    }
+                    if(!flag){
+                        parent.layer.msg("已填写电子发票信息,请上传对应发票的xml文件!", {icon: 5});
+                        flags= false;
+                    }
+                    /*if(countFlag < electronicInvoiceArr.length){
+                        parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
+                        flags= false;
+                    }*/
+                }
+
                 if (flags){
                     $("#inputForm").attr("action","${ctx}/workReimbursementNew/workReimbursementNew/save");
                 }else{
@@ -252,6 +329,9 @@
             if(list == '#reimbursementVATTaxes'){
                 bornTemplete(list, idx, tpl, row, idx2);
             }
+            if(list == '#reimbursementElectronicInvoiceVATTaxes'){
+                bornTemplete(list, idx, tpl, row, idx2);
+            }
         }
         function bornTemplete(list, idx, tpl, row, idx1){
             $(list).append(Mustache.render(tpl, {
@@ -269,6 +349,13 @@
                     }
                 }
             });
+
+            laydate.render({
+                elem : (list+idx+"_invoiceDate"),
+                event: 'focus',
+                type : 'datetime',
+                trigger: 'click'
+            });
         }
         function delRow(obj, prefix){
             var id = $(prefix+"_id");
@@ -355,6 +442,80 @@
             var divId = "_attachment";
             $("#addFile"+divId).show();
             multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+
+            //判断报销类型是否为电子报销
+            var reimbursementType=$('input:radio[name="reimbursementType"]:checked').val();
+            if(reimbursementType === "1"){
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        var formdata = new FormData();
+                        formdata.append("multipartFile",file);
+                        $.ajax({
+                            type:'post',
+                            url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                            data:formdata,
+                            contentType: false,
+                            processData: false,
+                            success:function (data) {
+                                console.log(data)
+                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
+                                var includeFlag = false;
+                                //xml文件处理
+                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                                //获取专用发票信息 行数
+                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                                for(var i = 0;i < trlen;i++){
+                                    var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+                                    var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                                    var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
+                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
+                                    var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
+                                    var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
+                                    var money = $("#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 sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                                    var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                                    if(invoiceNumber === data.InvoiceNumber){
+                                        includeFlag = true
+                                        //数据处理
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val("");
+                                    }
+                                }
+                                //若发票号不存在。则新增行将对应信息添加进去
+                                if(!includeFlag){
+                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val("");
+
+                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                                }
+                            }
+                        });
+                    }
+                }
+            }
+
         }
         function insertTitleCollection(tValue){
             var list = "${workReimbursement.workAttachments}";
@@ -470,6 +631,33 @@
                 }
             })
         }
+
+        function getMoneyElectronicInvoiceVATT(index){
+            var money = "0.00";
+            //方法一使用id选择器进行计算。
+            //获取输入的数字
+            //自动计算出结果并填充在相应的输入框中
+            var workmoney = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val();
+            if(parseFloat(workmoney)<0){
+                workmoney=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val(0);
+            }
+            if(workmoney==undefined||!isNumber(workmoney)||workmoney==''){
+                workmoney=0;
+            }
+            var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val();
+            if(parseFloat(taxAmount)<0){
+                taxAmount=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val(0);
+            }
+            if(taxAmount==undefined||!isNumber(taxAmount)||taxAmount==''){
+                taxAmount=0;
+            }
+            if (workmoney!=undefined && isNumber(workmoney) ){
+                money = (parseFloat(taxAmount) + parseFloat(workmoney)).toFixed(2);
+            }
+            $("#reimbursementElectronicInvoiceVATTaxes"+index+"_sumMoney").val(money);
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -489,7 +677,7 @@
 <body>
 <div class="single-form">
 <div class="container">
-    <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workReimbursementNew/workReimbursementNew/save" method="post" class="form-horizontal layui-form" >
+    <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workReimbursementNew/workReimbursementNew/save" method="post" class="form-horizontal" >
         <form:hidden path="id"/>
         <form:hidden path="achivesId"/>
         <form:hidden path="submitterId"/>
@@ -498,11 +686,10 @@
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
             <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label">经办人:</label>
-                <div class="layui-input-block with-icon">
-                    <div class="input-group">
-                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
-                    </div>
+                <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+                <div class="layui-input-block layui-form">
+                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
+                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="电子发票报销" value="1">
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
@@ -517,6 +704,15 @@
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">经办人:</label>
+                <div class="layui-input-block with-icon">
+                    <div class="input-group">
+                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-item layui-col-sm6">
                 <label class="layui-form-label">所属部门:</label>
                 <div class="layui-input-block">
                     <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control judgment layui-input" value = "${workReimbursement.officeName}"/>
@@ -694,7 +890,7 @@
                 </script>
             </div>
         </div>
-        <div class="form-group layui-row">
+        <div class="form-group layui-row count1">
             <div class="form-group-label"><h2>专用发票信息</h2></div>
             <div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
@@ -703,11 +899,11 @@
                 <table id="contentTable2" class="table table-bordered table-condensed can-edit">
                     <thead>
                     <tr>
-                        <th width="300px">发票代码</th>
-                        <th width="200px">发票号</th>
-                        <th width="200px">金额</th>
-                        <th width="200px">税额</th>
-                        <th width="200px">价税合计</th>
+                        <th width="300px"><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">操作</th>
                     </tr>
                     </thead>
@@ -720,20 +916,20 @@
                                     <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control  number"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
                                 </td>
 
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number  sumMoney"/>
+                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
                                 </td>
                                 <td class="text-center op-td">
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -750,20 +946,20 @@
                                             <input id="reimbursementVATTaxes{{idx}}_delFlag" name="reimbursementVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control judgment number "/>
                                         </td>
 
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number judgment"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number judgment"/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number  sumMoney"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number judgment sumMoney"/>
                                         </td>
                                         <td class="text-center op-td">
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
@@ -789,6 +985,149 @@
                 </script>
             </div>
         </div>
+
+        <div class="form-group layui-row count2">
+            <div class="form-group-label"><h2>电子发票信息</h2></div>
+            <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">
+                    <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">备注</th>
+                        <th width="150px">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="reimbursementElectronicInvoiceVATTaxes">
+                    <c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+                        <c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+                            <tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+                                <td class="hide">
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_id" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].id" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.id}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
+                                </td>
+                                    <%--发票类型--%>
+                                <td>
+                                    <select name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" class="form-control judgment">
+                                        <option value=""></option>
+                                        <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                            <option value="${var.value}" <c:if test="${reimbursementElectronicInvoiceVATTaxes.invoiceType eq var.value}">selected</c:if>>${var.label}</option>
+                                        </c:forEach>
+                                    </select>
+                                </td>
+                                    <%--发票号--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control judgment number "/>
+                                </td>
+                                    <%--开票日期--%>
+                                <td>
+                                    <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly onmouseover="this.title=this.value" autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control judgment datetime"/>
+                                </td>
+                                    <%--开票单位--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceUnit" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                                </td>
+                                    <%--金额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--税额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--合计价税--%>
+                                <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 number judgment sumMoney"/>
+                                </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 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>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+                <script type="text/template" id="reimbursementElectronicInvoiceVATTaxesTpl">//<!--
+                    <tr id="reimbursementElectronicInvoiceVATTaxes{{idx}}">
+                        <td class="hide">
+                            <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"/>
+                        </td>
+                            <%--发票类型--%>
+                        <td>
+                            <select name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" class="form-control judgment">
+                                <option value=""></option>
+                                <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                    <option value="${var.value}">${var.label}</option>
+                                </c:forEach>
+                            </select>
+                        </td>
+                            <%--发票号--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
+                        </td>
+                            <%--开票日期--%>
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceDate" type="text" value="{{row.invoiceDate}}"  onmouseover="this.title=this.value" class="form-control required datetime"/>
+                        </td>
+                            <%--开票单位--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceUnit" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceUnit" type="text" value="{{row.invoiceUnit}}" maxlength="32" placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                        </td>
+                            <%--金额--%>
+                         <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_money" onchange="getMoneyElectronicInvoiceVATT({{idx}})" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--税额--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_taxAmount"  onchange="getMoneyElectronicInvoiceVATT({{idx}})"name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--合计价税--%>
+                         <td>
+                            <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>
+                        <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">
+                    var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    var reimbursementElectronicInvoiceVATTaxesRowIdx = 0, reimbursementElectronicInvoiceVATTaxesTpl = $("#reimbursementElectronicInvoiceVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    if($("#id").val()){
+                        workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    }
+                    $(document).ready(function() {
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                        /*var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl, data[i]);
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    }*/
+                    });
+                </script>
+            </div>
+        </div>
+
+
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销附件信息</h2></div>
             <div class="layui-item nav-btns">
@@ -901,7 +1240,14 @@
                                                     <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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>

+ 369 - 18
src/main/webapp/webpage/modules/workreimbursement/new/workReimbursementNewModifyApply.jsp

@@ -4,10 +4,40 @@
 <head>
 	<title>报销单管理</title>
 	<meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
     <script type="text/javascript">
 		var validateForm;
 		var count = 0;
 		$(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+                form.on('radio(reimbursementTypeRadio)',function (event) {
+                    var radioVal = $(this).val();
+                    if(radioVal == 0 || radioVal == "0"){
+                        $(".count2").hide();
+                        $(".count1").show();
+                    }else if(radioVal == 1 || radioVal == "1"){
+                        $(".count1").hide();
+                        $(".count2").show();
+                    }
+                    form.render();
+                })
+            })
+
+            var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+            if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+                document.getElementsByName("reimbursementType")[0].checked = true;
+                $(".count2").hide();
+                $(".count1").show();
+            }else{
+                document.getElementsByName("reimbursementType")[1].checked = true;
+                $(".count1").hide();
+                $(".count2").show();
+            }
+
             if($("#submitterDate").val()==null || $("#submitterDate").val()==''){
                 $("#submitterDate").val(getNowFormatDate());
             }
@@ -87,6 +117,22 @@
             });
            // getRandom();
 
+
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+
+            var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};//后端获取值
+            for (var i=0; i<data.length; i++){
+                laydate.render({
+                    elem: '#reimbursementElectronicInvoiceVATTaxes' + i + '_invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                    event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                    type : 'datetime'
+                });
+            }
+
         });
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
             var idArr = $("#workAccountList tr:visible");
@@ -95,6 +141,45 @@
                 return false;
             }
 
+            var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
+            if(electronicInvoiceArr.length>0){
+                var flag = false;
+                var countFlag = 0;
+                var list = "${workReimbursement.workAttachments}";
+                var size = (list.split('url')).length-1;
+                var files = $("#attachment_file")[0].files;
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        flag = true;
+                        countFlag ++;
+                    }
+                }
+                if(!flag){
+                    var data = ${fns:toJson(workReimbursement.workAttachments)};//后端获取值
+                    for (var i=0; i<data.length; i++){
+                        //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                        const spliceLength2 = data[i].attachmentName.lastIndexOf(".");
+                        var fileNameSuffix = data[i].attachmentName.slice(spliceLength2 + 1);
+                        if(fileNameSuffix === "xml" ) {
+                            flag = true;
+                            countFlag ++;
+                        }
+                    }
+                }
+                if(!flag){
+                    parent.layer.msg("已填写电子发票信息,请上传对应发票的xml文件!", {icon: 5});
+                    flags= false;
+                }
+                /*if(countFlag < electronicInvoiceArr.length){
+                    parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
+                    flags= false;
+                }*/
+            }
+
             var trlen = $("#workAccountList tr").length;
             var tdlen = $("#workAccountList tr td").length;
             var trArr = [];
@@ -307,6 +392,9 @@
             if(list == '#reimbursementVATTaxes'){
                 bornTemplete(list, idx, tpl, row, idx2);
             }
+            if(list == '#reimbursementElectronicInvoiceVATTaxes'){
+                bornTemplete(list, idx, tpl, row, idx2);
+            }
         }
         function bornTemplete(list, idx, tpl, row, idx1){
             $(list).append(Mustache.render(tpl, {
@@ -324,6 +412,13 @@
                     }
                 }
             });
+
+            laydate.render({
+                elem : (list+idx+"_invoiceDate"),
+                event: 'focus',
+                type : 'datetime',
+                trigger: 'click'
+            });
         }
         function delRow(obj, prefix){
             var id = $(prefix+"_id");
@@ -409,6 +504,80 @@
             var divId = "_attachment";
             $("#addFile"+divId).show();
             multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+
+            //判断报销类型是否为电子报销
+            var reimbursementType=$('input:radio[name="reimbursementType"]:checked').val();
+            if(reimbursementType === "1"){
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        var formdata = new FormData();
+                        formdata.append("multipartFile",file);
+                        $.ajax({
+                            type:'post',
+                            url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                            data:formdata,
+                            contentType: false,
+                            processData: false,
+                            success:function (data) {
+                                console.log(data)
+                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
+                                var includeFlag = false;
+                                //xml文件处理
+                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                                //获取专用发票信息 行数
+                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                                for(var i = 0;i < trlen;i++){
+                                    var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+                                    var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                                    var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
+                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
+                                    var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
+                                    var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
+                                    var money = $("#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 sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                                    var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                                    if(invoiceNumber === data.InvoiceNumber){
+                                        includeFlag = true
+                                        //数据处理
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val("");
+                                    }
+                                }
+                                //若发票号不存在。则新增行将对应信息添加进去
+                                if(!includeFlag){
+                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val("");
+
+                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                                }
+                            }
+                        });
+                    }
+                }
+            }
+
         }
         function insertTitleCollection(tValue){
             var list = "${workReimbursement.workAttachments}";
@@ -535,6 +704,32 @@
                 }
             })
         }
+        function getMoneyElectronicInvoiceVATT(index){
+            var money = "0.00";
+            //方法一使用id选择器进行计算。
+            //获取输入的数字
+            //自动计算出结果并填充在相应的输入框中
+            var workmoney = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val();
+            if(parseFloat(workmoney)<0){
+                workmoney=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val(0);
+            }
+            if(workmoney==undefined||!isNumber(workmoney)||workmoney==''){
+                workmoney=0;
+            }
+            var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val();
+            if(parseFloat(taxAmount)<0){
+                taxAmount=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val(0);
+            }
+            if(taxAmount==undefined||!isNumber(taxAmount)||taxAmount==''){
+                taxAmount=0;
+            }
+            if (workmoney!=undefined && isNumber(workmoney) ){
+                money = (parseFloat(taxAmount) + parseFloat(workmoney)).toFixed(2);
+            }
+            $("#reimbursementElectronicInvoiceVATTaxes"+index+"_sumMoney").val(money);
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -570,11 +765,10 @@
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
             <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label"><span class="require-item">*</span>报销人:</label>
-                <div class="layui-input-block with-icon">
-                    <div class="input-group">
-                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
-                    </div>
+                <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+                <div class="layui-input-block layui-form">
+                    <input type="radio" name="reimbursementType" disabled lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
+                    <input type="radio" name="reimbursementType" disabled lay-filter="reimbursementTypeRadio" title="电子发票报销" value="1">
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
@@ -589,6 +783,14 @@
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label"><span class="require-item">*</span>报销人:</label>
+                <div class="layui-input-block with-icon">
+                    <div class="input-group">
+                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                    </div>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
                 <label class="layui-form-label">所属部门:</label>
                 <div class="layui-input-block">
                     <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control required layui-input" value = "${workReimbursement.officeName}"/>
@@ -958,7 +1160,7 @@
             </script>
         </div>
     </div>
-        <div class="form-group layui-row">
+        <div class="form-group layui-row count1">
             <div class="form-group-label"><h2>专用发票信息</h2></div>
             <div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
@@ -984,20 +1186,20 @@
                                     <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" maxlength="32" type="text" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
                                 </td>
 
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber"  maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" maxlength="32" type="text" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number required sumMoney"/>
+                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
                                 </td>
                                 <td class="text-center op-td">
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -1014,22 +1216,21 @@
                                             <input id="reimbursementVATTaxes{{idx}}_delFlag" name="reimbursementVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" maxlength="32" value="{{row.invoiceCode}}"  placeholder="请输入发票代码"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control judgment number "/>
                                         </td>
 
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber"  maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" maxlength="32" value="{{row.invoiceNumber}}"  placeholder="请输入发票号"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number judgment"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number judgment"/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number required sumMoney"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number judgment sumMoney"/>
                                         </td>
-
                                         <td class="text-center op-td">
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
                                         </td>
@@ -1052,6 +1253,149 @@
                 </script>
             </div>
         </div>
+
+        <div class="form-group layui-row count2">
+            <div class="form-group-label"><h2>电子发票信息</h2></div>
+            <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">
+                    <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">备注</th>
+                        <th width="150px">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="reimbursementElectronicInvoiceVATTaxes">
+                    <c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+                        <c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+                            <tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+                                <td class="hide">
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_id" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].id" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.id}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
+                                </td>
+                                    <%--发票类型--%>
+                                <td>
+                                    <select name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" class="form-control judgment">
+                                        <option value=""></option>
+                                        <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                            <option value="${var.value}" <c:if test="${reimbursementElectronicInvoiceVATTaxes.invoiceType eq var.value}">selected</c:if>>${var.label}</option>
+                                        </c:forEach>
+                                    </select>
+                                </td>
+                                    <%--发票号--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control judgment number "/>
+                                </td>
+                                    <%--开票日期--%>
+                                <td>
+                                    <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly onmouseover="this.title=this.value" autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control judgment datetime"/>
+                                </td>
+                                    <%--开票单位--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceUnit" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                                </td>
+                                    <%--金额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--税额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--合计价税--%>
+                                <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 number judgment sumMoney"/>
+                                </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 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>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+                <script type="text/template" id="reimbursementElectronicInvoiceVATTaxesTpl">//<!--
+                    <tr id="reimbursementElectronicInvoiceVATTaxes{{idx}}">
+                        <td class="hide">
+                            <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"/>
+                        </td>
+                            <%--发票类型--%>
+                        <td>
+                            <select name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" class="form-control judgment">
+                                <option value=""></option>
+                                <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                    <option value="${var.value}">${var.label}</option>
+                                </c:forEach>
+                            </select>
+                        </td>
+                            <%--发票号--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
+                        </td>
+                            <%--开票日期--%>
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceDate" type="text" value="{{row.invoiceDate}}"  onmouseover="this.title=this.value" class="form-control required datetime"/>
+                        </td>
+                            <%--开票单位--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceUnit" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceUnit" type="text" value="{{row.invoiceUnit}}" maxlength="32" placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                        </td>
+                            <%--金额--%>
+                         <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_money" onchange="getMoneyElectronicInvoiceVATT({{idx}})" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--税额--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_taxAmount"  onchange="getMoneyElectronicInvoiceVATT({{idx}})"name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--合计价税--%>
+                         <td>
+                            <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>
+                        <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">
+                    var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    var reimbursementElectronicInvoiceVATTaxesRowIdx = 0, reimbursementElectronicInvoiceVATTaxesTpl = $("#reimbursementElectronicInvoiceVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    if($("#id").val()){
+                        workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    }
+                    $(document).ready(function() {
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                        /*var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl, data[i]);
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    }*/
+                    });
+                </script>
+            </div>
+        </div>
+
+
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销附件信息</h2></div>
             <div class="layui-item nav-btns">
@@ -1163,7 +1507,14 @@
                                                     <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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>

+ 87 - 4
src/main/webapp/webpage/modules/workreimbursement/workReimbursementAudit.jsp

@@ -30,6 +30,14 @@
 				var form = layui.form;
 				form.render();
 			});
+			var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+			if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				$(".count1").hide();
+				$(".count2").show();
+			}
             if (${workReimbursement.ext == 0}){
                 $(".td1").removeClass("hide");
                 $(".project_reimbursement_div").show();
@@ -86,12 +94,14 @@
 		<form:hidden path="act.procDefId"/>
 		<form:hidden id="flag" path="act.flag"/>
 		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+		<input type="hidden" id="reimbursementType" name="reimbursementType" 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">
-				<label class="layui-form-label">报销人:</label>
+				<label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
 				<div class="layui-input-block">
-					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.reimbursementTypeStr}"/>
 				</div>
 			</div>
 			<div class="layui-item layui-col-sm6">
@@ -106,6 +116,12 @@
 				</div>
 			</div>
 			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销人:</label>
+				<div class="layui-input-block">
+					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
 				<label class="layui-form-label">所属部门:</label>
 				<div class="layui-input-block">
 					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.officeName}"/>
@@ -341,7 +357,7 @@
 				</table>
 			</div>
 		</div>
-		<div class="form-group layui-row">
+		<div class="form-group layui-row count1">
 			<div class="form-group-label"><h2>专用发票信息</h2></div>
 			<div class="layui-item layui-col-xs12 form-table-container" >
 				<table id="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
@@ -383,6 +399,66 @@
 				</table>
 			</div>
 		</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">
+					<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">备注</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementElectronicInvoiceVATTaxes">
+					<c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+						<c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+							<tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+									<%--发票类型--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceTypeStr}" onmouseover="this.title=this.value"  class="form-control "/>
+								</td>
+									<%--发票号--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control "/>
+								</td>
+									<%--开票日期--%>
+								<td>
+									<input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" onmouseover="this.title=this.value" readOnly="true" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control datetime"/>
+								</td>
+									<%--开票单位--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" readOnly="true" maxlength="30" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--金额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--税额--%>
+								<td>
+									<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" readOnly="true" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control "/>
+								</td>
+									<%--合计价税--%>
+								<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>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
 		<div class="form-group layui-row">
 			<div class="form-group-label"><h2>相关附件</h2></div>
 			<div class="layui-item layui-col-xs12 form-table-container" >
@@ -477,7 +553,14 @@
 														<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
 													</c:when>
 													<c:otherwise>
-														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+																<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:when>
+															<c:otherwise>
+																<a href="${workClientAttachment.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>

+ 383 - 32
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -13,10 +13,35 @@
         $(document).ready(function() {
             layui.use(['form', 'layer'], function () {
                 var form = layui.form;
+
+                form.on('radio(reimbursementTypeRadio)',function (event) {
+                    var radioVal = $(this).val();
+                    if(radioVal == 0 || radioVal == "0"){
+                        $(".count2").hide();
+                        $(".count1").show();
+                    }else if(radioVal == 1 || radioVal == "1"){
+                        $(".count1").hide();
+                        $(".count2").show();
+                    }
+                    form.render();
+                })
+
             })
             if($("#submitterDate").val()==null || $("#submitterDate").val()==''){
                 $("#submitterDate").val(getNowFormatDate());
             }
+
+            var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+            if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+                document.getElementsByName("reimbursementType")[0].checked = true;
+                $(".count2").hide();
+                $(".count1").show();
+            }else{
+                document.getElementsByName("reimbursementType")[1].checked = true;
+                $(".count1").hide();
+                $(".count2").show();
+            }
+
             /*$("input[name='ext']").on('ifChecked', function(event){
                 var radioVal = $(this).val();
                 if(radioVal == 0){
@@ -90,6 +115,22 @@
             });
             // getRandom();
 
+
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+
+            var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};//后端获取值
+            for (var i=0; i<data.length; i++){
+                laydate.render({
+                    elem: '#reimbursementElectronicInvoiceVATTaxes' + i + '_invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                    event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                    type : 'datetime'
+                });
+            }
+
         });
             <%--$.ajax({--%>
             <%--    url:"${ctx}/reimbursementType/reimbursementType/projectCharge",--%>
@@ -132,6 +173,46 @@
                     parent.layer.msg("请添加报销详情!", {icon: 5});
                     flags= false;
                 }
+
+                var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
+                if(electronicInvoiceArr.length>0){
+                    var flag = false;
+                    var countFlag = 0;
+                    var list = "${workReimbursement.workAttachments}";
+                    var size = (list.split('url')).length-1;
+                    var files = $("#attachment_file")[0].files;
+                    for(var i = 0;i<files.length;i++) {
+                        var file = files[i];
+                        //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                        const spliceLength2 = file.name.lastIndexOf(".");
+                        var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                        if(fileNameSuffix === "xml" ) {
+                            flag = true;
+                            countFlag ++;
+                        }
+                    }
+                    if(!flag){
+                        var data = ${fns:toJson(workReimbursement.workAttachments)};//后端获取值
+                        for (var i=0; i<data.length; i++){
+                            //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                            const spliceLength2 = data[i].attachmentName.lastIndexOf(".");
+                            var fileNameSuffix = data[i].attachmentName.slice(spliceLength2 + 1);
+                            if(fileNameSuffix === "xml" ) {
+                                flag = true;
+                                countFlag ++;
+                            }
+                        }
+                    }
+                    if(!flag){
+                        parent.layer.msg("已填写电子发票信息,请上传对应发票的xml文件!", {icon: 5});
+                        flags= false;
+                    }
+                    /*if(countFlag < electronicInvoiceArr.length){
+                        parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
+                        flags= false;
+                    }*/
+                }
+
                 if (flags){
                     $("#inputForm").attr("action","${ctx}/workreimbursement/workReimbursement/save");
                 }else{
@@ -326,6 +407,11 @@
             if(list == '#reimbursementVATTaxes'){
                 bornTemplete(list, idx, tpl, row, idx2);
             }
+
+            if(list == '#reimbursementElectronicInvoiceVATTaxes'){
+                bornTemplete(list, idx, tpl, row, idx2);
+            }
+
         }
         function bornTemplete(list, idx, tpl, row, idx1){
             $(list).append(Mustache.render(tpl, {
@@ -343,6 +429,13 @@
                     }
                 }
             });
+
+            laydate.render({
+                elem : (list+idx+"_invoiceDate"),
+                event: 'focus',
+                type : 'datetime',
+                trigger: 'click'
+            });
         }
         function delRow(obj, prefix){
             var id = $(prefix+"_id");
@@ -419,16 +512,89 @@
             var list = "${workReimbursement.workAttachments}";
             var size = (list.split('url')).length-1;
             var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
-            var attachmentId = "";
-            var attachmentFlag = "6";
-            console.log(file);
-            var timestamp=new Date().getTime();
+                var attachmentId = "";
+                var attachmentFlag = "6";
+                var timestamp=new Date().getTime();
+
+                var storeAs = "wrkReimbursement";
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+
+            //判断报销类型是否为电子报销
+            var reimbursementType=$('input:radio[name="reimbursementType"]:checked').val();
+            if(reimbursementType === "1"){
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        var formdata = new FormData();
+                        formdata.append("multipartFile",file);
+                        $.ajax({
+                            type:'post',
+                            url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                            data:formdata,
+                            contentType: false,
+                            processData: false,
+                            success:function (data) {
+                                console.log(data)
+                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
+                                var includeFlag = false;
+                                //xml文件处理
+                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                                //获取专用发票信息 行数
+                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                                for(var i = 0;i < trlen;i++){
+                                    var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+                                    var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                                    var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
+                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
+                                    var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
+                                    var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
+                                    var money = $("#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 sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                                    var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                                    if(invoiceNumber === data.InvoiceNumber){
+                                        includeFlag = true
+                                        //数据处理
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val("");
+                                    }
+                                }
+                                //若发票号不存在。则新增行将对应信息添加进去
+                                if(!includeFlag){
+                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val("");
+
+                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                                }
+                            }
+                        });
+                    }
+                }
+            }
 
-            var storeAs = "wrkReimbursement";
-            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
-            var divId = "_attachment";
-            $("#addFile"+divId).show();
-            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
         }
         function insertTitleCollection(tValue){
             var list = "${workReimbursement.workAttachments}";
@@ -556,6 +722,33 @@
                 }
             })
         }
+
+        function getMoneyElectronicInvoiceVATT(index){
+            var money = "0.00";
+            //方法一使用id选择器进行计算。
+            //获取输入的数字
+            //自动计算出结果并填充在相应的输入框中
+            var workmoney = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val();
+            if(parseFloat(workmoney)<0){
+                workmoney=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val(0);
+            }
+            if(workmoney==undefined||!isNumber(workmoney)||workmoney==''){
+                workmoney=0;
+            }
+            var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val();
+            if(parseFloat(taxAmount)<0){
+                taxAmount=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val(0);
+            }
+            if(taxAmount==undefined||!isNumber(taxAmount)||taxAmount==''){
+                taxAmount=0;
+            }
+            if (workmoney!=undefined && isNumber(workmoney) ){
+                money = (parseFloat(taxAmount) + parseFloat(workmoney)).toFixed(2);
+            }
+            $("#reimbursementElectronicInvoiceVATTaxes"+index+"_sumMoney").val(money);
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -575,7 +768,7 @@
 <body>
 <div class="single-form">
 <div class="container">
-    <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workreimbursement/workReimbursement/save" method="post" class="form-horizontal layui-form" >
+    <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workreimbursement/workReimbursement/save" method="post" class="form-horizontal" >
         <form:hidden path="id"/>
         <form:hidden path="achivesId"/>
         <form:hidden path="submitterId"/>
@@ -583,12 +776,12 @@
         <input id="wId" type="hidden" value="${workReimbursement.id}">
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
+
             <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label">经办人:</label>
-                <div class="layui-input-block with-icon">
-                    <div class="input-group">
-                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
-                    </div>
+                <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+                <div class="layui-input-block layui-form">
+                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
+                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="电子发票报销" value="1">
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
@@ -603,6 +796,15 @@
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">经办人:</label>
+                <div class="layui-input-block with-icon">
+                    <div class="input-group">
+                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-item layui-col-sm6">
                 <label class="layui-form-label">所属部门:</label>
                 <div class="layui-input-block">
                     <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control judgment layui-input" value = "${workReimbursement.officeName}"/>
@@ -869,7 +1071,7 @@
                 </script>
             </div>
         </div>
-        <div class="form-group layui-row">
+        <div class="form-group layui-row count1">
             <div class="form-group-label"><h2>专用发票信息</h2></div>
             <div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
@@ -878,11 +1080,11 @@
                 <table id="contentTable2" class="table table-bordered table-condensed can-edit">
                     <thead>
                     <tr>
-                        <th width="300px">发票代码</th>
-                        <th width="200px">发票号</th>
-                        <th width="200px">金额</th>
-                        <th width="200px">税额</th>
-                        <th width="200px">价税合计</th>
+                        <th width="300px"><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">操作</th>
                     </tr>
                     </thead>
@@ -895,20 +1097,20 @@
                                     <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control  number"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode"  name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="30" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
                                 </td>
 
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber"  name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="30" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="30" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number "/>
+                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="30" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number  sumMoney"/>
+                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="30" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number  judgment sumMoney"/>
                                 </td>
                                 <td class="text-center op-td">
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -925,20 +1127,20 @@
                                             <input id="reimbursementVATTaxes{{idx}}_delFlag" name="reimbursementVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"   name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="30" placeholder="请输入发票代码"  class="form-control judgment number "/>
                                         </td>
 
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber"  name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="30" placeholder="请输入发票号"  class="form-control judgment number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="30" placeholder="请输入金额"  class="form-control judgment number "/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number "/>
+                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="30" placeholder="请输入税额"  class="form-control judgment number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number  sumMoney"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="30"  class="form-control number judgment sumMoney"/>
                                         </td>
                                         <td class="text-center op-td">
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
@@ -964,6 +1166,148 @@
                 </script>
             </div>
         </div>
+
+        <div class="form-group layui-row count2">
+            <div class="form-group-label"><h2>电子发票信息</h2></div>
+            <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">
+                    <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">备注</th>
+                        <th width="150px">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="reimbursementElectronicInvoiceVATTaxes">
+                    <c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+                        <c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+                            <tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+                                <td class="hide">
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_id" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].id" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.id}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
+                                </td>
+                                    <%--发票类型--%>
+                                <td>
+                                    <select name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" class="form-control judgment">
+                                        <option value=""></option>
+                                        <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                            <option value="${var.value}" <c:if test="${reimbursementElectronicInvoiceVATTaxes.invoiceType eq var.value}">selected</c:if>>${var.label}</option>
+                                        </c:forEach>
+                                    </select>
+                                </td>
+                                    <%--发票号--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control judgment number "/>
+                                </td>
+                                    <%--开票日期--%>
+                                <td>
+                                    <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly onmouseover="this.title=this.value" autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control judgment datetime"/>
+                                </td>
+                                    <%--开票单位--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceUnit" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                                </td>
+                                    <%--金额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--税额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--合计价税--%>
+                                <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 number judgment sumMoney"/>
+                                </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 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>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+                <script type="text/template" id="reimbursementElectronicInvoiceVATTaxesTpl">//<!--
+                    <tr id="reimbursementElectronicInvoiceVATTaxes{{idx}}">
+                        <td class="hide">
+                            <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"/>
+                        </td>
+                            <%--发票类型--%>
+                        <td>
+                            <select name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" class="form-control judgment">
+                                <option value=""></option>
+                                <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                    <option value="${var.value}">${var.label}</option>
+                                </c:forEach>
+                            </select>
+                        </td>
+                            <%--发票号--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
+                        </td>
+                            <%--开票日期--%>
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceDate" type="text" value="{{row.invoiceDate}}"  onmouseover="this.title=this.value" class="form-control required datetime"/>
+                        </td>
+                            <%--开票单位--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceUnit" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceUnit" type="text" value="{{row.invoiceUnit}}" maxlength="32" placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                        </td>
+                            <%--金额--%>
+                         <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_money" onchange="getMoneyElectronicInvoiceVATT({{idx}})" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--税额--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_taxAmount"  onchange="getMoneyElectronicInvoiceVATT({{idx}})"name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--合计价税--%>
+                         <td>
+                            <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>
+                        <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">
+                    var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    var reimbursementElectronicInvoiceVATTaxesRowIdx = 0, reimbursementElectronicInvoiceVATTaxesTpl = $("#reimbursementElectronicInvoiceVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    if($("#id").val()){
+                        workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    }
+                    $(document).ready(function() {
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                        /*var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl, data[i]);
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    }*/
+                    });
+                </script>
+            </div>
+        </div>
+
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销附件信息</h2></div>
             <div class="layui-item nav-btns">
@@ -1076,7 +1420,14 @@
                                                     <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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>

+ 92 - 4
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormDetail.jsp

@@ -7,6 +7,16 @@
     <script type="text/javascript">
         var validateForm;
         $(document).ready(function() {
+
+            var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+            if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+                $(".count2").hide();
+                $(".count1").show();
+            }else{
+                $(".count1").hide();
+                $(".count2").show();
+            }
+
             if (${workReimbursement.ext == 0}){
                 $(".td1").removeClass("hide");
                 $(".project_reimbursement_div").show();
@@ -77,12 +87,14 @@
 <%--<sys:message content="${message}"/>--%>
     <div class="form-group layui-row first ">
         <div class="form-group-label"><h2>基础信息</h2></div>
+
         <div class="layui-item layui-col-sm6">
-            <label class="layui-form-label"><span class="require-item">*</span>报销:</label>
+            <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
             <div class="layui-input-block">
-                <form:input path="submitterName" readonly="true" cssStyle="background-color: #f1f1f1" htmlEscape="false"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                <input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.reimbursementTypeStr}"/>
             </div>
         </div>
+
         <div class="layui-item layui-col-sm6">
             <label class="layui-form-label">报销编号:</label>
             <div class="layui-input-block">
@@ -95,6 +107,13 @@
             </div>
         </div>
         <div class="layui-item layui-col-sm6">
+            <label class="layui-form-label"><span class="require-item">*</span>报销人:</label>
+            <div class="layui-input-block">
+                <form:input path="submitterName" readonly="true" cssStyle="background-color: #f1f1f1" htmlEscape="false"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+            </div>
+        </div>
+
+        <div class="layui-item layui-col-sm6">
             <label class="layui-form-label">所属部门:</label>
             <div class="layui-input-block">
                 <input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.officeName}"/>
@@ -396,7 +415,7 @@
                 </table>
         </div>
     </div>
-    <div class="form-group layui-row">
+    <div class="form-group layui-row count1">
         <div class="form-group-label"><h2>专用发票信息</h2></div>
         <div class="layui-item layui-col-xs12 form-table-container" >
             <table id="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
@@ -438,6 +457,68 @@
             </table>
         </div>
     </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">
+                <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">备注</th>
+                </tr>
+                </thead>
+                <tbody id="reimbursementElectronicInvoiceVATTaxes">
+                <c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+                    <c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+                        <tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+                                <%--发票类型--%>
+                            <td>
+                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" onmouseover="this.title=this.value" readOnly="true" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceType}" onmouseover="this.title=this.value"  class="form-control "/>
+                            </td>
+                                <%--发票号--%>
+                            <td>
+                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" readOnly="true" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control "/>
+                            </td>
+                                <%--开票日期--%>
+                            <td>
+                                <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" onmouseover="this.title=this.value" readOnly="true" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control datetime"/>
+                            </td>
+                                <%--开票单位--%>
+                            <td>
+                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" readOnly="true" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceUnit" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control "/>
+                            </td>
+                                <%--金额--%>
+                            <td>
+                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" readOnly="true" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control "/>
+                            </td>
+                                <%--税额--%>
+                            <td>
+                                <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" readOnly="true" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control "/>
+                            </td>
+                                <%--合计价税--%>
+                            <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>
+                        </tr>
+                    </c:forEach>
+                </c:if>
+                </tbody>
+            </table>
+        </div>
+    </div>
+
+
     <div class="form-group layui-row">
         <div class="form-group-label"><h2>相关附件</h2></div>
         <div class="layui-item layui-col-xs12 form-table-container" >
@@ -532,7 +613,14 @@
                                                 <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                             </c:when>
                                             <c:otherwise>
-                                                <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                        <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:when>
+                                                    <c:otherwise>
+                                                        <a href="${workClientAttachment.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>

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

@@ -311,7 +311,7 @@
                         if(d.cancancel != undefined && d.cancancel == "1")
                             xml += "<a href=\"${ctx}/workreimbursement/workReimbursement/cancelInvalidate?id=" + d.id + "\" onclick=\"return confirmx('确认要强制撤回?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 撤回</a>";
                         if(d.canedit1 != undefined && d.canedit1 == "1")
-                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改报销单', '${ctx}/workReimbursementNew/workReimbursementNew/form?id="+ d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改报销单', '${ctx}/workreimbursement/workReimbursement/form?id="+ d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
                         if(d.canedit2 != undefined && d.canedit2 == "1")
                             //判断是什么流程(新旧流程)
                             if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 2){
@@ -321,7 +321,7 @@
                             }
 
                         if(d.canedit3 != undefined && d.canedit3 == "1")
-                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请报销单', '${ctx}/workReimbursementNew/workReimbursementNew/form?id=" + d.id + "&tabId=4','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请报销单', '${ctx}/workreimbursement/workReimbursement/form?id=" + d.id + "&tabId=4','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
                         if(d.candelete != undefined && d.candelete == "1")
                             xml +="<a href=\"${ctx}/workreimbursement/workReimbursement/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该报销单吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
 

+ 366 - 18
src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

@@ -4,10 +4,39 @@
 <head>
 	<title>报销单管理</title>
 	<meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
     <script type="text/javascript">
 		var validateForm;
 		var count = 0;
 		$(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+                form.on('radio(reimbursementTypeRadio)',function (event) {
+                    var radioVal = $(this).val();
+                    if(radioVal == 0 || radioVal == "0"){
+                        $(".count2").hide();
+                        $(".count1").show();
+                    }else if(radioVal == 1 || radioVal == "1"){
+                        $(".count1").hide();
+                        $(".count2").show();
+                    }
+                    form.render();
+                })
+            })
+            var reimbursementTypeRadio = '${workReimbursement.reimbursementType}';//后端获取值
+            if(undefined == reimbursementTypeRadio || null == reimbursementTypeRadio || '' == reimbursementTypeRadio || reimbursementTypeRadio == "0"){
+                document.getElementsByName("reimbursementType")[0].checked = true;
+                $(".count2").hide();
+                $(".count1").show();
+            }else{
+                document.getElementsByName("reimbursementType")[1].checked = true;
+                $(".count1").hide();
+                $(".count2").show();
+            }
+
             if($("#submitterDate").val()==null || $("#submitterDate").val()==''){
                 $("#submitterDate").val(getNowFormatDate());
             }
@@ -87,6 +116,22 @@
             });
            // getRandom();
 
+
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+
+            var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};//后端获取值
+            for (var i=0; i<data.length; i++){
+                laydate.render({
+                    elem: '#reimbursementElectronicInvoiceVATTaxes' + i + '_invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                    event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                    type : 'datetime'
+                });
+            }
+
         });
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
             var idArr = $("#workAccountList tr:visible");
@@ -95,6 +140,45 @@
                 return false;
             }
 
+            var electronicInvoiceArr = $("#reimbursementElectronicInvoiceVATTaxes tr:visible");
+            if(electronicInvoiceArr.length>0){
+                var flag = false;
+                var countFlag = 0;
+                var list = "${workReimbursement.workAttachments}";
+                var size = (list.split('url')).length-1;
+                var files = $("#attachment_file")[0].files;
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        flag = true;
+                        countFlag ++;
+                    }
+                }
+                if(!flag){
+                    var data = ${fns:toJson(workReimbursement.workAttachments)};//后端获取值
+                    for (var i=0; i<data.length; i++){
+                        //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                        const spliceLength2 = data[i].attachmentName.lastIndexOf(".");
+                        var fileNameSuffix = data[i].attachmentName.slice(spliceLength2 + 1);
+                        if(fileNameSuffix === "xml" ) {
+                            flag = true;
+                            countFlag ++;
+                        }
+                    }
+                }
+                if(!flag){
+                    parent.layer.msg("已填写电子发票信息,请上传对应发票的xml文件!", {icon: 5});
+                    flags= false;
+                }
+                /*if(countFlag < electronicInvoiceArr.length){
+                    parent.layer.msg("填写电子发票数据量与上传发票xml文件数量不符,请重新上传!", {icon: 5});
+                    flags= false;
+                }*/
+            }
+
             var trlen = $("#workAccountList tr").length;
             var tdlen = $("#workAccountList tr td").length;
             var trArr = [];
@@ -307,6 +391,9 @@
             if(list == '#reimbursementVATTaxes'){
                 bornTemplete(list, idx, tpl, row, idx2);
             }
+            if(list == '#reimbursementElectronicInvoiceVATTaxes'){
+                bornTemplete(list, idx, tpl, row, idx2);
+            }
         }
         function bornTemplete(list, idx, tpl, row, idx1){
             $(list).append(Mustache.render(tpl, {
@@ -324,6 +411,12 @@
                     }
                 }
             });
+            laydate.render({
+                elem : (list+idx+"_invoiceDate"),
+                event: 'focus',
+                type : 'datetime',
+                trigger: 'click'
+            });
         }
         function delRow(obj, prefix){
             var id = $(prefix+"_id");
@@ -409,6 +502,80 @@
             var divId = "_attachment";
             $("#addFile"+divId).show();
             multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+
+            //判断报销类型是否为电子报销
+            var reimbursementType=$('input:radio[name="reimbursementType"]:checked').val();
+            if(reimbursementType === "1"){
+                for(var i = 0;i<files.length;i++) {
+                    var file = files[i];
+                    //如果文件以xml文件结尾,则需要将该文件上传到后台进行数据处理后返回数据
+                    const spliceLength2 = file.name.lastIndexOf(".");
+                    var fileNameSuffix = file.name.slice(spliceLength2 + 1);
+                    if(fileNameSuffix === "xml" ) {
+                        var formdata = new FormData();
+                        formdata.append("multipartFile",file);
+                        $.ajax({
+                            type:'post',
+                            url:"${ctx}/workreimbursement/workReimbursement/disposeXmlFile",
+                            data:formdata,
+                            contentType: false,
+                            processData: false,
+                            success:function (data) {
+                                console.log(data)
+                                //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
+                                var includeFlag = false;
+                                //xml文件处理
+                                //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
+                                //获取专用发票信息 行数
+                                var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
+                                for(var i = 0;i < trlen;i++){
+                                    var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+                                    var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
+                                    var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
+                                    var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
+                                    var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
+                                    var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
+                                    var money = $("#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 sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
+                                    var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
+
+                                    if(invoiceNumber === data.InvoiceNumber){
+                                        includeFlag = true
+                                        //数据处理
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                        $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val("");
+                                    }
+                                }
+                                //若发票号不存在。则新增行将对应信息添加进去
+                                if(!includeFlag){
+                                    addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
+
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
+                                    $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val("");
+
+                                    reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                                }
+                            }
+                        });
+                    }
+                }
+            }
+
         }
         function insertTitleCollection(tValue){
             var list = "${workReimbursement.workAttachments}";
@@ -535,6 +702,32 @@
                 }
             })
         }
+        function getMoneyElectronicInvoiceVATT(index){
+            var money = "0.00";
+            //方法一使用id选择器进行计算。
+            //获取输入的数字
+            //自动计算出结果并填充在相应的输入框中
+            var workmoney = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val();
+            if(parseFloat(workmoney)<0){
+                workmoney=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_money").val(0);
+            }
+            if(workmoney==undefined||!isNumber(workmoney)||workmoney==''){
+                workmoney=0;
+            }
+            var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val();
+            if(parseFloat(taxAmount)<0){
+                taxAmount=0;
+                $("#reimbursementElectronicInvoiceVATTaxes"+index+"_taxAmount").val(0);
+            }
+            if(taxAmount==undefined||!isNumber(taxAmount)||taxAmount==''){
+                taxAmount=0;
+            }
+            if (workmoney!=undefined && isNumber(workmoney) ){
+                money = (parseFloat(taxAmount) + parseFloat(workmoney)).toFixed(2);
+            }
+            $("#reimbursementElectronicInvoiceVATTaxes"+index+"_sumMoney").val(money);
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -570,11 +763,10 @@
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
             <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label"><span class="require-item">*</span>报销人:</label>
-                <div class="layui-input-block with-icon">
-                    <div class="input-group">
-                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
-                    </div>
+                <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+                <div class="layui-input-block layui-form">
+                    <input type="radio" name="reimbursementType" disabled lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
+                    <input type="radio" name="reimbursementType" disabled lay-filter="reimbursementTypeRadio" title="电子发票报销" value="1">
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
@@ -589,6 +781,14 @@
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label"><span class="require-item">*</span>报销人:</label>
+                <div class="layui-input-block with-icon">
+                    <div class="input-group">
+                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                    </div>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
                 <label class="layui-form-label">所属部门:</label>
                 <div class="layui-input-block">
                     <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control required layui-input" value = "${workReimbursement.officeName}"/>
@@ -958,7 +1158,7 @@
             </script>
         </div>
     </div>
-        <div class="form-group layui-row">
+        <div class="form-group layui-row count1">
             <div class="form-group-label"><h2>专用发票信息</h2></div>
             <div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
@@ -984,20 +1184,20 @@
                                     <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" maxlength="32" type="text" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
                                 </td>
 
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber"  maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" maxlength="32" type="text" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number required"/>
+                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number required sumMoney"/>
+                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
                                 </td>
                                 <td class="text-center op-td">
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -1014,22 +1214,21 @@
                                             <input id="reimbursementVATTaxes{{idx}}_delFlag" name="reimbursementVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" maxlength="32" value="{{row.invoiceCode}}"  placeholder="请输入发票代码"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control judgment number "/>
                                         </td>
 
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber"  maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" maxlength="32" value="{{row.invoiceNumber}}"  placeholder="请输入发票号"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number judgment"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number required"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number judgment"/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number required sumMoney"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number judgment sumMoney"/>
                                         </td>
-
                                         <td class="text-center op-td">
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
                                         </td>
@@ -1052,6 +1251,148 @@
                 </script>
             </div>
         </div>
+
+        <div class="form-group layui-row count2">
+            <div class="form-group-label"><h2>电子发票信息</h2></div>
+            <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">
+                    <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">备注</th>
+                        <th width="150px">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="reimbursementElectronicInvoiceVATTaxes">
+                    <c:if test="${not empty workReimbursement.reimbursementElectronicInvoiceVATTaxes}">
+                        <c:forEach items="${workReimbursement.reimbursementElectronicInvoiceVATTaxes}" var="reimbursementElectronicInvoiceVATTaxes" varStatus="index">
+                            <tr id="reimbursementElectronicInvoiceVATTaxes${index.index}">
+                                <td class="hide">
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_id" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].id" type="hidden" value="${reimbursementElectronicInvoiceVATTaxes.id}"/>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_delFlag" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
+                                </td>
+                                    <%--发票类型--%>
+                                <td>
+                                    <select name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceType" class="form-control judgment">
+                                        <option value=""></option>
+                                        <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                            <option value="${var.value}" <c:if test="${reimbursementElectronicInvoiceVATTaxes.invoiceType eq var.value}">selected</c:if>>${var.label}</option>
+                                        </c:forEach>
+                                    </select>
+                                </td>
+                                    <%--发票号--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号"  class="form-control judgment number "/>
+                                </td>
+                                    <%--开票日期--%>
+                                <td>
+                                    <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly onmouseover="this.title=this.value" autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceDate" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceDateStr}"  onmouseover="this.title=this.value" class="form-control judgment datetime"/>
+                                </td>
+                                    <%--开票单位--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceUnit" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceUnit" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceUnit}"  placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                                </td>
+                                    <%--金额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_money" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.money}"  placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--税额--%>
+                                <td>
+                                    <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_taxAmount" onmouseover="this.title=this.value" onchange="getMoneyElectronicInvoiceVATT(${index.index})" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementElectronicInvoiceVATTaxes.taxAmount}"  placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control judgment number "/>
+                                </td>
+                                    <%--合计价税--%>
+                                <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 number judgment sumMoney"/>
+                                </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 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>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                    </c:if>
+                    </tbody>
+                </table>
+                <script type="text/template" id="reimbursementElectronicInvoiceVATTaxesTpl">//<!--
+                    <tr id="reimbursementElectronicInvoiceVATTaxes{{idx}}">
+                        <td class="hide">
+                            <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"/>
+                        </td>
+                            <%--发票类型--%>
+                        <td>
+                            <select name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceType" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceType" class="form-control judgment">
+                                <option value=""></option>
+                                <c:forEach items="${fns:getMainDictList('invoiceReimbursementType')}" var="var">
+                                    <option value="${var.value}">${var.label}</option>
+                                </c:forEach>
+                            </select>
+                        </td>
+                            <%--发票号--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" maxlength="32" placeholder="请输入发票号"  class="form-control judgment number "/>
+                        </td>
+                            <%--开票日期--%>
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd HH:mm:ss" readonly autocomplete="off" id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceDate" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceDate" type="text" value="{{row.invoiceDate}}"  onmouseover="this.title=this.value" class="form-control required datetime"/>
+                        </td>
+                            <%--开票单位--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceUnit" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceUnit" type="text" value="{{row.invoiceUnit}}" maxlength="32" placeholder="请输入开票单位"  onmouseover="this.title=this.value" class="form-control judgment "/>
+                        </td>
+                            <%--金额--%>
+                         <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_money" onchange="getMoneyElectronicInvoiceVATT({{idx}})" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--税额--%>
+                        <td>
+                            <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_taxAmount"  onchange="getMoneyElectronicInvoiceVATT({{idx}})"name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  onmouseover="this.title=this.value" class="form-control number judgment"/>
+                        </td>
+                            <%--合计价税--%>
+                         <td>
+                            <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>
+                        <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">
+                    var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    var reimbursementElectronicInvoiceVATTaxesRowIdx = 0, reimbursementElectronicInvoiceVATTaxesTpl = $("#reimbursementElectronicInvoiceVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    if($("#id").val()){
+                        workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    }
+                    $(document).ready(function() {
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                        /*var data = ${fns:toJson(workReimbursement.reimbursementElectronicInvoiceVATTaxes)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl, data[i]);
+                        reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
+                    }*/
+                    });
+                </script>
+            </div>
+        </div>
+
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销附件信息</h2></div>
             <div class="layui-item nav-btns">
@@ -1163,7 +1504,14 @@
                                                     <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                                 </c:when>
                                                 <c:otherwise>
-                                                    <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                            <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:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.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>